Commit 53081294 by Java-曹文达

流程列表获取修改 页面展示

parent bbc6803a
package com.bbd.bpm.controller.deployment;
import com.bbd.bpm.base.PageBean;
import com.bbd.bpm.domain.ActReModelEntity;
import com.bbd.bpm.dto.SysCode;
import com.bbd.bpm.dto.response.BpmResponse;
import com.bbd.bpm.dto.request.StartModelRequest;
import com.bbd.bpm.result.Result;
import com.bbd.bpm.service.ActReModelService;
import com.bbd.bpm.util.validate.ValidateUtil;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
......@@ -47,13 +51,24 @@ public class DeploymentController {
@Autowired
private IdentityService identityService;
@Autowired
private ActReModelService actReModelService;
@ApiOperation(value = "查询流程列表")
@GetMapping("/modelList")
public BpmResponse modelList() {
@RequestMapping(value = "/modelList")
public BpmResponse modelList(PageBean pageBean) {
BpmResponse resp = new BpmResponse();
try{
List<ProcessDefinition> processDefinitionList = repositoryService.createProcessDefinitionQuery().list();
resp.setData(processDefinitionList);
if(pageBean.getPageNum()==0){
pageBean.setPageNum(1);
}
if (pageBean.getPageSize()==0) {
pageBean.setPageSize(10);
}
//获取流程列表
Result result= actReModelService.getList(pageBean);
resp.setData(result);
resp.setCode(SysCode.SUCCESS_CODE);
resp.setSuccess(true);
resp.setMessage("获取成功");
......
......@@ -62,6 +62,19 @@ public class UserController {
return "user/organizationList";
}
/**
* @Author:cwd
* @Description:进入流程管理
* @Date: 2019/03/04 22:53
* @Param:
* @return
**/
@RequestMapping(value = "toDeployment")
public String toDeployment(){
return "deployment/deplymentList";
}
/**
* @Author:cwd
......
......@@ -2,6 +2,7 @@ package com.bbd.bpm.dao;
import com.bbd.bpm.base.BaseMapper;
import com.bbd.bpm.domain.ActReModelEntity;
import com.bbd.bpm.domain.BpmCompany;
import com.bbd.bpm.vo.BpmCompanyVo;
import org.apache.ibatis.annotations.Param;
......@@ -26,4 +27,6 @@ public interface UserInfoMapper extends BaseMapper<BpmCompany>{
void deleteDepartment(@Param("id") Long id);
void deleteDepartments(@Param("id") Long id);
List<ActReModelEntity> getList();
}
......@@ -74,4 +74,23 @@
update bpm_company set status=2 where id=#{id}
</update>
<select id="getList" resultType="com.bbd.bpm.domain.ActReModelEntity">
SELECT
ID_ id,
REV_ revision,
NAME_ AS name,
KEY_ ,
CATEGORY_ category,
CREATE_TIME_ createTime,
LAST_UPDATE_TIME_ updateTime,
VERSION_ version,
META_INFO_ metaInfo,
DEPLOYMENT_ID_ deploymentId,
EDITOR_SOURCE_EXTRA_VALUE_ID_ editorSourceExtraValueId,
EDITOR_SOURCE_VALUE_ID_ editorSourceValueId,
TENANT_ID_ tenantId
FROM
act_re_model
</select>
</mapper>
\ No newline at end of file
package com.bbd.bpm.domain;
import com.bbd.bpm.base.BaseEntity;
import lombok.Data;
import javax.persistence.*;
import java.sql.Timestamp;
/**
* Created by houkang on 2019/2/22.
*/
* @ClassName ActReModel
* @Description 流程表
* @Author cwd
* @Date 2019/4/3 13:59
* @Version 1.0
**/
@Entity
@Table(name = "act_re_model")
public class ActReModelEntity {
private String id;
private Integer rev;
private String name;
private String key;
private String category;
private Timestamp createTime;
private Timestamp lastUpdateTime;
private Integer version;
private String metaInfo;
private String tenantId;
@Table(name = "acr_re_model")
@Data
public class ActReModelEntity extends BaseEntity{
@Id
@GeneratedValue(strategy= GenerationType.AUTO)
@Column(name = "ID_")
public String getId() {
return id;
}
private Long id;
public void setId(String id) {
this.id = id;
}
@Basic
@Column(name = "REV_")
public Integer getRev() {
return rev;
}
public void setRev(Integer rev) {
this.rev = rev;
}
private String revision;
@Basic
@Column(name = "NAME_")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
private String name;
@Basic
@Column(name = "KEY_")
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
private String KEY_;
@Basic
@Column(name = "CATEGORY_")
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
@Basic
@Column(name = "CREATE_TIME_")
public Timestamp getCreateTime() {
return createTime;
}
public void setCreateTime(Timestamp createTime) {
this.createTime = createTime;
}
@Basic
@Column(name = "LAST_UPDATE_TIME_")
public Timestamp getLastUpdateTime() {
return lastUpdateTime;
}
public void setLastUpdateTime(Timestamp lastUpdateTime) {
this.lastUpdateTime = lastUpdateTime;
}
private String category;
@Basic
@Column(name = "VERSION_")
public Integer getVersion() {
return version;
}
public void setVersion(Integer version) {
this.version = version;
}
private Integer version;
@Basic
@Column(name = "META_INFO_")
public String getMetaInfo() {
return metaInfo;
}
public void setMetaInfo(String metaInfo) {
this.metaInfo = metaInfo;
}
private String metaInfo;
@Basic
@Column(name = "TENANT_ID_")
public String getTenantId() {
return tenantId;
}
@Column(name ="DEPLOYMENT_ID_" )
private String deploymentId;
public void setTenantId(String tenantId) {
this.tenantId = tenantId;
}
@Column(name = "EDITOR_SOURCE_VALUE_ID_")
private String editorSourceValueId;
@Column(name = "EDITOR_SOURCE_EXTRA_VALUE_ID_")
private String editorSourceExtraValueId;
@Column(name = "TENANT_ID_")
private String tenantId;
}
package com.bbd.bpm.service;
import com.bbd.bpm.base.PageBean;
import com.bbd.bpm.result.Result;
public interface ActReModelService {
Result getList(PageBean pageBean);
}
package com.bbd.bpm.serviceImpl;
import com.bbd.bpm.base.PageBean;
import com.bbd.bpm.dao.UserInfoMapper;
import com.bbd.bpm.domain.ActReModelEntity;
import com.bbd.bpm.result.RespCode;
import com.bbd.bpm.result.Result;
import com.bbd.bpm.result.ResultUtil;
import com.bbd.bpm.service.ActReModelService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
@Service
public class ActReModelServiceImpl implements ActReModelService{
@Autowired
private UserInfoMapper userInfoMapper;
@Override
public Result getList(PageBean pageBean) {
PageHelper.startPage(pageBean.getPageNum(), pageBean.getPageSize());
List<ActReModelEntity> list = userInfoMapper.getList();
PageInfo<ActReModelEntity> pageInfo = new PageInfo<>(list);
return ResultUtil.getResult(RespCode.Code.SUCCESS, pageInfo);
}
}
......@@ -39,16 +39,16 @@
<!--左边导航-->
<div class="main_wrap clearfix" >
<ul id="aside_nav" class="navBox" style='width:125px;min-height: 680px;'>
<li class="s_menu_item"><a target="main_frame" href="/bpm/user/welcome">查看流程</a></li>
<li class="s_menu_item"><a target="main_frame" href="/bpm/user/toDeployment">查看流程</a></li>
<li class="s_menu_item"><a target="main_frame" href="/model/createNew">创建流程</a></li>
<li class="s_menu_item"><a target="main_frame" href="/model/createNew">组织结构</a></li>
<li class="s_menu_item"><a target="main_frame" href="/bpm/user/toOrganization">组织结构</a></li>
<li class="s_menu_item"><a target="main_frame" href="/swagger-ui.html">API</a></li>
</ul>
</div>
<!--end 左边导航-->
<div class="mainContentBox">
<iframe id="main_frame" width="100%" height="100%" frameborder="0" onload="" name="main_frame" src="/bpm/user/welcome"
<iframe id="main_frame" width="100%" height="90%" frameborder="0" onload="" name="main_frame" src="/bpm/user/welcome"
style="overflow:hidden; position:absolute;"></iframe>
</div><!--主体内容-->
......
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link rel="stylesheet" th:href="@{/css/common/base.css}" />
<link rel="stylesheet" th:href="@{/css/common/page_new.css}" />
<link rel="stylesheet" th:href="@{/js/plugins/bootstrapselect/css/product_list.css}" />
</head>
<style type="text/css">
.box .search_pro .cx input{
background: #00B983;
width: 100px;
height: 39px;
color:white;
margin-right: 10px;
padding: 10px -1px;
}
.content p span input{
background: #00B983;
color:white;
margin-right: 10px;
padding: 10px 20px;
border:1px solid #EEEEEE;
text-indent: 5px;
}
</style>
<body>
<div class="box">
<h2><span></span>流程列表<button onclick="location.reload()">刷新</button></h2>
<div class="search">
<p class="title">筛选查询</p>
<p class="search_pro">
<span><b>流程名称:</b><input type="text" name="teamName" placeholder="请输入"/></span>
<span class="cx">
<input type="button" style=" border: 1px solid #000000;background-color: #2b2b2b;width: 64px;height: 35px;color: white;border-radius: 0px;text-align: center;line-height: 30px;" value="查询" onclick="getBargainProduct()">
</span>
</p>
</div>
<div class="content">
<p class="title list_ti"><span>数据列表</span></p>
<table border="" cellspacing="" cellpadding="">
</table>
</div>
<div class="footer" style="display: flex;justify-content: space-between;align-items:center;padding:10px 10px;border:1px solid #e4e4e4;font-size:14px;color:#999">
<div style="flex-grow: 1;display: flex;justify-content: flex-end;">
<p style="line-height:33px"><span style="color:#d00" id="pages">0</span>页/<span style="color:#d00" id="total">0</span>条数据</p>
<div class="pagediv" style="clear:both;"></div>
</div>
</div>
</div>
</body>
</html>
<script src="/js/plugins/jquery.min.js"></script>
<script src="/js/plugins/layer/layer.js"></script>
<script type="text/javascript" src="/js/plugins/page_new.js"></script>
<script type="text/javascript">
$(function(){
$.post(
"/api/bpm/model/modelList",
{
pageSize:10,
pageNum:1,
teamName:"",
status:""
},
function (data) {
var size = data.data.data.pages;
if (!data.data.data.pages){
size = 0;
}
var current = data.data.data.pageNum;
/*分页*/
$(".pagediv").createPage({
pageNum: size,//总页码
current: current,//当前页
shownum: 10,//每页显示个数
showPageNum: true, //显示总页数
showToPage: true, //显示跳转页码
backfun: function (page) {
flushHtml(page.current);
}
});
},
'json'
);
flushHtml();
});
function flushHtml(current) {
var pageNum = 1;
if(current){
pageNum = current;
}
var teamName = $("[name='teamName']").val();
var status = $("[name='status']").val();
$.post(
"/api/bpm/model/modelList",
{
pageSize:10,
pageNum:pageNum,
teamName:teamName,
status:status
},
function (data) {
selectListAll(data.data.data);
},'json'
);
}
function selectListAll(data) {
var pages = data.pages;
var total = data.total;
data = data.list;
var content = '';
content += '<tr><th>编号</th><th>流程名称</th><th style="width: 8%">KEY</th><th>创建时间</th><th style="width: 8%">更新时间</th><th style="width: 8%">META_INFO_</th><th style="width: 8%">版本</th><th style="width: 15%">操作</th></tr>';
if(data!=null){
for (var i in data) {
content += '<tr>';
content += '<td class="product_name" style="width: 5%;">'+data[i].id+'</td>';
content += '<td class="product_num">'+data[i].name+'</td><td class="product_num">'+data[i].KEY_+'</td>';
content += '<td class="product_num">'+data[i].createTime+'</td><td class="product_num">'+data[i].updateTime+'</td>';
content += '<td class="product_num">'+data[i].metaInfo+'</td><td class="product_num">'+data[i].version+'</td>';
content += '<td class="cao_zuo"><span onclick="toActivityDetail('+data[i].id+')">查看</span></span><span onclick="toActivityMember(\'+data[i].id+\')">启动流程</span><span onclick="toActivityMember('+data[i].id+')">删除</span></td></tr>';
}
$('#pages').text(pages);
$('#total').text(total);
}else{
content+= '<div class="tipImg"><img src="/images/non.png" ><p class="tipNon">暂无数据</p></div>';
$('#pages').text(0);
$('#total').text(0);
}
$('table').html(content);
}
/*条件查询*/
function getBargainProduct() {
var teamName = $("[name='teamName']").val();
var status = $("[name='status']").val();
$.post("activityList",
{
pageSize:10,
pageNum:1,
teamName:teamName,
status:status
},function (data) {
selectListAll(data.data);
var size = data.data.pages;
if (!data.data.pages){
size = 0;
}
/*分页*/
$(".pagediv").createPage({
pageNum: size,//总页码
current: 1,//当前页
shownum: 10,//每页显示个数
showPageNum: true, //显示总页数
showToPage: true, //显示跳转页码
backfun: function (page) {
flushHtml(page.current);
}
});
},'json')
}
/*跳转活动详情页 */
function toActivityDetail(id) {
location.href="/activityManage/toActivityInfo?activityId="+id+"&type=1";
}
/*跳转活动人员列表 */
function toActivityMember(id) {
location.href="/activityManage/toActivityMember?activityId="+id;
}
</script>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment