|
|
@@ -7,9 +7,13 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
|
|
import com.baomidou.mybatisplus.annotation.TableName;
|
|
|
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
|
|
|
import com.ydtech.modules.protocol.entity.dto.PtlAgreementAttributionDto;
|
|
|
+import com.ydtech.modules.protocol.entity.dto.PtlAttributionTemplateDto;
|
|
|
import lombok.*;
|
|
|
|
|
|
import java.io.Serializable;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* 协议归属信息
|
|
|
@@ -96,4 +100,23 @@ public class PtlAgreementAttribution implements Serializable {
|
|
|
this.fields = ptlInsAttributionTemplate.getFields();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 过滤模版信息
|
|
|
+ *
|
|
|
+ * @param ptlAgreementAttribution 协议归属
|
|
|
+ * @param ptlInsAttributionTemplate 协议归属模版
|
|
|
+ */
|
|
|
+ public static void filterTemplates(PtlAgreementAttribution ptlAgreementAttribution, PtlInsAttributionTemplate ptlInsAttributionTemplate) {
|
|
|
+ List<PtlAttributionTemplateDto> ptlAttributionTemplateDtoList = ptlAgreementAttribution.getFields().toJavaList(PtlAttributionTemplateDto.class);
|
|
|
+ // 信息
|
|
|
+ Map<String, String> map = ptlAttributionTemplateDtoList.stream().collect(Collectors.toMap(PtlAttributionTemplateDto::getField, PtlAttributionTemplateDto::getValue, (v1, v2) -> v1));
|
|
|
+ // 模版中的数据
|
|
|
+ List<PtlAttributionTemplateDto> ptlAttributionTemplate = ptlInsAttributionTemplate.getFields().toJavaList(PtlAttributionTemplateDto.class);
|
|
|
+ ptlAttributionTemplate.forEach(x -> {
|
|
|
+ String s = map.get(x.getField());
|
|
|
+ x.setValue(s);
|
|
|
+ });
|
|
|
+ ptlAgreementAttribution.setFields(JSON.parseArray(JSON.toJSONString(ptlAttributionTemplate)));
|
|
|
+ }
|
|
|
+
|
|
|
}
|