|
@@ -765,7 +765,11 @@ public class CgglServiceImpl implements CgglService {
|
|
return RequestResult.error("参数为传递", false);
|
|
return RequestResult.error("参数为传递", false);
|
|
}
|
|
}
|
|
List<EscalationRzDTO> res = escalationRzMapper.getStatus(id);
|
|
List<EscalationRzDTO> res = escalationRzMapper.getStatus(id);
|
|
- res.sort(Comparator.comparing(m -> sdf.format(m.getOperatetime())));
|
|
|
|
|
|
+ try {
|
|
|
|
+ res.sort(Comparator.comparing(m -> sdf.format(m.getOperatetime())));
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
Collections.reverse(res);
|
|
Collections.reverse(res);
|
|
return RequestResult.success("查询成功!", res);
|
|
return RequestResult.success("查询成功!", res);
|
|
}
|
|
}
|
|
@@ -1038,6 +1042,102 @@ public class CgglServiceImpl implements CgglService {
|
|
return RequestResult.success("操作成功!", 1);
|
|
return RequestResult.success("操作成功!", 1);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public RequestResult updateCgBaseInfo(HttpServletResponse response) {
|
|
|
|
+ //TODO wanger 总体规划类型中除过 报批项目、重大项目外 统一更新T_CGGL_ESCALATION_FILE表的REMARK字段
|
|
|
|
+ List<EscalationFileDTO> ztghFiles = escalationMapper.getEscalationFile();
|
|
|
|
+ Integer ztghcount = 0;
|
|
|
|
+ for (EscalationFileDTO file : ztghFiles) {
|
|
|
|
+ String filepath = file.getUnzippath();
|
|
|
|
+ File folder = new File(filepath);
|
|
|
|
+ if (folder.exists() && folder.isDirectory()) {
|
|
|
|
+ } else {
|
|
|
|
+ System.out.println("文件夹不存在或路径不是目录");
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ String txtFilePath = FileSearch(filepath, "基本信息.txt");
|
|
|
|
+ if (StringUtils.isEmpty(txtFilePath)) {
|
|
|
|
+ String firstFolder = FirstDirectoryName(filepath);
|
|
|
|
+ if (StringUtils.isEmpty(firstFolder)) {
|
|
|
|
+ System.out.println(filepath + "成果包中没有包含“xxx基本信息.txt”文件");
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ filepath = filepath + "\\" + firstFolder;
|
|
|
|
+ txtFilePath = FileSearch(filepath, "基本信息.txt");
|
|
|
|
+ if (StringUtils.isEmpty(txtFilePath)) {
|
|
|
|
+ System.out.println(filepath + "成果包中没有包含“xxx基本信息.txt”文件");
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ System.out.println("txtFilePath===" + txtFilePath);
|
|
|
|
+ Map<String, String> txtMap = null;
|
|
|
|
+ try {
|
|
|
|
+ txtMap = readTxt(txtFilePath, charset);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ System.out.println(filepath + "2---解析规划文本txt错误,请检查格式!");
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ System.out.println("txtMap===" + txtMap);
|
|
|
|
+ ObjectMapper objectMapper = new ObjectMapper();
|
|
|
|
+ String txtjson = "";
|
|
|
|
+ try {
|
|
|
|
+ txtjson = objectMapper.writeValueAsString(txtMap);
|
|
|
|
+ } catch (JsonProcessingException e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ file.setRemark(txtjson);
|
|
|
|
+ QueryWrapper<EscalationFileDTO> wrapper = new QueryWrapper();
|
|
|
|
+ wrapper.eq("id", file.getId());
|
|
|
|
+ escalationFileMapper.update(file, wrapper);
|
|
|
|
+ ztghcount++;
|
|
|
|
+ }
|
|
|
|
+ //TODO wanger 村庄规划 统一更新T_XZCZGHCGSB表的BZ字段
|
|
|
|
+ List<XzczghcgsbDTO> czghFiles = xzczghcgsbMapper.selectList(null);
|
|
|
|
+ Integer czghcount = 0;
|
|
|
|
+ for (XzczghcgsbDTO file : czghFiles) {
|
|
|
|
+ String filepath = file.getFilePath();
|
|
|
|
+ if (StringUtils.isEmpty(filepath)) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ File folder = new File(filepath);
|
|
|
|
+ if (folder.exists()) {
|
|
|
|
+ } else {
|
|
|
|
+ System.out.println("文件夹不存在或路径不是目录");
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ String parentFolder = folder.getParent();
|
|
|
|
+ String firstFolder = FirstDirectoryName(parentFolder);
|
|
|
|
+ filepath = parentFolder + "\\" + firstFolder;
|
|
|
|
+ String txtFilePath = FileSearch(filepath, "基本信息.txt");
|
|
|
|
+ if (StringUtils.isEmpty(txtFilePath)) {
|
|
|
|
+ System.out.println(filepath + "成果包中没有包含“xxx基本信息.txt”文件");
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ System.out.println("txtFilePath===" + txtFilePath);
|
|
|
|
+ Map<String, String> txtMap = null;
|
|
|
|
+ try {
|
|
|
|
+ txtMap = readTxt(txtFilePath, charset);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ System.out.println(filepath + "2---解析规划文本txt错误,请检查格式!");
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ System.out.println("txtMap===" + txtMap);
|
|
|
|
+ ObjectMapper objectMapper = new ObjectMapper();
|
|
|
|
+ String txtjson = "";
|
|
|
|
+ try {
|
|
|
|
+ txtjson = objectMapper.writeValueAsString(txtMap);
|
|
|
|
+ } catch (JsonProcessingException e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ file.setBz(txtjson);
|
|
|
|
+ QueryWrapper<XzczghcgsbDTO> wrapper = new QueryWrapper();
|
|
|
|
+ wrapper.eq("uuid", file.getUuid());
|
|
|
|
+ xzczghcgsbMapper.update(file, wrapper);
|
|
|
|
+ czghcount++;
|
|
|
|
+ }
|
|
|
|
+ return RequestResult.success(String.format("共更新总体规划类型数据:%s条记录!共更新村庄规划类型数据:%s条记录!", ztghcount, czghcount));
|
|
|
|
+ }
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public RequestResult xbfiledownload(String id, HttpServletResponse response) {
|
|
public RequestResult xbfiledownload(String id, HttpServletResponse response) {
|
|
if (StringUtils.isEmpty(id)) {
|
|
if (StringUtils.isEmpty(id)) {
|