|
@@ -37,9 +37,13 @@ import java.util.stream.Collectors;
|
|
|
*/
|
|
*/
|
|
|
@Slf4j
|
|
@Slf4j
|
|
|
@Service
|
|
@Service
|
|
|
-public class DealExcelServiceImpl{
|
|
|
|
|
|
|
+public class DealExcelServiceImpl {
|
|
|
|
|
|
|
|
- private static List<LandType> allLandTypeList =new ArrayList<>();
|
|
|
|
|
|
|
+ private final String rootPath2019 = Constant.IMPORT_EXCEL_DATA_FILE_PATH + "\\数据治理批量导入示例数据\\赣江新区项目文件夹建立\\1.出让项目\\2019";
|
|
|
|
|
+ private final String rootPath2020 = Constant.IMPORT_EXCEL_DATA_FILE_PATH + "\\数据治理批量导入示例数据\\赣江新区项目文件夹建立\\1.出让项目\\2020";
|
|
|
|
|
+ private final String targectDir = Constant.FILE_UPLOAD_PATH;
|
|
|
|
|
+
|
|
|
|
|
+ private static List<LandType> allLandTypeList = new ArrayList<>();
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private ProjectService projectService;
|
|
private ProjectService projectService;
|
|
@@ -71,13 +75,9 @@ public class DealExcelServiceImpl{
|
|
|
private CadastreFileMapper cadastreFileMapper;
|
|
private CadastreFileMapper cadastreFileMapper;
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* 检查excel数据到数据库
|
|
* 检查excel数据到数据库
|
|
|
|
|
+ *
|
|
|
* @param dataMap
|
|
* @param dataMap
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
@@ -86,16 +86,15 @@ public class DealExcelServiceImpl{
|
|
|
int i = 0;
|
|
int i = 0;
|
|
|
for (Map<String, String> xm : xmList) {
|
|
for (Map<String, String> xm : xmList) {
|
|
|
ProjectVo projectVo = new ProjectVo();
|
|
ProjectVo projectVo = new ProjectVo();
|
|
|
- String projectType = xm.get("项目类型(必填)");
|
|
|
|
|
|
|
+ String projectType = xm.get("项目类型(必填)");
|
|
|
|
|
|
|
|
- if(projectType.equalsIgnoreCase("单独选址")){
|
|
|
|
|
|
|
+ if (projectType.equalsIgnoreCase("单独选址")) {
|
|
|
projectVo.setProjectType(1);
|
|
projectVo.setProjectType(1);
|
|
|
- }else if(projectType.equalsIgnoreCase("批次报批")){
|
|
|
|
|
|
|
+ } else if (projectType.equalsIgnoreCase("批次报批")) {
|
|
|
projectVo.setProjectType(2);
|
|
projectVo.setProjectType(2);
|
|
|
- }else {
|
|
|
|
|
- writeToLog("xm_err.log","行("+i+")项目类型不合法,项目类型只能是单独选址或者批次报批");
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ writeToLog("xm_err.log", "行(" + i + ")项目类型不合法,项目类型只能是单独选址或者批次报批");
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -104,27 +103,21 @@ public class DealExcelServiceImpl{
|
|
|
for (Map<String, String> tdgyExcel : tdgyList) {
|
|
for (Map<String, String> tdgyExcel : tdgyList) {
|
|
|
String tdyt = tdgyExcel.get("土地用途");
|
|
String tdyt = tdgyExcel.get("土地用途");
|
|
|
String tdytCode = getTdytCodeByName(tdyt);
|
|
String tdytCode = getTdytCodeByName(tdyt);
|
|
|
- if(StringUtils.isBlank(tdytCode)){
|
|
|
|
|
- writeToLog("tdgy_err.log","行("+i+")项目类型不合法,项目类型只能是单独选址或者批次报批");
|
|
|
|
|
|
|
+ if (StringUtils.isBlank(tdytCode)) {
|
|
|
|
|
+ writeToLog("tdgy_err.log", "行(" + i + ")项目类型不合法,项目类型只能是单独选址或者批次报批");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
return "successs";
|
|
return "successs";
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* 添加excel数据到数据库
|
|
* 添加excel数据到数据库
|
|
|
|
|
+ *
|
|
|
* @param dataMap
|
|
* @param dataMap
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
public String addExcelDataToDb(Map<String, List<Map<String, String>>> dataMap) {
|
|
public String addExcelDataToDb(Map<String, List<Map<String, String>>> dataMap) {
|
|
|
- String rootPath2019 = Constant.IMPORT_EXCEL_DATA_FILE_PATH+"\\数据治理批量导入示例数据\\赣江新区项目文件夹建立\\1.出让项目\\2019";
|
|
|
|
|
- String rootPath2020 = Constant.IMPORT_EXCEL_DATA_FILE_PATH+"\\数据治理批量导入示例数据\\赣江新区项目文件夹建立\\1.出让项目\\2020";
|
|
|
|
|
- String targectDir = Constant.FILE_UPLOAD_PATH;
|
|
|
|
|
|
|
|
|
|
List<Map<String, String>> xmList = dataMap.get("项目信息");
|
|
List<Map<String, String>> xmList = dataMap.get("项目信息");
|
|
|
List<Map<String, String>> tdgyList = dataMap.get("土地供应");
|
|
List<Map<String, String>> tdgyList = dataMap.get("土地供应");
|
|
@@ -134,57 +127,57 @@ public class DealExcelServiceImpl{
|
|
|
|
|
|
|
|
for (Map<String, String> xm : xmList) {
|
|
for (Map<String, String> xm : xmList) {
|
|
|
ProjectVo projectVo = new ProjectVo();
|
|
ProjectVo projectVo = new ProjectVo();
|
|
|
- String projectType = xm.get("项目类型(必填)");
|
|
|
|
|
- if(projectType.equalsIgnoreCase("单独选址")){
|
|
|
|
|
|
|
+ String projectType = xm.get("项目类型(必填)");
|
|
|
|
|
+ if (projectType.equalsIgnoreCase("单独选址")) {
|
|
|
projectVo.setProjectType(1);
|
|
projectVo.setProjectType(1);
|
|
|
- }else if(projectType.equalsIgnoreCase("批次报批")){
|
|
|
|
|
|
|
+ } else if (projectType.equalsIgnoreCase("批次报批")) {
|
|
|
projectVo.setProjectType(2);
|
|
projectVo.setProjectType(2);
|
|
|
- }else {
|
|
|
|
|
|
|
+ } else {
|
|
|
log.error("项目类型不合法,项目类型只能是单独选址或者批次报批{}", projectType);
|
|
log.error("项目类型不合法,项目类型只能是单独选址或者批次报批{}", projectType);
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- String projectName = xm.get("项目名称");
|
|
|
|
|
- if(StringUtils.isBlank(projectName)){
|
|
|
|
|
- projectName = "xxxxx"+System.currentTimeMillis();
|
|
|
|
|
|
|
+ String projectName = xm.get("项目名称");
|
|
|
|
|
+ if (StringUtils.isBlank(projectName)) {
|
|
|
|
|
+ projectName = "xxxxx" + System.currentTimeMillis();
|
|
|
log.warn("项目名称为空,默认设置为{}", projectName);
|
|
log.warn("项目名称为空,默认设置为{}", projectName);
|
|
|
}
|
|
}
|
|
|
projectVo.setName(projectName);
|
|
projectVo.setName(projectName);
|
|
|
|
|
|
|
|
- String code = xm.get("项目代码");
|
|
|
|
|
|
|
+ String code = xm.get("项目代码");
|
|
|
projectVo.setCode(code);
|
|
projectVo.setCode(code);
|
|
|
|
|
|
|
|
- String company = xm.get("建设单位");
|
|
|
|
|
|
|
+ String company = xm.get("建设单位");
|
|
|
projectVo.setCompany(company);
|
|
projectVo.setCompany(company);
|
|
|
projectVo.setOnChainNum(0);
|
|
projectVo.setOnChainNum(0);
|
|
|
|
|
|
|
|
String projectId = projectService.add(projectVo);
|
|
String projectId = projectService.add(projectVo);
|
|
|
|
|
|
|
|
- // -----------------第一部分增加项目结束-------------------------------
|
|
|
|
|
|
|
+ // -----------------第一部分增加项目结束-------------------------------
|
|
|
|
|
|
|
|
TdgyVo tdgyVo = new TdgyVo();
|
|
TdgyVo tdgyVo = new TdgyVo();
|
|
|
tdgyVo.setProjectId(projectId);
|
|
tdgyVo.setProjectId(projectId);
|
|
|
|
|
|
|
|
- Map<String, String> tdgyExcel = tdgyList.get(i);
|
|
|
|
|
|
|
+ Map<String, String> tdgyExcel = tdgyList.get(i);
|
|
|
String srf = tdgyExcel.get("土地受让人");
|
|
String srf = tdgyExcel.get("土地受让人");
|
|
|
tdgyVo.setSrf(srf);
|
|
tdgyVo.setSrf(srf);
|
|
|
|
|
|
|
|
String tdyt = tdgyExcel.get("土地用途");
|
|
String tdyt = tdgyExcel.get("土地用途");
|
|
|
String tdytCode = getTdytCodeByName(tdyt);
|
|
String tdytCode = getTdytCodeByName(tdyt);
|
|
|
- if(StringUtils.isBlank(tdytCode)){
|
|
|
|
|
|
|
+ if (StringUtils.isBlank(tdytCode)) {
|
|
|
log.warn("土地用途{}没有找到对应的code,默认设置为{}", tdyt, tdytCode);
|
|
log.warn("土地用途{}没有找到对应的code,默认设置为{}", tdyt, tdytCode);
|
|
|
}
|
|
}
|
|
|
tdgyVo.setTdyt(tdytCode);
|
|
tdgyVo.setTdyt(tdytCode);
|
|
|
|
|
|
|
|
String gdArea = tdgyExcel.get("供地面积");
|
|
String gdArea = tdgyExcel.get("供地面积");
|
|
|
- if(StringUtils.isBlank(gdArea)){
|
|
|
|
|
|
|
+ if (StringUtils.isBlank(gdArea)) {
|
|
|
log.warn("供地面积为空,默认设置为0");
|
|
log.warn("供地面积为空,默认设置为0");
|
|
|
gdArea = "0";
|
|
gdArea = "0";
|
|
|
}
|
|
}
|
|
|
tdgyVo.setGdArea(Float.parseFloat(gdArea));
|
|
tdgyVo.setGdArea(Float.parseFloat(gdArea));
|
|
|
|
|
|
|
|
String gdUnit = tdgyExcel.get("面积单位");
|
|
String gdUnit = tdgyExcel.get("面积单位");
|
|
|
- if(StringUtils.isBlank(gdUnit)){
|
|
|
|
|
|
|
+ if (StringUtils.isBlank(gdUnit)) {
|
|
|
log.warn("供地面积为空,默认设置为0");
|
|
log.warn("供地面积为空,默认设置为0");
|
|
|
gdUnit = "";
|
|
gdUnit = "";
|
|
|
}
|
|
}
|
|
@@ -197,11 +190,11 @@ public class DealExcelServiceImpl{
|
|
|
tdgyVo.setGdType(gdType);
|
|
tdgyVo.setGdType(gdType);
|
|
|
|
|
|
|
|
String hasZz = tdgyExcel.get("是否完成征转");
|
|
String hasZz = tdgyExcel.get("是否完成征转");
|
|
|
- if(hasZz.equalsIgnoreCase("是")){
|
|
|
|
|
|
|
+ if (hasZz.equalsIgnoreCase("是")) {
|
|
|
hasZz = "已报已征";
|
|
hasZz = "已报已征";
|
|
|
- }else if(hasZz.equalsIgnoreCase("否")){
|
|
|
|
|
|
|
+ } else if (hasZz.equalsIgnoreCase("否")) {
|
|
|
hasZz = "未报未征";
|
|
hasZz = "未报未征";
|
|
|
- }else {
|
|
|
|
|
|
|
+ } else {
|
|
|
log.warn("是否完成征转{}不合法,默认设置为否", hasZz);
|
|
log.warn("是否完成征转{}不合法,默认设置为否", hasZz);
|
|
|
hasZz = "";
|
|
hasZz = "";
|
|
|
}
|
|
}
|
|
@@ -218,69 +211,95 @@ public class DealExcelServiceImpl{
|
|
|
String id = tdgyService.add(tdgyVo);
|
|
String id = tdgyService.add(tdgyVo);
|
|
|
|
|
|
|
|
//附件材料处理 -- 数据治理文件名
|
|
//附件材料处理 -- 数据治理文件名
|
|
|
- Map<String, String> jdMap = jdList.get(i);
|
|
|
|
|
- String projectFileName = jdMap.get("数据治理文件名");
|
|
|
|
|
- String fullFilePath = "";
|
|
|
|
|
|
|
+ Map<String, String> jdMap = jdList.get(i);
|
|
|
|
|
+ String projectFileName = jdMap.get("数据治理文件名");
|
|
|
|
|
+ String nodeFileName = "03土地供应阶段";
|
|
|
|
|
+ dealCurrentNodeAttachment(projectId,id,projectFileName,nodeFileName);
|
|
|
|
|
|
|
|
- String nodeFileName ="03土地供应阶段";
|
|
|
|
|
|
|
|
|
|
- Path filePath = Paths.get(rootPath2019+"\\"+projectFileName);
|
|
|
|
|
- if(Files.exists(filePath) && Files.isDirectory(filePath)){
|
|
|
|
|
- fullFilePath = copyFileToDirectory(rootPath2019+"\\"+projectFileName,targectDir+"\\"+projectFileName,nodeFileName);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ //矢量数据处理 -- 数据治理文件名
|
|
|
|
|
+ String dzjgh = jdMap.get("划拨决定书/出让合同电子监管号");
|
|
|
|
|
+ dealCurrentNodeGeom(dzjgh, id);
|
|
|
|
|
+ // -----------------第二部分增加项目关联的(土地供应)环节结束-------------------------------
|
|
|
|
|
|
|
|
- if(StringUtils.isBlank(fullFilePath)){
|
|
|
|
|
- filePath = Paths.get(rootPath2020+"\\"+projectFileName);
|
|
|
|
|
- if(!Files.exists(filePath) || !Files.isDirectory(filePath)){
|
|
|
|
|
- fullFilePath = copyFileToDirectory(rootPath2019+"\\"+projectFileName,targectDir+"\\"+projectFileName,nodeFileName);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ i++;
|
|
|
|
|
+ if (i > 2) {
|
|
|
|
|
+ log.warn("目前只支持处理一条土地供应数据,后续增加处理逻辑");
|
|
|
|
|
+ break;
|
|
|
}
|
|
}
|
|
|
|
|
+ }
|
|
|
|
|
+ return "successs";
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- if(StringUtils.isNotBlank(fullFilePath)) {
|
|
|
|
|
- //这里进行文件关联
|
|
|
|
|
- String nodeAttachmentId = associationFile(fullFilePath, projectId, id);
|
|
|
|
|
- log.info("关于项目{}的土地供应环节,文件{}关联结果{}", projectId, nodeFileName, nodeAttachmentId);
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- //矢量数据处理 -- 数据治理文件名
|
|
|
|
|
- try {
|
|
|
|
|
- String dzjgh = jdMap.get("划拨决定书/出让合同电子监管号");
|
|
|
|
|
- String ywh = "dzjgh = " + "'"+dzjgh+"'";
|
|
|
|
|
- List<Map<String,Object>> gdRes = cadastreFileMapper.selectTableDataByCondition("","gj_gd_data","",ywh);
|
|
|
|
|
-
|
|
|
|
|
- log.info("获取excel中电子监管号:{}", dzjgh);
|
|
|
|
|
- List<String> gdIdList = gdRes.stream().filter(s->s.get("dzjgh")!=null).map(s->s.get("gid").toString()).collect(Collectors.toList());
|
|
|
|
|
- log.info("获取供地图层gid为:{}", gdIdList);
|
|
|
|
|
-
|
|
|
|
|
- if(CollectionUtils.isNotEmpty(gdIdList)){
|
|
|
|
|
- Map<String, Object> map = new HashMap<>();
|
|
|
|
|
- map.put("geomData", gdIdList);
|
|
|
|
|
- map.put("sourceType", "excel");
|
|
|
|
|
- R<TGeomDb> saveGeomRes = remoteSpatialFilesDbService.saveGeom(map);
|
|
|
|
|
- TGeomDb tGeomDb = saveGeomRes.getData();
|
|
|
|
|
- log.info("远程调用geom保存,返回结果:{}", tGeomDb);
|
|
|
|
|
- //这里保存geom映射关系
|
|
|
|
|
- nodeLandService.createNodeLand(id, tGeomDb.getId());
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ //附件数据处理 -- 数据治理文件名
|
|
|
|
|
+ public void dealCurrentNodeAttachment(String projectId, String nodeId,String projectFileName,String nodeFileName) {
|
|
|
|
|
+ if (StringUtils.isBlank(projectFileName)) {
|
|
|
|
|
+ log.info("数据治理文件名称--附件材料:{}", projectFileName);
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- } catch (IOException e) {
|
|
|
|
|
- throw new RuntimeException(e);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ String fullFilePath = "";
|
|
|
|
|
+ Path filePath = Paths.get(rootPath2019 + "\\" + projectFileName);
|
|
|
|
|
+ if (Files.exists(filePath) && Files.isDirectory(filePath)) {
|
|
|
|
|
+ fullFilePath = copyFileToDirectory(rootPath2019 + "\\" + projectFileName, targectDir + "\\" + projectFileName, nodeFileName);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- // -----------------第二部分增加项目关联的(土地供应)环节结束-------------------------------
|
|
|
|
|
- i++;
|
|
|
|
|
- if (i>2) {
|
|
|
|
|
- log.warn("目前只支持处理一条土地供应数据,后续增加处理逻辑");
|
|
|
|
|
- break;
|
|
|
|
|
|
|
+ if (StringUtils.isBlank(fullFilePath)) {
|
|
|
|
|
+ filePath = Paths.get(rootPath2020 + "\\" + projectFileName);
|
|
|
|
|
+ if (!Files.exists(filePath) || !Files.isDirectory(filePath)) {
|
|
|
|
|
+ fullFilePath = copyFileToDirectory(rootPath2019 + "\\" + projectFileName, targectDir + "\\" + projectFileName, nodeFileName);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- return "successs";
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if (StringUtils.isNotBlank(fullFilePath)) {
|
|
|
|
|
+ //这里进行文件关联
|
|
|
|
|
+ String nodeAttachmentId = associationFile(fullFilePath, projectId, nodeId);
|
|
|
|
|
+ log.info("关于项目{}的土地供应环节,文件{}关联结果{}", projectId, nodeFileName, nodeAttachmentId);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- public static String copyFileToDirectory(String sourceFilePath, String targetDirectoryPath,String FileName){
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ //矢量数据处理 -- 数据治理文件名
|
|
|
|
|
+ public void dealCurrentNodeGeom(String dzjgh, String nodeId) {
|
|
|
|
|
+ if (StringUtils.isBlank(dzjgh)) {
|
|
|
|
|
+ log.info("入参电子监管号:{}", dzjgh);
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ String ywh = "dzjgh = " + "'" + dzjgh + "'";
|
|
|
|
|
+ List<Map<String, Object>> gdRes = cadastreFileMapper.selectTableDataByCondition("", "gj_gd_data", "", ywh);
|
|
|
|
|
+
|
|
|
|
|
+ log.info("获取excel中电子监管号:{}", dzjgh);
|
|
|
|
|
+ List<String> gdIdList = gdRes.stream().filter(s -> s.get("dzjgh") != null).map(s -> s.get("gid").toString()).collect(Collectors.toList());
|
|
|
|
|
+ log.info("获取供地图层gid为:{}", gdIdList);
|
|
|
|
|
+
|
|
|
|
|
+ if (CollectionUtils.isNotEmpty(gdIdList)) {
|
|
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
|
|
+ map.put("gdIdList", gdIdList);
|
|
|
|
|
+ map.put("sourceType", "excel");
|
|
|
|
|
+ R<TGeomDb> saveGeomRes = remoteSpatialFilesDbService.saveGeom(map);
|
|
|
|
|
+ TGeomDb tGeomDb = saveGeomRes.getData();
|
|
|
|
|
+ log.info("远程调用geom保存,返回结果:{}", tGeomDb);
|
|
|
|
|
+ //这里保存geom映射关系
|
|
|
|
|
+ nodeLandService.createNodeLand(nodeId, tGeomDb.getId());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ } catch (IOException e) {
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ throw new RuntimeException(e);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ public static String copyFileToDirectory(String sourceFilePath, String targetDirectoryPath, String FileName) {
|
|
|
String fullTargetFilePath = "";
|
|
String fullTargetFilePath = "";
|
|
|
try {
|
|
try {
|
|
|
File sourceDir = new File(sourceFilePath, FileName);
|
|
File sourceDir = new File(sourceFilePath, FileName);
|
|
@@ -297,30 +316,29 @@ public class DealExcelServiceImpl{
|
|
|
throw new RuntimeException(e);
|
|
throw new RuntimeException(e);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- return fullTargetFilePath;
|
|
|
|
|
|
|
+ return fullTargetFilePath;
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
public String getTdytCodeByName(String useName) {
|
|
public String getTdytCodeByName(String useName) {
|
|
|
- if(allLandTypeList.isEmpty()){
|
|
|
|
|
|
|
+ if (allLandTypeList.isEmpty()) {
|
|
|
List<LandType> all = landTypeMapper.selectAll();
|
|
List<LandType> all = landTypeMapper.selectAll();
|
|
|
allLandTypeList.addAll(all);
|
|
allLandTypeList.addAll(all);
|
|
|
}
|
|
}
|
|
|
String code = "";
|
|
String code = "";
|
|
|
// 转换为节点
|
|
// 转换为节点
|
|
|
- Optional<LandType> filterRes = allLandTypeList.stream().filter(s->s.getName().equalsIgnoreCase(useName)).findFirst();
|
|
|
|
|
- if(filterRes.isPresent()){
|
|
|
|
|
|
|
+ Optional<LandType> filterRes = allLandTypeList.stream().filter(s -> s.getName().equalsIgnoreCase(useName)).findFirst();
|
|
|
|
|
+ if (filterRes.isPresent()) {
|
|
|
code = filterRes.get().getCode();
|
|
code = filterRes.get().getCode();
|
|
|
}
|
|
}
|
|
|
return code;
|
|
return code;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
- * 关于提交相关信息
|
|
|
|
|
|
|
+ * 关于提交相关信息
|
|
|
|
|
+ *
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
public static String writeToLog(String fileName, String msg) {
|
|
public static String writeToLog(String fileName, String msg) {
|
|
@@ -348,35 +366,35 @@ public class DealExcelServiceImpl{
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* 这里与项目进行
|
|
* 这里与项目进行
|
|
|
|
|
+ *
|
|
|
* @param filePath
|
|
* @param filePath
|
|
|
* @param projectId
|
|
* @param projectId
|
|
|
* @param nodeId
|
|
* @param nodeId
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
- public String associationFile(String filePath , String projectId, String nodeId) {
|
|
|
|
|
|
|
+ public String associationFile(String filePath, String projectId, String nodeId) {
|
|
|
try {
|
|
try {
|
|
|
String tableName = "";
|
|
String tableName = "";
|
|
|
String gdType = "";
|
|
String gdType = "";
|
|
|
- ProjectWorkflow projectWorkflow = projectService.getProjectWorkflowByNodeId(projectId,nodeId);
|
|
|
|
|
- if(Objects.nonNull(projectWorkflow)){
|
|
|
|
|
- if(AloneWorkFlowEnum.NODE_2.getTableName().equals(projectWorkflow.getNodeTableName())){
|
|
|
|
|
|
|
+ ProjectWorkflow projectWorkflow = projectService.getProjectWorkflowByNodeId(projectId, nodeId);
|
|
|
|
|
+ if (Objects.nonNull(projectWorkflow)) {
|
|
|
|
|
+ if (AloneWorkFlowEnum.NODE_2.getTableName().equals(projectWorkflow.getNodeTableName())) {
|
|
|
TdgyRes tdgy = tdgyService.getById(nodeId);
|
|
TdgyRes tdgy = tdgyService.getById(nodeId);
|
|
|
gdType = tdgy.getGdType();
|
|
gdType = tdgy.getGdType();
|
|
|
- gdType= "出让".equals(gdType) ? "1" : "划拨".equals(gdType)? "2":"1";
|
|
|
|
|
|
|
+ gdType = "出让".equals(gdType) ? "1" : "划拨".equals(gdType) ? "2" : "1";
|
|
|
}
|
|
}
|
|
|
tableName = projectWorkflow.getNodeTableName();
|
|
tableName = projectWorkflow.getNodeTableName();
|
|
|
- }else {
|
|
|
|
|
|
|
+ } else {
|
|
|
YdbpData data = ydbpDataService.getById(nodeId);
|
|
YdbpData data = ydbpDataService.getById(nodeId);
|
|
|
- if(Objects.nonNull(data)){
|
|
|
|
|
|
|
+ if (Objects.nonNull(data)) {
|
|
|
tableName = AloneWorkFlowEnum.NODE_1.getTableName();
|
|
tableName = AloneWorkFlowEnum.NODE_1.getTableName();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- String nodeAttachmentId = nodeAttachmentService.processFileAndSave(filePath,tableName,gdType);
|
|
|
|
|
|
|
+ String nodeAttachmentId = nodeAttachmentService.processFileAndSave(filePath, tableName, gdType);
|
|
|
boolean success = nodeAttachmentService.updateNodeId(nodeAttachmentId, nodeId);
|
|
boolean success = nodeAttachmentService.updateNodeId(nodeAttachmentId, nodeId);
|
|
|
- nodeAttachmentService.modifyAttachmentInfo(projectId,nodeId,nodeAttachmentId);
|
|
|
|
|
|
|
+ nodeAttachmentService.modifyAttachmentInfo(projectId, nodeId, nodeAttachmentId);
|
|
|
return nodeAttachmentId;
|
|
return nodeAttachmentId;
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
log.error("处理文件异常", e);
|
|
log.error("处理文件异常", e);
|
|
@@ -385,24 +403,6 @@ public class DealExcelServiceImpl{
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
// public Map<String, String> getImmobileCode(String projectId) {
|
|
// public Map<String, String> getImmobileCode(String projectId) {
|
|
|
// Map<String, String> retMap = new LinkedHashMap<>();
|
|
// Map<String, String> retMap = new LinkedHashMap<>();
|
|
|
//
|
|
//
|
|
@@ -437,8 +437,4 @@ public class DealExcelServiceImpl{
|
|
|
//
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
}
|
|
}
|