|
@@ -32,11 +32,13 @@ import com.base.plan.model.dto.StripDTO;
|
|
import com.base.plan.model.dto.*;
|
|
import com.base.plan.model.dto.*;
|
|
import com.base.plan.model.dto.request.*;
|
|
import com.base.plan.model.dto.request.*;
|
|
import com.base.plan.model.entity.*;
|
|
import com.base.plan.model.entity.*;
|
|
|
|
+import com.base.plan.model.enums.PointTypeEnumes;
|
|
import com.base.plan.model.enums.TaskStateEnums;
|
|
import com.base.plan.model.enums.TaskStateEnums;
|
|
import com.base.plan.model.input.SarInput;
|
|
import com.base.plan.model.input.SarInput;
|
|
import com.base.plan.mq.model.*;
|
|
import com.base.plan.mq.model.*;
|
|
import com.base.plan.service.biz.StripBiz;
|
|
import com.base.plan.service.biz.StripBiz;
|
|
import com.base.plan.utils.FileUploadUtil;
|
|
import com.base.plan.utils.FileUploadUtil;
|
|
|
|
+import com.base.plan.utils.LaLonUtil;
|
|
import com.base.plan.utils.ReadTxtFileTool;
|
|
import com.base.plan.utils.ReadTxtFileTool;
|
|
import com.base.task.TaskInitialize;
|
|
import com.base.task.TaskInitialize;
|
|
import com.base.task.cdlatch.aop.Countdlatch;
|
|
import com.base.task.cdlatch.aop.Countdlatch;
|
|
@@ -820,113 +822,170 @@ public class StripService extends ServiceImpl<StripMapper, StripInfo> {
|
|
|
|
|
|
|
|
|
|
log.info("开始计算:{}", System.currentTimeMillis());
|
|
log.info("开始计算:{}", System.currentTimeMillis());
|
|
- List<SatelliteIdAndPayloadDTO> dtos = satelliteIdCastDTO(targetRelationDTO.getSatelliteSelected());
|
|
|
|
threadPoolTaskExecutor.execute(() -> {
|
|
threadPoolTaskExecutor.execute(() -> {
|
|
- for (SatelliteIdAndPayloadDTO dto : dtos) {
|
|
|
|
- //根据卫星id查询载荷
|
|
|
|
- List<PayloadRpcDTO> payloadRpcDTOS = payloadRpcDTOList
|
|
|
|
- .stream()
|
|
|
|
- .filter(t -> t.getSatelliteId().equals(dto.getSatelliteId()))
|
|
|
|
- .collect(Collectors.toList());
|
|
|
|
-
|
|
|
|
- if (!CollectionUtils.isEmpty(payloadRpcDTOS)) {
|
|
|
|
- for (PayloadRpcDTO payloadRpcDTO : payloadRpcDTOS) {
|
|
|
|
|
|
+ List<PointRpcDTO> value=targetRelationDTO.getPointDTOList();
|
|
|
|
+ /**
|
|
|
|
+ * 1.构建观测区域
|
|
|
|
+ * 2.根据观测区域获取可见星下点数据
|
|
|
|
+ */
|
|
|
|
+ System.out.println("====================构建观测区域===================");
|
|
|
|
+
|
|
|
|
+ //判断是那个类型的目标 目前只有移动点目标 线目标 点群目标需要做单独处理
|
|
|
|
+ if (value.get(0).getTargetType().equals(PointTypeEnumes.MOVEPOINT.toString())){
|
|
|
|
+ //移动点目标
|
|
|
|
+ //根据 航向 航速 时间进行轨迹推算 取得所需时刻后的目标点位
|
|
|
|
+ LaLonUtil.deadReckoning("","","","","");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ Map<Integer, List<PointRpcDTO>> PointRpcDTOmapNew=new HashMap<>();
|
|
|
|
+
|
|
|
|
+ if (value.get(0).getTargetType().equals(PointTypeEnumes.LINE.toString())){
|
|
|
|
+ //线目标
|
|
|
|
+ //先将多点目标按照时间连城线并绘制区域
|
|
|
|
+ PointRpcDTO pointRpcDTO1=new PointRpcDTO();
|
|
|
|
+ PointRpcDTO pointRpcDTO2=new PointRpcDTO();
|
|
|
|
+ for (int i=0;i<value.size();i++){
|
|
|
|
+ if (i!=value.size()-1){
|
|
|
|
+ pointRpcDTO1=value.get(i);
|
|
|
|
+ pointRpcDTO2=value.get(i+1);
|
|
|
|
+ //两点连线转区域
|
|
|
|
+ List<PointRpcDTO> pointRpcDTOList2=new ArrayList<>();
|
|
|
|
+ pointRpcDTOList2= LaLonUtil.draw(pointRpcDTO1,pointRpcDTO2);
|
|
|
|
+ PointRpcDTOmapNew.put(i,pointRpcDTOList2);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ if (value.get(0).getTargetType().equals(PointTypeEnumes.GROUPPOINT.toString())){
|
|
|
|
+ //点群目标
|
|
|
|
+ //先绘制点群外接四边形区域
|
|
|
|
+ List<PointRpcDTO> pointRpcDTOList2=new ArrayList<>();
|
|
|
|
+ pointRpcDTOList2=LaLonUtil.getregion(value);
|
|
|
|
+ value=new ArrayList<>();
|
|
|
|
+ value=pointRpcDTOList2;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (!CollectionUtils.isEmpty(PointRpcDTOmapNew)) {
|
|
|
|
+ PointRpcDTOmapNew.forEach((key1, value1) -> {
|
|
|
|
+ count( targetRelationDTO, payloadRpcDTOList, stripCalcResults, primaryKeyGenerator
|
|
|
|
+ );
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ }else {
|
|
|
|
+ count( targetRelationDTO, payloadRpcDTOList, stripCalcResults, primaryKeyGenerator
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ log.info("结束计算:{}", System.currentTimeMillis());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void count(TargetDemandRpcDTO targetRelationDTO ,List<PayloadRpcDTO> payloadRpcDTOList
|
|
|
|
+ ,ArrayList<StripCalcResult> stripCalcResults
|
|
|
|
+ ,AtomicLong primaryKeyGenerator) {
|
|
|
|
+ List<SatelliteIdAndPayloadDTO> dtos = satelliteIdCastDTO(targetRelationDTO.getSatelliteSelected());
|
|
|
|
+ for (SatelliteIdAndPayloadDTO dto : dtos) {
|
|
|
|
+ //根据卫星id查询载荷
|
|
|
|
+ List<PayloadRpcDTO> payloadRpcDTOS = payloadRpcDTOList
|
|
|
|
+ .stream()
|
|
|
|
+ .filter(t -> t.getSatelliteId().equals(dto.getSatelliteId()))
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
+
|
|
|
|
+ if (!CollectionUtils.isEmpty(payloadRpcDTOS)) {
|
|
|
|
+ for (PayloadRpcDTO payloadRpcDTO : payloadRpcDTOS) {
|
|
/* //暂时使用第一个载荷 不知道一个卫星是否确定对应一个载荷
|
|
/* //暂时使用第一个载荷 不知道一个卫星是否确定对应一个载荷
|
|
PayloadRpcDTO payloadRpcDTO = payloadRpcDTOS.get(0);*/
|
|
PayloadRpcDTO payloadRpcDTO = payloadRpcDTOS.get(0);*/
|
|
- // 根据卫星id查询卫星信息
|
|
|
|
- // SatelliteRpcDTO satellite = satelliteRpcService.queryAllSatelliteByIds(Lists.newArrayList(dto.getSatelliteId())).get(0);
|
|
|
|
-
|
|
|
|
- List<BizReq> bizReqs = new ArrayList<>();
|
|
|
|
- List<EphTrack> ephdatas = new ArrayList<>();
|
|
|
|
- BizReq bizReq = new BizReq();
|
|
|
|
- StripCalcResult stripCalcResult = new StripCalcResult();
|
|
|
|
- String stripCalcResultId = UUID.randomUUID().toString().replace("-", "") + primaryKeyGenerator.getAndIncrement();
|
|
|
|
- stripCalcResult.setStripCalcResultId(stripCalcResultId);
|
|
|
|
- stripCalcResult.setTargetCode(targetRelationDTO.getTargetCode());
|
|
|
|
- stripCalcResult.setTargetName(targetRelationDTO.getTargetName());
|
|
|
|
- stripCalcResult.setStartTime(targetRelationDTO.getStartTime());
|
|
|
|
- stripCalcResult.setEndTime(targetRelationDTO.getEndTime());
|
|
|
|
- stripCalcResult.setParentId(targetRelationDTO.getParentId());
|
|
|
|
- stripCalcResult.setSatelliteCode(payloadRpcDTO.getSatelliteCode());
|
|
|
|
- try {
|
|
|
|
- /**
|
|
|
|
- * 1.构建观测区域
|
|
|
|
- * 2.根据观测区域获取可见星下点数据
|
|
|
|
- */
|
|
|
|
- Region regionCoreDTO = getRegionCoreDTO(targetRelationDTO.getPointDTOList());
|
|
|
|
-
|
|
|
|
- if (payloadRpcDTO.getPayloadType().equals("SAR")) {
|
|
|
|
- if (targetRelationDTO.getPointDTOList().size() == 1) {
|
|
|
|
- //设置观测区域类型,0为点目标
|
|
|
|
- regionCoreDTO.setAreaorpoint(REGION_TYPE_POINT);
|
|
|
|
- regionCoreDTO.setStripExecuteHandler(stripExecuteInitialize.map.get(StripAccessTypeEnums.POINT_SAR));
|
|
|
|
- } else {
|
|
|
|
- regionCoreDTO.setAreaorpoint(REGION_TYPE_AREA);
|
|
|
|
- regionCoreDTO.setStripExecuteHandler(stripExecuteInitialize.map.get(StripAccessTypeEnums.AREA_SAR));
|
|
|
|
- }
|
|
|
|
- } else if (payloadRpcDTO.getPayloadType().equals("CCD") || payloadRpcDTO.getPayloadType().equals("wg")
|
|
|
|
- || payloadRpcDTO.getPayloadType().equals("IRS") || payloadRpcDTO.getPayloadType().equals("wb")) {
|
|
|
|
- if (targetRelationDTO.getPointDTOList().size() == 1) {
|
|
|
|
- regionCoreDTO.setAreaorpoint(REGION_TYPE_POINT);
|
|
|
|
- regionCoreDTO.setStripExecuteHandler(stripExecuteInitialize.map.get(StripAccessTypeEnums.POINT_CCD_COMMON));
|
|
|
|
- /*regionCoreDTO.setUpdown(1);*/
|
|
|
|
- } else {
|
|
|
|
- regionCoreDTO.setAreaorpoint(REGION_TYPE_AREA);
|
|
|
|
- regionCoreDTO.setStripExecuteHandler(stripExecuteInitialize.map.get(StripAccessTypeEnums.AREA_CCD_COMMON));
|
|
|
|
- /*regionCoreDTO.setUpdown(1);*/
|
|
|
|
- }
|
|
|
|
- }/* else if (payloadRpcDTO.getType().equals("IRS")) {
|
|
|
|
|
|
+ // 根据卫星id查询卫星信息
|
|
|
|
+ // SatelliteRpcDTO satellite = satelliteRpcService.queryAllSatelliteByIds(Lists.newArrayList(dto.getSatelliteId())).get(0);
|
|
|
|
+
|
|
|
|
+ List<BizReq> bizReqs = new ArrayList<>();
|
|
|
|
+ List<EphTrack> ephdatas = new ArrayList<>();
|
|
|
|
+ BizReq bizReq = new BizReq();
|
|
|
|
+ StripCalcResult stripCalcResult = new StripCalcResult();
|
|
|
|
+ String stripCalcResultId = UUID.randomUUID().toString().replace("-", "") + primaryKeyGenerator.getAndIncrement();
|
|
|
|
+ stripCalcResult.setStripCalcResultId(stripCalcResultId);
|
|
|
|
+ stripCalcResult.setTargetCode(targetRelationDTO.getTargetCode());
|
|
|
|
+ stripCalcResult.setTargetName(targetRelationDTO.getTargetName());
|
|
|
|
+ stripCalcResult.setStartTime(targetRelationDTO.getStartTime());
|
|
|
|
+ stripCalcResult.setEndTime(targetRelationDTO.getEndTime());
|
|
|
|
+ stripCalcResult.setParentId(targetRelationDTO.getParentId());
|
|
|
|
+ stripCalcResult.setSatelliteCode(payloadRpcDTO.getSatelliteCode());
|
|
|
|
+ try {
|
|
|
|
+ /**
|
|
|
|
+ * 1.构建观测区域
|
|
|
|
+ * 2.根据观测区域获取可见星下点数据
|
|
|
|
+ */
|
|
|
|
+ Region regionCoreDTO = getRegionCoreDTO(targetRelationDTO.getPointDTOList());
|
|
|
|
+
|
|
|
|
+ if (payloadRpcDTO.getPayloadType().equals("SAR")) {
|
|
|
|
+ if (targetRelationDTO.getPointDTOList().size() == 1) {
|
|
|
|
+ //设置观测区域类型,0为点目标
|
|
|
|
+ regionCoreDTO.setAreaorpoint(REGION_TYPE_POINT);
|
|
|
|
+ regionCoreDTO.setStripExecuteHandler(stripExecuteInitialize.map.get(StripAccessTypeEnums.POINT_SAR));
|
|
|
|
+ } else {
|
|
|
|
+ regionCoreDTO.setAreaorpoint(REGION_TYPE_AREA);
|
|
|
|
+ regionCoreDTO.setStripExecuteHandler(stripExecuteInitialize.map.get(StripAccessTypeEnums.AREA_SAR));
|
|
|
|
+ }
|
|
|
|
+ } else if (payloadRpcDTO.getPayloadType().equals("CCD") || payloadRpcDTO.getPayloadType().equals("wg")
|
|
|
|
+ || payloadRpcDTO.getPayloadType().equals("IRS") || payloadRpcDTO.getPayloadType().equals("wb")) {
|
|
|
|
+ if (targetRelationDTO.getPointDTOList().size() == 1) {
|
|
|
|
+ regionCoreDTO.setAreaorpoint(REGION_TYPE_POINT);
|
|
|
|
+ regionCoreDTO.setStripExecuteHandler(stripExecuteInitialize.map.get(StripAccessTypeEnums.POINT_CCD_COMMON));
|
|
|
|
+ /*regionCoreDTO.setUpdown(1);*/
|
|
|
|
+ } else {
|
|
|
|
+ regionCoreDTO.setAreaorpoint(REGION_TYPE_AREA);
|
|
|
|
+ regionCoreDTO.setStripExecuteHandler(stripExecuteInitialize.map.get(StripAccessTypeEnums.AREA_CCD_COMMON));
|
|
|
|
+ /*regionCoreDTO.setUpdown(1);*/
|
|
|
|
+ }
|
|
|
|
+ }/* else if (payloadRpcDTO.getType().equals("IRS")) {
|
|
//红外 计算跟普通光学一样 星下点查询降轨 升轨都查
|
|
//红外 计算跟普通光学一样 星下点查询降轨 升轨都查
|
|
regionCoreDTO.setStripExecuteHandler(stripExecuteInitialize.map.get(StripAccessTypeEnums.AREA_CCD_COMMON));
|
|
regionCoreDTO.setStripExecuteHandler(stripExecuteInitialize.map.get(StripAccessTypeEnums.AREA_CCD_COMMON));
|
|
} */ else if (payloadRpcDTO.getPayloadType().equals("ELECTRON")) {
|
|
} */ else if (payloadRpcDTO.getPayloadType().equals("ELECTRON")) {
|
|
- //电子区域
|
|
|
|
- regionCoreDTO.setStripExecuteHandler(stripExecuteInitialize.map.get(StripAccessTypeEnums.AREA_ELECTRONIC));
|
|
|
|
- if (targetRelationDTO.getPointDTOList().size() > 1) {
|
|
|
|
- //区域
|
|
|
|
- regionCoreDTO.setAreaorpoint(REGION_TYPE_AREA);
|
|
|
|
- } else {
|
|
|
|
- regionCoreDTO.setAreaorpoint(REGION_TYPE_POINT);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- /*regionCoreDTO.setBizSerial(req.getReqIds().get(0));*/
|
|
|
|
- bizReq.setRegion(regionCoreDTO);
|
|
|
|
- List<SubPointDataRpcDTO> subPointDataRpcDTOS = regionService.getSubPoint(regionCoreDTO, payloadRpcDTO, targetRelationDTO);
|
|
|
|
- if (!CollectionUtils.isEmpty(subPointDataRpcDTOS)) {
|
|
|
|
|
|
+ //电子区域
|
|
|
|
+ regionCoreDTO.setStripExecuteHandler(stripExecuteInitialize.map.get(StripAccessTypeEnums.AREA_ELECTRONIC));
|
|
|
|
+ if (targetRelationDTO.getPointDTOList().size() > 1) {
|
|
|
|
+ //区域
|
|
|
|
+ regionCoreDTO.setAreaorpoint(REGION_TYPE_AREA);
|
|
|
|
+ } else {
|
|
|
|
+ regionCoreDTO.setAreaorpoint(REGION_TYPE_POINT);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ /*regionCoreDTO.setBizSerial(req.getReqIds().get(0));*/
|
|
|
|
+ bizReq.setRegion(regionCoreDTO);
|
|
|
|
+ List<SubPointDataRpcDTO> subPointDataRpcDTOS = regionService.getSubPoint(regionCoreDTO, payloadRpcDTO, targetRelationDTO);
|
|
|
|
+ if (!CollectionUtils.isEmpty(subPointDataRpcDTOS)) {
|
|
/*EphTrack ephTrack = ephTrackService.convertEphTrack(subPointDataRpcDTOS, payloadInfo, fzTaskInfo);
|
|
/*EphTrack ephTrack = ephTrackService.convertEphTrack(subPointDataRpcDTOS, payloadInfo, fzTaskInfo);
|
|
ephdatas.add(ephTrack);*/
|
|
ephdatas.add(ephTrack);*/
|
|
- List<EphTrack> ephdatasnew = ephTrackService.convertEphTracknew(subPointDataRpcDTOS, payloadRpcDTO);
|
|
|
|
- ephdatas.addAll(ephdatasnew);
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- List<EphTrackCoreDTO> ephTrackCoreDTOS = copyEph(ephdatas);
|
|
|
|
- bizReq.setEphTrackCoreDTOs(ephTrackCoreDTOS);
|
|
|
|
- bizReqs.add(bizReq);
|
|
|
|
- List<com.base.core.model.enity.StripDTO> stripDTOList = stripAbstractTemplate.compute(bizReqs);
|
|
|
|
- if (!CollectionUtils.isEmpty(stripDTOList)) {
|
|
|
|
- // 原有代码一个条带生成一个筹划方案
|
|
|
|
- List<AlgSchemeStepWindow> algSchemeStepWindows = formatAndBatch(stripDTOList, payloadRpcDTO, targetRelationDTO.getParentId());
|
|
|
|
- try {
|
|
|
|
- saveStrips(stripDTOList, payloadRpcDTO, targetRelationDTO.getParentId(), targetRelationDTO.getPointDTOList().get(0));
|
|
|
|
- }catch (Exception e){
|
|
|
|
- stripCalcResult.setIsSucceeded(STRIP_CALC_RESULT_FAILED);
|
|
|
|
- log.info("条带保存失败!");
|
|
|
|
- }
|
|
|
|
- // 条带提供测控、数传列表
|
|
|
|
- insetAlgSchemeWindow(targetRelationDTO, payloadRpcDTO, algSchemeStepWindows);
|
|
|
|
- }
|
|
|
|
- stripCalcResult.setIsSucceeded(STRIP_CALC_RESULT_SUCCEED);
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- e.printStackTrace();
|
|
|
|
|
|
+ List<EphTrack> ephdatasnew = ephTrackService.convertEphTracknew(subPointDataRpcDTOS, payloadRpcDTO);
|
|
|
|
+ ephdatas.addAll(ephdatasnew);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ List<EphTrackCoreDTO> ephTrackCoreDTOS = copyEph(ephdatas);
|
|
|
|
+ bizReq.setEphTrackCoreDTOs(ephTrackCoreDTOS);
|
|
|
|
+ bizReqs.add(bizReq);
|
|
|
|
+ List<com.base.core.model.enity.StripDTO> stripDTOList = stripAbstractTemplate.compute(bizReqs);
|
|
|
|
+ if (!CollectionUtils.isEmpty(stripDTOList)) {
|
|
|
|
+ // 原有代码一个条带生成一个筹划方案
|
|
|
|
+ List<AlgSchemeStepWindow> algSchemeStepWindows = formatAndBatch(stripDTOList, payloadRpcDTO, targetRelationDTO.getParentId());
|
|
|
|
+ try {
|
|
|
|
+ saveStrips(stripDTOList, payloadRpcDTO, targetRelationDTO.getParentId(), targetRelationDTO.getPointDTOList().get(0));
|
|
|
|
+ }catch (Exception e){
|
|
|
|
+ stripCalcResult.setIsSucceeded(STRIP_CALC_RESULT_FAILED);
|
|
|
|
+ log.info("条带保存失败!");
|
|
}
|
|
}
|
|
- stripCalcResults.add(stripCalcResult);
|
|
|
|
|
|
+ // 条带提供测控、数传列表
|
|
|
|
+ insetAlgSchemeWindow(targetRelationDTO, payloadRpcDTO, algSchemeStepWindows);
|
|
}
|
|
}
|
|
|
|
+ stripCalcResult.setIsSucceeded(STRIP_CALC_RESULT_SUCCEED);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
}
|
|
}
|
|
|
|
+ stripCalcResults.add(stripCalcResult);
|
|
}
|
|
}
|
|
- stripCalcResultService.saveBatch(stripCalcResults);
|
|
|
|
- });
|
|
|
|
- log.info("结束计算:{}", System.currentTimeMillis());
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+ stripCalcResultService.saveBatch(stripCalcResults);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|