Commit 213a9961 by 罗绍泽

activiti整合(一)

parent 44cadacd
......@@ -124,6 +124,41 @@
<property name="filters" value="stat" />
</bean>
<!-- 增加数据源dataSource-business -->
<bean id="dataSource-activiti" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method="close">
<!-- 基本属性 url、user、password -->
<property name="url" value="jdbc:mysql://192.168.1.116:3306/lcyq_activiti?useUnicode=true&amp;characterEncoding=utf8&amp;autoReconnect=true&amp;useSSL=false" />
<property name="username" value="lcyq_activiti" />
<property name="password" value="lcyq_activiti" />
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<!-- 配置初始化大小、最小、最大 -->
<property name="initialSize" value="1" />
<property name="minIdle" value="1" />
<property name="maxActive" value="20" />
<!-- 配置获取连接等待超时的时间 -->
<property name="maxWait" value="60000" />
<!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 -->
<property name="timeBetweenEvictionRunsMillis" value="60000" />
<!-- 配置一个连接在池中最小生存的时间,单位是毫秒 -->
<property name="minEvictableIdleTimeMillis" value="300000" />
<property name="validationQuery" value="SELECT 'x'" />
<property name="testWhileIdle" value="true" />
<property name="testOnBorrow" value="false" />
<property name="testOnReturn" value="false" />
<!-- 打开PSCache,并且指定每个连接上PSCache的大小 -->
<property name="poolPreparedStatements" value="true" />
<property name="maxPoolPreparedStatementPerConnectionSize" value="20" />
<!-- 配置监控统计拦截的filters,去掉后监控界面sql无法统计 -->
<property name="filters" value="stat" />
</bean>
<!-- 增加事务transactionManager-system -->
<bean id="transactionManager-system" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource-system"/>
......@@ -157,6 +192,17 @@
</property>
</bean>
<!-- 增加事务transactionManager-business -->
<bean id="transactionManager-activiti" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource-activiti"/>
</bean>
<bean id="transactionInterceptor-activiti" parent="abstractTransactionInterceptor">
<property name="transactionManager">
<ref bean="transactionManager-activiti"/>
</property>
</bean>
<!-- 自动创建事务代理 -->
<bean class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
<property name="beanNames">
......@@ -169,6 +215,7 @@
<value>transactionInterceptor-system</value>
<value>transactionInterceptor-standard</value>
<value>transactionInterceptor-business</value>
<value>transactionInterceptor-activiti</value>
</list>
</property>
</bean>
......@@ -206,4 +253,5 @@
<import resource="business-standard.xml"/>
<import resource="business-test.xml"/>
<import resource="business-process.xml"/>
<import resource="business-activiti.xml"/>
</beans>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<!-- spring负责创建流程引擎的配置文件 -->
<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
<!-- 数据源 -->
<property name="dataSource" ref="dataSource-activiti" />
<!-- 配置事务管理器,统一事务 -->
<property name="transactionManager" ref="transactionManager-activiti" />
<!-- 设置建表策略,如果没有表,自动创建表 -->
<property name="databaseSchemaUpdate" value="true" />
</bean>
<!-- 创建流程引擎对象 -->
<bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean">
<property name="processEngineConfiguration" ref="processEngineConfiguration" />
</bean>
<!--
相当于下面的代码
RepositoryServicie repositoryService = processEngine.getRepositoryService();
RuntimeServicie repositoryService = processEngine.getRuntimeServicie();
TaskServicie taskServicie = processEngine.getTaskServicie();
HistoryServicie historyServicie = processEngine.getHistoryServicie();
-->
<!-- 由流程引擎对象,提供的方法,创建项目中使用的Activiti工作流的Service -->
<bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService" />
<bean id="runtimeService" factory-bean="processEngine" factory-method="getRuntimeService" />
<bean id="taskService" factory-bean="processEngine" factory-method="getTaskService" />
<bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService" />
<bean id="formService" factory-bean="processEngine" factory-method="getFormService" />
</beans>
......@@ -7,6 +7,8 @@
<property name="mapperLocations">
<list>
<value>classpath:com/gaowj/business/formtable/formtableDAO.xml</value>
<value>classpath:com/gaowj/business/procdefinition/procdefinitionDAO.xml</value>
<value>classpath:com/gaowj/business/procdefinitionmodels/procdefinitionmodelsDAO.xml</value>
</list>
</property>
</bean>
......@@ -15,7 +17,27 @@
<property name="formtableDAO">
<bean class="org.mybatis.spring.mapper.MapperFactoryBean">
<property name="mapperInterface" value="com.gaowj.business.formtable.formtableDAO" />
<property name="sqlSessionFactory" ref="sqlSessionFactory-test" />
<property name="sqlSessionFactory" ref="sqlSessionFactory-process" />
</bean>
</property>
</bean>
<bean id="procdefinitionBusiness" class="com.gaowj.business.procdefinition.ProcdefinitionBusinessImpl">
<property name="procdefinitionDAO">
<bean class="org.mybatis.spring.mapper.MapperFactoryBean">
<property name="mapperInterface" value="com.gaowj.business.procdefinition.procdefinitionDAO" />
<property name="sqlSessionFactory" ref="sqlSessionFactory-process" />
</bean>
</property>
<property name="repositoryService" ref="repositoryService"></property>
</bean>
<bean id="procdefinitionmodelsBusiness" class="com.gaowj.business.procdefinitionmodels.ProcdefinitionmodelsBusinessImpl">
<property name="procdefinitionmodelsDAO">
<bean class="org.mybatis.spring.mapper.MapperFactoryBean">
<property name="mapperInterface" value="com.gaowj.business.procdefinitionmodels.procdefinitionmodelsDAO" />
<property name="sqlSessionFactory" ref="sqlSessionFactory-process" />
</bean>
</property>
</bean>
......
......@@ -35,6 +35,7 @@
<script type="text/javascript" src="<%=localPath %>/js/ajaxfileupload.js"></script>
<script type="text/javascript" src="<%=localPath %>/jwapp/common/js/lang_json.js"></script>
<script type="text/javascript" src="<%=localPath %>/jwapp/common/js/common_util.js"></script>
<script type="text/javascript" src="<%=localPath %>/jwapp/common/js/common_luosz_util.js"></script>
<script type="text/javascript" src="<%=commonPath %>/ria/jquery/zTree_v3/js/jquery.ztree.core-3.5.js"></script>
<script type="text/javascript" src="<%=commonPath %>/ria/jquery/zTree_v3/js/jquery.ztree.excheck-3.5.js"></script>
......
......@@ -301,3 +301,6 @@
.icon-ext-02_25{
background:url('../../../../images/icons/(02,25).png') no-repeat left center;
}
.icon-ext-04_46{
background:url('../../../../images/icons/(04,46).png') no-repeat left center;
}
var commonutil = {
/**
* 往object的所有key统一添加前缀
*/
keyAddStr : function(object, str) {
if (typeof str == 'undefined' || str == null || str == '') {
str = 'FIELD_';
}
var news = {};
for (key in object) {
news[str + key] = object[key];
}
return news;
}
};
\ No newline at end of file
......@@ -14,11 +14,13 @@ formtableModule.prototype.insertFormTable = function(){};
formtableModule.prototype.updateFormTable = function(){};
//删除附件数据
formtableModule.prototype.deleteFormTable = function(){};
//获取所有的表数据
formtableModule.prototype.listFormTable = function(){};
//创建一个数据操作对象,然后再后续使用
formtableModule.act = new formtableModule("json").delegate("formtableAct");
//创建一个数据获取对象,然后再后续使用
formtableModule.date = new formtableModule("json").delegate("formtableData");
formtableModule.data = new formtableModule("json").delegate("formtableData");
//说明: 1、所有方法里统一传递josn格式的参数,用于后台交互,如data.listTables(param) ,如没有参数则传'{}',如data.listTables({})
// 2、前后台数据获取传输协议 如:json[{'0':{pageCount':'2','pageNo':'1','pageSize':'20','rowSet':'[{0},{1}....]'}}]
......
//此乃本模块与后台交互的方法接口部分
var procdefinitionModule = function(format) {
this.module = "";
this.action = "";
this.format = format;
};
//定义数据交互
procdefinitionModule.prototype = BusinessObject;
//插入流程定义
procdefinitionModule.prototype.insertProcdefinition = function(){};
//修改流程定义
procdefinitionModule.prototype.updateProcdefinition = function(){};
//删除流程定义
procdefinitionModule.prototype.deleteProcdefinition = function(){};
//创建一个数据操作对象,然后再后续使用
procdefinitionModule.act = new procdefinitionModule("json").delegate("procdefinitionAct");
//创建一个数据获取对象,然后再后续使用
procdefinitionModule.data = new procdefinitionModule("json").delegate("procdefinitionData");
//说明: 1、所有方法里统一传递josn格式的参数,用于后台交互,如data.listTables(param) ,如没有参数则传'{}',如data.listTables({})
// 2、前后台数据获取传输协议 如:json[{'0':{pageCount':'2','pageNo':'1','pageSize':'20','rowSet':'[{0},{1}....]'}}]
// 3、前后台增删改的返回状态 如:json[{'0':{'rowSet':{'NAME':'-1','VALUE':'保存失败'}}}]
/**
* 序号:1
* 功能:定义分页(EasyUI)
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:无需更改
**/
var ls_width = $(window).width();
var ls_height = $(window).height();
var local_page=1;
var rows=20;
var listPageSize = [10,20,50,100,500,1000];
var queryData = eval("({'page':'"+local_page+"','rows':'"+rows+"'})");
var tab_n = 0;
//重置分页参数
function resetQueryData(){
queryData = "";
queryData = eval("({'page':'"+local_page+"','rows':'"+rows+"'})");
}
//定义附件关联模块ID(1:一般业务,2:测试信息,3:审批业务,999:其它数据 )
var ls_module_id='2';
//定义当前模块业务类型(YBYW:一般业务,SPGL:审批业务)
var ls_ywlx = 'YBYW';
/****/
/**
* 序号:2
* 功能:构建下拉框内容
* 参数:
* 说明:方便新增、修改页面里的下拉选项加载数据
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
var v_formtable_data=formtableModule.data.listFormTable();
/****/
/**
* 序号:3
* 功能:构建主页面列表
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
//定义grid列表
var ls_title="流程定义";
var is_column = [ [
{field : 'PROC_NAME',title : '流程名',width : 100,align : 'center'},
{field : 'DEPLOYMENT_KEY',title : 'KEY',width : 80,align : 'center'},
{field : 'CONTENT',title : '关联表',width : 80,align : 'center'}
] ];
//列表加载完成回调
function dataOnLoadSuccess(){
}
//设置颜色和每行高度
function rowstyler(index,row){
if(row.STATUS == '1'){
return 'color:green;height:30px;';
}
else{
return 'color:blue;height:30px;';
}
}
//展示列表
datagrid("list", ls_title, gaowj.WEB_APP_NAME + "/procdefinitionData_list", queryData, is_column, 60, 80);
/****/
/**
* 序号:4
* 功能:设置主页面操作列菜单
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
//操用列显示更多(一般情况下无需更改)
function formatMenu(value, data,index) {
var returnData="";
return returnData
+ "<span class=\"icon-ext-moremenu\" style=\"padding-left:20px;*width:20px;\"></span>"
+ "<span data-p1="+index+" class=\"easyui-tooltip\" style=\"color:blue;cursor:pointer;\">更多</span>";
}
//上浮横向菜单集里的具体菜单项(需更改)
function getOptionMenu(data,index){
var returnData= "<span class=\"icon-edit\" style=\"padding-left:20px;*width:20px;\"></span><a href=\"javascript:void(0);\" onclick=\"editRow('"
+ index + "')\">编辑</a> | <span class=\"icon-clear\" style=\"padding-left:20px;*width:20px;\"></span><a href=\"javascript:void(0);\" onclick=\"deleteRow('"
+ index + "')\">删除</a> | <span class=\"icon-ext-file\" style=\"padding-left:20px;*width:20px;\"></span><a href=\"javascript:void(0);\" onclick=\"modelList('"
+ index + "')\">模板</a>";
return returnData;
}
//返回菜单集的菜单个数(需更改)
function getOptionMenuCount(){
var is_menu_count = 3;
return is_menu_count;
}
/****/
/**
* 序号:5
* 功能:新增修改弹出
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
//加载增加子页面
function addRow(){
var is_row={OPETYPE:'insert'};
openEditRow("procdefinitionView_procdefinitionTabDetail",is_row,"新增",true,0.65,0.95,0,0);
}
//加载增加子页面成功后的回调
function addUrlOnloadCallback(is_row){
$('#TABLE_ID').combobox({
data : v_formtable_data.rowSet,
valueField : 'UUID',
textField : 'CONTENT',
editable:false,
panelHeight:'auto'
});
}
//保存
function insertData(is_entity){
var v_result = procdefinitionModule.act.insertProcdefinition(is_entity);
$('#list').datagrid('reload');
return v_result;
}
//加载修改子页面
function editRow(index) {
$('#list').datagrid('selectRow',index);
var is_row = $('#list').datagrid('getSelections');
$('#list').datagrid('clearSelections');
is_row[0].OPETYPE = 'update';
openEditRow("procdefinitionView_procdefinitionTabDetail",is_row[0],"编辑",true,0.65,0.95,0,0);
}
//加载修改子页面成功后的回调
function updateUrlOnloadCallback(is_row){
$("#inputForm").form('load',commonutil.keyAddStr(is_row));
$('#TABLE_ID').combobox({
data : v_formtable_data.rowSet,
valueField : 'UUID',
textField : 'CONTENT',
editable:false,
panelHeight:'auto'
});
}
//保存
function updateData(is_entity){
v_result = procdefinitionModule.act.updateProcdefinition(is_entity);
$('#list').datagrid('reload');
return v_result;
}
/****/
/**
* 序号:6
* 功能:单个删除
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function deleteRow(index){
$('#list').datagrid('selectRow',index);
var is_row = $('#list').datagrid('getSelections');
$('#list').datagrid('clearSelections');
var code = is_row[0].UUID;
$.messager.confirm('提示', '确定删除?', function(r) {
if (r) {
var v_query = {};
v_query.FIELD_CODE = code;
var v_result = procdefinitionModule.act.deleteProcdefinition(v_query);
$.messager.alert('提示',v_result.VALUE);
$('#list').datagrid('reload');
}
});
}
/****/
/**
* 序号:7
* 功能:批量删除
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function deleteBatchRow(){
var code="";
var rows = $('#list').datagrid('getSelections');
for(var i=0; i<rows.length; i++){
code = code + rows[i].UUID+",";
}
if(rows == null || rows == ""){
$.messager.alert('提示',"请选择需删除的记录!",'info');
return;
}
if(code.length>0){
code = code.substring(0,code.length - 1);
}
$.messager.confirm('提示', '确定删除?', function(r) {
if (r) {
var v_query = {};
v_query.FIELD_CODE = code;
var v_result = procdefinitionModule.act.deleteProcdefinition(v_query);
$.messager.alert('提示',v_result.VALUE);
$('#list').datagrid('reload');
}
});
}
/****/
/**
* 序号:8
* 功能:刷新
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function refreshRow(){
$('#list').datagrid('load',{});
$("#studentTab_searchForm")[0].reset();
}
/****/
/**
* 序号:9
* 功能:查询
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function searchRow(){
var v_query = $("#procdefinitionTab_searchForm").getFormVal();
$('#list').datagrid('load',v_query);
}
/****/
/**
* 序号:10
* 功能:高级查询弹出
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
//加载高级查询子页面
function advsearchRow(){
var is_row={OPETYPE:'ww'};
openAdvsearchRow("studentView_studentAdvsearch",is_row,"高级查询",true,0.65,0.95,0,0);
}
//加载高级查询子页面成功后的回调
function addAdvsearchCallback(is_row){
$('#adv_STATUS').combobox({
data : v_statusquery_data,
valueField : 'CODE_ID',
textField : 'CODE_NAME',
editable:false,
panelHeight:'auto'
});
$('#adv_SEX').combobox({
data : v_sexquery_data.rowSet,
valueField : 'CODE_ID',
textField : 'CODE_NAME',
editable:false,
panelHeight:'auto'
});
$('#adv_NATION').combobox({
data : v_nationquery_data.rowSet,
valueField : 'CODE_ID',
textField : 'CODE_NAME',
editable:false,
panelHeight:'200'
});
}
//高级查询
function advsearchData(is_entity){
is_entity.FIELD_START_TIME = strToDateObj(is_entity.FIELD_START_TIME);
is_entity.FIELD_END_TIME = strToDateObj(is_entity.FIELD_END_TIME);
$('#list').datagrid('load',is_entity);
}
/****/
/**
* 序号:11
* 功能:处理接口附件
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function uploadcommonRow(index){
$('#list').datagrid('selectRow',index);
var is_row = $('#list').datagrid('getSelections');
$('#list').datagrid('clearSelections');
var code = is_row[0].UUID;
var is_row={MAINDATA_ID:code,MODULE_ID:ls_module_id};
var editUrl = "uploadFileCommonView_uploadfileCommonTab?FIELD_MODULE_ID="+ls_module_id+"&FIELD_MAINDATA_ID="+code;
openViewIframRow("uploadcommon",editUrl,is_row,"毕业证附件",true,0.65,0.95,0,0);
}
/****/
/**
* 序号:12
* 功能:批量处理接口附件
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function uploadcommonBatchRow(){
var code="";
var rows = $('#list').datagrid('getSelections');
for(var i=0; i<rows.length; i++){
code = code + rows[i].UUID+",";
}
if(rows == null || rows == ""){
$.messager.alert('提示',"请选择记录!",'info');
return;
}
if(code.length>0){
code = code.substring(0,code.length - 1);
}
var is_row={MAINDATA_ID:code,MODULE_ID:ls_module_id};
var editUrl = "uploadFileCommonView_uploadfileCommonTab?FIELD_MODULE_ID="+ls_module_id+"&FIELD_MAINDATA_ID="+code;
openViewIframRow("uploadcommon",editUrl,is_row,"批量毕业证附件",true,0.65,0.95,0,0);
}
/****/
function replaceByJson(text,json){
for(key in json){
text = text.replace('@{'+key+'}',json[key]);
}
return text;
}
function modelList(index){
$('#list').datagrid('selectRow',index);
var is_row = $('#list').datagrid('getSelections');
$('#list').datagrid('clearSelections');
openViewIframRow("iframedetail","procdefinitionmodelsView_procdefinitionmodelsTab?procId="+is_row[0].UUID,is_row[0],"流程模板列表",true,0.95,0.95,0,0);
}
function closeCallback(is_row){
console.log(is_row);
}
<%@page contentType="text/html; charset=UTF-8"%>
<%@ include file="/gaowj/header-simple-1.0.jsp"%>
<div id="procdefinitionTab">
<link rel="stylesheet" type="text/css" href="${ctx}/jwapp/common/css/content_body.css" charset="utf-8"></link>
<link rel="stylesheet" type="text/css" href="${ctx}/jwapp/common/css/content_table.css" charset="utf-8"></link>
<link rel="stylesheet" type="text/css" href="${ctx}/jwapp/common/css/content_input.css" charset="utf-8"></link>
</div>
<table id="list" style="width: 100%; height: 100%;"></table>
<div id="tb">
<form id="procdefinitionTab_searchForm" style="float:left">
流程名称: <input class="easyui-textbox" id="FIELD_PROC_NAME" name="FIELD_PROC_NAME" style="width:200px"/>&nbsp;&nbsp;
</form>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true" onclick="javascript:searchRow()">查询</a>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-ext-advsearch',plain:true" onclick="javascript:advsearchRow()">高级查询</a>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true" onclick="javascript:refreshRow()">刷新</a>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" onclick="javascript:addRow()">新增</a>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-clear',plain:true" onclick="javascript:deleteBatchRow()">删除</a>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-ext-file',plain:true" onclick="javascript:uploadcommonBatchRow()">附件</a>
</div>
<div id="detail" style="overflow:auto;"></div>
<div id="iframedetail" style="overflow:auto;"></div>
<script type="text/javascript" src="${ctx}/jwapp/pages/standard/js/jwStandardModule.js" charset="utf-8"></script>
<script type="text/javascript" src="${ctx}/process/pages/procdefinition/js/procdefinitionModule.js" charset="utf-8"></script>
<script type="text/javascript" src="${ctx}/process/pages/formtable/js/formtableModule.js" charset="utf-8"></script>
<script type="text/javascript" src="${ctx}/process/pages/procdefinition/js/procdefinitionTab.js" charset="utf-8"></script>
<%@page contentType="text/html; charset=UTF-8"%>
<form id="inputForm" method="post" style="width: 100%;">
<input type="hidden" name="FIELD_OPETYPE" id="OPETYPE" value="${is_row.OPETYPE}" /> <input type="hidden" name="FIELD_UUID" id="UUID" value="${is_row.UUID}" />
<table align="center" border="0" cellpadding="0" cellspacing="0" class="tableStyle" style="margin: 10px 15px; width: 95%; line-height: 30px;">
<tr>
<td style="width: 15%;" class="tableStyleLable">
<span>流程名称:</span>
</td>
<td style="width: 74%">
<input class="easyui-textbox" id="PROC_NAME" name="FIELD_PROC_NAME" style="width:200px" />
</td>
</tr>
<tr>
<td class="tableStyleLable">
<span>表:</span>
</td>
<td>
<input class="easyui-textbox" id="TABLE_ID" name="FIELD_TABLE_ID" style="width:200px" />
</td>
</tr>
<tr>
<td class="tableStyleLable">
<span>KEY:</span>
</td>
<td>
<input class="easyui-textbox" id="DEPLOYMENT_KEY" name="FIELD_DEPLOYMENT_KEY" style="width:200px" />
</td>
</tr>
</table>
</form>
\ No newline at end of file
//此乃本模块与后台交互的方法接口部分
var procdefinitionmodelsModule = function(format) {
this.module = "";
this.action = "";
this.format = format;
};
//定义数据交互
procdefinitionmodelsModule.prototype = BusinessObject;
//插入流程定义
procdefinitionmodelsModule.prototype.insertProcdefinitionmodels = function(){};
//修改流程定义
procdefinitionmodelsModule.prototype.updateProcdefinitionmodels = function(){};
//删除流程定义
procdefinitionmodelsModule.prototype.deleteProcdefinitionmodels = function(){};
//创建一个数据操作对象,然后再后续使用
procdefinitionmodelsModule.act = new procdefinitionmodelsModule("json").delegate("procdefinitionmodelsAct");
//创建一个数据获取对象,然后再后续使用
procdefinitionmodelsModule.data = new procdefinitionmodelsModule("json").delegate("procdefinitionmodelsData");
//说明: 1、所有方法里统一传递josn格式的参数,用于后台交互,如data.listTables(param) ,如没有参数则传'{}',如data.listTables({})
// 2、前后台数据获取传输协议 如:json[{'0':{pageCount':'2','pageNo':'1','pageSize':'20','rowSet':'[{0},{1}....]'}}]
// 3、前后台增删改的返回状态 如:json[{'0':{'rowSet':{'NAME':'-1','VALUE':'保存失败'}}}]
/**
* 序号:1
* 功能:定义分页(EasyUI)
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:无需更改
**/
var ls_width = $(window).width();
var ls_height = $(window).height();
var local_page=1;
var rows=20;
var listPageSize = [10,20,50,100,500,1000];
var queryData = eval("({'page':'"+local_page+"','rows':'"+rows+"'})");
var tab_n = 0;
//重置分页参数
function resetQueryData(){
queryData = "";
queryData = eval("({'page':'"+local_page+"','rows':'"+rows+"'})");
}
//定义附件关联模块ID(1:一般业务,2:测试信息,3:审批业务,999:其它数据 )
var ls_module_id='2';
//定义当前模块业务类型(YBYW:一般业务,SPGL:审批业务)
var ls_ywlx = 'YBYW';
/****/
/**
* 序号:2
* 功能:构建下拉框内容
* 参数:
* 说明:方便新增、修改页面里的下拉选项加载数据
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
/****/
/**
* 序号:3
* 功能:构建主页面列表
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
//定义grid列表
var ls_title=null;
var is_column = [ [
{field : 'PROC_NAME',title : '流程名',width : 100,align : 'center'},
{field : 'DEPLOYMENT_KEY',title : 'KEY',width : 80,align : 'center'},
{field : 'CONTENT',title : '关联表',width : 80,align : 'center'}
] ];
//列表加载完成回调
function dataOnLoadSuccess(){
}
//设置颜色和每行高度
function rowstyler(index,row){
if(row.STATUS == '1'){
return 'color:green;height:30px;';
}
else{
return 'color:blue;height:30px;';
}
}
//展示列表
datagrid("list", ls_title, gaowj.WEB_APP_NAME + "/procdefinitionmodelsData_list", queryData, is_column, 60, 80);
/****/
/**
* 序号:4
* 功能:设置主页面操作列菜单
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
//操用列显示更多(一般情况下无需更改)
function formatMenu(value, data,index) {
var returnData="";
return returnData
+ "<span class=\"icon-ext-moremenu\" style=\"padding-left:20px;*width:20px;\"></span>"
+ "<span data-p1="+index+" class=\"easyui-tooltip\" style=\"color:blue;cursor:pointer;\">更多</span>";
}
//上浮横向菜单集里的具体菜单项(需更改)
function getOptionMenu(data,index){
var returnData= "<span class=\"icon-edit\" style=\"padding-left:20px;*width:20px;\"></span><a href=\"javascript:void(0);\" onclick=\"editRow('"
+ index + "')\">编辑</a> | <span class=\"icon-clear\" style=\"padding-left:20px;*width:20px;\"></span><a href=\"javascript:void(0);\" onclick=\"deleteRow('"
+ index + "')\">删除</a> | <span class=\"icon-ext-file\" style=\"padding-left:20px;*width:20px;\"></span><a href=\"javascript:void(0);\" onclick=\"modelList('"
+ index + "')\">模板</a>";
return returnData;
}
//返回菜单集的菜单个数(需更改)
function getOptionMenuCount(){
var is_menu_count = 3;
return is_menu_count;
}
/****/
/**
* 序号:5
* 功能:新增修改弹出
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
//加载增加子页面
function addRow(){
var is_row={OPETYPE:'insert'};
openEditRow("procdefinitionmodelsView_procdefinitionmodelsTabDetail",is_row,"新增",true,0.95,0.95,0,0);
}
//加载增加子页面成功后的回调
function addUrlOnloadCallback(is_row){
}
//保存
function insertData(is_entity){
is_entity.PROCID=$("#PROCID").val();
var v_result = procdefinitionmodelsModule.act.insertProcdefinitionmodels(is_entity);
$('#list').datagrid('reload');
return v_result;
}
//加载修改子页面
function editRow(index) {
$('#list').datagrid('selectRow',index);
var is_row = $('#list').datagrid('getSelections');
$('#list').datagrid('clearSelections');
is_row[0].OPETYPE = 'update';
openEditRow("procdefinitionView_procdefinitionTabDetail",is_row[0],"编辑",true,0.65,0.95,0,0);
}
//加载修改子页面成功后的回调
function updateUrlOnloadCallback(is_row){
$("#inputForm").form('load',commonutil.keyAddStr(is_row));
}
//保存
function updateData(is_entity){
v_result = procdefinitionModule.act.updateProcdefinition(is_entity);
$('#list').datagrid('reload');
return v_result;
}
/****/
/**
* 序号:6
* 功能:单个删除
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function deleteRow(index){
$('#list').datagrid('selectRow',index);
var is_row = $('#list').datagrid('getSelections');
$('#list').datagrid('clearSelections');
var code = is_row[0].UUID;
$.messager.confirm('提示', '确定删除?', function(r) {
if (r) {
var v_query = {};
v_query.FIELD_CODE = code;
var v_result = procdefinitionModule.act.deleteProcdefinition(v_query);
$.messager.alert('提示',v_result.VALUE);
$('#list').datagrid('reload');
}
});
}
/****/
/**
* 序号:7
* 功能:批量删除
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function deleteBatchRow(){
var code="";
var rows = $('#list').datagrid('getSelections');
for(var i=0; i<rows.length; i++){
code = code + rows[i].UUID+",";
}
if(rows == null || rows == ""){
$.messager.alert('提示',"请选择需删除的记录!",'info');
return;
}
if(code.length>0){
code = code.substring(0,code.length - 1);
}
$.messager.confirm('提示', '确定删除?', function(r) {
if (r) {
var v_query = {};
v_query.FIELD_CODE = code;
var v_result = procdefinitionModule.act.deleteProcdefinition(v_query);
$.messager.alert('提示',v_result.VALUE);
$('#list').datagrid('reload');
}
});
}
/****/
/**
* 序号:8
* 功能:刷新
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function refreshRow(){
$('#list').datagrid('load',{});
$("#studentTab_searchForm")[0].reset();
}
/****/
/**
* 序号:9
* 功能:查询
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function searchRow(){
var v_query = $("#procdefinitionTab_searchForm").getFormVal();
$('#list').datagrid('load',v_query);
}
/****/
/**
* 序号:10
* 功能:高级查询弹出
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
//加载高级查询子页面
function advsearchRow(){
var is_row={OPETYPE:'ww'};
openAdvsearchRow("studentView_studentAdvsearch",is_row,"高级查询",true,0.65,0.95,0,0);
}
//加载高级查询子页面成功后的回调
function addAdvsearchCallback(is_row){
$('#adv_STATUS').combobox({
data : v_statusquery_data,
valueField : 'CODE_ID',
textField : 'CODE_NAME',
editable:false,
panelHeight:'auto'
});
$('#adv_SEX').combobox({
data : v_sexquery_data.rowSet,
valueField : 'CODE_ID',
textField : 'CODE_NAME',
editable:false,
panelHeight:'auto'
});
$('#adv_NATION').combobox({
data : v_nationquery_data.rowSet,
valueField : 'CODE_ID',
textField : 'CODE_NAME',
editable:false,
panelHeight:'200'
});
}
//高级查询
function advsearchData(is_entity){
is_entity.FIELD_START_TIME = strToDateObj(is_entity.FIELD_START_TIME);
is_entity.FIELD_END_TIME = strToDateObj(is_entity.FIELD_END_TIME);
$('#list').datagrid('load',is_entity);
}
/****/
/**
* 序号:11
* 功能:处理接口附件
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function uploadcommonRow(index){
$('#list').datagrid('selectRow',index);
var is_row = $('#list').datagrid('getSelections');
$('#list').datagrid('clearSelections');
var code = is_row[0].UUID;
var is_row={MAINDATA_ID:code,MODULE_ID:ls_module_id};
var editUrl = "uploadFileCommonView_uploadfileCommonTab?FIELD_MODULE_ID="+ls_module_id+"&FIELD_MAINDATA_ID="+code;
openViewIframRow("uploadcommon",editUrl,is_row,"毕业证附件",true,0.65,0.95,0,0);
}
/****/
/**
* 序号:12
* 功能:批量处理接口附件
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function uploadcommonBatchRow(){
var code="";
var rows = $('#list').datagrid('getSelections');
for(var i=0; i<rows.length; i++){
code = code + rows[i].UUID+",";
}
if(rows == null || rows == ""){
$.messager.alert('提示',"请选择记录!",'info');
return;
}
if(code.length>0){
code = code.substring(0,code.length - 1);
}
var is_row={MAINDATA_ID:code,MODULE_ID:ls_module_id};
var editUrl = "uploadFileCommonView_uploadfileCommonTab?FIELD_MODULE_ID="+ls_module_id+"&FIELD_MAINDATA_ID="+code;
openViewIframRow("uploadcommon",editUrl,is_row,"批量毕业证附件",true,0.65,0.95,0,0);
}
/****/
function replaceByJson(text,json){
for(key in json){
text = text.replace('@{'+key+'}',json[key]);
}
return text;
}
function modelList(index){
$('#list').datagrid('selectRow',index);
var is_row = $('#list').datagrid('getSelections');
$('#list').datagrid('clearSelections');
openViewIframRow("detail","procdefinitionView_modelList",is_row[0],"流程模板列表",true,0.65,0.95,0,0);
}
function modelList_datagrid(is_view,is_title,is_url,is_query,is_column,is_opetipmenuwidth,optionWidth){
if(optionWidth==null || optionWidth==''){
optionWidth = 80;
}
$('#'+is_view).datagrid({
title:is_title,
iconCls:$.getJwWindowPic(),
url:is_url,
queryParams : is_query,//查询参数
rownumbers : true,//显示索引号
singleSelect : false,//是否多选
fitColumns : false,//是否撑满
autoRowHeight : false,//设定高度
rowStyler :function(index,row){return rowstyler(index,row);},
pagination : true,//分页显示
pageSize : rows,//显示行数
pageList : listPageSize,//条数选择
striped : true, //是否隔行显示
remoteSort : false,//是否从服务器排序
frozenColumns : [[
{
field : 'ck',
checkbox : true
},
{
field : 'option',
title : '操作',
width : optionWidth,
align : 'center',
formatter : formatMenu
}
]],
columns : is_column,
//toolbar : '#modelTabTb',
onLoadSuccess : function() {
if(is_opetipmenuwidth==null){
is_opetipmenuwidth = 60;
}
createOptionMenuTooltip(is_opetipmenuwidth);
dataOnLoadSuccess();
}
});
}
\ No newline at end of file
<%@page contentType="text/html; charset=UTF-8"%>
<%@ include file="/gaowj/header-simple-1.0.jsp"%>
<div id="procdefinitionmodelsTab">
<link rel="stylesheet" type="text/css" href="${ctx}/jwapp/common/css/content_body.css" charset="utf-8"></link>
<link rel="stylesheet" type="text/css" href="${ctx}/jwapp/common/css/content_table.css" charset="utf-8"></link>
<link rel="stylesheet" type="text/css" href="${ctx}/jwapp/common/css/content_input.css" charset="utf-8"></link>
</div>
<table id="list" style="width: 100%; height: 100%;"></table>
<div id="tb">
<form id="procdefinitionmodelsTab_searchForm" style="float:left">
<input type="hidden" name="FIELD_PROCID" id="PROCID" value="${procId}" />
模板名称: <input class="easyui-textbox" id="FIELD_PROC_NAME" name="FIELD_PROC_NAME" style="width:200px"/>&nbsp;&nbsp;
</form>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true" onclick="javascript:searchRow()">查询</a>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-ext-advsearch',plain:true" onclick="javascript:advsearchRow()">高级查询</a>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true" onclick="javascript:refreshRow()">刷新</a>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" onclick="javascript:addRow()">新增</a>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-clear',plain:true" onclick="javascript:deleteBatchRow()">删除</a>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-ext-file',plain:true" onclick="javascript:uploadcommonBatchRow()">附件</a>
</div>
<div id="detail" style="overflow:auto;"></div>
<script type="text/javascript" src="${ctx}/jwapp/pages/standard/js/jwStandardModule.js" charset="utf-8"></script>
<script type="text/javascript" src="${ctx}/process/pages/procdefinitionmodels/js/procdefinitionmodelsModule.js" charset="utf-8"></script>
<script type="text/javascript" src="${ctx}/process/pages/procdefinitionmodels/js/procdefinitionmodelsTab.js" charset="utf-8"></script>
<%@page contentType="text/html; charset=UTF-8"%>
<form id="inputForm" method="post" style="width: 100%;">
<input type="hidden" name="FIELD_UUID" id="UUID" />
<table align="center" border="0" cellpadding="0" cellspacing="0" class="tableStyle" style="margin: 10px 15px; width: 95%; line-height: 30px;">
<tr>
<td style="width: 15%;" class="tableStyleLable">
<span>模板名称:</span>
</td>
<td style="width: 74%">
<input class="easyui-textbox" id="MODEL_NAME" name="FIELD_MODEL_NAME" style="width:200px" />
</td>
</tr>
<tr>
<td class="tableStyleLable">
<span>模板描述:</span>
</td>
<td>
<input class="easyui-textbox" id="DESCRIPTION" name="FIELD_DESCRIPTION" style="width:200px" />
</td>
</tr>
</table>
</form>
\ No newline at end of file
......@@ -18,5 +18,33 @@
<param name="root">jsonObject</param>
</result>
</action>
<action name="procdefinitionView_*" class="com.gaowj.procdefinition.action.viewAction" method="{1}">
<result name="{1}">/process/pages/procdefinition/{1}.jsp</result>
</action>
<action name="procdefinitionAct_*" class="com.gaowj.procdefinition.action.actAction" method="{1}">
<result name="json" type="json">
<param name="root">jsonObject</param>
</result>
</action>
<action name="procdefinitionData_*" class="com.gaowj.procdefinition.action.dataAction" method="{1}">
<result name="json" type="json">
<param name="root">jsonObject</param>
</result>
</action>
<action name="procdefinitionmodelsView_*" class="com.gaowj.procdefinitionmodels.action.viewAction" method="{1}">
<result name="{1}">/process/pages/procdefinitionmodels/{1}.jsp</result>
</action>
<action name="procdefinitionmodelsAct_*" class="com.gaowj.procdefinitionmodels.action.actAction" method="{1}">
<result name="json" type="json">
<param name="root">jsonObject</param>
</result>
</action>
<action name="procdefinitionmodelsData_*" class="com.gaowj.procdefinitionmodels.action.dataAction" method="{1}">
<result name="json" type="json">
<param name="root">jsonObject</param>
</result>
</action>
</package>
</struts>
package com.gaowj.business;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Service;
import com.gaowj.business.exception.BusinessException;
import com.gaowj.business.util.Page;
@Service
public interface ProcdefinitionBusiness {
/**
* 插入
* @param entity
* @throws BusinessException
*/
Map<String,Object> insert_procde_finition(Map<String,Object> entity) throws BusinessException ;
/**
* 更新
* @param entity
* @throws BusinessException
*/
void update_procde_finition(Map<String,Object> entity) throws BusinessException ;
/**
* 删除记录
* @param entity
* @throws BusinessException
*/
void delete_procde_finition(List<String> list)throws BusinessException;
/**
* 分页获取记录
* @param entity
* @throws BusinessException
*/
Page<Map<String, Object>> list_procde_finition(int pageNo, int pageSize, Map<String, Object> query)throws BusinessException ;
/**
* 获取所有记录
* @param entity
* @throws BusinessException
*/
List<Map<String,Object>> list_procde_finition(Map<String, Object> query) throws BusinessException ;
/**
* 获取所有记录数
* @param entity
* @throws BusinessException
*/
int listCount_procde_finition(Map<String, Object> query) throws BusinessException ;
}
package com.gaowj.business;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Service;
import com.gaowj.business.exception.BusinessException;
import com.gaowj.business.util.Page;
@Service
public interface ProcdefinitionmodelsBusiness {
/**
* 插入
* @param entity
* @throws BusinessException
*/
Map<String,Object> insert_procde_finition_models(Map<String,Object> entity) throws BusinessException ;
/**
* 更新
* @param entity
* @throws BusinessException
*/
void update_procde_finition_models(Map<String,Object> entity) throws BusinessException ;
/**
* 删除记录
* @param entity
* @throws BusinessException
*/
void delete_procde_finition_models(List<String> list)throws BusinessException;
/**
* 分页获取记录
* @param entity
* @throws BusinessException
*/
Page<Map<String, Object>> list_procde_finition_models(int pageNo, int pageSize, Map<String, Object> query)throws BusinessException ;
/**
* 获取所有记录
* @param entity
* @throws BusinessException
*/
List<Map<String,Object>> list_procde_finition_models(Map<String, Object> query) throws BusinessException ;
/**
* 获取所有记录数
* @param entity
* @throws BusinessException
*/
int listCount_procde_finition_models(Map<String, Object> query) throws BusinessException ;
}
......@@ -7,6 +7,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import org.activiti.engine.RepositoryService;
import org.apache.commons.lang.StringUtils;
import org.apache.ibatis.session.RowBounds;
......@@ -27,30 +28,30 @@ public class FormtableBusinessImpl implements FormtableBusiness {
}
@Override
public Map<String,Object> insert_form_table(Map<String, Object> entity) throws BusinessException {
if(entity.get("UUID")==null){
public Map<String, Object> insert_form_table(Map<String, Object> entity) throws BusinessException {
if (entity.get("UUID") == null) {
entity.put("UUID", java.util.UUID.randomUUID().toString());
}
if(entity.get("CREATE_TIME")==null){
if (entity.get("CREATE_TIME") == null) {
entity.put("CREATE_TIME", new Date());
}
if(entity.get("CREATE_ID")==null){
if (entity.get("CREATE_ID") == null) {
entity.put("CREATE_ID", SessionUtil.getCode());
}
if(entity.get("UPDATE_ID")==null){
if (entity.get("UPDATE_ID") == null) {
entity.put("UPDATE_ID", SessionUtil.getCode());
}
if(entity.get("UPDATE_TIME")==null){
if (entity.get("UPDATE_TIME") == null) {
entity.put("UPDATE_TIME", new Date());
}
if(entity.get("IS_DBSYNCH")==null){
if (entity.get("IS_DBSYNCH") == null) {
entity.put("IS_DBSYNCH", "0");
}
//动态传值插入
// 动态传值插入
List<String> infoListKey = new ArrayList<String>();
List<Object> infoList = new ArrayList<Object>();
if(entity.keySet()!=null){
if (entity.keySet() != null) {
Set<String> key = entity.keySet();
// 将map集合中的key和value 取出来分别放到list集合里
for (String str : key) {
......@@ -100,8 +101,8 @@ public class FormtableBusinessImpl implements FormtableBusiness {
@Override
public List<Map<String, Object>> list_form_table(Map<String, Object> query) throws BusinessException {
// TODO Auto-generated method stub
return null;
List<Map<String, Object>> items = formtableDAO.list_form_table(query);
return items;
}
@Override
......@@ -115,14 +116,14 @@ public class FormtableBusinessImpl implements FormtableBusiness {
*
* @param entity
*/
private void convertEntity(Map<String, Object> entity,String... ignoreKeys) {
private void convertEntity(Map<String, Object> entity, String... ignoreKeys) {
List<Map<String, Object>> updateList = new ArrayList<Map<String, Object>>();
Set<String> key = entity.keySet();
// 将map集合中的key和value 取出来分别放到list集合里
for (String str : key) {
Map<String, Object> updateMap = new HashMap<String, Object>();
for(String k:ignoreKeys){
for (String k : ignoreKeys) {
if (StringUtils.equalsIgnoreCase("UUID", str))
continue;
}
......
package com.gaowj.business.procdefinition;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.activiti.engine.RepositoryService;
import org.apache.commons.lang.StringUtils;
import org.apache.ibatis.session.RowBounds;
import com.gaowj.business.ProcdefinitionBusiness;
import com.gaowj.business.exception.BusinessException;
import com.gaowj.business.util.Page;
import com.gaowj.business.util.SessionUtil;
public class ProcdefinitionBusinessImpl implements ProcdefinitionBusiness {
private procdefinitionDAO procdefinitionDAO;
private RepositoryService repositoryService;
public procdefinitionDAO getProcdefinitionDAO() {
return procdefinitionDAO;
}
public void setProcdefinitionDAO(procdefinitionDAO procdefinitionDAO) {
this.procdefinitionDAO = procdefinitionDAO;
}
public void setRepositoryService(RepositoryService repositoryService) {
this.repositoryService = repositoryService;
}
@Override
public Map<String, Object> insert_procde_finition(Map<String, Object> entity) throws BusinessException {
if (entity.get("UUID") == null) {
entity.put("UUID", java.util.UUID.randomUUID().toString());
}
if (entity.get("CREATE_TIME") == null) {
entity.put("CREATE_TIME", new Date());
}
if (entity.get("CREATE_ID") == null) {
entity.put("CREATE_ID", SessionUtil.getCode());
}
if (entity.get("UPDATE_ID") == null) {
entity.put("UPDATE_ID", SessionUtil.getCode());
}
if (entity.get("UPDATE_TIME") == null) {
entity.put("UPDATE_TIME", new Date());
}
// 动态传值插入
List<String> infoListKey = new ArrayList<String>();
List<Object> infoList = new ArrayList<Object>();
if (entity.keySet() != null) {
Set<String> key = entity.keySet();
// 将map集合中的key和value 取出来分别放到list集合里
for (String str : key) {
infoList.add(entity.get(str));
infoListKey.add(str);
}
entity.put("infoListKey", infoListKey);
entity.put("infoList", infoList);
}
procdefinitionDAO.insert_procde_finition(entity);
return entity;
}
@Override
public void update_procde_finition(Map<String, Object> entity) throws BusinessException {
// 动态传值修改
if (entity.keySet() != null) {
convertEntity(entity);
procdefinitionDAO.update_procde_finition(entity);
entity.remove("info");
}
}
@Override
public void delete_procde_finition(List<String> list) throws BusinessException {
procdefinitionDAO.delete_procde_finition(list);
}
@Override
public Page<Map<String, Object>> list_procde_finition(int pageNo, int pageSize, Map<String, Object> query) throws BusinessException {
machining(query);
// 计算起始记录
int pageStart = (pageNo - 1) * pageSize;
// 获取列表
List<Map<String, Object>> items = procdefinitionDAO.list_procde_finition(new RowBounds(pageStart, pageSize), query);
// 获取列表个数
int count = listCount_procde_finition(query);
// 创建分页对象
Page<Map<String, Object>> page = new Page<Map<String, Object>>();
page.setStart(pageStart);
page.setLimit(pageSize);
page.setCount(count);
page.setItems(items);
return page;
}
@Override
public List<Map<String, Object>> list_procde_finition(Map<String, Object> query) throws BusinessException {
machining(query);
return null;
}
@Override
public int listCount_procde_finition(Map<String, Object> query) throws BusinessException {
machining(query);
return procdefinitionDAO.listCount_procde_finition(query);
}
/**
* 更新或者插入时,处理map对象的形式(将字段信息存储为list,便于mybatis代码调用)
*
* @param entity
*/
private void convertEntity(Map<String, Object> entity, String... ignoreKeys) {
List<Map<String, Object>> updateList = new ArrayList<Map<String, Object>>();
Set<String> key = entity.keySet();
// 将map集合中的key和value 取出来分别放到list集合里
for (String str : key) {
Map<String, Object> updateMap = new HashMap<String, Object>();
for (String k : ignoreKeys) {
if (StringUtils.equalsIgnoreCase("UUID", str))
continue;
}
updateMap.put("key", str);
updateMap.put("value", entity.get(str));
updateList.add(updateMap);
}
entity.put("info", updateList);
}
private void machining(Map<String, Object> query){
if(query.get("PROC_NAME")!=null&&!"".equals(query.get("PROC_NAME"))){
query.put("PROC_NAME", "%"+query.get("PROC_NAME")+"%");
}
}
}
package com.gaowj.business.procdefinition;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import com.gaowj.business.exception.BusinessException;
public interface procdefinitionDAO {
void insert_procde_finition(Map<String, Object> entity) throws BusinessException;
void update_procde_finition(Map<String, Object> entity) throws BusinessException;
void delete_procde_finition(List<String> list) throws BusinessException;
List<Map<String, Object>> list_procde_finition(RowBounds rowbounds, Map<String, Object> query) throws BusinessException;
List<Map<String, Object>> list_procde_finition(Map<String, Object> query) throws BusinessException;
int listCount_procde_finition(Map<String, Object> query) throws BusinessException;
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gaowj.business.procdefinition.procdefinitionDAO">
<sql id="Where_Clause">
<trim prefix="WHERE" prefixOverrides="AND |OR">
<if test="UUID != null and UUID != ''">
and f.UUID = #{UUID}
</if>
<if test="PROC_NAME != null and PROC_NAME != ''">
and f.PROC_NAME LIKE #{PROC_NAME}
</if>
</trim>
</sql>
<insert id="insert_procde_finition" parameterType="map">
insert into C_T_PROC_DEFINITION(
<trim prefix="" suffixOverrides=",">
<foreach collection="infoListKey" item="key">
${key},
</foreach>
</trim>
<![CDATA[ ) values( ]]>
<trim prefix="" suffixOverrides=",">
<foreach collection="infoList" item="value">
#{value},
</foreach>
</trim>
<![CDATA[ ) ]]>
</insert>
<update id="update_procde_finition" parameterType="map">
<![CDATA[
update C_T_PROC_DEFINITION set
]]>
<trim prefix="" suffixOverrides=",">
<foreach collection="info" item="info">
${info.key} = #{info.value} ,
</foreach>
</trim>
<where>
<if test="UUID != null and UUID != ''">
and UUID = #{UUID}
</if>
</where>
</update>
<delete id="delete_procde_finition" parameterType="list">
<![CDATA[
delete from C_T_PROC_DEFINITION where UUID IN
]]>
<foreach collection="list" item="UUID" open="(" separator=","
close=")">
#{UUID}
</foreach>
</delete>
<select id="list_procde_finition" parameterType="map" resultType="upperCaseKeyMap">
<![CDATA[
select f.*
from (
SELECT a.*,b.content FROM c_t_proc_definition a
LEFT JOIN c_t_form_table b ON a.table_id=b.uuid
) f
]]>
<include refid="Where_Clause" />
order by f.CREATE_TIME DESC
</select>
<select id="listCount_procde_finition" parameterType="map"
resultType="int">
<![CDATA[
select count(*) c from C_T_PROC_DEFINITION f
]]>
<include refid="Where_Clause" />
</select>
</mapper>
\ No newline at end of file
package com.gaowj.business.procdefinitionmodels;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.lang.StringUtils;
import org.apache.ibatis.session.RowBounds;
import com.gaowj.business.ProcdefinitionmodelsBusiness;
import com.gaowj.business.exception.BusinessException;
import com.gaowj.business.util.Page;
import com.gaowj.business.util.SessionUtil;
public class ProcdefinitionmodelsBusinessImpl implements ProcdefinitionmodelsBusiness {
private procdefinitionmodelsDAO procdefinitionmodelsDAO;
public procdefinitionmodelsDAO getProcdefinitionmodelsDAO() {
return procdefinitionmodelsDAO;
}
public void setProcdefinitionmodelsDAO(procdefinitionmodelsDAO procdefinitionmodelsDAO) {
this.procdefinitionmodelsDAO = procdefinitionmodelsDAO;
}
@Override
public Map<String, Object> insert_procde_finition_models(Map<String, Object> entity) throws BusinessException {
if (entity.get("UUID") == null) {
entity.put("UUID", java.util.UUID.randomUUID().toString());
}
if (entity.get("CREATE_TIME") == null) {
entity.put("CREATE_TIME", new Date());
}
if (entity.get("CREATE_ID") == null) {
entity.put("CREATE_ID", SessionUtil.getCode());
}
if (entity.get("UPDATE_ID") == null) {
entity.put("UPDATE_ID", SessionUtil.getCode());
}
if (entity.get("UPDATE_TIME") == null) {
entity.put("UPDATE_TIME", new Date());
}
// 动态传值插入
List<String> infoListKey = new ArrayList<String>();
List<Object> infoList = new ArrayList<Object>();
if (entity.keySet() != null) {
Set<String> key = entity.keySet();
// 将map集合中的key和value 取出来分别放到list集合里
for (String str : key) {
infoList.add(entity.get(str));
infoListKey.add(str);
}
entity.put("infoListKey", infoListKey);
entity.put("infoList", infoList);
}
procdefinitionmodelsDAO.insert_procde_finition_models(entity);
return entity;
}
@Override
public void update_procde_finition_models(Map<String, Object> entity) throws BusinessException {
// 动态传值修改
if (entity.keySet() != null) {
convertEntity(entity);
procdefinitionmodelsDAO.update_procde_finition_models(entity);
entity.remove("info");
}
}
@Override
public void delete_procde_finition_models(List<String> list) throws BusinessException {
procdefinitionmodelsDAO.delete_procde_finition_models(list);
}
@Override
public Page<Map<String, Object>> list_procde_finition_models(int pageNo, int pageSize, Map<String, Object> query) throws BusinessException {
machining(query);
// 计算起始记录
int pageStart = (pageNo - 1) * pageSize;
// 获取列表
List<Map<String, Object>> items = procdefinitionmodelsDAO.list_procde_finition_models(new RowBounds(pageStart, pageSize), query);
// 获取列表个数
int count = listCount_procde_finition_models(query);
// 创建分页对象
Page<Map<String, Object>> page = new Page<Map<String, Object>>();
page.setStart(pageStart);
page.setLimit(pageSize);
page.setCount(count);
page.setItems(items);
return page;
}
@Override
public List<Map<String, Object>> list_procde_finition_models(Map<String, Object> query) throws BusinessException {
machining(query);
return procdefinitionmodelsDAO.list_procde_finition_models(query);
}
@Override
public int listCount_procde_finition_models(Map<String, Object> query) throws BusinessException {
machining(query);
return procdefinitionmodelsDAO.listCount_procde_finition_models(query);
}
/**
* 更新或者插入时,处理map对象的形式(将字段信息存储为list,便于mybatis代码调用)
*
* @param entity
*/
private void convertEntity(Map<String, Object> entity, String... ignoreKeys) {
List<Map<String, Object>> updateList = new ArrayList<Map<String, Object>>();
Set<String> key = entity.keySet();
// 将map集合中的key和value 取出来分别放到list集合里
for (String str : key) {
Map<String, Object> updateMap = new HashMap<String, Object>();
for (String k : ignoreKeys) {
if (StringUtils.equalsIgnoreCase("UUID", str))
continue;
}
updateMap.put("key", str);
updateMap.put("value", entity.get(str));
updateList.add(updateMap);
}
entity.put("info", updateList);
}
private void machining(Map<String, Object> query){
if(query.get("PROC_NAME")!=null&&!"".equals(query.get("PROC_NAME"))){
query.put("PROC_NAME", "%"+query.get("PROC_NAME")+"%");
}
}
}
package com.gaowj.business.procdefinitionmodels;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import com.gaowj.business.exception.BusinessException;
public interface procdefinitionmodelsDAO {
void insert_procde_finition_models(Map<String, Object> entity) throws BusinessException;
void update_procde_finition_models(Map<String, Object> entity) throws BusinessException;
void delete_procde_finition_models(List<String> list) throws BusinessException;
List<Map<String, Object>> list_procde_finition_models(RowBounds rowbounds, Map<String, Object> query) throws BusinessException;
List<Map<String, Object>> list_procde_finition_models(Map<String, Object> query) throws BusinessException;
int listCount_procde_finition_models(Map<String, Object> query) throws BusinessException;
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gaowj.business.procdefinitionmodels.procdefinitionmodelsDAO">
<sql id="Where_Clause">
<trim prefix="WHERE" prefixOverrides="AND |OR">
<if test="UUID != null and UUID != ''">
and f.UUID = #{UUID}
</if>
<if test="PROC_DEFINITION_ID != null and PROC_DEFINITION_ID != ''">
and f.PROC_DEFINITION_ID = #{PROC_DEFINITION_ID}
</if>
</trim>
</sql>
<insert id="insert_procde_finition_models" parameterType="map">
insert into C_T_PROC_DEFINITION_MODELS(
<trim prefix="" suffixOverrides=",">
<foreach collection="infoListKey" item="key">
${key},
</foreach>
</trim>
<![CDATA[ ) values( ]]>
<trim prefix="" suffixOverrides=",">
<foreach collection="infoList" item="value">
#{value},
</foreach>
</trim>
<![CDATA[ ) ]]>
</insert>
<update id="update_procde_finition_models" parameterType="map">
<![CDATA[
update C_T_PROC_DEFINITION_MODELS set
]]>
<trim prefix="" suffixOverrides=",">
<foreach collection="info" item="info">
${info.key} = #{info.value} ,
</foreach>
</trim>
<where>
<if test="UUID != null and UUID != ''">
and UUID = #{UUID}
</if>
</where>
</update>
<delete id="delete_procde_finition_models" parameterType="list">
<![CDATA[
delete from C_T_PROC_DEFINITION_MODELS where UUID IN
]]>
<foreach collection="list" item="UUID" open="(" separator=","
close=")">
#{UUID}
</foreach>
</delete>
<select id="list_procde_finition_models" parameterType="map" resultType="upperCaseKeyMap">
<![CDATA[
select f.*
from C_T_PROC_DEFINITION_MODELS f
]]>
<include refid="Where_Clause" />
order by f.CREATE_TIME DESC
</select>
<select id="listCount_procde_finition_models" parameterType="map"
resultType="int">
<![CDATA[
select count(*) c from C_T_PROC_DEFINITION_MODELS f
]]>
<include refid="Where_Clause" />
</select>
</mapper>
\ No newline at end of file
......@@ -80,4 +80,29 @@ public class dataAction extends BasicAction{
}
return "json";
}
public String listFormTable() throws BusinessException{
FormtableBusiness business = BusinessManager.getBusiness(FormtableBusiness.class);
Map<String, Object> query = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX);
try {
query = QueryParamUtil.StringToDate(query);
List<Map<String,Object>> listRows = business.list_form_table(query);
Map<String, Object> data = new HashMap<String, Object>();
data.put("rowSet", QueryParamUtil.DateToString(listRows));
data.put("pageNo", pageNo);
data.put("pageSize", pageSize);
data.put("pageCount", pageCount);
data.put("rows", data.get("rowSet"));
data.put("total", listRows.size());
jsonObject = new JSONObject();
jsonObject.putAll(data);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return "json";
}
}
package com.gaowj.procdefinition.action;
import java.util.List;
import java.util.Map;
import com.gaowj.business.ProcdefinitionBusiness;
import com.gaowj.business.StudentBusiness;
import com.gaowj.business.SystemOpeBusiness;
import com.gaowj.business.action.BasicAction;
import com.gaowj.business.comp.BusinessManager;
import com.gaowj.business.exception.BusinessException;
import com.gaowj.business.util.QueryParamUtil;
import com.gaowj.business.util.RequestUtils;
import com.gaowj.business.util.Status;
import net.sf.json.JSONObject;
public class actAction extends BasicAction {
/**
*
*/
private static final long serialVersionUID = 1559759499504671708L;
private JSONObject jsonObject = new JSONObject();
public JSONObject getJsonObject() {
return jsonObject;
}
public void setJsonObject(JSONObject jsonObject) {
this.jsonObject = jsonObject;
}
/**
* 插入
*
* @param entity
* @throws BusinessException
*/
public String insertProcdefinition() throws BusinessException {
ProcdefinitionBusiness business = BusinessManager.getBusiness(ProcdefinitionBusiness.class);
Map<String, Object> entity = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX);
jsonObject = new JSONObject();
try {
entity = QueryParamUtil.StringToDate(entity);
//去除不要更新的字段
entity.remove("OPETYPE");
//新增
Map<String,Object> procdefinition=business.insert_procde_finition(entity);
// 操作日志
//sysbusiness.insert_logBusiness(具体方法,操作内容,操作描述,操作记录ID,操作记录中文描述,分类)
SystemOpeBusiness sysbusiness = BusinessManager.getBusiness(SystemOpeBusiness.class);
sysbusiness.insert_logBusiness("insertProcdefinition", "" + entity,
"增加流程定义数据", (String) entity.get("UUID"), (String) entity.get("CONTENT"), "procdefinition");
//
//
jsonObject.putAll(Status.getStatusSuccessMessage("保存成功"));
} catch (Exception e) {
jsonObject.putAll(Status.getStatusErrorMessage("保存失败"));
e.printStackTrace();
}
return "json";
}
public String updateProcdefinition() throws BusinessException {
ProcdefinitionBusiness business = BusinessManager.getBusiness(ProcdefinitionBusiness.class);
Map<String, Object> entity = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX);
jsonObject = new JSONObject();
try {
entity = QueryParamUtil.StringToDate(entity);
//去除不要更新的字段
entity.remove("OPETYPE");
//新增
business.update_procde_finition(entity);
// 操作日志
//sysbusiness.insert_logBusiness(具体方法,操作内容,操作描述,操作记录ID,操作记录中文描述,分类)
SystemOpeBusiness sysbusiness = BusinessManager.getBusiness(SystemOpeBusiness.class);
sysbusiness.insert_logBusiness("updateProcdefinition", "" + entity,
"修改流程定义数据", (String) entity.get("UUID"), (String) entity.get("CONTENT"), "procdefinition");
//
//
jsonObject.putAll(Status.getStatusSuccessMessage("保存成功"));
} catch (Exception e) {
jsonObject.putAll(Status.getStatusErrorMessage("保存失败"));
e.printStackTrace();
}
return "json";
}
public String deleteProcdefinition() throws BusinessException {
ProcdefinitionBusiness business = BusinessManager.getBusiness(ProcdefinitionBusiness.class);
Map<String, Object> entity = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX);
String deletekey = (String) entity.get("CODE");
List<String> ListKey = QueryParamUtil.StringToList(deletekey);
try {
business.delete_procde_finition(ListKey);
// 操作日志
SystemOpeBusiness sysbusiness = BusinessManager.getBusiness(SystemOpeBusiness.class);
sysbusiness.insert_logBusiness("deleteProcdefinition", "" + ListKey,
"删除流程定义数据", deletekey, "多个流水号","procdefinition");
//
jsonObject.putAll(Status.getStatusSuccessMessage("删除成功"));
} catch (Exception e) {
jsonObject.putAll(Status.getStatusErrorMessage("删除失败"));
e.printStackTrace();
}
return "json";
}
}
package com.gaowj.procdefinition.action;
import java.sql.SQLException;
import java.text.ParseException;
import java.util.HashMap;
import java.util.Map;
import com.gaowj.business.ProcdefinitionBusiness;
import com.gaowj.business.action.BasicAction;
import com.gaowj.business.comp.BusinessManager;
import com.gaowj.business.exception.BusinessException;
import com.gaowj.business.util.Page;
import com.gaowj.business.util.QueryParamUtil;
import com.gaowj.business.util.RequestUtils;
import net.sf.json.JSONObject;
public class dataAction extends BasicAction{
/**
*
*/
private static final long serialVersionUID = -5059421324729466816L;
private JSONObject jsonObject = new JSONObject();
private int rows = 20;// 每页显示的记录数
private int page = 1;// 当前第几页
public JSONObject getJsonObject() {
return jsonObject;
}
public void setJsonObject(JSONObject jsonObject) {
this.jsonObject = jsonObject;
}
public int getRows() {
return rows;
}
public void setRows(int rows) {
this.rows = rows;
}
public int getPage() {
return page;
}
public void setPage(int page) {
this.page = page;
}
/**
* 分页获取记录
* @param entity
* @throws BusinessException
*/
public String list() throws BusinessException {
ProcdefinitionBusiness business = BusinessManager.getBusiness(ProcdefinitionBusiness.class);
Map<String, Object> query = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX);
try {
query = QueryParamUtil.StringToDate(query);
Page<Map<String, Object>> pageRows = business.list_procde_finition(pageNo,pageSize, query);
setPageCount((pageRows.getCount() - 1) / pageSize + 1);
Map<String, Object> data = new HashMap<String, Object>();
data.put("rowSet", QueryParamUtil.DateToString(pageRows.getItems()));
data.put("pageNo", pageNo);
data.put("pageSize", pageSize);
data.put("pageCount", pageCount);
data.put("rows", data.get("rowSet"));
data.put("total", pageRows.getCount());
jsonObject = new JSONObject();
jsonObject.putAll(data);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return "json";
}
}
package com.gaowj.procdefinition.action;
import com.gaowj.business.action.BasicAction;
import com.gaowj.business.exception.BusinessException;
public class viewAction extends BasicAction {
/**
*
*/
private static final long serialVersionUID = -5986096180610140300L;
public String procdefinitionTab() throws BusinessException{
return "procdefinitionTab";
}
public String procdefinitionTabDetail() throws BusinessException{
return "procdefinitionTabDetail";
}
}
package com.gaowj.procdefinitionmodels.action;
import java.util.List;
import java.util.Map;
import com.gaowj.business.ProcdefinitionBusiness;
import com.gaowj.business.StudentBusiness;
import com.gaowj.business.SystemOpeBusiness;
import com.gaowj.business.action.BasicAction;
import com.gaowj.business.comp.BusinessManager;
import com.gaowj.business.exception.BusinessException;
import com.gaowj.business.util.QueryParamUtil;
import com.gaowj.business.util.RequestUtils;
import com.gaowj.business.util.Status;
import net.sf.json.JSONObject;
public class actAction extends BasicAction {
/**
*
*/
private static final long serialVersionUID = 1559759499504671708L;
private JSONObject jsonObject = new JSONObject();
public JSONObject getJsonObject() {
return jsonObject;
}
public void setJsonObject(JSONObject jsonObject) {
this.jsonObject = jsonObject;
}
/**
* 插入
*
* @param entity
* @throws BusinessException
*/
public String insertProcdefinition() throws BusinessException {
ProcdefinitionBusiness business = BusinessManager.getBusiness(ProcdefinitionBusiness.class);
Map<String, Object> entity = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX);
jsonObject = new JSONObject();
try {
entity = QueryParamUtil.StringToDate(entity);
//去除不要更新的字段
entity.remove("OPETYPE");
//新增
Map<String,Object> procdefinition=business.insert_procde_finition(entity);
// 操作日志
//sysbusiness.insert_logBusiness(具体方法,操作内容,操作描述,操作记录ID,操作记录中文描述,分类)
SystemOpeBusiness sysbusiness = BusinessManager.getBusiness(SystemOpeBusiness.class);
sysbusiness.insert_logBusiness("insertProcdefinition", "" + entity,
"增加流程定义数据", (String) entity.get("UUID"), (String) entity.get("CONTENT"), "procdefinition");
//
//
jsonObject.putAll(Status.getStatusSuccessMessage("保存成功"));
} catch (Exception e) {
jsonObject.putAll(Status.getStatusErrorMessage("保存失败"));
e.printStackTrace();
}
return "json";
}
public String updateProcdefinition() throws BusinessException {
ProcdefinitionBusiness business = BusinessManager.getBusiness(ProcdefinitionBusiness.class);
Map<String, Object> entity = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX);
jsonObject = new JSONObject();
try {
entity = QueryParamUtil.StringToDate(entity);
//去除不要更新的字段
entity.remove("OPETYPE");
//新增
business.update_procde_finition(entity);
// 操作日志
//sysbusiness.insert_logBusiness(具体方法,操作内容,操作描述,操作记录ID,操作记录中文描述,分类)
SystemOpeBusiness sysbusiness = BusinessManager.getBusiness(SystemOpeBusiness.class);
sysbusiness.insert_logBusiness("updateProcdefinition", "" + entity,
"修改流程定义数据", (String) entity.get("UUID"), (String) entity.get("CONTENT"), "procdefinition");
//
//
jsonObject.putAll(Status.getStatusSuccessMessage("保存成功"));
} catch (Exception e) {
jsonObject.putAll(Status.getStatusErrorMessage("保存失败"));
e.printStackTrace();
}
return "json";
}
public String deleteProcdefinition() throws BusinessException {
ProcdefinitionBusiness business = BusinessManager.getBusiness(ProcdefinitionBusiness.class);
Map<String, Object> entity = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX);
String deletekey = (String) entity.get("CODE");
List<String> ListKey = QueryParamUtil.StringToList(deletekey);
try {
business.delete_procde_finition(ListKey);
// 操作日志
SystemOpeBusiness sysbusiness = BusinessManager.getBusiness(SystemOpeBusiness.class);
sysbusiness.insert_logBusiness("deleteProcdefinition", "" + ListKey,
"删除流程定义数据", deletekey, "多个流水号","procdefinition");
//
jsonObject.putAll(Status.getStatusSuccessMessage("删除成功"));
} catch (Exception e) {
jsonObject.putAll(Status.getStatusErrorMessage("删除失败"));
e.printStackTrace();
}
return "json";
}
}
package com.gaowj.procdefinitionmodels.action;
import java.sql.SQLException;
import java.text.ParseException;
import java.util.HashMap;
import java.util.Map;
import com.gaowj.business.ProcdefinitionBusiness;
import com.gaowj.business.ProcdefinitionmodelsBusiness;
import com.gaowj.business.action.BasicAction;
import com.gaowj.business.comp.BusinessManager;
import com.gaowj.business.exception.BusinessException;
import com.gaowj.business.util.Page;
import com.gaowj.business.util.QueryParamUtil;
import com.gaowj.business.util.RequestUtils;
import net.sf.json.JSONObject;
public class dataAction extends BasicAction{
/**
*
*/
private static final long serialVersionUID = -5059421324729466816L;
private JSONObject jsonObject = new JSONObject();
private int rows = 20;// 每页显示的记录数
private int page = 1;// 当前第几页
public JSONObject getJsonObject() {
return jsonObject;
}
public void setJsonObject(JSONObject jsonObject) {
this.jsonObject = jsonObject;
}
public int getRows() {
return rows;
}
public void setRows(int rows) {
this.rows = rows;
}
public int getPage() {
return page;
}
public void setPage(int page) {
this.page = page;
}
/**
* 分页获取记录
* @param entity
* @throws BusinessException
*/
public String list() throws BusinessException {
ProcdefinitionmodelsBusiness business = BusinessManager.getBusiness(ProcdefinitionmodelsBusiness.class);
Map<String, Object> query = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX);
try {
query = QueryParamUtil.StringToDate(query);
Page<Map<String, Object>> pageRows = business.list_procde_finition_models(pageNo,pageSize, query);
setPageCount((pageRows.getCount() - 1) / pageSize + 1);
Map<String, Object> data = new HashMap<String, Object>();
data.put("rowSet", QueryParamUtil.DateToString(pageRows.getItems()));
data.put("pageNo", pageNo);
data.put("pageSize", pageSize);
data.put("pageCount", pageCount);
data.put("rows", data.get("rowSet"));
data.put("total", pageRows.getCount());
jsonObject = new JSONObject();
jsonObject.putAll(data);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return "json";
}
}
package com.gaowj.procdefinitionmodels.action;
import com.gaowj.business.action.BasicAction;
import com.gaowj.business.exception.BusinessException;
public class viewAction extends BasicAction {
/**
*
*/
private static final long serialVersionUID = -5986096180610140300L;
public String procdefinitionmodelsTab() throws BusinessException{
request.setAttribute("procId", request.getParameter("procId"));
return "procdefinitionmodelsTab";
}
public String procdefinitionmodelsTabDetail() throws BusinessException{
return "procdefinitionmodelsTabDetail";
}
}
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