|
@@ -75,6 +75,7 @@ import org.springframework.http.HttpHeaders;
|
|
|
import org.springframework.http.MediaType;
|
|
|
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.multipart.MultipartFile;
|
|
@@ -1926,13 +1927,7 @@ public class ExcelTabController extends BladeController {
|
|
|
/*全加载,或者可以优化成依赖加载*/
|
|
|
List<AppWbsTreeContractVO> tableAll = new ArrayList<>();
|
|
|
List<TableInfo> tableInfoList = this.excelTabService.getTableInfoList(dataArray);
|
|
|
-/* long start = System.currentTimeMillis();
|
|
|
- if (tableInfoList != null) {
|
|
|
- tableInfoList.forEach(e->{e.setToBeUpdated(true);});
|
|
|
- tableAll = wbsTreeContractService.searchNodeAllTable(nodeId, "1", contractId, projectId, null);
|
|
|
- doForTableIst(tableAll,tableInfoList);
|
|
|
- }
|
|
|
- System.out.println("加载所有表单数据耗时:"+(System.currentTimeMillis()-start));*/
|
|
|
+
|
|
|
executionTime.info("公式前");
|
|
|
//公式填充
|
|
|
this.excelTabService.formulaFillData(tableInfoList, Long.parseLong(nodeId), ExecuteType.INSPECTION);
|
|
@@ -4017,19 +4012,21 @@ public class ExcelTabController extends BladeController {
|
|
|
JSONArray array = new JSONArray();
|
|
|
if (tableAll != null && tableAll.size() >= 1) {
|
|
|
/*只需加载第一张即可,生效会自动补全*/
|
|
|
- AppWbsTreeContractVO tab =tableAll.get(0);
|
|
|
- Map<String, Object> jo = excelTabService.getBussDataInfo(tab.getPKeyId(), 0);
|
|
|
- String s = new Gson().toJson(jo);
|
|
|
- //字符串转jsonobject
|
|
|
- JSONObject obj = JSON.parseObject(s);
|
|
|
- obj.put("classify", classify);
|
|
|
- obj.put("nodeId", noId);
|
|
|
- obj.put("contractId", contractId);
|
|
|
- obj.put("pkeyId", tab.getPKeyId());
|
|
|
- obj.put("projectId", projectId);
|
|
|
- obj.put("isCollapseLoad", true);
|
|
|
- obj.put("isRenderForm", true);
|
|
|
- array.add(obj);
|
|
|
+ for(AppWbsTreeContractVO tab:tableAll) {
|
|
|
+ // AppWbsTreeContractVO tab = tableAll.get(0);
|
|
|
+ Map<String, Object> jo = excelTabService.getBussDataInfo(tab.getPKeyId(), 0);
|
|
|
+ String s = new Gson().toJson(jo);
|
|
|
+ //字符串转jsonobject
|
|
|
+ JSONObject obj = JSON.parseObject(s);
|
|
|
+ obj.put("classify", classify);
|
|
|
+ obj.put("nodeId", noId);
|
|
|
+ obj.put("contractId", contractId);
|
|
|
+ obj.put("pkeyId", tab.getPKeyId());
|
|
|
+ obj.put("projectId", projectId);
|
|
|
+ obj.put("isCollapseLoad", true);
|
|
|
+ obj.put("isRenderForm", true);
|
|
|
+ array.add(obj);
|
|
|
+ }
|
|
|
}
|
|
|
js2.put("orderList", array);
|
|
|
js.put("dataInfo", js2);
|
|
@@ -4108,6 +4105,79 @@ public class ExcelTabController extends BladeController {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ @Scheduled(cron = "0/20 * * * * ?")
|
|
|
+ public void HtmlCope() {
|
|
|
+ //执行代码
|
|
|
+ String sql = "SELECT * from m_wbs_tree_contract where p_key_id=1789131196718907437" ;
|
|
|
+ List<Map<String, Object>> maps = jdbcTemplate.queryForList(sql);
|
|
|
+ if (maps != null && maps.size() >= 1) {
|
|
|
+ for (Map<String, Object> dataInfo : maps) {
|
|
|
+ if (executor.getQueue().size() <= 40) {
|
|
|
+ String idkey = dataInfo.get("p_key_id") + "";
|
|
|
+ Boolean aBoolean = RedisTemplate.hasKey("sign-" + idkey);
|
|
|
+ if (!aBoolean) {
|
|
|
+ RedisTemplate.opsForValue().set("sign-" + idkey, "1", 30, TimeUnit.SECONDS);
|
|
|
+ CompletableFuture<Void> runAsync = CompletableFuture.runAsync(() -> {
|
|
|
+ try {
|
|
|
+ this.checkHtmlCope(dataInfo);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }, executor);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ System.out.println("队列数量" + executor.getQueue().size());
|
|
|
+ System.out.println("活跃数量" + executor.getActiveCount());
|
|
|
+ System.out.println("总共数量" + executor.getTaskCount());
|
|
|
+ System.out.println("完成数量" + executor.getCompletedTaskCount());
|
|
|
+ }
|
|
|
+
|
|
|
+ public void checkHtmlCope (Map < String, Object > dataInfo) throws Exception {
|
|
|
+ String pkey_id = dataInfo.get("p_key_id")+"";
|
|
|
+ String Html1 = dataInfo.get("html_url")+"";
|
|
|
+ String url183= "http://183.247.216.148:22776/";
|
|
|
+ String local183 = "/home/www/wwwroot/Users/hongchuangyanfa/Desktop/";
|
|
|
+ String s1 = Html1.replaceAll(local183, url183);
|
|
|
+ InputStream stream1 = getOSSInputStream2(s1);
|
|
|
+ if(stream1==null){
|
|
|
+
|
|
|
+ }else{
|
|
|
+ System.out.println("成功!");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ public static synchronized InputStream getOSSInputStream2(String urlStr) throws Exception {
|
|
|
+ //获取OSS文件流
|
|
|
+ URL url =new URL(urlStr);
|
|
|
+ final URLConnection conn = url.openConnection();
|
|
|
+ conn.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)");
|
|
|
+ try {
|
|
|
+ return conn.getInputStream();
|
|
|
+ } catch (Exception e){
|
|
|
+ System.out.println("zw-----------");
|
|
|
+ e.printStackTrace();
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void main(String[] args) {
|
|
|
+ String Html1 = "/home/www/wwwroot/Users/hongchuangyanfa/Desktop/privateUrl/1790283758071447552.html";
|
|
|
+ String local183 = "/home/www/wwwroot/Users/hongchuangyanfa/Desktop/";
|
|
|
+ String url183= "http://183.247.216.148:22776/";
|
|
|
+
|
|
|
+ String s = Html1.replaceAll(local183, url183);
|
|
|
+
|
|
|
+ System.out.println(s);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
// @Scheduled(cron = "0/20 * * * * ?")
|
|
|
public void SignInfo() {
|
|
|
//执行代码
|