正在显示
3 个修改的文件
包含
92 行增加
和
2 行删除
@@ -135,4 +135,9 @@ custom: | @@ -135,4 +135,9 @@ custom: | ||
135 | receptDirectory: /Users/mrz/Downloads/rdp_temp | 135 | receptDirectory: /Users/mrz/Downloads/rdp_temp |
136 | #回执解析成功后的备份目录 | 136 | #回执解析成功后的备份目录 |
137 | receptBakDir: ./success | 137 | receptBakDir: ./success |
138 | - errBakDir: ./error | ||
138 | + errBakDir: ./error | ||
139 | +devops: | ||
140 | + dir: | ||
141 | + singlewindow-tcs-recept: D:\TCSSingleWindow\recive | ||
142 | + tianbo-tcs-recept: D:\Data\Receive | ||
143 | + cfps-subscribe-dir: D:\系统部署\imf_Warehouse_reader\xmlFromImf |
@@ -27,4 +27,19 @@ | @@ -27,4 +27,19 @@ | ||
27 | * 要集成util项目为model才能跑起来 [git地址](git@118.31.66.166:wlxxpt/utitls.git) | 27 | * 要集成util项目为model才能跑起来 [git地址](git@118.31.66.166:wlxxpt/utitls.git) |
28 | * 集成thymeleaf,webmvc 视图配置参考资料[地址](https://blog.csdn.net/zheng_chang_wei/article/details/76155440) | 28 | * 集成thymeleaf,webmvc 视图配置参考资料[地址](https://blog.csdn.net/zheng_chang_wei/article/details/76155440) |
29 | 及[打jar包后找不到路径](https://blog.csdn.net/qq_37372909/article/details/84824805) | 29 | 及[打jar包后找不到路径](https://blog.csdn.net/qq_37372909/article/details/84824805) |
30 | -* 支持在线CMD功能,运维级,访问路径/cmd | ||
30 | +* 支持在线CMD功能,运维级,访问路径/cmd | ||
31 | + * 查询进程pid: | ||
32 | + * wmic process get caption,commandline,processid /value |findstr java | ||
33 | + * wmic process get name,executablepath,processid /value |findstr java | ||
34 | + * 停止启动服务: wmic Service where caption="新舱单数据订阅服务" call stopservice / wmic Service where caption="新舱单数据订阅服务" call startservice | ||
35 | + * 系统服务截图在新舱单维护手册中,有道云笔记中也有。 | ||
36 | + | ||
37 | + | ||
38 | + 舱单回执目录: D:\Data\Receive | ||
39 | + 单一窗口回执目录: D:\TCSSingleWindow\recive | ||
40 | + 单一窗口报文转换工具目录:D:\TCSSingleWindow\报文转换工具,"java -Dfile.encoding=utf-8 -jar convert.jar" | ||
41 | + 货运数据订阅目录:D:\系统部署\imf_Warehouse_reader\xmlFromImf | ||
42 | + | ||
43 | +* 配合微信前端定时监控3个回执目录的文件数量,超过警戒值 微信发出提醒 | ||
44 | + * path = /devops/watchdir?dir=tcs | ||
45 | + 参数dir,可以是指定目录值,也可以是stcs、tcs、cfps 分别代表单一窗口回执目录、商务节点回执目录、CFPS数据订阅目录 |
1 | +package com.tianbo.analysis.controller; | ||
2 | + | ||
3 | +import com.tianbo.analysis.handle.CustomXmlHandle; | ||
4 | +import com.tianbo.util.Date.DateUtil; | ||
5 | +import com.tianbo.util.IO.FileTool; | ||
6 | +import lombok.extern.slf4j.Slf4j; | ||
7 | +import org.apache.commons.io.FileUtils; | ||
8 | +import org.springframework.beans.factory.annotation.Value; | ||
9 | +import org.springframework.stereotype.Controller; | ||
10 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
11 | +import org.springframework.web.bind.annotation.RequestParam; | ||
12 | +import org.springframework.web.bind.annotation.RestController; | ||
13 | + | ||
14 | +import java.io.File; | ||
15 | +import java.util.Iterator; | ||
16 | +import java.util.List; | ||
17 | + | ||
18 | +@RestController | ||
19 | +@Slf4j | ||
20 | +@RequestMapping("/devops") | ||
21 | +public class DevOpsController { | ||
22 | + | ||
23 | + //单一窗口回执读取目录 | ||
24 | + @Value("${devops.dir.singlewindow-tcs-recept}") | ||
25 | + private String singlewindow_tcs_recept_dir; | ||
26 | + | ||
27 | + //天博TCS回执读取目录 | ||
28 | + @Value("${devops.dir.tianbo-tcs-recept}") | ||
29 | + private String tianbo_tcs_recept_dir; | ||
30 | + | ||
31 | + //CFPS订阅货运报文目录 | ||
32 | + @Value("${devops.dir.cfps-subscribe-dir}") | ||
33 | + private String cfps_recept_dir; | ||
34 | + | ||
35 | + @RequestMapping("/watchdir") | ||
36 | + public Integer singlewindow(@RequestParam(value = "dir",required = true,defaultValue = "D:\\系统部署\\imf_Warehouse_reader\\xmlFromImf") String dir){ | ||
37 | + switch (dir){ | ||
38 | + case "stcs" : | ||
39 | + dir = singlewindow_tcs_recept_dir; | ||
40 | + break; | ||
41 | + case "tcs" : | ||
42 | + dir = tianbo_tcs_recept_dir; | ||
43 | + break; | ||
44 | + case "cfps" : | ||
45 | + dir = cfps_recept_dir; | ||
46 | + break; | ||
47 | + default: | ||
48 | + dir = cfps_recept_dir; | ||
49 | + break; | ||
50 | + } | ||
51 | + try{ | ||
52 | + File fileDirectory = new File(dir); | ||
53 | + List<File> files = FileTool.readDirectoryFiles(fileDirectory); | ||
54 | + if(files!=null && !files.isEmpty()){ | ||
55 | + return files.size(); | ||
56 | + }else { | ||
57 | + return 0; | ||
58 | + } | ||
59 | + | ||
60 | + | ||
61 | + }catch (Exception e){ | ||
62 | + e.printStackTrace(); | ||
63 | + log.error("获取目录文件出错",e); | ||
64 | + } | ||
65 | + return 500; | ||
66 | + } | ||
67 | + | ||
68 | + | ||
69 | + | ||
70 | +} |
-
请 注册 或 登录 后发表评论