Authored by zhengyouwei

worksystem

package com.ui.model.req;
import lombok.Data;
/**
* Created by zhengyouwei on 2016/9/2.
* <p>
* 已处理工单表
*/
@Data
public class HandledJob {
public HandledJob() {
}
public HandledJob(String type,String workId, String title, String handler, String handlerRole, int handleType) {
this.type = type;
this.workId = workId;
this.title = title;
this.handler = handler;
this.handlerRole = handlerRole;
this.handleType = handleType;
}
private int id;
/**
* 工单ID
*/
private String workId;
/**
* 工单主题
*/
private String title;
/**
* 工单类型
*/
private String type;
/**
* 处理人
*/
private String handler;
/**
* 处理人的职责 develop test operator
*/
private String handlerRole;
/**
* 处理类型 1 发起 2 通过 3 驳回 -1 close
*/
private int handleType;
/**
*
*/
private String createTime;
private String handlecType;
}
... ...
package com.ui.model.req;
import lombok.Data;
/**
* Created by zhengyouwei on 2016/9/2.
* <p>
* 待处理工单列表
*/
@Data
public class PendingJob {
public PendingJob() {
}
public PendingJob(String type,String workId, String title, String handler, String handlerRole, int currentStatus) {
this.type = type;
this.workId = workId;
this.title = title;
this.handler = handler;
this.handlerRole = handlerRole;
this.currentStatus = currentStatus;
}
private int id;
/**
* 工单ID
*/
private String workId;
/**
* 主题
*/
private String title;
/**
* 类型 release or
*/
private String type;
/**
* 待处理人
*/
private String handler;
/**
* 当前状态
*/
private int currentStatus;
/**
* 处理人的职责 develop test operator
*/
private String handlerRole;
private String createTime;
}
... ...
package com.ui.model.req;
import lombok.Data;
import java.util.List;
/**
* Created by zhengyouwei on 2016/9/2.
*
* 发布工单
*/
@Data
public class ReleaseWorkJob {
/**
* id
*/
private String id;
/**
* 主题
*/
private String title;
/**
* 需求说明
*/
private String demand;
/**
* 发布环境 aws,qcloud,qcloudGray
*/
private String environment;
/**
* 平台 java php node
*/
private String platform;
/**
* 具体项目
*/
private String project;
/**
* 开发
*/
private String develop;
/**
* 测试
*/
private String test;
/**
* 运维
*/
private String operator;
/**
* WorkStatus 详见
*
*/
private int status;
/**
* 工单操作记录
*/
private List<HandledJob> handleList;
private String createTime;
private String updateTime;
}
... ...
... ... @@ -25,4 +25,14 @@ public class User {
private String email;
private String mobile;
/**
* 职责 develop test operator leader other
*/
private String role;
/**
* 中文名
*/
private String cName;
}
... ...
package com.ui.model.req;
import lombok.Data;
/**
* Created by zhengyouwei on 2016/9/2.
*/
@Data
public class WorkSystemReq extends PageRequest {
private String handler;
private String id;
}
... ...
package com.ui.project;
import java.util.ArrayList;
import java.util.List;
/**
* Created by zhengyouwei on 2016/9/5.
*/
public class Platform {
public static List<String> list = new ArrayList<>();
public static final String JAVA = "JAVA";
public static final String PHP = "PHP";
public static final String NODE = "NODE";
static {
list.add("JAVA");
list.add("PHP");
list.add("NODE");
}
public static List<String> getPlatforms(){
return list;
}
}
... ...
... ... @@ -13,8 +13,6 @@ public class ProjectEnvironment {
map.put("aws", "http://172.31.16.167:8883/web/");
map.put("qcloud","http://172.31.16.167:8883/web/");
map.put("qcloud_gray","http://172.31.16.167:8883/web/");
//map.put("test","http://192.168.102.220:8083/web/");
//map.put("dev");
}
... ...
... ... @@ -7,52 +7,80 @@ import java.util.Map;
public class ProjectOnline {
private static List<Project> list = new ArrayList<Project>();
private static List<Project> JAVA_LIST = new ArrayList<Project>();
private static List<Project> PHP_LIST = new ArrayList<Project>();
private static List<Project> NODE_LIST = new ArrayList<Project>();
private static Map<String,Project> map = new HashMap<String,Project>();
static{
list.add(new Project("1","yoho-sns","125","yoho30"));
list.add(new Project("1","yoho-message","123","yoho30"));
list.add(new Project("1","uic","439","yoho30"));
list.add(new Project("1","yoho-users","134","yoho30"));
list.add(new Project("1","yohobuy-resources","122","yoho30"));
list.add(new Project("1","yohobuy-promotion","140","yoho30"));
list.add(new Project("1","yohobuy-product","143","yoho30"));
list.add(new Project("1","yohobuy-order","124","yoho30"));
list.add(new Project("1","yoho-push","137","yoho30"));
list.add(new Project("1","cms_push","514","yoho30"));
list.add(new Project("1","mars_push","494","yoho30"));
list.add(new Project("1","yohobuy-shops","490","yoho30"));
list.add(new Project("1","yoho-social","353","yoho30"));
list.add(new Project("1","yohobuy-union","133","yoho30"));
list.add(new Project("1","yohobuy-activity","129","yoho30"));
list.add(new Project("1","yohobuy-task","138","yoho30"));
list.add(new Project("1","yohobuy-wechat","248","yoho30"));
list.add(new Project("1","yohobuy-brower","131","yoho30"));
list.add(new Project("1","yohobuy-bigdata","144","yoho30"));
list.add(new Project("1","yoho-gateway","126","yoho30"));
list.add(new Project("2","yoho-search-service","12","yoho-search"));
list.add(new Project("2","yoho-search-consumer","8","yoho-search"));
list.add(new Project("2","yoho-search-producer","7","yoho-search"));
list.add(new Project("2","yoho-search-adaptor","13","yoho-search"));
list.add(new Project("3","yohobuy-platform","110","platform"));
for(Project project :list){
map.put(project.getName(),project);
}
JAVA_LIST.add(new Project("1","yoho-sns","125","yoho30"));
JAVA_LIST.add(new Project("1","yoho-message","123","yoho30"));
JAVA_LIST.add(new Project("1","uic","439","yoho30"));
JAVA_LIST.add(new Project("1","yoho-users","134","yoho30"));
JAVA_LIST.add(new Project("1","yohobuy-resources","122","yoho30"));
JAVA_LIST.add(new Project("1","yohobuy-promotion","140","yoho30"));
JAVA_LIST.add(new Project("1","yohobuy-product","143","yoho30"));
JAVA_LIST.add(new Project("1","yohobuy-order","124","yoho30"));
JAVA_LIST.add(new Project("1","yoho-push","137","yoho30"));
JAVA_LIST.add(new Project("1","cms_push","514","yoho30"));
JAVA_LIST.add(new Project("1","mars_push","494","yoho30"));
JAVA_LIST.add(new Project("1","yohobuy-shops","490","yoho30"));
JAVA_LIST.add(new Project("1","yoho-social","353","yoho30"));
JAVA_LIST.add(new Project("1","yohobuy-union","133","yoho30"));
JAVA_LIST.add(new Project("1","yohobuy-activity","129","yoho30"));
JAVA_LIST.add(new Project("1","yohobuy-task","138","yoho30"));
JAVA_LIST.add(new Project("1","yohobuy-wechat","248","yoho30"));
JAVA_LIST.add(new Project("1","yohobuy-brower","131","yoho30"));
JAVA_LIST.add(new Project("1","yohobuy-bigdata","144","yoho30"));
JAVA_LIST.add(new Project("1","yoho-gateway","126","yoho30"));
JAVA_LIST.add(new Project("2","yoho-search-service","12","yoho-search"));
JAVA_LIST.add(new Project("2","yoho-search-consumer","8","yoho-search"));
JAVA_LIST.add(new Project("2","yoho-search-producer","7","yoho-search"));
JAVA_LIST.add(new Project("2","yohomars-search-service","554","yoho-search"));
JAVA_LIST.add(new Project("2","yoho-search-adaptor","13","yoho-search"));
JAVA_LIST.add(new Project("3","yohobuy-platform","110","platform"));
PHP_LIST.add(new Project("","YOHOBUYWAP","",""));
PHP_LIST.add(new Project("","YOHOBUYPC","",""));
PHP_LIST.add(new Project("","yohoboys","",""));
PHP_LIST.add(new Project("","yohogirls","",""));
PHP_LIST.add(new Project("","yohorecruitment","",""));
PHP_LIST.add(new Project("","yohood","",""));
PHP_LIST.add(new Project("","yoho-phppush","",""));
PHP_LIST.add(new Project("","yoho-global-bs","",""));
PHP_LIST.add(new Project("","yohoshow","",""));
PHP_LIST.add(new Project("","yohoezine","",""));
PHP_LIST.add(new Project("","sso","",""));
PHP_LIST.add(new Project("","yohomars","",""));
PHP_LIST.add(new Project("","yohocn","",""));
PHP_LIST.add(new Project("","yohocnstatic","",""));
PHP_LIST.add(new Project("","yoho-chat","",""));
PHP_LIST.add(new Project("","yoholive","",""));
PHP_LIST.add(new Project("","yohoim","",""));
NODE_LIST.add(new Project("","yoho-blk","",""));
NODE_LIST.add(new Project("","yohoblk-wap","",""));
NODE_LIST.add(new Project("","yohobuy","",""));
NODE_LIST.add(new Project("","yohobuywap","",""));
NODE_LIST.add(new Project("","yohobuy-portal-fe2","",""));
NODE_LIST.add(new Project("","yohobuy-shop","",""));
}
public static List<Project> getProjectList() {
return list;
public static List<Project> getJavaList() {
return JAVA_LIST;
}
public static Project getProject(String name){
return map.get(name);
public static List<Project> getPhpList() {
return PHP_LIST;
}
public static List<Project> getNodeList() {
return NODE_LIST;
}
}
... ...
... ... @@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpSession;
import java.util.HashMap;
import java.util.Map;
... ... @@ -45,7 +46,7 @@ public class ManagerCtrl {
@RequestMapping("/saveUser")
@ResponseBody
public BaseResponse saveUser(@RequestBody User user) {
public BaseResponse saveUser(@RequestBody User user,HttpSession session) {
BaseResponse baseResponse = null;
if (user.getId() < 1) {//add
if (userAuthLocal.getUserByname(user.getName()) != null) {
... ... @@ -54,7 +55,9 @@ public class ManagerCtrl {
user.setPwd(MD5Util.encryption("Yoho@9646"));
baseResponse = httpRestClient.defaultPost(HttpUriContants.USER_INSERT, user, BaseResponse.class);
} else {
if ("admin".equals(user.getName())) {
User u = (User) session.getAttribute("user");
String username = u.getName();
if ("admin".equals(user.getName()) && !"admin".equals(username)) {
return new BaseResponse(201, "此用户无法修改");
}
baseResponse = httpRestClient.defaultPost(HttpUriContants.USER_UPDATE, user, BaseResponse.class);
... ...
... ... @@ -51,7 +51,7 @@ public class ProjectBuildCtrl {
@RequestMapping("/toHistory")
public ModelAndView toHistory(Model model) {
model.addAttribute("environments", ProjectEnvironment.getEnviroments());
model.addAttribute("projects", ProjectOnline.getProjectList());
model.addAttribute("projects", ProjectOnline.getJavaList());
return new ModelAndView("project/history");
}
... ... @@ -64,7 +64,7 @@ public class ProjectBuildCtrl {
@ResponseBody
public String getProjects() {
try {
return JSONArray.toJSON(ProjectOnline.getProjectList()).toString();
return JSONArray.toJSON(ProjectOnline.getJavaList()).toString();
} catch (Exception ex) {
return "failed";
}
... ...
... ... @@ -47,7 +47,7 @@ public class UserCtrl {
return new ModelAndView("user/login");
}
if (u.getPwd().equals(MD5Util.encryption(user.getPwd()))) {
session.setAttribute("user", user.getName());
session.setAttribute("user", u);
if("Yoho@9646".equals(user.getPwd())){
return new ModelAndView("user/modifypwd");
}
... ... @@ -60,15 +60,15 @@ public class UserCtrl {
}
@RequestMapping("/logout")
public ModelAndView toLogin(HttpSession session, Model model) {
public ModelAndView toLogin(HttpSession session) {
session.removeAttribute("user");
return new ModelAndView("user/login");
}
@RequestMapping("/updatePwd")
public ModelAndView updatePwd(String name, String oldpwd, String newpwd, HttpSession session, Model model) {
Object obj = session.getAttribute("user");
String username = String.valueOf(obj);
User u = (User) session.getAttribute("user");
String username = u.getName();
if ("admin".equals(username) && !"admin".equals(name)) {
User user = userAuthLocal.getUserByname(name);
if (user == null) {
... ...
package com.ui.ctrl;
import com.ui.contants.HttpUriContants;
import com.ui.http.HttpRestClient;
import com.ui.model.BaseResponse;
import com.ui.model.domain.OutRecod;
import com.ui.model.req.*;
import com.ui.project.Platform;
import com.ui.project.Project;
import com.ui.project.ProjectEnvironment;
import com.ui.project.ProjectOnline;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpSession;
import java.util.ArrayList;
import java.util.List;
/**
* Created by zhengyouwei on 2016/9/5.
*/
@Controller
@RequestMapping("workSystem")
public class WorkSystemCtrl {
Logger log = LoggerFactory.getLogger(UserCtrl.class);
@Autowired
HttpRestClient httpRestClient;
@RequestMapping("/toAddWork")
public ModelAndView toAddWork(Model model) {
model.addAttribute("platforms", Platform.getPlatforms());
model.addAttribute("environments", ProjectEnvironment.getEnviroments());
BaseResponse<List<User>> response = httpRestClient.exchangeForget(HttpUriContants.GET_USER_BY_ROLE + "?role=test", new ParameterizedTypeReference<BaseResponse<List<User>>>() {
}, null);
model.addAttribute("tests", response.getData());
return new ModelAndView("worksystem/addWorkOrder");
}
@RequestMapping("/toHandledWork")
public ModelAndView toHandledWork() {
return new ModelAndView("worksystem/handledwork");
}
@RequestMapping("/toPendingwork")
public ModelAndView toPendingwork() {
return new ModelAndView("worksystem/pendingwork");
}
@RequestMapping("/toWorkList")
public ModelAndView toWorkList() {
return new ModelAndView("worksystem/workList");
}
@RequestMapping("/toWorkJob")
public ModelAndView toWorkJob(String workid, String type, Model model, HttpSession session) {
//查询是否为该工单的下一个处理人
User u = (User) session.getAttribute("user");
BaseResponse<PendingJob> isHandler = httpRestClient.defaultGet(HttpUriContants.GET_PENDING_JOB_BYUSER + "?workid=" + workid + "&user=" + u.getName(), BaseResponse.class);
int count = 0;
if (isHandler.getData() != null) {
count = 1;
model.addAttribute("pendingJob",isHandler.getData());
}
model.addAttribute("count", count);
if ("release".equals(type)) {
BaseResponse response = httpRestClient.defaultGet(HttpUriContants.GET_RELEASEWORKJOB_ID + "?id=" + workid, BaseResponse.class);
model.addAttribute("workJob", response.getData());
return new ModelAndView("worksystem/releaseWork");
}
return new ModelAndView("worksystem/releaseWork");
}
@RequestMapping("/getProjectsByPlatform")
@ResponseBody
public List<Project> getProjectsByPlatform(String platform) {
if (Platform.JAVA.equals(platform)) {
return ProjectOnline.getJavaList();
} else if (Platform.PHP.equals(platform)) {
return ProjectOnline.getPhpList();
} else {
return ProjectOnline.getNodeList();
}
}
@RequestMapping("/checkRole")
@ResponseBody
public int checkRole(String type, HttpSession session) {
User user = (User) session.getAttribute("user");
if ("release".equals(type)) {//项目发布
BaseResponse<Integer> baseResponse = httpRestClient.defaultGet(HttpUriContants.CHECK_RELEASE_ROLE + "?role=" + user.getRole(), BaseResponse.class);
return baseResponse.getData();
}
return 0;
}
@RequestMapping("/createReleaseWorkJob")
@ResponseBody
public int createReleaseWorkJob(@RequestBody ReleaseWorkJob releaseWorkJob, HttpSession session) {
User user = (User) session.getAttribute("user");
releaseWorkJob.setDevelop(user.getName());
BaseResponse<Integer> baseResponse = httpRestClient.defaultPost(HttpUriContants.CREATE_RELEASEWORKJOB, releaseWorkJob, BaseResponse.class);
return baseResponse.getData();
}
@RequestMapping("/getHandledJobs")
@ResponseBody
public BaseResponse getHandledJobs(HttpSession session, PageRequest req) {
User user = (User) session.getAttribute("user");
WorkSystemReq workSystemReq = new WorkSystemReq();
workSystemReq.setHandler(user.getName());
workSystemReq.setCurrentPage(req.getCurrentPage());
workSystemReq.setPageSize(req.getPageSize());
BaseResponse response = httpRestClient.defaultPost(HttpUriContants.GET_HANDLED_JOBS, workSystemReq, BaseResponse.class);
return response;
}
@RequestMapping("/getPendingJobs")
@ResponseBody
public BaseResponse getPendingJobs(HttpSession session, PageRequest req) {
User user = (User) session.getAttribute("user");
WorkSystemReq workSystemReq = new WorkSystemReq();
workSystemReq.setHandler(user.getName());
workSystemReq.setCurrentPage(req.getCurrentPage());
workSystemReq.setPageSize(req.getPageSize());
BaseResponse response = httpRestClient.defaultPost(HttpUriContants.GET_PENDING_JOBS, workSystemReq, BaseResponse.class);
return response;
}
@RequestMapping("/handleJobsJobs")
@ResponseBody
public int handleJobsJobs(HttpSession session, @RequestBody HandledJob handledJob) {
User user = (User) session.getAttribute("user");
handledJob.setHandler(user.getName());
handledJob.setHandlerRole(user.getRole());
BaseResponse<Integer> response = httpRestClient.defaultPost(HttpUriContants.HANDLE_JOB, handledJob, BaseResponse.class);
return response.getData();
}
@RequestMapping("/getJobs")
@ResponseBody
public BaseResponse getJobs(WorkSystemReq req) {
BaseResponse response = httpRestClient.defaultPost(HttpUriContants.GET_WORKJOBS, req, BaseResponse.class);
return response;
}
}
... ...
... ... @@ -28,9 +28,9 @@ public class AuthInterceptor implements HandlerInterceptor {
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
throws Exception {
HttpSession session = request.getSession();
Object obj = session.getAttribute("user");
if(null!=obj){
String name = String.valueOf(obj);
User u = (User) session.getAttribute("user");
if(null!=u){
String name = u.getName();
String path = getPath(request);
userOperateListener.add(name,request.getRequestURI());//记录用户操作
if(!userAuthLocal.auth(name,path)){
... ...
... ... @@ -72,7 +72,7 @@
<div class="widget-title" style="height: 53px;">
<div class="form-inline">
<a href="#" id="toAddUser" class="btn btn-success"
style="margin-top: 12px;margin-left: 0px;" onclick="editUser(0,0,0,0,0)">添加用户</a>
style="margin-top: 12px;margin-left: 0px;" onclick="editUser(0,0,0,0,0,0,0)">添加用户</a>
</div>
</div>
</div>
... ... @@ -103,6 +103,14 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label"> <span style="color:red">*</span>中文名:</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="cName" name="cName"
placeholder="中文名" maxlength="30" size="40"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label"> <span style="color:red">*</span>等级:</label>
<div class="col-sm-8">
... ... @@ -127,6 +135,19 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label"> <span style="color:red">*</span>职责:</label>
<div class="col-sm-8">
<select id="role" name="role" class="form-control"style="width:295px">
<option value="develop" selected="selected">develop</option>
<option value="test">test</option>
<option value="operator">operator</option>
<option value="leader">leader</option>
<option value="other">other</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label"> </label>
<div class="col-sm-8" id="messageAlert"></div>
... ... @@ -166,6 +187,10 @@
title: "用户名",
field: "name",
width: "15%"
},{
title: "中文名",
field: "cName",
width: "15%"
}, {
title: "等级",
field: "level",
... ... @@ -179,10 +204,14 @@
field: "mobile",
width: "15%"
},{
title: "职责",
field: "role",
width: "15%"
},{
title: "操作",
formatter: function (value, rowData, rowIndex) {
var div = $("<div>");
$("<button onclick=\"editUser(\'" + rowData.id + "\',\'" + rowData.name + "\',\'" + rowData.level + "\',\'" + rowData.email + "\',\'" + rowData.mobile + "\')\">").addClass("btn btn-xs btn-success").html("修改").appendTo(div);
$("<button onclick=\"editUser(\'" + rowData.id + "\',\'" + rowData.name + "\',\'" + rowData.level + "\',\'" + rowData.email + "\',\'" + rowData.mobile + "\',\'" + rowData.cName+ "\',\'" + rowData.role+ "\')\">").addClass("btn btn-xs btn-success").html("修改").appendTo(div);
div.append("&nbsp;");
$("<button onclick=\"deleteUser(\'" + rowData.name + "\')\">").addClass("btn btn-xs btn-danger").html("删除").appendTo(div);
return div;
... ... @@ -192,11 +221,12 @@
});
//打开新增或修改页面
function editUser(id, name,level,email,maobile) {
function editUser(id, name,level,email,maobile,cName,role) {
$("#hostGroupForm #messageAlert").hide();
if (id == 0) {//新增页面
$("input[name='id']").val(0);
$("input[name='name']").val("");
$("input[name='cName']").val("");
$("input[name='level']").val("");
$("input[name='email']").val("");
$("input[name='mobile']").val("");
... ... @@ -207,9 +237,11 @@
$("input[name='id']").val(id);
$("input[name='name']").val(name);
$("input[name='name']").attr("readonly","readonly");
$("input[name='cName']").val(cName);
$("input[name='level']").val(level);
$("input[name='email']").val(email);
$("input[name='mobile']").val(maobile);
$("#role").val(role);
}
$("#myModal").modal('show');
... ... @@ -260,6 +292,9 @@
var level = $("input[name='level']").val();
var email = $("input[name='email']").val();
var mobile = $("input[name='mobile']").val();
var cName = $("input[name='cName']").val();
var role = $("#role option:selected").val()
if (name == null || name == "") {
$("#hostGroupForm #messageAlert").alerts({
content: "请输入用户名",
... ... @@ -280,6 +315,8 @@
level: level,
email: email,
mobile: mobile,
cName: cName,
role: role
}
$.ajax({
url: contextPath + 'manage/saveUser',
... ...
<%@page language="java" contentType="text/html;charset=utf-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="<%=basePath %>css/unicorn.main.css"/>
<link rel="stylesheet" href="<%=basePath %>css/unicorn.grey.css"/>
<link rel="stylesheet" href="<%=basePath %>css/bootstrap.min.css"/>
<link href="<%=basePath%>css/style.default.css" rel="stylesheet">
<link href="<%=basePath%>css/morris.css" rel="stylesheet">
<link href="<%=basePath%>css/select2.css" rel="stylesheet"/>
<script>
var contextPath = '<%=basePath %>';
</script>
<title>添加工单</title>
</head>
<body style="background-color: #444444;font-size: 14px">
<!-- 头部 -->
<div id="head">
</div>
<!-- 右侧具体内容 -->
<div id="content">
<div id="breadcrumb">
<a href="#" title="Go to Home" class="tip-bottom"><i
class="icon-home"></i> Home</a> <a href="#" class="current">工单系统</a>
</div>
<div class="container-fluid">
<div class="widget-box">
<div class="widget-title">
<h5>新增</h5>
</div>
<div class="widget-content nopadding">
<div class="widget-title" style="height: 53px;">
<div class="form-inline">
<a href="#" id="toAddUser" class="btn btn-success"
style="margin-top: 12px;margin-left: 0px;" onclick="toAddReleaseWork()">新建发布工单</a>
</div>
</div>
</div>
<div id="releaseWorkDiv" style="display: none">
<form class="form-horizontal form-bordered">
<div class="form-group">
<label class="col-sm-1 control-label"><strong>主题: </strong></label>
<div class="col-sm-8">
<input type="text" id="title" name="title" class="form-control" placeholder="ex:2016.09.08_yohobuy-sns_上aws"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-1 control-label"><strong>需求说明: </strong></label>
<div class="col-sm-8">
<textarea name="demand" id="demand" class="form-control" rows="5"></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-1 control-label"><strong>选择平台: </strong></label>
<div class="col-sm-8">
<c:forEach items="${platforms }" var="platform">
<div class="rdio rdio-default" style="display: inline">
<input type="radio" name="platform" value="${platform}" id="${platform}"
onclick="changePlatform()"/>
<label for="${platform}" style="width: 100px">${platform}</label>
</div>
</c:forEach>
</div>
</div>
<div class="form-group">
<label class="col-sm-1 control-label"><strong>环境选择: </strong></label>
<div class="col-sm-8">
<c:forEach items="${environments }" var="environment">
<div class="ckbox ckbox-default" style="display: inline">
<input type="checkbox" name="environment" id="${environment}"
value="${environment}"/>
<label for="${environment}" style='width: 100px'>${environment}</label>
</div>
</c:forEach>
</div>
</div>
<div class="form-group">
<label class="col-sm-1 control-label"><strong>项目选择: </strong></label>
<div class="col-sm-8">
<select id="prjects" data-placeholder="Choose One" class="width300" style="height:40px">
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-1 control-label"><strong>指定测试: </strong></label>
<div class="col-sm-8">
<select id="test" data-placeholder="Choose One" class="width300" style="height:40px">
<c:forEach items="${tests }" var="test">
<option value="${test.name}">${test.name}</option>
</c:forEach>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-1 control-label"><strong>操作: </strong></label>
<div class="col-sm-8">
<button type="button" class="btn btn-primary" onclick="addReleaseJob()">提交</button>
</div>
</div>
<!-- form-group -->
</form>
</div>
</div>
</div>
</div>
<script src="<%=basePath%>js/jquery-2.1.4.min.js"></script>
<script src="<%=basePath%>js/bootstrap.min.js"></script>
<script src="<%=basePath%>js/select2.min.js"></script>
<script src="<%=basePath%>js/custom.js"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.dialog.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>script/common/genarate_left_panel.js"></script>
<script>
$("#li_worksystem").addClass("active open");
$("#li_addWork").addClass("active");
</script>
<script type="text/javascript">
function toAddReleaseWork() {
$.ajax({
url: contextPath + 'workSystem/checkRole?type=release',
type: 'POST',
success: function (data) {
if (data != 1) {
localAlert("权限不够", "你不能发起该工单");
} else {
$("#releaseWorkDiv").show();
}
},
error: function (e) {
console.log(e);
}
});
}
function changePlatform() {
var platform = $('input:radio[name=platform]:checked').val();
$.ajax({
url: contextPath + 'workSystem/getProjectsByPlatform?platform=' + platform,
type: 'POST',
success: function (data) {
$("#prjects").empty();
for (var i = 0; i < data.length; i++) {
$("#prjects").append("<option value=\'" + data[i].name + "\' selected=\"selected\">" + data[i].name + "</option>");
}
},
error: function (e) {
console.log(e);
}
});
}
/**
*添加项目发布工单
*/
function addReleaseJob() {
var title = $("input[name='title']").val();
var demand = $("textarea[name='demand']").val();
var platform = $('input:radio[name=platform]:checked').val();
var envuronments = "";
$('input[name="environment"]:checked').each(function () {
envuronments = envuronments + "|" + $(this).val();//向数组中添加元素
});
var project = $("#prjects option:selected").val();
var test = $("#test option:selected").val();
if (title == null || title == "") {
localAlert("参数错误", "请输入标题");
return;
}
if (demand == null || demand == "") {
localAlert("参数错误", "请输入需求");
return;
}
if (platform == null || platform == "") {
localAlert("参数错误", "请选择平台");
return;
}
if (envuronments.length == 0) {
localAlert("参数错误", "请选择环境");
return;
}
if (project == null || project == "") {
localAlert("参数错误", "请选择项目");
return;
}
if (test == null || test == "") {
localAlert("参数错误", "请选择测试");
return;
}
var param = {
title: title,
demand: demand,
platform: platform,
environment: envuronments,
project: project,
test: test
};
$.ajax({
url: contextPath + "/workSystem/createReleaseWorkJob",
type: 'post',
data: JSON.stringify(param),
dataType: "json",
contentType: "application/json",
success: function (data) {
if (data < 0) {
localAlert('添加失败', data.message);
} else {
window.location.href = contextPath + "/workSystem/toHandledWork";
}
},
error: function (e) {
console.log(e);
}
});
}
</script>
</body>
</html>
... ...
<%@page language="java" contentType="text/html;charset=utf-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="<%=basePath %>css/bootstrap.min.css"/>
<link rel="stylesheet" href="<%=basePath %>css/unicorn.main.css"/>
<link rel="stylesheet" href="<%=basePath %>css/unicorn.grey.css"/>
<link rel="stylesheet" href="<%=basePath %>css/jquery-ui.css"/>
<link rel="stylesheet" href="<%=basePath %>css/bootstrap-responsive.min.css"/>
<link rel="stylesheet" href="<%=basePath %>css/uniform.css"/>
<link rel="stylesheet" href="<%=basePath %>css/select2.css"/>
<script src="<%=basePath %>js/excanvas.min.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/jquery-1.12.0.min.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/jquery-ui.custom.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>/js/bootstrap.min.js"></script>
<script src="<%=basePath %>/js/unicorn.js"></script>
<script src="<%=basePath %>js/bootstrap-plugin/datetimepicker/moment-with-locales.js" charset="UTF-8"
type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/datetimepicker/bootstrap-datetimepicker.js" charset="UTF-8"
type="text/javascript"></script>
<script src="<%=basePath %>js/global.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.pagination.js" charset="UTF-8"
type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.table.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.dialog.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.form.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.panel.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.alerts.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.accordion.js" charset="UTF-8"
type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.breadcrumb.js" charset="UTF-8"
type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.validate.js" charset="UTF-8"
type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.form.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/layer/layer.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.select.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/jstree/jstree.min.js"></script>
<script src="<%=basePath %>js/jquery.toaster.js"></script>
<script>
var contextPath = '<%=basePath %>';
</script>
<title>已办工单</title>
</head>
<body>
<!-- 头部 -->
<div id="head">
</div>
<!-- 右侧具体内容 -->
<div id="content">
<div id="breadcrumb">
<a href="#" title="Go to Home" class="tip-bottom"><i
class="icon-home"></i> Home</a> <a href="#" class="current">工单系统</a>
</div>
<div class="container-fluid">
<div class="widget-box">
<div id="jobTable">
</div>
</div>
</div>
</div>
<script src="<%=basePath %>script/common/genarate_left_panel.js"></script>
<script>
$("#li_worksystem").addClass("active open");
$("#li_handledWork").addClass("active");
</script>
<script type="text/javascript">
$(function () {
//加载表格
$("#jobTable").table({
columnAutoWidth: false,
url: contextPath + "/workSystem/getHandledJobs",
striped: true,
title: "已办工单列表",
pagination: true,
pageSize: 10,
loadFilter: function (data) {
return defaultLoadFilter(data);
},
columns: [{
title: "工单id",
field: "workId",
width: "10%"
}, {
title: "主题",
field: "title",
formatter: function (value, rowData, rowIndex) {
return "<a href=\'" + contextPath + "workSystem/toWorkJob/?workid=" + rowData.workId + "&type=" + rowData.type + "\'>" + value + "</a>";
},
width: "40%"
}, {
title: "工单类型",
field: "type",
formatter: function (value, rowData, rowIndex) {
if (value == 'release') {
return '项目发布';
} else {
return '其他';
}
},
width: "15%"
}, {
title: "操作",
field: "handleType",
formatter: function (value, rowData, rowIndex) {
if (value == 1) {
return '发起';
} else if (value == 2) {
return '通过';
} else if (value == 3) {
return '拒绝';
} else if (value == -1) {
return '关闭';
}
},
width: "15%"
}, {
title: "时间",
field: "createTime",
width: "20%"
}]
});
});
</script>
</body>
</html>
... ...
<%@page language="java" contentType="text/html;charset=utf-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="<%=basePath %>css/bootstrap.min.css"/>
<link rel="stylesheet" href="<%=basePath %>css/unicorn.main.css"/>
<link rel="stylesheet" href="<%=basePath %>css/unicorn.grey.css"/>
<link rel="stylesheet" href="<%=basePath %>css/jquery-ui.css"/>
<link rel="stylesheet" href="<%=basePath %>css/bootstrap-responsive.min.css"/>
<link rel="stylesheet" href="<%=basePath %>css/uniform.css"/>
<link rel="stylesheet" href="<%=basePath %>css/select2.css"/>
<script src="<%=basePath %>js/excanvas.min.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/jquery-1.12.0.min.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/jquery-ui.custom.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>/js/bootstrap.min.js"></script>
<script src="<%=basePath %>/js/unicorn.js"></script>
<script src="<%=basePath %>js/bootstrap-plugin/datetimepicker/moment-with-locales.js" charset="UTF-8"
type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/datetimepicker/bootstrap-datetimepicker.js" charset="UTF-8"
type="text/javascript"></script>
<script src="<%=basePath %>js/global.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.pagination.js" charset="UTF-8"
type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.table.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.dialog.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.form.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.panel.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.alerts.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.accordion.js" charset="UTF-8"
type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.breadcrumb.js" charset="UTF-8"
type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.validate.js" charset="UTF-8"
type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.form.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/layer/layer.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.select.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/jstree/jstree.min.js"></script>
<script src="<%=basePath %>js/jquery.toaster.js"></script>
<script>
var contextPath = '<%=basePath %>';
</script>
<title>待办工单</title>
</head>
<body>
<!-- 头部 -->
<div id="head">
</div>
<!-- 右侧具体内容 -->
<div id="content">
<div id="breadcrumb">
<a href="#" title="Go to Home" class="tip-bottom"><i
class="icon-home"></i> Home</a> <a href="#" class="current">工单系统</a>
</div>
<div class="container-fluid">
<div class="widget-box">
<div id="jobTable">
</div>
</div>
</div>
</div>
<script src="<%=basePath %>script/common/genarate_left_panel.js"></script>
<script>
$("#li_worksystem").addClass("active open");
$("#li_pendingWork").addClass("active");
</script>
<script type="text/javascript">
$(function () {
//加载表格
$("#jobTable").table({
columnAutoWidth: false,
url: contextPath + "/workSystem/getPendingJobs",
striped: true,
title: "待办工单列表",
pagination: true,
pageSize: 10,
loadFilter: function (data) {
return defaultLoadFilter(data);
},
columns: [{
title: "工单id",
field: "workId",
width: "10%"
}, {
title: "主题",
field: "title",
formatter: function (value, rowData, rowIndex) {
return "<a href=\'" + contextPath + "workSystem/toWorkJob/?workid=" + rowData.workId + "&type=" + rowData.type + "\'>" + value + "</a>";
},
width: "40%"
}, {
title: "工单类型",
field: "type",
formatter: function (value, rowData, rowIndex) {
if (value == 'release') {
return '项目发布';
} else {
return '其他';
}
},
width: "15%"
}, {
title: "时间",
field: "createTime",
width: "20%"
}, {
title: "操作",
formatter: function (value, rowData, rowIndex) {
var div = $("<div>");
if(rowData.currentStatus == 0){//创建状态,只有发起按钮
$("<button onclick=\"editWork(\'" + rowData.id + "\',\'" + rowData.type + "\',2)\">").addClass("btn btn-xs btn-success").html("发起").appendTo(div);
div.append("&nbsp;");
}else {
$("<button onclick=\"editWork(\'" + rowData.id + "\',\'" + rowData.type + "\',2)\">").addClass("btn btn-xs btn-success").html("通过").appendTo(div);
div.append("&nbsp;");
$("<button onclick=\"editWork(\'" + rowData.id + "\',\'" + rowData.type + "\',3)\">").addClass("btn btn-xs btn-primary").html("拒绝").appendTo(div);
div.append("&nbsp;");
}
$("<button onclick=\"editWork(\'" + rowData.id + "\',\'" + rowData.type + "\',-1)\">").addClass("btn btn-xs btn-danger").html("关闭").appendTo(div);
return div;
}
}
]
});
});
/**
* 工单操作
* @param id
* @param handleType
*/
function editWork(id,type, handleType) {
var param = {
id: id,
type:type,
handleType: handleType
};
$.ajax({
url: contextPath + "/workSystem/handleJobsJobs",
type: 'post',
data: JSON.stringify(param),
dataType: "json",
contentType: "application/json",
success: function (data) {
if (data != 1) {
localAlert('处理结果', "处理失败");
} else {
localAlert('处理结果', "处理成功");
$("#jobTable").table("load")
}
},
error: function (e) {
console.log(e);
}
});
}
</script>
</body>
</html>
... ...
<%@page language="java" contentType="text/html;charset=utf-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>工单</title>
<link rel="stylesheet" href="<%=basePath %>css/unicorn.main.css"/>
<link rel="stylesheet" href="<%=basePath %>css/unicorn.grey.css"/>
<link rel="stylesheet" href="<%=basePath %>css/bootstrap.min.css"/>
<link href="<%=basePath%>css/style.default.css" rel="stylesheet">
<link href="<%=basePath%>css/morris.css" rel="stylesheet">
<link href="<%=basePath%>css/select2.css" rel="stylesheet"/>
<script>
var contextPath = '<%=basePath %>';
</script>
</head>
<body style="background-color: #444444;font-size: 14px">
<!-- 头部 -->
<div id="head">
</div>
<div id="content" style="background-color: white">
<div id="breadcrumb">
<a href="#" title="Go to Home" class="tip-bottom"><i
class="icon-home"></i> Home</a> <a href="#" class="current">工单详情</a>
</div>
<div>
<form class="form-horizontal form-bordered">
<div class="form-group">
<label class="col-sm-6 control-label"><strong>工单ID: </strong></label>
<div class="col-sm-8">
<input type="text" class="form-control" value=" ${workJob.id}"
style='border-left:0px;border-top:0px;border-right:0px;border-bottom:1px '
readonly="readonly"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label"><strong>发布时间: </strong></label>
<div class="col-sm-8">
<input type="text" class="form-control" value=" ${workJob.createTime}"
style='border-left:0px;border-top:0px;border-right:0px;border-bottom:1px '
readonly="readonly"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label"><strong>主题: </strong></label>
<div class="col-sm-8">
<input type="text" class="form-control" value=" ${workJob.title}"
style='border-left:0px;border-top:0px;border-right:0px;border-bottom:1px '
readonly="readonly"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label"><strong>需求说明: </strong></label>
<div class="col-sm-8">
<textarea id="autoResizeTA" class="form-control" rows="5"
readonly="readonly">${workJob.demand}</textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label"><strong>发布环境: </strong></label>
<div class="col-sm-8">
<input type="text" class="form-control" value="${workJob.environment }"
style='border-left:0px;border-top:0px;border-right:0px;border-bottom:1px '
readonly="readonly"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label"><strong>发布平台: </strong></label>
<div class="col-sm-8">
<input type="text" class="form-control" value=" ${workJob.platform}"
style='border-left:0px;border-top:0px;border-right:0px;border-bottom:1px '
readonly="readonly"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label"><strong>发布项目: </strong></label>
<div class="col-sm-8">
<input type="text" class="form-control" value=" ${workJob.project}"
style='border-left:0px;border-top:0px;border-right:0px;border-bottom:1px '
readonly="readonly"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label"><strong>审批过程: </strong></label>
<div class="col-sm-8">
<table class="table table-striped mb30" style="width: 778px">
<thead>
<tr>
<th>职责</th>
<th>操作人</th>
<th>操作</th>
<th>时间</th>
</tr>
</thead>
<tbody>
<c:forEach items="${workJob.handleList }" var="handledJob">
<tr>
<td align="center">${handledJob.handlerRole}</td>
<td align="center">${handledJob.handler}</td>
<td align="center">${handledJob.handlecType}</td>
<td align="center">${handledJob.createTime}</td>
</tr>
</c:forEach>
</tbody>
</table>
</div>
</div>
<c:if test="${count > 0}">
<div class="form-group">
<label class="col-sm-6 control-label"><strong>操作: </strong></label>
<div class="col-sm-8">
<c:choose>
<c:when test="${pendingJob.status == 0}">
<button type="button" class="btn btn-success" onclick="editWork(${pendingJob.id},'${pendingJob.type}',2)">发起</button>
</c:when>
<c:otherwise>
<button type="button" class="btn btn-success" onclick="editWork(${pendingJob.id},'${pendingJob.type}',2)">通过</button>
<button type="button" class="btn btn-primary" onclick="editWork(${pendingJob.id},'${pendingJob.type}',3)">拒绝</button>
</c:otherwise>
</c:choose>
<button type="button" class="btn btn-danger" onclick="editWork(${pendingJob.id},${pendingJob.type},-1)">关闭</button>
</div>
</div>
</c:if>
<!-- form-group -->
</form>
</div>
</div>
</div>
<script src="<%=basePath%>js/jquery-2.1.4.min.js"></script>
<script src="<%=basePath%>js/bootstrap.min.js"></script>
<script src="<%=basePath%>js/select2.min.js"></script>
<script src="<%=basePath%>js/custom.js"></script>
<script src="<%=basePath %>script/common/genarate_left_panel.js"></script>
<script type="text/javascript">
$("#li_worksystem").addClass("active open");
/**
* 工单操作
* @param id
* @param handleType
*/
function editWork(id,type, handleType) {
var param = {
id: id,
type:type,
handleType: handleType
};
$.ajax({
url: contextPath + "/workSystem/handleJobsJobs",
type: 'post',
data: JSON.stringify(param),
dataType: "json",
contentType: "application/json",
success: function (data) {
if (data != 1) {
localAlert('处理结果', "处理失败");
} else {
localAlert('处理结果', "处理成功");
window.location.href = contextPath + "/workSystem/toHandledWork";
}
},
error: function (e) {
console.log(e);
}
});
}
</script>
</body>
</html>
... ...
<%@page language="java" contentType="text/html;charset=utf-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="<%=basePath %>css/bootstrap.min.css"/>
<link rel="stylesheet" href="<%=basePath %>css/bootstrap-datetimepicker.css"/>
<link href="<%=basePath %>js/bootstrap-plugin/css/bootstrap.table.css" rel="stylesheet" media="screen"/>
<link rel="stylesheet" href="<%=basePath %>css/bootstrap-responsive.min.css"/>
<link rel="stylesheet" href="<%=basePath %>css/fullcalendar.css"/>
<link rel="stylesheet" href="<%=basePath %>css/unicorn.main.css"/>
<link rel="stylesheet" href="<%=basePath %>css/unicorn.grey.css"/>
<link rel="stylesheet" href="<%=basePath %>css/jquery-ui.css"/>
<link rel="stylesheet" href="<%=basePath %>css/uniform.css"/>
<link rel="stylesheet" href="<%=basePath %>css/select2.css"/>
<link rel="stylesheet" href="<%=basePath %>js/jstree/themes/proton/style.css"/>
<link rel="stylesheet" href="<%=basePath %>css/select2.css"/>
<link rel="stylesheet" href="<%=basePath %>css/yoho.css"/>
<script src="<%=basePath %>js/excanvas.min.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/jquery-1.12.0.min.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/jquery-ui.custom.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>/js/bootstrap.min.js"></script>
<script src="<%=basePath %>/js/unicorn.js"></script>
<script src="<%=basePath %>js/bootstrap-plugin/datetimepicker/moment-with-locales.js" charset="UTF-8"
type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/datetimepicker/bootstrap-datetimepicker.js" charset="UTF-8"
type="text/javascript"></script>
<script src="<%=basePath %>js/global.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.pagination.js" charset="UTF-8"
type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.table.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.dialog.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.form.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.panel.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.alerts.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.accordion.js" charset="UTF-8"
type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.breadcrumb.js" charset="UTF-8"
type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.validate.js" charset="UTF-8"
type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.form.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/layer/layer.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.select.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/jstree/jstree.min.js"></script>
<script src="<%=basePath %>js/jquery.toaster.js"></script>
<script>
var contextPath = '<%=basePath %>';
</script>
<title>YOHO!工单</title>
</head>
<body>
<!-- 头部 -->
<div id="head">
</div>
<!-- 右侧具体内容 -->
<div id="content">
<div id="breadcrumb">
<a href="#" title="Go to Home" class="tip-bottom"><i
class="icon-home"></i> Home</a> <a href="#" class="current">工单系统</a>
</div>
<div class="container-fluid">
<div class="widget-box">
<div class="widget-title">
<h5>工单查询</h5>
</div>
<div class="widget-content nopadding">
<div class="widget-title" style="height: 53px;">
<div>
<div class="form-inline" role="form" id="inBoxQueryDiv"
style=" margin-top: 12px;margin-left: 25px;float: left;">
<div class="input-group" style="float: left;">
<span class="input-group-addon">工单ID:</span>
<input type="text" id="workid" name="workid" class="form-control" placeholder=""/>
</div>
<button id="searchBtn" class="btn btn-primary" style="margin-left: 18px;">搜索</button>
</div>
</div>
</div>
<div id="jobsTable">
</div>
</div>
</div>
</div>
</div>
<script src="<%=basePath %>script/common/genarate_left_panel.js"></script>
<script>
$("#li_worksystem").addClass("active open");
$("#li_works").addClass("active");
</script>
<script>
$(function () {
//加载表格
$("#jobsTable").table({
columnAutoWidth: false,
url: contextPath +"workSystem/getJobs",
striped: true,
title: "工单列表",
dataType: "json",
pagination: true,
pageSize: 10,
loadFilter: function (data) {
return defaultLoadFilter(data);
},
columns: [ {
title: "工单id",
field: "workId",
width: "10%"
}, {
title: "主题",
field: "title",
formatter : function(value, rowData, rowIndex) {
return "<a href=\'" + contextPath + "workSystem/toWorkJob/?workid=" + rowData.workId + "&type=" + rowData.type + "\'>" + value + "</a>";
},
width: "40%"
},{
title: "工单类型",
field: "type",
formatter : function(value, rowData, rowIndex) {
if(value == 'release'){
return '项目发布';
} else{
return '其他';
}
},
width: "15%"
},{
title: "时间",
field: "createTime",
width: "20%"
}]
});
});
//点击查询按钮
$("#searchBtn").click(function () {
var workid = $("#workid").val();
$("#jobsTable").table("load", {
'id': workid
});
});
</script>
\ No newline at end of file
... ...