|
|
@@ -18,6 +18,7 @@ import com.tuoheng.common.core.config.common.CommonConfig; |
|
|
|
import com.tuoheng.common.core.exception.ServiceException; |
|
|
|
import com.tuoheng.common.core.utils.*; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.jetbrains.annotations.NotNull; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.http.HttpStatus; |
|
|
@@ -263,6 +264,12 @@ public class DspCallbackServiceImpl implements IDspCallbackService { |
|
|
|
inspectionFile.setGaodeAddress(gaodeAddress_live); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
Map<String, QuestionType> questionTypeMap = getStringQuestionTypeMap(); |
|
|
|
QuestionType questionType = questionTypeMap.get(inspectionFile.getQuestionCode()); |
|
|
|
if(0 == questionType.getIsShow()){ |
|
|
|
inspectionFile.setMark(MarkEnum.NOTVALID.getCode()); |
|
|
|
} |
|
|
|
return inspectionFile; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
|
|
|
@@ -289,12 +296,7 @@ public class DspCallbackServiceImpl implements IDspCallbackService { |
|
|
|
private Boolean saveAccidentData(List<InspectionFile> inspectionFileList) { |
|
|
|
log.info("调用保存应急数据方法,应急数据入库开始...."); |
|
|
|
List<Accident> accidentList = new ArrayList<>(); |
|
|
|
List<QuestionType> questionTypeList = questionTypeMapper.selectList(Wrappers.<QuestionType>lambdaQuery() |
|
|
|
.eq(QuestionType::getMark, MarkEnum.VALID.getCode())); |
|
|
|
Map<String, QuestionType> questionTypeMap = new HashMap<>(); |
|
|
|
for (QuestionType type : questionTypeList) { |
|
|
|
questionTypeMap.put(type.getCode(), type); |
|
|
|
} |
|
|
|
Map<String, QuestionType> questionTypeMap = getStringQuestionTypeMap(); |
|
|
|
for (InspectionFile inspectionFile : inspectionFileList) { |
|
|
|
QuestionType questionType = questionTypeMap.get(inspectionFile.getQuestionCode()); |
|
|
|
if (0 == questionType.getAccidentQuestion()) { |
|
|
@@ -355,6 +357,20 @@ public class DspCallbackServiceImpl implements IDspCallbackService { |
|
|
|
return accidentService.saveBatch(accidentList); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 根据问题类型封装成map |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
private Map<String, QuestionType> getStringQuestionTypeMap() { |
|
|
|
List<QuestionType> questionTypeList = questionTypeMapper.selectList(Wrappers.<QuestionType>lambdaQuery() |
|
|
|
.eq(QuestionType::getMark, MarkEnum.VALID.getCode())); |
|
|
|
Map<String, QuestionType> questionTypeMap = new HashMap<>(); |
|
|
|
for (QuestionType type : questionTypeList) { |
|
|
|
questionTypeMap.put(type.getCode(), type); |
|
|
|
} |
|
|
|
return questionTypeMap; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取飞行坐标 |
|
|
|
* |