|
@@ -3,12 +3,14 @@ package com.sooka.sponest.data.housingconstruction.service.impl;
|
|
|
import com.sooka.sponest.data.housingconstruction.domain.CenterdataTHousingconstructionAttach;
|
|
|
import com.sooka.sponest.data.housingconstruction.mapper.CenterdataTHousingconstructionAttachMapper;
|
|
|
import com.sooka.sponest.data.housingconstruction.service.ICenterdataTHousingconstructionAttachService;
|
|
|
+import org.apache.commons.collections4.MapUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* 住建-附件Service业务层处理
|
|
@@ -46,6 +48,19 @@ public class CenterdataTHousingconstructionAttachServiceImpl implements ICenterd
|
|
|
return addAttach(Arrays.asList(attachStr.split(",")), busId, dictType, dictValue);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public int addAttach(List<Map<String, Object>> attachList, String busId) {
|
|
|
+ List<CenterdataTHousingconstructionAttach> dataList = new ArrayList<>();
|
|
|
+ attachList.forEach(map -> {
|
|
|
+ //{"key":"字段名", "value":"路径"}
|
|
|
+ String path = MapUtils.getString(map, "value");
|
|
|
+ String type = MapUtils.getString(map, "key");
|
|
|
+ String[] split = path.split("/");
|
|
|
+ dataList.add(new CenterdataTHousingconstructionAttach(busId, type, null, path, split[split.length - 1], 0L));
|
|
|
+ });
|
|
|
+ return addAttach(dataList);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 路径处理
|
|
|
*/
|