|
@@ -19,23 +19,18 @@ package org.springblade.manager.controller;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
-import io.swagger.annotations.*;
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
|
+import io.swagger.annotations.*;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
-
|
|
|
-import javax.validation.Valid;
|
|
|
-
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
-import org.apache.commons.net.ftp.FTPClient;
|
|
|
import org.jsoup.Jsoup;
|
|
|
import org.jsoup.nodes.Document;
|
|
|
import org.jsoup.nodes.Element;
|
|
|
import org.jsoup.select.Elements;
|
|
|
-import org.springblade.common.constant.CommonConstant;
|
|
|
-import org.springblade.common.utils.CommonUtil;
|
|
|
import org.springblade.common.utils.SnowFlakeUtil;
|
|
|
-import org.springblade.common.utils.SystemUtils;
|
|
|
+import org.springblade.core.boot.ctrl.BladeController;
|
|
|
import org.springblade.core.log.exception.ServiceException;
|
|
|
import org.springblade.core.mp.support.Condition;
|
|
|
import org.springblade.core.mp.support.Query;
|
|
@@ -43,28 +38,30 @@ import org.springblade.core.redis.cache.BladeRedis;
|
|
|
import org.springblade.core.secure.utils.SecureUtil;
|
|
|
import org.springblade.core.tool.api.R;
|
|
|
import org.springblade.core.tool.utils.*;
|
|
|
-import org.springblade.manager.entity.*;
|
|
|
+import org.springblade.manager.entity.TextdictInfo;
|
|
|
+import org.springblade.manager.entity.WbsTreeContract;
|
|
|
+import org.springblade.manager.entity.WbsTreePrivate;
|
|
|
import org.springblade.manager.mapper.WbsTreePrivateMapper;
|
|
|
+import org.springblade.manager.service.ITextdictInfoService;
|
|
|
import org.springblade.manager.service.impl.WbsTreeContractServiceImpl;
|
|
|
-import org.springblade.manager.service.impl.WbsTreePrivateServiceImpl;
|
|
|
import org.springblade.manager.utils.ExcelInfoUtils;
|
|
|
import org.springblade.manager.utils.FileUtils;
|
|
|
import org.springblade.manager.vo.*;
|
|
|
-import org.springblade.manager.wrapper.ExcelTabWrapper;
|
|
|
-import org.springblade.manager.wrapper.TextdictWrapper;
|
|
|
-import org.springblade.system.cache.ParamCache;
|
|
|
+import org.springframework.dao.DataAccessException;
|
|
|
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
-import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
-import org.springframework.web.bind.annotation.RequestParam;
|
|
|
-import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
-import org.springblade.manager.service.ITextdictInfoService;
|
|
|
-import org.springblade.core.boot.ctrl.BladeController;
|
|
|
|
|
|
-import java.io.*;
|
|
|
-import java.util.*;
|
|
|
+import javax.validation.Valid;
|
|
|
+import java.io.File;
|
|
|
+import java.io.FileInputStream;
|
|
|
+import java.io.FileNotFoundException;
|
|
|
+import java.io.InputStream;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
@@ -374,10 +371,15 @@ public class TextdictInfoController extends BladeController {
|
|
|
String isExitSql = " select * from information_schema.TABLES where TABLE_NAME='" + tabName + "'";
|
|
|
List<Map<String, Object>> tablist = jdbcTemplate.queryForList(isExitSql);
|
|
|
if (tablist != null && tablist.size() > 0 && wbsTreePrivate.getType() != 10) {
|
|
|
- String clarSql = "update " + tabName + " set " + keyname.split("__")[0] + "=null where p_key_id in(SELECT p_key_id FROM m_wbs_tree_contract WHERE id ='" + wbsTreePrivate.getId() + "' and project_id='" + wbsTreePrivate.getProjectId() + "' )";
|
|
|
- jdbcTemplate.execute(clarSql);
|
|
|
+ String clarSql = "update " + tabName + " set " + keyname.split("__")[0] + "=null where p_key_id in(SELECT p_key_id FROM m_wbs_tree_contract WHERE is_type_private_pid ='" + wbsTreePrivate.getPKeyId() + "' and project_id='" + wbsTreePrivate.getProjectId() + "'UNION ALL SELECT 1 )";
|
|
|
+ try {
|
|
|
+ jdbcTemplate.execute(clarSql);
|
|
|
+ } catch (DataAccessException e) {
|
|
|
+ throw new RuntimeException("该实体信息无对应字段");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
File writeFile = ResourceUtil.getFile(wbsTreePrivate.getHtmlUrl());
|
|
|
if (!writeFile.exists()) {
|
|
|
if (StringUtils.isNotEmpty(fileUrl)) {
|
|
@@ -516,8 +518,8 @@ public class TextdictInfoController extends BladeController {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
File writeFile = new File(wbsTreePrivate.getHtmlUrl());
|
|
|
+// File writeFile = new File("D:\\file\\downfile\\1792757075013533696.html");
|
|
|
FileUtil.writeToFile(writeFile, doc.html(), Boolean.parseBoolean("UTF-8"));
|
|
|
|
|
|
String str1 = wbsTreePrivate.getHtmlUrl().replace("Desktop//privateUrl", "Desktop/privateUrl");
|
|
@@ -815,5 +817,4 @@ public class TextdictInfoController extends BladeController {
|
|
|
TextdictInfoVO detail = textdictInfoService.selectTextdictInfoById(textdictInfo);
|
|
|
return R.data(detail);
|
|
|
}
|
|
|
-
|
|
|
}
|