123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- package com.shkpr.service.alambizplugin.dto;
- import com.shkpr.service.alambizplugin.commtools.ThirdImportTemplateUtils;
- import com.shkpr.service.alambizplugin.constants.GisMetadataDefine;
- import com.shkpr.service.alambizplugin.constants.GisSurveyExcelDefine;
- import lombok.Data;
- import java.util.Map;
- import java.util.Objects;
- /**
- * 第三方导入元素dto
- *
- * @author 欧阳劲驰
- * @since 1.0.0
- */
- @Data
- public class GisSurveyThirdImportElement {
- /**
- * 点号
- */
- private String no;
- /**
- * 上游点号
- */
- private String upNO;
- /**
- * 下游点号
- */
- private String downNO;
- /**
- * 元素分类:point--点;line--线;face--面
- */
- private String kind;
- /**
- * 图层名称
- */
- private String layerName;
- /**
- * 属性名称
- */
- private String propertyName;
- /**
- * 约束条件
- */
- private GisSurveyCondition condition;
- /**
- * 值
- */
- private String value;
- /**
- * 原因
- */
- private String message;
- public GisSurveyThirdImportElement(String kind, String no, String layerName, String propertyName, String message) {
- this.kind = kind;
- this.no = no;
- this.layerName = layerName;
- this.propertyName = propertyName;
- this.message = message;
- }
- public GisSurveyThirdImportElement(String kind, String upNO, String downNO, String layerName, String propertyName, String message) {
- this.kind = kind;
- this.upNO = upNO;
- this.downNO = downNO;
- this.layerName = layerName;
- this.propertyName = propertyName;
- this.message = message;
- }
- public static GisSurveyThirdImportElement create(Map<String, String> data, GisMetadataLayerTemplate layerTemplate
- , String propertyName, String message) {
- if (Objects.equals(GisMetadataDefine.TYPE_KINE.POINT, layerTemplate.getKind())) {
- return new GisSurveyThirdImportElement(GisMetadataDefine.TYPE_KINE.POINT,
- ThirdImportTemplateUtils.getValue(data, layerTemplate, GisSurveyExcelDefine.TEMPLATE.NO),
- layerTemplate.getName(),
- propertyName,
- message
- );
- }
- if (Objects.equals(GisMetadataDefine.TYPE_KINE.LINE, layerTemplate.getKind())) {
- return new GisSurveyThirdImportElement(GisMetadataDefine.TYPE_KINE.LINE,
- ThirdImportTemplateUtils.getValue(data, layerTemplate, GisSurveyExcelDefine.TEMPLATE.UP_NO),
- ThirdImportTemplateUtils.getValue(data, layerTemplate, GisSurveyExcelDefine.TEMPLATE.DOWN_NO),
- layerTemplate.getName(),
- propertyName,
- message
- );
- }
- return null;
- }
- public static GisSurveyThirdImportElement create(Map<String, String> data, GisMetadataLayerTemplate layerTemplate
- , String propertyName, String value, GisSurveyCondition condition, String message) {
- GisSurveyThirdImportElement element = create(data, layerTemplate, propertyName, message);
- if (element == null) return null;
- element.setValue(value);
- element.setCondition(condition);
- return element;
- }
- }
|