|
|
|
|
@ -124,16 +124,21 @@ public class AppDataController extends BladeController { |
|
|
|
|
for (Map<String, Object> map : pictureList) { |
|
|
|
|
String url = String.valueOf(map.get("url")); |
|
|
|
|
String substring = url.substring(url.lastIndexOf(".") + 1); |
|
|
|
|
// 图片
|
|
|
|
|
if ("png".equals(substring) || "jpg".equals(substring)) { |
|
|
|
|
map.put("type", 2); |
|
|
|
|
String base64 = ImageBase64Util.encodeImgageToBase64(url); |
|
|
|
|
map.put("base64", base64); |
|
|
|
|
map.remove("url"); |
|
|
|
|
} else if ("mp3".equals(substring)) { |
|
|
|
|
map.put("type", 2); |
|
|
|
|
map.put("base64", ImageBase64Util.getBase64(url)); |
|
|
|
|
map.remove("url"); |
|
|
|
|
} else { |
|
|
|
|
} |
|
|
|
|
// 语音
|
|
|
|
|
// else if ("mp3".equals(substring)) {
|
|
|
|
|
// map.put("type", 2);
|
|
|
|
|
// map.put("base64", ImageBase64Util.getBase64(url));
|
|
|
|
|
// map.remove("url");
|
|
|
|
|
// }
|
|
|
|
|
// 其他
|
|
|
|
|
else { |
|
|
|
|
map.put("type", 1); |
|
|
|
|
map.put("url", url); |
|
|
|
|
} |
|
|
|
|
@ -153,9 +158,6 @@ public class AppDataController extends BladeController { |
|
|
|
|
String zfcAll = "1234567890"; |
|
|
|
|
char[] zfc = zfcAll.toCharArray(); |
|
|
|
|
String nonce = RandomStringUtils.random(32, zfc); |
|
|
|
|
// UUID id = UUID.randomUUID();
|
|
|
|
|
// String[] idd = id.toString().split("-");
|
|
|
|
|
// String nonce = idd[0] + idd[1] + idd[2] + idd[3] + idd[4];
|
|
|
|
|
String timestamp = String.valueOf(System.currentTimeMillis()); |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
@ -263,6 +265,25 @@ public class AppDataController extends BladeController { |
|
|
|
|
return map; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 子系统消警 |
|
|
|
|
*/ |
|
|
|
|
@PostMapping("/clearAlarm") |
|
|
|
|
public R clearAlarm(@RequestParam String hostSerialNumber, @RequestParam String num) { |
|
|
|
|
String[] splitHost = hostSerialNumber.split(","); |
|
|
|
|
String[] splitNum = num.split(","); |
|
|
|
|
String status = ""; |
|
|
|
|
for (int i = 0; i < splitHost.length; i++) { |
|
|
|
|
String[] split = splitNum[i].split("_"); |
|
|
|
|
if (Alarm.clearAlarm(splitHost[i], Integer.parseInt(split[split.length - 1]))) { |
|
|
|
|
status += "子系统:" + split[split.length - 2] + "_" + split[split.length - 1] + "消警成功!"; |
|
|
|
|
} else { |
|
|
|
|
status += "子系统:" + split[split.length - 2] + "_" + split[split.length - 1] + "消警失败!"; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return R.success(status); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 子系统布防 |
|
|
|
|
*/ |
|
|
|
|
@ -365,10 +386,4 @@ public class AppDataController extends BladeController { |
|
|
|
|
return R.data(new JoysuchCoordinate((double) x, (double) y, lng, lat)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static void main(String[] args) throws IOException { |
|
|
|
|
String url = "http://171.16.8.51:9000/hospital/upload/20231221/afe50cd7d6bc8227e6079193cbb9f00c.mp3"; |
|
|
|
|
String base64 = ImageBase64Util.getBase64(url); |
|
|
|
|
System.out.println("base64:" + base64); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|