1:修改表结构

2:增加项目管理功能(增/删/改/查)
This commit is contained in:
seagull 2017-04-26 14:59:31 +08:00
parent ad4dca5513
commit e8c93751ac
17 changed files with 707 additions and 90 deletions

View File

@ -356,6 +356,12 @@ insert into USER_AUTHORITY (id, module, auth_type, alias)
values (46, '用户管理-权限角色', '增加', 'role_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (47, '用户管理-权限角色', '删除', 'role_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (48, '项目管理', '增加', 'pro_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (49, '项目管理', '删除', 'pro_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (50, '项目管理', '修改', 'pro_3');
/*插入角色默认定义*/
insert into USER_ROLE (id, role, permission)

View File

@ -1,2 +1,9 @@
/*扩展日志明细字段到2000*/
alter table test_logdetail modify column detail varchar(2000);
/*扩展日志明细字段到5000*/
alter table test_logdetail modify column detail varchar(5000);
/*添加项目管理的权限控制*/
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (48, '项目管理', '增加', 'pro_1');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (49, '项目管理', '删除', 'pro_2');
insert into USER_AUTHORITY (id, module, auth_type, alias)
values (50, '项目管理', '修改', 'pro_3');

View File

@ -17,5 +17,6 @@ public interface OperationLogDao {
public List findByPage(final String hql, final Object value, final int offset, final int pageSize);
public int findRows(OperationLog oplog, String hql);
public void delete(String hql) throws Exception;
}

View File

@ -96,5 +96,20 @@ public class OperationLogDaoImpl extends HibernateDaoSupport implements Operatio
return s;
}
@Override
public void delete(String hql) throws Exception {
Session session=this.getSession(true);
try {
session.beginTransaction();
Query query =session .createQuery(hql);
query.executeUpdate();
session.getTransaction().commit();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
}
}

View File

@ -17,7 +17,7 @@ public interface SectorProjectsDao {
public void modifyInfo(SectorProjects sectorprojects) throws Exception;
public void delete(int id) throws Exception;
public void delete(SectorProjects sectorprojects) throws Exception;
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public List<SectorProjects> list(SectorProjects sectorprojects) throws Exception;
@ -30,8 +30,6 @@ public interface SectorProjectsDao {
public List<SectorProjects> load(String name, String cmdType, String planPath)
throws Exception;
public SectorProjects get(int id) throws Exception;
public int getid(String projectname) throws Exception;
// public List findByPage(final String hql, final int offset,final int pageSize);
@ -41,7 +39,6 @@ public interface SectorProjectsDao {
public List findByPage(final String hql, final Object value,final int offset, final int pageSize);
public int findRows(SectorProjects sectorprojects,String hql);
public List<SectorProjects> findJobsList();
public SectorProjects load(int projectid) throws Exception;
public int projectrow(String hql);
}

View File

@ -12,7 +12,9 @@ import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import luckyweb.seagull.spring.entity.ProjectVersion;
import luckyweb.seagull.spring.entity.SectorProjects;
import luckyweb.seagull.spring.entity.UserInfo;
import luckyweb.seagull.util.StrLib;
@Repository("sectorprojectsDao")
@ -26,9 +28,9 @@ public class SectorProjectsDaoImpl extends HibernateDaoSupport implements Sector
@Override
public void delete(int id) throws Exception {
public void delete(SectorProjects sectorprojects) throws Exception {
// TODO Auto-generated method stub
this.getHibernateTemplate().delete(sectorprojects);
}
private void whereParameter(SectorProjects sectorprojects, Query query) {
@ -88,8 +90,8 @@ public class SectorProjectsDaoImpl extends HibernateDaoSupport implements Sector
@Override
public int add(SectorProjects sectorprojects) throws Exception {
// TODO Auto-generated method stub
return 0;
this.getHibernateTemplate().save(sectorprojects);
return sectorprojects.getProjectid();
}
@ -97,7 +99,7 @@ public class SectorProjectsDaoImpl extends HibernateDaoSupport implements Sector
@Override
public void modify(SectorProjects sectorprojects) throws Exception {
// TODO Auto-generated method stub
this.getHibernateTemplate().update(sectorprojects);
}
@ -169,20 +171,25 @@ public class SectorProjectsDaoImpl extends HibernateDaoSupport implements Sector
return null;
}
@Override
public SectorProjects load(int projectid) throws Exception {
// TODO Auto-generated method stub
return (SectorProjects) this.getHibernateTemplate().get(SectorProjects.class, projectid);
}
@Override
public SectorProjects get(int id) throws Exception {
// TODO Auto-generated method stub
return null;
public int projectrow(String hql) {
// List<TestTastexcute> list=new ArrayList<TestTastexcute>();
Session session = this.getSession(true);
int count=0;
try {
count = session.createSQLQuery(hql).list().size();
} catch (Exception e) {
e.printStackTrace();
}finally{
session.close();
}
@Override
public List<SectorProjects> findJobsList() {
// TODO Auto-generated method stub
return null;
return count;
// return this.getHibernateTemplate().find("select id,name,planproj from TestJobs order by id asc ");
}
}

View File

@ -12,8 +12,15 @@ public class SectorProjects implements java.io.Serializable{
private String projectname;
private String projectmanager;
private int sectorid;
private int projecttype;
private SecondarySector secondarySector;
public int getProjecttype() {
return projecttype;
}
public void setProjecttype(int projecttype) {
this.projecttype = projecttype;
}
public int getProjectid() {
return projectid;
}

View File

@ -5,16 +5,29 @@ import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import luckyweb.seagull.spring.entity.Accident;
import luckyweb.seagull.spring.entity.ProjectVersion;
import luckyweb.seagull.spring.entity.SecondarySector;
import luckyweb.seagull.spring.entity.SectorProjects;
import luckyweb.seagull.spring.entity.TestCasedetail;
import luckyweb.seagull.spring.entity.TestJobs;
import luckyweb.seagull.spring.entity.UserInfo;
import luckyweb.seagull.spring.service.AccidentService;
import luckyweb.seagull.spring.service.OperationLogService;
import luckyweb.seagull.spring.service.ProjectsVersionService;
import luckyweb.seagull.spring.service.SecondarySectorService;
import luckyweb.seagull.spring.service.SectorProjectsService;
import luckyweb.seagull.spring.service.TestJobsService;
import luckyweb.seagull.util.Endecrypt;
import luckyweb.seagull.util.StrLib;
@Controller
@ -41,6 +54,11 @@ public class SectorProjectsController {
this.sectorprojectsservice = sectorprojectsservice;
}
@Resource(name = "testJobsService")
private TestJobsService testJobsService;
@Resource(name = "operationlogService")
private OperationLogService operationlogservice;
@RequestMapping(value = "/sectorprojects.do")
public String qualityshow(TestCasedetail caseDetail, HttpServletRequest req,HttpServletResponse rsp,
@ -109,6 +127,232 @@ public class SectorProjectsController {
return "/jsp/base/sectorprojects";
}
/**
* 项目添加
* @param tj
* @param br
* @param model
* @param req
* @param rsp
* @return
* @throws Exception
* @Description:
*/
@RequestMapping(value = "/add.do")
public String add(@Valid @ModelAttribute("sectorprojects") SectorProjects sectorprojects, BindingResult br, Model model,
HttpServletRequest req, HttpServletResponse rsp) throws Exception
{
try
{
rsp.setContentType("text/html;charset=utf-8");
req.setCharacterEncoding("utf-8");
if(!UserLoginController.permissionboolean(req, "pro_1")){
model.addAttribute("sectorprojects", new SectorProjects());
model.addAttribute("url", "/sectorProjects/list.do");
model.addAttribute("message", "当前用户无权限添加项目,请联系管理员!");
return "success";
}
String retVal = "/jsp/base/projects_add";
if (req.getMethod().equals("POST"))
{
if (br.hasErrors())
{
return retVal;
}
String message = "";
if(StrLib.isEmpty(sectorprojects.getProjectname())){
message = "项目名称不能为空!";
model.addAttribute("secondarysector", secondarysectorservice.listall());
model.addAttribute("message", message);
return retVal;
}
if(StrLib.isEmpty(sectorprojects.getProjectmanager())){
message = "项目经理不能为空!";
model.addAttribute("secondarysector", secondarysectorservice.listall());
model.addAttribute("message", message);
return retVal;
}
if(sectorprojects.getSecondarySector().getSectorid()==0){
message = "请至少选择一个所属部门!";
model.addAttribute("secondarysector", secondarysectorservice.listall());
model.addAttribute("message", message);
return retVal;
}
SecondarySector ss = secondarysectorservice.load(sectorprojects.getSecondarySector().getSectorid());
sectorprojects.setSecondarySector(ss);
int proid = sectorprojectsservice.add(sectorprojects);
operationlogservice.add(req, "SectorProjects", proid,
proid,"项目添加成功!项目名:"+sectorprojects.getProjectname());
model.addAttribute("message", "添加项目成功");
model.addAttribute("url", "/sectorProjects/list.do");
return "success";
}
model.addAttribute("secondarysector", secondarysectorservice.listall());
return retVal;
}
catch (Exception e)
{
model.addAttribute("message", e.getMessage());
model.addAttribute("url", "/sectorProjects/list.do");
return "error";
}
}
/**
* 删除项目
*
* @param id
* @param model
* @return
* @throws Exception
*/
@RequestMapping(value = "/delete.do", method = RequestMethod.GET)
public String delete(Model model,HttpServletRequest req) throws Exception
{
if(!UserLoginController.permissionboolean(req, "pro_2")){
model.addAttribute("sectorprojects", new SectorProjects());
model.addAttribute("url", "/sectorProjects/list.do");
model.addAttribute("message", "当前用户无权限删除项目,请联系管理员!");
return "success";
}
int projectid = Integer.valueOf(req.getParameter("projectid"));
SectorProjects sectorprojects = sectorprojectsservice.loadob(projectid);
sectorprojects.setSectorid(sectorprojects.getSecondarySector().getSectorid());
if(null!=sectorprojects&&sectorprojects.getProjecttype()==0){
int rows = sectorprojectsservice.projectrow(projectid);
if(rows>=1){
String message = "此项目关联了质量管理模块信息,不能删除!";
model.addAttribute("sectorprojects", new SectorProjects());
model.addAttribute("message", message);
model.addAttribute("url", "/sectorProjects/list.do");
return "success";
}
}
if(null!=sectorprojects&&sectorprojects.getProjecttype()==1){
TestJobs testjobs = new TestJobs();
testjobs.setPlanproj(sectorprojects.getProjectname());
int rows = testJobsService.findRows(testjobs);
if(rows>=1){
String message = "此项目有关联自动化调度任务,不能删除!";
model.addAttribute("sectorprojects", new SectorProjects());
model.addAttribute("message", message);
model.addAttribute("url", "/sectorProjects/list.do");
return "success";
}
}
try
{
operationlogservice.delete(projectid);
sectorprojectsservice.delete(sectorprojects);
}
catch (Exception e)
{
model.addAttribute("message", e.getMessage());
model.addAttribute("url", "/sectorProjects/list.do");
return "error";
}
operationlogservice.add(req, "SectorProjects", projectid,
99,"项目信息删除成功!项目名:"+sectorprojects.getProjectname());
String message = "删除项目成功!";
model.addAttribute("sectorprojects", new SectorProjects());
model.addAttribute("message", message);
model.addAttribute("url", "/sectorProjects/list.do");
return "success";
}
/**
*
* 根据id更新项目信息
* @param id
* @param model
* @return
* @throws Exception
*/
@RequestMapping(value = "/update.do")
public String update(@Valid @ModelAttribute("sectorprojects") SectorProjects sectorprojects, BindingResult br,
Model model, HttpServletRequest req) throws Exception
{
req.setCharacterEncoding("utf-8");
int projectid = Integer.valueOf(req.getParameter("projectid"));
if(!UserLoginController.permissionboolean(req, "pro_3")){
model.addAttribute("sectorprojects", new SectorProjects());
model.addAttribute("url", "/sectorProjects/list.do");
model.addAttribute("message", "当前用户无权限修改项目信息,请联系管理员!");
return "success";
}
try{
String retVal = "/jsp/base/projects_add";
if (req.getMethod().equals("POST"))
{
if (br.hasErrors())
{
return retVal;
}
String message = "";
if(StrLib.isEmpty(sectorprojects.getProjectname())){
message = "项目名称不能为空!";
model.addAttribute("secondarysector", secondarysectorservice.listall());
model.addAttribute("message", message);
return retVal;
}
if(StrLib.isEmpty(sectorprojects.getProjectmanager())){
message = "项目经理不能为空!";
model.addAttribute("secondarysector", secondarysectorservice.listall());
model.addAttribute("message", message);
return retVal;
}
if(sectorprojects.getSecondarySector().getSectorid()==0){
message = "请至少选择一个所属部门!";
model.addAttribute("secondarysector", secondarysectorservice.listall());
model.addAttribute("message", message);
return retVal;
}
SecondarySector ss = secondarysectorservice.load(sectorprojects.getSecondarySector().getSectorid());
sectorprojects.setSecondarySector(ss);
sectorprojectsservice.modify(sectorprojects);
operationlogservice.add(req, "SectorProjects", sectorprojects.getProjectid(),
sectorprojects.getProjectid(),"项目信息修改成功!项目名"+sectorprojects.getProjectname());
model.addAttribute("message", "修改项目信息成功");
model.addAttribute("url", "/sectorProjects/list.do");
return "success";
}
SectorProjects sss = sectorprojectsservice.loadob(projectid);
sss.setSectorid(sss.getSecondarySector().getSectorid());
model.addAttribute("secondarysector", secondarysectorservice.listall());
model.addAttribute("sectorprojects", sss);
return "/jsp/base/projects_update";
}
catch (Exception e){
model.addAttribute("message", e.getMessage());
model.addAttribute("url", "/sectorProjects/list.do");
return "error";
}
}
public static void main(String[] args) {
// TODO Auto-generated method stub

View File

@ -16,4 +16,5 @@ public interface OperationLogService {
public OperationLog load(int id)throws Exception;
public List findByPage( final Object value,final int offset, final int pageSize);
public int findRows(OperationLog oplog);
public void delete(int id) throws Exception;
}

View File

@ -92,4 +92,9 @@ public class OperationLogServiceImpl implements OperationLogService{
return this.operationlogdao.add(op_log);
}
@Override
public void delete(int id) throws Exception {
String hql="delete from OperationLog where projectid="+id;
this.operationlogdao.delete(hql);
}
}

View File

@ -12,7 +12,7 @@ public interface SectorProjectsService {
public int add(SectorProjects sectorprojects)throws Exception;
public void modify(SectorProjects sectorprojects)throws Exception;
public void modifyState(SectorProjects sectorprojects)throws Exception;
public void delete(int id)throws Exception;
public void delete(SectorProjects sectorprojects)throws Exception;
@Transactional(propagation=Propagation.NOT_SUPPORTED)
public List<SectorProjects> list(SectorProjects sectorprojects)throws Exception;
@ -38,4 +38,6 @@ public interface SectorProjectsService {
// public List<TestJobs> getListForPage( final int offset,final int lengh);
public List<SectorProjects> findProjectsList();
public SectorProjects loadob(int projectid) throws Exception;
public int projectrow(int id);
}

View File

@ -27,13 +27,13 @@ public class SectorProjectsServiceImpl implements SectorProjectsService{
@Override
public int add(SectorProjects sectorprojects) throws Exception {
// TODO Auto-generated method stub
return 0;
return this.sectorprojectsdao.add(sectorprojects);
}
@Override
public void modify(SectorProjects sectorprojects) throws Exception {
// TODO Auto-generated method stub
this.sectorprojectsdao.modify(sectorprojects);
}
@Override
@ -43,9 +43,9 @@ public class SectorProjectsServiceImpl implements SectorProjectsService{
}
@Override
public void delete(int id) throws Exception {
public void delete(SectorProjects sectorprojects) throws Exception {
// TODO Auto-generated method stub
this.sectorprojectsdao.delete(sectorprojects);
}
@Override
@ -73,6 +73,12 @@ public class SectorProjectsServiceImpl implements SectorProjectsService{
return this.sectorprojectsdao.findproject(projectid);
}
@Override
public SectorProjects loadob(int projectid) throws Exception {
// TODO Auto-generated method stub
return this.sectorprojectsdao.load(projectid);
}
@Override
public int getid(String projectname) throws Exception {
// TODO Auto-generated method stub
@ -129,4 +135,14 @@ public class SectorProjectsServiceImpl implements SectorProjectsService{
return null;
}
@Override
public int projectrow(int id) {
int row=0;
row=sectorprojectsdao.projectrow("SELECT projectid from qa_accident where projectid="+id);
row=sectorprojectsdao.projectrow("SELECT projectid from qa_flowcheck where projectid="+id)+row;
row=sectorprojectsdao.projectrow("SELECT projectid from qa_planflowcheck where projectid="+id)+row;
row=sectorprojectsdao.projectrow("SELECT projectid from qa_projectversion where projectid="+id)+row;
row=sectorprojectsdao.projectrow("SELECT projectid from qa_review where projectid="+id)+row;
return row;
}
}

View File

@ -18,5 +18,8 @@
<many-to-one name="secondarySector" class="SecondarySector" fetch="select" lazy="false"> <!-- 关于lazy的解释 http://blog.sina.com.cn/s/blog_4731ed500101cwsk.html -->
<column name="sectorid" not-null="true" />
</many-to-one>
<property name="projecttype" type="java.lang.Integer">
<column name="projecttype" length="4" not-null="true" />
</property>
</class>
</hibernate-mapping>

View File

@ -0,0 +1,120 @@
<%@ page contentType="text/html; charset=utf-8" language="java"
import="java.sql.*" errorPage=""%>
<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>项目添加</title>
<link href="/css/style.css" rel="stylesheet" type="text/css" />
<link href="/js/easyui/themes/default/easyui.css" rel="stylesheet" type="text/css" />
<link href="/js/easyui/themes/icon.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.STYLE1 {
font-size: 12px;
color: #ffffff;
}
-->
.error_msg {
font-size: 12px;
color: #f00;
}
.tip {
font-size: 12px;
color: blue;
}
</style>
<script language="JavaScript" type="text/javascript"
src="/js/jslib.js"></script>
</head>
<body onload="init()">
<div>
<%@ include file="/head.jsp" %>
</div>
<header id="head" class="secondary"></header>
<!-- container -->
<div class="container" style="width:auto;font-size:14px">
<ol class="breadcrumb">
<li><a href="/">主页</a></li>
<li class="active"><a href="/sectorProjects/list.do">项目管理</a></li>
<li class="active">添加项目</li>
</ol>
<div class="row">
<!-- Article main content -->
<article class="col-sm-9 maincontent" style="width:100%;">
<header class="page-header">
<h1 class="page-title" style="text-align:center;">添加项目</h1>
</header>
<div class="col-md-6 col-md-offset-3 col-sm-8 col-sm-offset-2">
<div class="panel panel-default">
<div class="panel-body">
<h3 class="thin text-center">添加一个项目</h3>
<sf:form modelAttribute="sectorprojects" method="post">
<div class="top-margin">
<label>项目名称 <span class="text-danger">*</span></label>
<sf:input type="text" class="form-control" path="projectname" id="projectname"/>
</div>
<div class="top-margin">
<label>项目经理 <span class="text-danger">*</span></label>
<sf:input type="text" class="form-control" path="projectmanager" id="projectmanager"/>
</div>
<div class="top-margin">
<label>所属部门 <span class="text-danger">*</span></label>
<sf:select type="text" class="form-control"
path="secondarySector.sectorid"
id="secondarySector.sectorid">
<sf:option value="0">请选择</sf:option>
<c:forEach var="p" items="${secondarysector}">
<sf:option value="${p.sectorid}">${p.departmentname}</sf:option>
</c:forEach>
</sf:select>
</div>
<div class="top-margin">
<label>项目类型 <span class="text-danger">*</span></label><br/>
<sf:radiobutton path="projecttype" id="projecttype" value="0" /> 质量管理项目&nbsp;&nbsp;&nbsp;&nbsp;
<sf:radiobutton path="projecttype" id="projecttype" value="1" /> 自动化管理项目(testlink)
</div>
</br>
<div class="row">
<div class="col-lg-4 text-center" style="width:900px">
<button class="btn btn-action" type="submit">添加项目</button>
</div>
</div>
</sf:form>
</div>
</div>
</div>
<p>&nbsp;</p>
</article>
</div>
</div>
<script type="text/javascript">
function init(){
if('${message}'!=''){
if('${message}'=='添加成功'){
alert("添加成功,请返回查询!");
}else{
alert('${message}');
}
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,120 @@
<%@ page contentType="text/html; charset=utf-8" language="java"
import="java.sql.*" errorPage=""%>
<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>项目修改</title>
<link href="/css/style.css" rel="stylesheet" type="text/css" />
<link href="/js/easyui/themes/default/easyui.css" rel="stylesheet" type="text/css" />
<link href="/js/easyui/themes/icon.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.STYLE1 {
font-size: 12px;
color: #ffffff;
}
-->
.error_msg {
font-size: 12px;
color: #f00;
}
.tip {
font-size: 12px;
color: blue;
}
</style>
<script language="JavaScript" type="text/javascript"
src="/js/jslib.js"></script>
</head>
<body onload="init()">
<div>
<%@ include file="/head.jsp" %>
</div>
<header id="head" class="secondary"></header>
<!-- container -->
<div class="container" style="width:auto;font-size:14px">
<ol class="breadcrumb">
<li><a href="/">主页</a></li>
<li class="active"><a href="/sectorProjects/list.do">项目管理</a></li>
<li class="active">修改项目</li>
</ol>
<div class="row">
<!-- Article main content -->
<article class="col-sm-9 maincontent" style="width:100%;">
<header class="page-header">
<h1 class="page-title" style="text-align:center;">修改项目</h1>
</header>
<div class="col-md-6 col-md-offset-3 col-sm-8 col-sm-offset-2">
<div class="panel panel-default">
<div class="panel-body">
<h3 class="thin text-center">修改当前项目</h3>
<sf:form modelAttribute="sectorprojects" method="post">
<div class="top-margin">
<label>项目名称 <span class="text-danger">*</span></label>
<sf:input type="text" class="form-control" path="projectname" id="projectname"/>
</div>
<div class="top-margin">
<label>项目经理 <span class="text-danger">*</span></label>
<sf:input type="text" class="form-control" path="projectmanager" id="projectmanager"/>
</div>
<div class="top-margin">
<label>所属部门 <span class="text-danger">*</span></label>
<sf:select type="text" class="form-control"
path="secondarySector.sectorid"
id="secondarySector.sectorid">
<sf:option value="0">请选择</sf:option>
<c:forEach var="p" items="${secondarysector}">
<sf:option value="${p.sectorid}">${p.departmentname}</sf:option>
</c:forEach>
</sf:select>
</div>
<div class="top-margin">
<label>项目类型 <span class="text-danger">*</span></label><br/>
<sf:radiobutton path="projecttype" id="projecttype" value="0" /> 质量管理项目&nbsp;&nbsp;&nbsp;&nbsp;
<sf:radiobutton path="projecttype" id="projecttype" value="1" /> 自动化管理项目(testlink)
</div>
</br>
<div class="row">
<div class="col-lg-4 text-center" style="width:900px">
<button class="btn btn-action" type="submit">修改项目</button>
</div>
</div>
</sf:form>
</div>
</div>
</div>
<p>&nbsp;</p>
</article>
</div>
</div>
<script type="text/javascript">
function init(){
if('${message}'!=''){
if('${message}'=='添加成功'){
alert("添加成功,请返回查询!");
}else{
alert('${message}');
}
}
}
</script>
</body>
</html>

View File

@ -6,12 +6,10 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script Charset="utf-8" type="text/javascript"
src="/js/jquery-1.7.2.js"></script>
<script language="JavaScript" type="text/javascript"
src="/js/My97DatePicker/WdatePicker.js"></script>
<title>项目信息</title>
<title>项目管理</title>
<link href="/css/style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
@ -21,6 +19,95 @@
.STYLE6 {color: #FF0000; font-size: 12px; }
-->
</style>
</head>
<body>
<div>
<%@ include file="/head.jsp" %>
</div>
<header id="head" class="secondary"></header>
<!-- container -->
<div class="container" style="width:auto;font-size:14px">
<ol class="breadcrumb">
<li><a href="/">主页</a></li>
<li class="active"><a href="/userInfo/list.do">用户管理</a></li>
<li class="active">项目管理</li>
</ol>
<div class="row">
<!-- Article main content -->
<article class="col-sm-9 maincontent" style="width:100%;">
<header class="page-header">
<h1 class="page-title" style="text-align:center;">项目管理</h1>
</header>
<sf:form method="post" modelAttribute="sectorprojects">
<input name="page" id="page" type="hidden" />
<table width="100%" align="center" class="rect" height=40 cellPadding=1 border=1 bordercolor="#CCCCCC">
<tr>
<td width="25%" align="center" valign="middle">
<a href="#" onclick="showDiv(0,1)" style="text-decoration: none;">
<span class="btnold STYLE1" style="width:70px;background:#FFA54F;border:#FFA54F;"> 添加项目</span></a>
</td>
</tr>
</table>
<table width="100%" align="center" class="bordered">
<tr bgcolor="#B9DCFF">
<th width="5%" height="40" nowrap="nowrap" bgcolor="#B9DCFF">项目编号</th>
<th width="35%" height="40" nowrap="nowrap" bgcolor="#B9DCFF">项目名称</th>
<th width="10%" height="40" nowrap="nowrap" bgcolor="#B9DCFF">项目经理</th>
<th width="10%" height="40" nowrap="nowrap" bgcolor="#B9DCFF">项目类型</th>
<th width="10%" height="40" nowrap="nowrap" bgcolor="#B9DCFF">所属部门</th>
<th width="10%" height="40" nowrap="nowrap" bgcolor="#B9DCFF">部门经理</th>
<th width="20%" height="40" nowrap="nowrap" bgcolor="#B9DCFF">操作</th>
</tr>
<c:forEach var="t" items="${splist}" begin="0" step="1"
varStatus="i">
<tr>
<td height="25" style="text-align:center">${t.projectid }&nbsp;</td>
<td height="25" >${t.projectname }&nbsp;</td>
<td height="25" >${t.projectmanager }&nbsp;</td>
<c:if test="${t.projecttype==0 }">
<td height="25" >质量管理项目&nbsp;</td>
</c:if>
<c:if test="${t.projecttype==1 }">
<td height="25" >自动化管理项目(testlink)&nbsp;</td>
</c:if>
<td height="25" >${t.secondarySector.departmentname }&nbsp;</td>
<td height="25" >${t.secondarySector.departmenthead }&nbsp;</td>
<td height="25" style="word-break: break-all">
<a href="#" onclick="showDiv('${t.projectid}','2')"
style="cursor: pointer;"><u>修改</u></a>&nbsp; <a href="#"
onclick="showDiv('${t.projectid}','3')" style="cursor: pointer;"><u>删除</u></a>&nbsp;
</td>
</tr>
</c:forEach>
</table>
<center>
<div id="pagelist" align="center">
<c:if test="${allRows!=0 }">
<ul>
<li><a href="#" onclick="return setPage(1)">首页 </a></li>
<li><a href="#" onclick="return frontPageCheck(${page-1});">上一页</a></li>
<li><a href="#" onclick="return backPageCheck(${page+1});">下一页</a></li>
<li><a href="#" onclick="return setPage(${allPage})">末页</a></li>
<li>第${page}页</li>
<li>共${allRows}条</li>
<li>共${allPage}页</li>
</ul>
</c:if>
<c:if test="${allRows==0 }">
<font color="#FF0000">没有记录!</font> </c:if>
</div></center>
</sf:form>
<p>&nbsp;</p>
</article>
</div>
</div>
<script type="text/javascript">
function frontPageCheck(page)
{
@ -55,63 +142,37 @@
document.getElementById("sectorprojects").submit();
return true;
}
function goVersionList(projectid){
alter("fdsa");
document.getElementById("sectorprojects").action="/projectVersion/list.do";
document.getElementById("projectid").value=projectid;
document.getElementById("sectorprojects").submit();
return true;
function showDiv(proid,opr){
var status = document.getElementById("loginstatus").value;
if(status=="false"){
if(window.confirm("你未登录哦,要先去首页登录吗?")){
var url = '/progressus/signin.jsp';
window.location.href=url;
}else{
return false;
}
}else{
if(opr=="1"){
var url = '/sectorProjects/add.do';
window.location.href=url;
}else if(opr=="2"){
var url = '/sectorProjects/update.do?projectid='+proid;
window.location.href=url;
}else if(opr=="3"){
if(window.confirm("将会把项目关联的操作日志一起删除,确定要删除吗?")){
var url = '/sectorProjects/delete.do?projectid='+proid;
window.location.href=url;
return true;
}else{
return false;
}
}else{
alert("操作码有误,是否有非法操作,请联系软件质量室!");
return false;
}
}
}
</script>
</head>
<body>
<div align="center" style="width: 100%">
<table width="100%" border="0" align="center" cellpadding="0"
cellspacing="0">
<tr>
<td width="12%" height="30"align="left" valign="baseline"><h2>所属室信息</h2></td>
</tr>
</table>
</div>
<sf:form method="post" modelAttribute="sectorprojects">
<table width="100%" align="center" class="bordered">
<tr bgcolor="#B9DCFF">
<th height="40" nowrap="nowrap" bgcolor="#B9DCFF">项目编号</th>
<th height="40" nowrap="nowrap">项目名称</th>
<th height="40" nowrap="nowrap" bgcolor="#B9DCFF">项目经理</th>
<th height="40" nowrap="nowrap" bgcolor="#B9DCFF">所属室</th>
<th height="40" nowrap="nowrap" bgcolor="#B9DCFF">室经理</th>
</tr>
<c:forEach var="t" items="${splist}" begin="0" step="1"
varStatus="i">
<tr>
<td height="25" align="center">${t.projectid }&nbsp;</td>
<td height="25" align="center">${t.projectname }&nbsp;</td>
<td height="25" align="center">${t.projectmanager }&nbsp;</td>
<td height="25" align="center">${t.secondarySector.departmentname }&nbsp;</td>
<td height="25" align="center">${t.secondarySector.departmenthead }&nbsp;</td>
</tr>
</c:forEach>
</table>
<center>
<div id="pagelist" align="center">
<c:if test="${allRows!=0 }">
<ul>
<li><a href="#" onclick="return setPage(1)">首页 </a></li>
<li><a href="#" onclick="return frontPageCheck(${page-1});">上一页</a></li>
<li><a href="#" onclick="return backPageCheck(${page+1});">下一页</a></li>
<li><a href="#" onclick="return setPage(${allPage})">末页</a></li>
<li>第${page}页</li>
<li>共${allRows}条</li>
<li>共${allPage}页</li>
</ul>
</c:if>
<c:if test="${allRows==0 }">
<font color="#FF0000">没有记录!</font> </c:if>
</div></center>
</sf:form>
</body>
</html>

View File

@ -59,7 +59,9 @@
<a href="#" onclick="showDiv(0,5)" style="text-decoration: none;">
<span class="btnold STYLE1" style="width:70px;background:#FFA54F;border:#FFA54F;"> 添加角色</span></a>&nbsp;&nbsp;
<a href="#" onclick="showDiv(0,4)" style="text-decoration: none;">
<span class="btnold STYLE1" style="width:70px;background:#FFA54F;border:#FFA54F;"> 权限管理</span></a>
<span class="btnold STYLE1" style="width:70px;background:#FFA54F;border:#FFA54F;"> 权限管理</span></a>&nbsp;&nbsp;
<a href="#" onclick="showDiv(0,6)" style="text-decoration: none;">
<span class="btnold STYLE1" style="width:70px;background:#FFA54F;border:#FFA54F;"> 项目管理</span></a>
</td>
</tr>
</table>
@ -178,6 +180,9 @@
}else if(opr=="5"){
var url = '/userInfo/roleadd.do';
window.location.href=url;
}else if(opr=="6"){
var url = '/sectorProjects/list.do';
window.location.href=url;
}else{
alert("操作码有误,是否有非法操作,请联系软件质量室!");
return false;