Commit 213a9961 by 罗绍泽

activiti整合(一)

parent 44cadacd
...@@ -124,6 +124,41 @@ ...@@ -124,6 +124,41 @@
<property name="filters" value="stat" /> <property name="filters" value="stat" />
</bean> </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 --> <!-- 增加事务transactionManager-system -->
<bean id="transactionManager-system" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <bean id="transactionManager-system" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource-system"/> <property name="dataSource" ref="dataSource-system"/>
...@@ -157,6 +192,17 @@ ...@@ -157,6 +192,17 @@
</property> </property>
</bean> </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"> <bean class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
<property name="beanNames"> <property name="beanNames">
...@@ -169,6 +215,7 @@ ...@@ -169,6 +215,7 @@
<value>transactionInterceptor-system</value> <value>transactionInterceptor-system</value>
<value>transactionInterceptor-standard</value> <value>transactionInterceptor-standard</value>
<value>transactionInterceptor-business</value> <value>transactionInterceptor-business</value>
<value>transactionInterceptor-activiti</value>
</list> </list>
</property> </property>
</bean> </bean>
...@@ -206,4 +253,5 @@ ...@@ -206,4 +253,5 @@
<import resource="business-standard.xml"/> <import resource="business-standard.xml"/>
<import resource="business-test.xml"/> <import resource="business-test.xml"/>
<import resource="business-process.xml"/> <import resource="business-process.xml"/>
<import resource="business-activiti.xml"/>
</beans> </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 @@ ...@@ -7,6 +7,8 @@
<property name="mapperLocations"> <property name="mapperLocations">
<list> <list>
<value>classpath:com/gaowj/business/formtable/formtableDAO.xml</value> <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> </list>
</property> </property>
</bean> </bean>
...@@ -15,7 +17,27 @@ ...@@ -15,7 +17,27 @@
<property name="formtableDAO"> <property name="formtableDAO">
<bean class="org.mybatis.spring.mapper.MapperFactoryBean"> <bean class="org.mybatis.spring.mapper.MapperFactoryBean">
<property name="mapperInterface" value="com.gaowj.business.formtable.formtableDAO" /> <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> </bean>
</property> </property>
</bean> </bean>
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
<script type="text/javascript" src="<%=localPath %>/js/ajaxfileupload.js"></script> <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/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_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.core-3.5.js"></script>
<script type="text/javascript" src="<%=commonPath %>/ria/jquery/zTree_v3/js/jquery.ztree.excheck-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 @@ ...@@ -301,3 +301,6 @@
.icon-ext-02_25{ .icon-ext-02_25{
background:url('../../../../images/icons/(02,25).png') no-repeat left center; 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(){}; ...@@ -14,11 +14,13 @@ formtableModule.prototype.insertFormTable = function(){};
formtableModule.prototype.updateFormTable = function(){}; formtableModule.prototype.updateFormTable = function(){};
//删除附件数据 //删除附件数据
formtableModule.prototype.deleteFormTable = function(){}; formtableModule.prototype.deleteFormTable = function(){};
//获取所有的表数据
formtableModule.prototype.listFormTable = function(){};
//创建一个数据操作对象,然后再后续使用 //创建一个数据操作对象,然后再后续使用
formtableModule.act = new formtableModule("json").delegate("formtableAct"); 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({}) //说明: 1、所有方法里统一传递josn格式的参数,用于后台交互,如data.listTables(param) ,如没有参数则传'{}',如data.listTables({})
// 2、前后台数据获取传输协议 如:json[{'0':{pageCount':'2','pageNo':'1','pageSize':'20','rowSet':'[{0},{1}....]'}}] // 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':'保存失败'}}}]
<%@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':'保存失败'}}}]
<%@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 @@ ...@@ -18,5 +18,33 @@
<param name="root">jsonObject</param> <param name="root">jsonObject</param>
</result> </result>
</action> </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> </package>
</struts> </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; ...@@ -7,6 +7,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import org.activiti.engine.RepositoryService;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.ibatis.session.RowBounds; import org.apache.ibatis.session.RowBounds;
...@@ -27,39 +28,39 @@ public class FormtableBusinessImpl implements FormtableBusiness { ...@@ -27,39 +28,39 @@ public class FormtableBusinessImpl implements FormtableBusiness {
} }
@Override @Override
public Map<String,Object> insert_form_table(Map<String, Object> entity) throws BusinessException { public Map<String, Object> insert_form_table(Map<String, Object> entity) throws BusinessException {
if(entity.get("UUID")==null){ if (entity.get("UUID") == null) {
entity.put("UUID", java.util.UUID.randomUUID().toString()); 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()); entity.put("CREATE_TIME", new Date());
} }
if(entity.get("CREATE_ID")==null){ if (entity.get("CREATE_ID") == null) {
entity.put("CREATE_ID", SessionUtil.getCode()); entity.put("CREATE_ID", SessionUtil.getCode());
} }
if(entity.get("UPDATE_ID")==null){ if (entity.get("UPDATE_ID") == null) {
entity.put("UPDATE_ID", SessionUtil.getCode()); entity.put("UPDATE_ID", SessionUtil.getCode());
} }
if(entity.get("UPDATE_TIME")==null){ if (entity.get("UPDATE_TIME") == null) {
entity.put("UPDATE_TIME", new Date()); entity.put("UPDATE_TIME", new Date());
} }
if(entity.get("IS_DBSYNCH")==null){ if (entity.get("IS_DBSYNCH") == null) {
entity.put("IS_DBSYNCH", "0"); entity.put("IS_DBSYNCH", "0");
} }
//动态传值插入 // 动态传值插入
List<String> infoListKey = new ArrayList<String>(); List<String> infoListKey = new ArrayList<String>();
List<Object> infoList = new ArrayList<Object>(); List<Object> infoList = new ArrayList<Object>();
if(entity.keySet()!=null){ if (entity.keySet() != null) {
Set<String> key = entity.keySet(); Set<String> key = entity.keySet();
// 将map集合中的key和value 取出来分别放到list集合里 // 将map集合中的key和value 取出来分别放到list集合里
for (String str : key) { for (String str : key) {
infoList.add(entity.get(str)); infoList.add(entity.get(str));
infoListKey.add(str); infoListKey.add(str);
} }
entity.put("infoListKey", infoListKey); entity.put("infoListKey", infoListKey);
entity.put("infoList", infoList); entity.put("infoList", infoList);
} }
formtableDAO.insert_form_table(entity); formtableDAO.insert_form_table(entity);
return entity; return entity;
} }
...@@ -100,8 +101,8 @@ public class FormtableBusinessImpl implements FormtableBusiness { ...@@ -100,8 +101,8 @@ public class FormtableBusinessImpl implements FormtableBusiness {
@Override @Override
public List<Map<String, Object>> list_form_table(Map<String, Object> query) throws BusinessException { public List<Map<String, Object>> list_form_table(Map<String, Object> query) throws BusinessException {
// TODO Auto-generated method stub List<Map<String, Object>> items = formtableDAO.list_form_table(query);
return null; return items;
} }
@Override @Override
...@@ -115,14 +116,14 @@ public class FormtableBusinessImpl implements FormtableBusiness { ...@@ -115,14 +116,14 @@ public class FormtableBusinessImpl implements FormtableBusiness {
* *
* @param entity * @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>>(); List<Map<String, Object>> updateList = new ArrayList<Map<String, Object>>();
Set<String> key = entity.keySet(); Set<String> key = entity.keySet();
// 将map集合中的key和value 取出来分别放到list集合里 // 将map集合中的key和value 取出来分别放到list集合里
for (String str : key) { for (String str : key) {
Map<String, Object> updateMap = new HashMap<String, Object>(); Map<String, Object> updateMap = new HashMap<String, Object>();
for(String k:ignoreKeys){ for (String k : ignoreKeys) {
if (StringUtils.equalsIgnoreCase("UUID", str)) if (StringUtils.equalsIgnoreCase("UUID", str))
continue; 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{ ...@@ -80,4 +80,29 @@ public class dataAction extends BasicAction{
} }
return "json"; 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