diff --git a/ruoyi-admin/src/main/java/com/ruoyi/dfm/controller/ProjectController.java b/ruoyi-admin/src/main/java/com/ruoyi/dfm/controller/ProjectController.java
index 31aadfd8c..fedfcae29 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/dfm/controller/ProjectController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/dfm/controller/ProjectController.java
@@ -14,6 +14,7 @@ import com.ruoyi.dfm.service.UserService;
import com.ruoyi.dfm.util.TimeUtil;
import com.ruoyi.framework.util.ShiroUtils;
import org.apache.commons.lang.StringUtils;
+import org.aspectj.weaver.loadtime.Aj;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -853,42 +854,48 @@ public class ProjectController extends com.ruoyi.common.core.controller.BaseCont
throws Exception
{
List servers = this.projectService.getAllServers();
- String server = req.getParameter("server");
- if ((server == null) && (servers != null))
- {
- server = (String)servers.get(0);
- }
- if ((server != null) || ("".equals(server)))
- {
- server = new String(server.getBytes("iso-8859-1"), "utf-8");
- Project project = this.projectService.getProjectByServerState(server, "在查");
- if (project != null)
- {
- int pid = project.getId();
- List stages = this.projectService.getStagesByProject(pid);
- req.setAttribute("project", project);
- req.setAttribute("stages", stages);
- }
- }
req.setAttribute("servers", servers);
- req.setAttribute("server", server);
- return new ModelAndView("serverMonitor");
+ return new ModelAndView("dfm/serverMonitor");
}
+
+ @RequestMapping("/serverMonitor/list")
+ @ResponseBody
+ public AjaxResult serverMonitorList(HttpServletRequest req, HttpServletResponse res)
+ throws Exception
+ {
+ String server = req.getParameter("server");
+ if (StringUtils.isBlank(server)) {
+ return AjaxResult.success();
+ }
+ server = new String(server.getBytes("iso-8859-1"), "utf-8");
+ Project project = this.projectService.getProjectByServerState(server, "在查");
+ if (project != null) {
+ int pid = project.getId();
+ List stages = this.projectService.getStagesByProject(pid);
+ JSONObject jsonObject = new JSONObject();
+ jsonObject.put("project", project);
+ jsonObject.put("stages", stages);
+ return AjaxResult.success(jsonObject);
+ }
+ return AjaxResult.error();
+ }
+
+
@RequestMapping("/stopProject")
- public void stopProject(HttpServletRequest req, HttpServletResponse res)
+ @ResponseBody
+ public AjaxResult stopProject(HttpServletRequest req, HttpServletResponse res)
throws Exception
{
try
{
String pid = req.getParameter("pid");
this.projectService.stopProject(pid);
- String server = new String(req.getParameter("server").getBytes("iso-8859-1"), "utf-8");
- outputMsg(res, "");
+ return AjaxResult.success();
}
catch (Exception e) {
logger.error("中止项目失败!", e);
- outputMsg(res, "");
+ return AjaxResult.error();
}
}
diff --git a/ruoyi-admin/src/main/resources/templates/dfm/queueManage.html b/ruoyi-admin/src/main/resources/templates/dfm/queueManage.html
index 88d224a95..2902c414c 100644
--- a/ruoyi-admin/src/main/resources/templates/dfm/queueManage.html
+++ b/ruoyi-admin/src/main/resources/templates/dfm/queueManage.html
@@ -46,9 +46,6 @@
@@ -196,19 +190,12 @@
} else {
pauseOperType = "暂停";
}
- // actions.push('
编辑 ');
actions.push('
删除 ');
if("继续" == pauseOperType) {
actions.push('
' + pauseOperType + ' ');
} else if("暂停" == pauseOperType) {
actions.push('
' + pauseOperType + ' ');
}
-
-
- // var more = [];
- // more.push("
数据权限 ");
- // more.push("
分配用户");
- // actions.push('
更多操作');
return actions.join('');
}
}
@@ -220,7 +207,6 @@
//下载文件
function getFile(fid)
{
- // document.location.href='file.do/download?fid=' + fid;
var url = ctx + 'file.do/download?fid=' + fid;
window.location.href = url;
}
@@ -228,7 +214,6 @@
//下载参数文件
function getParamFile(fid,fname)
{
- // document.location.href='project.do/downloadParamFile&fid=' + fid + '&fname=' + encodeURI(fname);
var url = ctx + 'project.do/downloadParamFile?fid=' + fid + '&fname=' + encodeURI(fname);
window.location.href = url;
}
@@ -237,12 +222,7 @@
//上调优先级
function changePri( pid,change )
{
-
$.operate.changeProjectPri(pid, change);
- // document.location.href='project.do/changePri?pid='
- // + pid +
- // '&change='+change +
- // '¤tPage=<%=myPage.getCurrentPage()%>';
}
diff --git a/ruoyi-admin/src/main/resources/templates/dfm/serverMonitor.html b/ruoyi-admin/src/main/resources/templates/dfm/serverMonitor.html
new file mode 100644
index 000000000..143424acf
--- /dev/null
+++ b/ruoyi-admin/src/main/resources/templates/dfm/serverMonitor.html
@@ -0,0 +1,160 @@
+
+
+
+
+
+
+
+
+
+
+
+ -
+ 服务器:
+
+
+ -
+ 状态:-
+
+
+
+
+
+
+
+ 当前任务:-
+ 版本:-
+ 提交人:-
+ 提交时间:-
+ 任务类型:-
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ruoyi-system/src/main/java/com/ruoyi/dfm/dao/ProjectDAO.java b/ruoyi-system/src/main/java/com/ruoyi/dfm/dao/ProjectDAO.java
index 79d817e73..8fd26eadf 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/dfm/dao/ProjectDAO.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/dfm/dao/ProjectDAO.java
@@ -13,7 +13,9 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
+import java.text.ParseException;
import java.util.ArrayList;
+import java.util.Date;
import java.util.List;
import java.util.Map;
@@ -597,9 +599,29 @@ public class ProjectDAO extends JdbcBaseDao
ProjectStage stage = new ProjectStage();
stage.setStageName((map.get("F_STAGE_NAME") == null) ? "" : map.get("F_STAGE_NAME").toString());
stage.setId((map.get("F_ID") == null) ? 0 : Integer.parseInt(map.get("F_ID").toString()));
- stage.setEndTime((map.get("F_END_TIME") == null) ? "" : map.get("F_END_TIME").toString());
stage.setId((map.get("F_PROJECT_ID") == null) ? 0 : Integer.parseInt(map.get("F_PROJECT_ID").toString()));
- stage.setStatrTime((map.get("F_START_TIME") == null) ? "" : map.get("F_START_TIME").toString());
+
+ String startTime = (map.get("F_START_TIME") == null) ? "" : map.get("F_START_TIME").toString();
+ if(!"".equalsIgnoreCase(startTime) ){
+ stage.setStatrTime(TimeUtil.getDateStrByFormat(startTime,"yyyy-MM-dd HH:mm:ss"));
+ }
+ String endTime = (map.get("F_END_TIME") == null) ? "" : map.get("F_END_TIME").toString();
+ if(!"".equalsIgnoreCase(endTime) ){
+ stage.setEndTime(TimeUtil.getDateStrByFormat(endTime,"yyyy-MM-dd HH:mm:ss"));
+ }
+
+ try {
+ Date start = TimeUtil.toUtilDateFromStrDateByFormat(startTime,"yyyyMMddHHmmss");
+ Date end = TimeUtil.toUtilDateFromStrDateByFormat(endTime,"yyyyMMddHHmmss");
+ Long start1 = TimeUtil.getMillisOfDate(start);
+ Long end1 = TimeUtil.getMillisOfDate(end);
+ Long m = (end1 - start1)/60000;
+ Long s = (end1 - start1)%60000/1000;
+ stage.setCostTime(m+"分钟"+s+"秒");
+ } catch (ParseException e) {
+ logger.error("计算耗时失败", e);
+ }
+
stage.setStageOrder((map.get("F_STAGE_ORDER") == null) ? 0 : Integer.parseInt(map.get("F_STAGE_ORDER").toString()));
rs.add(stage);
}
@@ -608,8 +630,7 @@ public class ProjectDAO extends JdbcBaseDao
}
public void stop(String pid) {
- String sql = "update t_project set F_CANCEL= 1 where f_id = " +
- pid;
+ String sql = "update t_project set F_CANCEL= 1 where f_id = " + pid;
getJdbcTemplate().update(sql);
}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/dfm/pojo/ProjectStage.java b/ruoyi-system/src/main/java/com/ruoyi/dfm/pojo/ProjectStage.java
index 8c4ccfb8c..8d125c33d 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/dfm/pojo/ProjectStage.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/dfm/pojo/ProjectStage.java
@@ -9,6 +9,7 @@ public class ProjectStage implements Serializable {
private int stageOrder;
private String statrTime;
private String endTime;
+ private String costTime;
private int projectId;
public int getId() {
return id;
@@ -47,7 +48,12 @@ public class ProjectStage implements Serializable {
public void setProjectId(int projectId) {
this.projectId = projectId;
}
-
-
-
+
+ public String getCostTime() {
+ return costTime;
+ }
+
+ public void setCostTime(String costTime) {
+ this.costTime = costTime;
+ }
}