|
@@ -12,6 +12,7 @@ import com.ozs.common.core.domain.entity.SysUser;
|
|
|
import com.ozs.common.core.domain.model.LoginUser;
|
|
|
import com.ozs.common.exception.base.BaseException;
|
|
|
import com.ozs.common.utils.AppendUtils;
|
|
|
+import com.ozs.common.utils.ChineseToPingyin;
|
|
|
import com.ozs.common.utils.StringUtils;
|
|
|
import com.ozs.common.utils.file.FileUtils;
|
|
|
import com.ozs.common.utils.http.HttpUtils;
|
|
@@ -54,10 +55,14 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.InputStream;
|
|
|
+import java.text.Collator;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.Collections;
|
|
|
+import java.util.Comparator;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
+import java.util.Locale;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
@@ -420,15 +425,39 @@ public class BaseCameraManagementController extends BaseController {
|
|
|
public AjaxResult cameraTree(@RequestParam(value = "name", required = false) String name) {
|
|
|
CameraTree cameraTree = baseDeviceDynamicManagementService.cameraTree(name);
|
|
|
List<CameraTree> children = cameraTree.getChildren();
|
|
|
+ children.sort(new Comparator<CameraTree>() {
|
|
|
+ @Override
|
|
|
+ public int compare(CameraTree o1, CameraTree o2) {
|
|
|
+ String name1 = ChineseToPingyin.convertHanziToPinyin(o1.getName());
|
|
|
+ String substring1 = name1.substring(0, 1);
|
|
|
+ String name2 = ChineseToPingyin.convertHanziToPinyin(o2.getName());
|
|
|
+ String substring2 = name2.substring(0, 1);
|
|
|
+ return substring1.compareTo(substring2);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
for (CameraTree child : children) {
|
|
|
List<CameraTree> children1 = child.getChildren();
|
|
|
+ children1.sort(new Comparator<CameraTree>() {
|
|
|
+ @Override
|
|
|
+ public int compare(CameraTree o1, CameraTree o2) {
|
|
|
+ int i= o1.getMileage() - o2.getMileage();
|
|
|
+ if (i==0) {
|
|
|
+ String[] split = o1.getName().split("-");
|
|
|
+ return "上行".equals(split[1])?-1:1;
|
|
|
+ }else {
|
|
|
+ return i;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
for (CameraTree tree : children1) {
|
|
|
List<CameraTree> children2 = tree.getChildren();
|
|
|
- if (children2.size()<2) {
|
|
|
- String code = children2.get(0).getName();
|
|
|
- tree.setCode(code);
|
|
|
- children2.remove(0);
|
|
|
- }
|
|
|
+ if (children2.size() < 2) {
|
|
|
+ String code = children2.get(0).getName();
|
|
|
+ tree.setCode(code);
|
|
|
+ children2.remove(0);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
return success(cameraTree);
|
|
@@ -485,7 +514,7 @@ public class BaseCameraManagementController extends BaseController {
|
|
|
queryWrapper.orderByDesc(MsgAlarm::getCreateTime);
|
|
|
}
|
|
|
List<MsgAlarm> msgAlarmList = msgAlarmService.list(queryWrapper);
|
|
|
- if (msgAlarmList.size()>0) {
|
|
|
+ if (msgAlarmList.size() > 0) {
|
|
|
MsgAlarm msgAlarm = msgAlarmList.get(0);
|
|
|
LambdaQueryWrapper<BaseCameraManagement> lw = new LambdaQueryWrapper<BaseCameraManagement>();
|
|
|
if (!ObjectUtils.isEmpty(cameraCode)) {
|
|
@@ -511,8 +540,8 @@ public class BaseCameraManagementController extends BaseController {
|
|
|
msgAlarmResp.setLineDir(baseCameraManagement.getLineDir());
|
|
|
msgAlarmResp.setAlarmMile(baseCameraManagement.getInstallMile().toString());
|
|
|
return AjaxResult.success(msgAlarmResp);
|
|
|
- }else {
|
|
|
- return error("该相机没有报警消息");
|
|
|
+ } else {
|
|
|
+ return error("该相机没有报警消息");
|
|
|
}
|
|
|
}
|
|
|
}
|