|
@@ -50,7 +50,6 @@ public class ParkUtils {
|
|
|
|
|
|
public static String token;
|
|
public static String token;
|
|
|
|
|
|
-
|
|
|
|
@Autowired
|
|
@Autowired
|
|
public void setMongoTemplate(MongoTemplate mongoTemplate) {
|
|
public void setMongoTemplate(MongoTemplate mongoTemplate) {
|
|
ParkUtils.mongoTemplate = mongoTemplate;
|
|
ParkUtils.mongoTemplate = mongoTemplate;
|
|
@@ -396,7 +395,6 @@ public class ParkUtils {
|
|
.body(getCommonParams(Levi.by("filePath", photo)))
|
|
.body(getCommonParams(Levi.by("filePath", photo)))
|
|
.execute().body();
|
|
.execute().body();
|
|
JSONArray dataItems = JSON.parseObject(str).getJSONArray("dataItems");
|
|
JSONArray dataItems = JSON.parseObject(str).getJSONArray("dataItems");
|
|
- System.out.println("getImgUrlById:" + dataItems);
|
|
|
|
if (dataItems != null) {
|
|
if (dataItems != null) {
|
|
String image = dataItems.toJavaList(Map.class).get(0).get("image").toString();
|
|
String image = dataItems.toJavaList(Map.class).get(0).get("image").toString();
|
|
return image;
|
|
return image;
|
|
@@ -404,6 +402,18 @@ public class ParkUtils {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 获取附件图片字节数组
|
|
|
|
+ *
|
|
|
|
+ * @param photo
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public static byte[] getExcelPhotoUrl(Object photo) {
|
|
|
|
+ String url = (String) photo;
|
|
|
|
+ String imgUrlById = getImgUrlById(url);
|
|
|
|
+ return StringUtils.isNotBlank(imgUrlById) ? Base64.getDecoder().decode(imgUrlById) : null;
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 判断数据是否存在异常 并插入异常信息
|
|
* 判断数据是否存在异常 并插入异常信息
|
|
*
|
|
*
|
|
@@ -425,7 +435,7 @@ public class ParkUtils {
|
|
if (CollUtil.isNotEmpty(feesTime)) {
|
|
if (CollUtil.isNotEmpty(feesTime)) {
|
|
feesTime.forEach(x -> {
|
|
feesTime.forEach(x -> {
|
|
x.put("imageUrl", x.get(ParkType.IN.getImage()));
|
|
x.put("imageUrl", x.get(ParkType.IN.getImage()));
|
|
- x.put("operator", x.get("inOperator"));
|
|
|
|
|
|
+ x.put("operator", x.get("inOperator") == null ? x.get("outOperator") : x.get("inOperator"));
|
|
});
|
|
});
|
|
}
|
|
}
|
|
data.put(ParkExceptionType.A.getCode(), feesTime);
|
|
data.put(ParkExceptionType.A.getCode(), feesTime);
|
|
@@ -441,14 +451,14 @@ public class ParkUtils {
|
|
if (CollUtil.isNotEmpty(feesTime)) {
|
|
if (CollUtil.isNotEmpty(feesTime)) {
|
|
feesTime.forEach(x -> {
|
|
feesTime.forEach(x -> {
|
|
x.put("imageUrl", x.get(ParkType.OUT.getImage()));
|
|
x.put("imageUrl", x.get(ParkType.OUT.getImage()));
|
|
- x.put("operator", x.get("outOperator"));
|
|
|
|
|
|
+ x.put("operator", x.get("outOperator") == null ? x.get("inOperator") : x.get("outOperator"));
|
|
x.put("equipName", x.get("outEquipName"));
|
|
x.put("equipName", x.get("outEquipName"));
|
|
});
|
|
});
|
|
}
|
|
}
|
|
data.put(ParkExceptionType.A.getCode(), feesTime);
|
|
data.put(ParkExceptionType.A.getCode(), feesTime);
|
|
// 支付时间过长
|
|
// 支付时间过长
|
|
String now = LocalDateTimeUtil.format(LocalDateTime.now(), DatePattern.NORM_DATETIME_PATTERN);
|
|
String now = LocalDateTimeUtil.format(LocalDateTime.now(), DatePattern.NORM_DATETIME_PATTERN);
|
|
- List<Map> list2 = params.stream().filter(x -> getDimSS(x.get("outTime") == null ? now : x.get("outTime").toString(), x.get("openDoor") == null ? now : x.get("opengate_time").toString()) > 60
|
|
|
|
|
|
+ List<Map> list2 = params.stream().filter(x -> getDimSS(x.get("outTime") == null ? now : x.get("outTime").toString(), x.get("opengate_time") == null ? now : x.get("opengate_time").toString()) > 60
|
|
).collect(Collectors.toList());
|
|
).collect(Collectors.toList());
|
|
List<Map> maps2 = data.getJSONArray(ParkExceptionType.B.getCode()) == null ? new ArrayList<>() : data.getJSONArray(ParkExceptionType.B.getCode()).toJavaList(Map.class);
|
|
List<Map> maps2 = data.getJSONArray(ParkExceptionType.B.getCode()) == null ? new ArrayList<>() : data.getJSONArray(ParkExceptionType.B.getCode()).toJavaList(Map.class);
|
|
maps2.addAll(list2);
|
|
maps2.addAll(list2);
|
|
@@ -456,7 +466,7 @@ public class ParkUtils {
|
|
if (CollUtil.isNotEmpty(feesTime2)) {
|
|
if (CollUtil.isNotEmpty(feesTime2)) {
|
|
feesTime2.forEach(x -> {
|
|
feesTime2.forEach(x -> {
|
|
x.put("imageUrl", x.get(ParkType.OUT.getImage()));
|
|
x.put("imageUrl", x.get(ParkType.OUT.getImage()));
|
|
- x.put("operator", x.get("outOperator"));
|
|
|
|
|
|
+ x.put("operator", x.get("outOperator") == null ? x.get("inOperator") : x.get("outOperator"));
|
|
x.put("equipName", x.get("outEquipName"));
|
|
x.put("equipName", x.get("outEquipName"));
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -469,7 +479,7 @@ public class ParkUtils {
|
|
if (CollUtil.isNotEmpty(feesTime3)) {
|
|
if (CollUtil.isNotEmpty(feesTime3)) {
|
|
feesTime3.forEach(x -> {
|
|
feesTime3.forEach(x -> {
|
|
x.put("imageUrl", x.get(ParkType.OUT.getImage()));
|
|
x.put("imageUrl", x.get(ParkType.OUT.getImage()));
|
|
- x.put("operator", x.get("outOperator"));
|
|
|
|
|
|
+ x.put("operator", x.get("outOperator") == null ? x.get("inOperator") : x.get("outOperator"));
|
|
x.put("equipName", x.get("outEquipName"));
|
|
x.put("equipName", x.get("outEquipName"));
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -489,7 +499,7 @@ public class ParkUtils {
|
|
data.put(ParkExceptionType.C.getCode(), feesTime);
|
|
data.put(ParkExceptionType.C.getCode(), feesTime);
|
|
if (CollUtil.isNotEmpty(feesTime)) {
|
|
if (CollUtil.isNotEmpty(feesTime)) {
|
|
feesTime.forEach(x -> {
|
|
feesTime.forEach(x -> {
|
|
- x.put("operator", x.get("operateName"));
|
|
|
|
|
|
+ x.put("operator", x.get("operateName") == null ? (x.get("outOperator") == null ? x.get("inOperator") : x.get("outOperator")) : x.get("operateName"));
|
|
x.put("equipName", x.get("cardTypeName"));
|
|
x.put("equipName", x.get("cardTypeName"));
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -545,5 +555,17 @@ public class ParkUtils {
|
|
}
|
|
}
|
|
return list;
|
|
return list;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 根据parkCode获取parkName
|
|
|
|
+ *
|
|
|
|
+ * @param code
|
|
|
|
+ * @return value
|
|
|
|
+ */
|
|
|
|
+ public static String getParkNameByCode(String code) {
|
|
|
|
+ ResourceBundle bundle = ResourceBundle.getBundle("parkName");
|
|
|
|
+ return bundle.getString(code);
|
|
|
|
+
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|