|
@@ -14,10 +14,7 @@ import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Collections;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
|
|
|
|
|
|
@Slf4j
|
|
@@ -73,17 +70,32 @@ public class CtrlController {
|
|
|
try {
|
|
|
List<String> resourceCodeList = new ArrayList<>();
|
|
|
// 将用户域传入的布控模型编号转换为烽火盘古平台数据资源编码
|
|
|
- for (String modelId : modelIdList) {
|
|
|
- resourceCodeList.add(CommonUtil.getConfValueByKeyApp(modelId));
|
|
|
+ // 1.数据资源编码值为[yhybk]:代表该模型在用户域布控,不参与数据域布控
|
|
|
+ // 2.数据资源编码值为[deving]:代表该模型在数据域布控,但还在开发中,目前不参与实际布控
|
|
|
+ Iterator<String> iterator = modelIdList.iterator();
|
|
|
+ while (iterator.hasNext()){
|
|
|
+ String modelId = iterator.next();
|
|
|
+ String fhResourceCode = CommonUtil.getConfValueByKeyApp(modelId);
|
|
|
+ // 集合中只添加数据资源编码值不为[yhybk]和[deving]的元素
|
|
|
+ if(!"yhybk".equals(fhResourceCode) && !"deving".equals(fhResourceCode)){
|
|
|
+ resourceCodeList.add(fhResourceCode);
|
|
|
+ } else { // 将集合中数据资源编码值为[yhybk]或[deving]的原始模型编号元素删除
|
|
|
+ iterator.remove();
|
|
|
+ }
|
|
|
}
|
|
|
- // 对resourceCodeList集合中的元素去重
|
|
|
+ // 对集合中的元素去重,如 DRYJ-WSLJ-JRBDYJ和DRYJ-BSMGQY-JRMGQY两个模型对应的烽火数据资源编码值相同(134B102),均对应网安AUTH认证数据,保留一个即可
|
|
|
List<String> newResourceCodeList = CommonUtil.deduplicateList(resourceCodeList);
|
|
|
String modelIdListStr = modelIdList.toString();
|
|
|
- if(modelIdListStr.contains("DRYJ") && !modelIdListStr.contains("JJYJ")){ // 任务仅包含单人预警
|
|
|
+ // 任务仅包含单人预警
|
|
|
+ if(modelIdListStr.contains("DRYJ") && !modelIdListStr.contains("JJYJ")){
|
|
|
ctrlService.processDRYJCtrl(taskId, clueList, newResourceCodeList, areaIdList, endCtrlTime);
|
|
|
- } else if(modelIdListStr.contains("JJYJ") && !modelIdListStr.contains("DRYJ")){ // 任务仅包含聚集预警
|
|
|
+ }
|
|
|
+ // 任务仅包含聚集预警
|
|
|
+ else if(modelIdListStr.contains("JJYJ") && !modelIdListStr.contains("DRYJ")){
|
|
|
ctrlService.processJJYJCtrl(taskId, clueList, newResourceCodeList, areaIdList);
|
|
|
- } else { // 任务既包含单人预警,又包含聚集预警
|
|
|
+ }
|
|
|
+ // 任务既包含单人预警,又包含聚集预警
|
|
|
+ else {
|
|
|
// 分别筛选出单人预警和聚集预警各自所对应的布控模型编号,并转换为对应的烽火数据资源编码
|
|
|
List<String> dryjResourceCodeList = new ArrayList<>();
|
|
|
List<String> jjyjResourceCodeList = new ArrayList<>();
|
|
@@ -98,7 +110,7 @@ public class CtrlController {
|
|
|
ctrlService.processJJYJCtrl(taskId, clueList, CommonUtil.deduplicateList(jjyjResourceCodeList), areaIdList);
|
|
|
}
|
|
|
return AjaxResult.success(Constants.CTRL_ING_MSG);
|
|
|
- }catch (Exception e){
|
|
|
+ } catch (Exception e){
|
|
|
log.error("任务布控发生异常", e);
|
|
|
}
|
|
|
return AjaxResult.error(Constants.SERVER_ERROR_MSG);
|
|
@@ -149,7 +161,7 @@ public class CtrlController {
|
|
|
JSONArray modelIdListInfo = reqBody.getJSONArray("modelIdListInfo");
|
|
|
JSONArray clueInfo = reqBody.getJSONArray("clueInfo");
|
|
|
JSONArray modelInfo = reqBody.getJSONArray("modelInfo");
|
|
|
- if(taskInfo == null || modelIdListInfo.size() == 0 || clueInfo.size() == 0 || modelInfo.size() == 0){
|
|
|
+ if(taskInfo == null || modelIdListInfo.isEmpty() || clueInfo.isEmpty() || modelInfo.isEmpty()){
|
|
|
return AjaxResult.error(Constants.PARAMS_EMPTY_MSG);
|
|
|
}
|
|
|
try{
|
|
@@ -167,7 +179,7 @@ public class CtrlController {
|
|
|
* @return
|
|
|
*/
|
|
|
@PostMapping("/getCtrlWarningInfo")
|
|
|
- public AjaxResult getCtrlWarningInfo(){
|
|
|
+ public AjaxResult getCtrlWarningInfo(@RequestBody JSONObject reqBody){
|
|
|
try{
|
|
|
return AjaxResult.success(ctrlService.getWarningInfoByInc());
|
|
|
} catch (Exception e){
|