Commit 992810eb by 罗绍泽

表定义修改,流程实例修改,licensen修改,当前环节高亮图实现

parent 8390de86
#Mon Mar 10 11:34:19 CST 2014
classpath.helper/org.eclipse.jdt.launching.JRE_CONTAINER\:\:org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType\:\:jdk1.6.0_31/owners=jst.java\:6.0
eclipse.preferences.version=1
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0"> <?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="jfV5lcyq"> <wb-module deploy-name="jfV5lcyq">
<wb-resource deploy-path="/" source-path="/WebContent"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/src"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src_process"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src_test"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/src_test"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src_system"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/src_system"/>
<wb-resource deploy-path="/" source-path="/WebContent"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src_utils"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/src_utils"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src_jwapp"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/src_jwapp"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src_standard"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/src_standard"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src_process"/>
<property name="java-output-path" value="build/classes"/> <property name="java-output-path" value="build/classes"/>
<property name="context-root" value="jfV5lcyq"/> <property name="context-root" value="jfV5lcyq"/>
</wb-module> </wb-module>
......
...@@ -11,8 +11,9 @@ ...@@ -11,8 +11,9 @@
<property name="databaseSchemaUpdate" value="true" /> <property name="databaseSchemaUpdate" value="true" />
<!-- 设置字体,防止流程图生成时候产生乱码 --> <!-- 设置字体,防止流程图生成时候产生乱码 -->
<property name="activityFontName" value="宋体"></property> <property name="activityFontName" value="宋体"></property>
<!-- 设置字体,防止xml生成时候产生乱码 -->
<property name="labelFontName" value="宋体"></property> <property name="labelFontName" value="宋体"></property>
<!-- 设置字体,防止xml生成时候产生乱码 -->
<property name="xmlEncoding" value="GBK"></property>
</bean> </bean>
<!-- 创建流程引擎对象 --> <!-- 创建流程引擎对象 -->
<bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean"> <bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean">
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
<value>classpath:com/gaowj/business/formfield/formfieldDAO.xml</value> <value>classpath:com/gaowj/business/formfield/formfieldDAO.xml</value>
<value>classpath:com/gaowj/business/formmodels/formmodelsDAO.xml</value> <value>classpath:com/gaowj/business/formmodels/formmodelsDAO.xml</value>
<value>classpath:com/gaowj/business/procdefinitionInitlink/procdefinitionInitlinkDAO.xml</value> <value>classpath:com/gaowj/business/procdefinitionInitlink/procdefinitionInitlinkDAO.xml</value>
<value>classpath:com/gaowj/business/procinstance/procinstanceDAO.xml</value>
</list> </list>
</property> </property>
</bean> </bean>
...@@ -40,6 +41,10 @@ ...@@ -40,6 +41,10 @@
<property name="mapperInterface" value="com.gaowj.business.procdefinitionInitlink.procdefinitionInitlinkDAO" /> <property name="mapperInterface" value="com.gaowj.business.procdefinitionInitlink.procdefinitionInitlinkDAO" />
<property name="sqlSessionFactory" ref="sqlSessionFactory-process" /> <property name="sqlSessionFactory" ref="sqlSessionFactory-process" />
</bean> </bean>
<bean id="procinstanceDAO" class="org.mybatis.spring.mapper.MapperFactoryBean">
<property name="mapperInterface" value="com.gaowj.business.procinstance.procinstanceDAO" />
<property name="sqlSessionFactory" ref="sqlSessionFactory-process" />
</bean>
<!-- DAO定义结束 --> <!-- DAO定义结束 -->
<bean id="FormtableBusiness" class="com.gaowj.business.formtable.FormtableBusinessImpl"> <bean id="FormtableBusiness" class="com.gaowj.business.formtable.FormtableBusinessImpl">
...@@ -80,6 +85,12 @@ ...@@ -80,6 +85,12 @@
<bean id="ProcinstanceBusiness" class="com.gaowj.business.procinstance.ProcinstanceBusinessImpl"> <bean id="ProcinstanceBusiness" class="com.gaowj.business.procinstance.ProcinstanceBusinessImpl">
<property name="runtimeService" ref="runtimeService"></property> <property name="runtimeService" ref="runtimeService"></property>
<property name="procdefinitionDAO" ref="procdefinitionDAO"></property>
<property name="formtableDAO" ref="formtableDAO"></property>
<property name="procinstanceDAO" ref="procinstanceDAO"></property>
<property name="taskService" ref="taskService"></property>
<property name="historyService" ref="historyService"></property>
<property name="repositoryService" ref="repositoryService"></property>
</bean> </bean>
<bean id="ProcdefinitionInitLinkBusiness" class="com.gaowj.business.procdefinitionInitlink.ProcdefinitionInitLinkBusinessImpl"> <bean id="ProcdefinitionInitLinkBusiness" class="com.gaowj.business.procdefinitionInitlink.ProcdefinitionInitLinkBusinessImpl">
......
...@@ -277,4 +277,78 @@ function notleafToUnchecked(data){ ...@@ -277,4 +277,78 @@ function notleafToUnchecked(data){
notleafToUnchecked(data[i].children); notleafToUnchecked(data[i].children);
} }
} }
} }
\ No newline at end of file
/**
* 流程编辑页面
* @returns {Boolean}
*/
function openProcEditRow(editUrl,is_row,is_title,is_max,is_width,is_height,is_left,is_top){
$('#detail').dialog( {
title : is_title,
iconCls : $.getJwWindowPic(),
width : ls_width * is_width,
height :ls_height * is_height,
closed : false,
cache : false,
maximizable:is_max,
left:is_left,
top:is_top,
href : editUrl,
queryParams:get_FIELD(is_row),
modal : true,
buttons : [ {
text : '保存',
iconCls : 'icon-ok',
handler : function() {
saveBox('detail','list');
}
}, {
text : '下一步',
iconCls : 'icon-ok',
handler : function() {
nextBox('detail','list');
}
}, {
text : '关闭',
iconCls : 'icon-back',
handler : function() {
closeBox('detail');
}
} ],
onLoad:function editUrlOnload(){
if(is_row.OPETYPE=='insert'){
addUrlOnloadCallback(is_row);
}else{
updateUrlOnloadCallback(is_row);
}
}
});
}
/****/
//弹出层流程编辑下一步按扭
function nextBox(Box_id,List_id) {
if(Box_id==null||Box_id==''||Box_id==undefined)
Box_id='detail';
if(List_id==null||List_id==''||List_id==undefined)
List_id='list';
var returnIsValid = $('#inputForm').form('validate');
if (returnIsValid) {
//$("#inputForm").submit();
var query = $("#inputForm").getFormVal();
var v_result;
if ($('#OPETYPE').val() == null || $('#OPETYPE').val() == undefined
|| $('#OPETYPE').val() == '' || $('#OPETYPE').val()=='insert'){
v_result = insertData(query);
}
else{
v_result = updateData(query);
}
if (v_result != null && v_result != undefined) {
closeBox(Box_id);
$.messager.alert('提示', v_result.VALUE);
}
}
}
/****/
\ No newline at end of file
<%@page contentType="text/html; charset=UTF-8"%> <%@page contentType="text/html; charset=UTF-8"%>
<style>
.fieldTable{
border:1px solid;
}
</style>
<form id="inputForm" method="post" style="width: 100%;"> <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}" /> <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;"> <table align="center" border="0" cellpadding="0" cellspacing="0" class="tableStyle" style="margin: 10px 15px; width: 95%; line-height: 30px;">
...@@ -6,28 +11,22 @@ ...@@ -6,28 +11,22 @@
<td style="width: 15%;" class="tableStyleLable"> <td style="width: 15%;" class="tableStyleLable">
<span>表名:</span> <span>表名:</span>
</td> </td>
<td style="width: 30%"> <td style="width: 80%">
<input class="easyui-textbox" required="required" id="TABLE_NAME" name="FIELD_TABLE_NAME" value="${is_row.TABLE_NAME}" style="width:200px" /> <input class="easyui-textbox" required="required" id="TABLE_NAME" name="FIELD_TABLE_NAME" value="${is_row.TABLE_NAME}" style="width:200px" />
</td> </td>
<td style="width: 15%;" class="tableStyleLable">
<span>同步数据库状态:</span>
</td>
<td style="width: 30%">
<input id="IS_DBSYNCH" name="FIELD_IS_DBSYNCH" value="0"/>
</td>
</tr> </tr>
<td class="tableStyleLable"> <td class="tableStyleLable">
<span>描述:</span> <span>描述:</span>
</td> </td>
<td colspan="3"> <td>
<input class="easyui-textbox" required="required" id="CONTENT" name="FIELD_CONTENT" value="${is_row.CONTENT}" style="width:570px" /> <input class="easyui-textbox" required="required" id="CONTENT" name="FIELD_CONTENT" value="${is_row.CONTENT}" style="width:200px" />
</td> </td>
</tr> </tr>
</table> </table>
<div> <div>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" onclick="javascript:addLine()">插入一行</a> <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" onclick="javascript:addLine()">插入一行</a>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-clear',plain:true" onclick="javascript:deleteLine()">删除行</a> <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-clear',plain:true" onclick="javascript:deleteLine()">删除行</a>
</div> </div>
<table id="fieldTable"> <div style="overflow:auto;width:98%;border:1px solid #ccc;"><table id="fieldTable"></div>
</table> </table>
</form> </form>
\ No newline at end of file
$.extend($.fn.validatebox.defaults.rules, {
widthBigThanZero:{
validator: function (value) {
return value>0;
},
message: '宽度必须大于0'
},
pointIsNatural:{
validator: function (value) {
var patt = /([1-9]\d+)|(\d)/;
return patt.test(value);;
},
message: '小数点必须为自然数'
},
lengthPositive :{
validator: function (value) {
var patt = /[1-9]\d*/;
return patt.test(value);;
},
message: '长度必须为正整数'
}
});
/** /**
* 序号:1 * 序号:1
* 功能:定义分页(EasyUI) * 功能:定义分页(EasyUI)
...@@ -55,7 +77,7 @@ var type_data=[ ...@@ -55,7 +77,7 @@ var type_data=[
var list_default_field=[{ var list_default_field=[{
FIELD_NAME:'uuid', FIELD_NAME:'uuid',
LENGTH:50, LENGTH:50,
POINT:0, POINT:'',
FIELD_MUST_INPUT:true, FIELD_MUST_INPUT:true,
IS_KEY:true, IS_KEY:true,
CONTENT:'主键UUID', CONTENT:'主键UUID',
...@@ -67,7 +89,7 @@ var list_default_field=[{ ...@@ -67,7 +89,7 @@ var list_default_field=[{
},{ },{
FIELD_NAME:'create_id', FIELD_NAME:'create_id',
LENGTH:50, LENGTH:50,
POINT:0, POINT:'',
FIELD_MUST_INPUT:true, FIELD_MUST_INPUT:true,
IS_KEY:false, IS_KEY:false,
CONTENT:'新建人', CONTENT:'新建人',
...@@ -79,7 +101,7 @@ var list_default_field=[{ ...@@ -79,7 +101,7 @@ var list_default_field=[{
},{ },{
FIELD_NAME:'create_time', FIELD_NAME:'create_time',
LENGTH:'', LENGTH:'',
POINT:0, POINT:'',
FIELD_MUST_INPUT:true, FIELD_MUST_INPUT:true,
IS_KEY:false, IS_KEY:false,
CONTENT:'新建时间', CONTENT:'新建时间',
...@@ -91,7 +113,7 @@ var list_default_field=[{ ...@@ -91,7 +113,7 @@ var list_default_field=[{
},{ },{
FIELD_NAME:'update_id', FIELD_NAME:'update_id',
LENGTH:50, LENGTH:50,
POINT:0, POINT:'',
FIELD_MUST_INPUT:true, FIELD_MUST_INPUT:true,
IS_KEY:false, IS_KEY:false,
CONTENT:'更新人', CONTENT:'更新人',
...@@ -103,7 +125,7 @@ var list_default_field=[{ ...@@ -103,7 +125,7 @@ var list_default_field=[{
},{ },{
FIELD_NAME:'update_time', FIELD_NAME:'update_time',
LENGTH:'', LENGTH:'',
POINT:0, POINT:'',
FIELD_MUST_INPUT:true, FIELD_MUST_INPUT:true,
IS_KEY:false, IS_KEY:false,
CONTENT:'更新时间', CONTENT:'更新时间',
...@@ -115,19 +137,19 @@ var list_default_field=[{ ...@@ -115,19 +137,19 @@ var list_default_field=[{
}]; }];
var tr=['<tr>', var tr=['<tr>',
' <td>@{index}</td>', ' <td >@{index}</td>',
' <td>@{opt}</td>', ' <td >@{opt}</td>',
' <td>@{field_name}</td>', ' <td >@{field_name}</td>',
' <td>@{content}</td>', ' <td >@{content}</td>',
' <td>@{type}</td>', ' <td >@{type}</td>',
' <td>@{length}</td>', ' <td >@{length}</td>',
' <td>@{point}</td>', ' <td >@{point}</td>',
' <td>@{field_default}</td>', ' <td >@{field_default}</td>',
' <td>@{field_width}</td>', ' <td >@{field_width}</td>',
' <td>@{is_key}</td>', ' <td >@{is_key}</td>',
' <td>@{is_null}</td>', ' <td >@{is_null}</td>',
' <td>@{order_num}</td>', ' <td >@{order_num}</td>',
' <td>@{is_show_list}</td>', ' <td >@{is_show_list}</td>',
'</tr>'].join(""); '</tr>'].join("");
/****/ /****/
...@@ -227,9 +249,7 @@ function addRow(){ ...@@ -227,9 +249,7 @@ function addRow(){
} }
//加载增加子页面成功后的回调 //加载增加子页面成功后的回调
function addUrlOnloadCallback(is_row){ function addUrlOnloadCallback(is_row){
initTableInsert(); initTableInsert();
} }
function initTableInsert(){ function initTableInsert(){
...@@ -249,6 +269,7 @@ function initTableInsert(){ ...@@ -249,6 +269,7 @@ function initTableInsert(){
order_num:'', order_num:'',
is_show_list:'列表显示', is_show_list:'列表显示',
})).appendTo(fieldTable); })).appendTo(fieldTable);
fieldTable.find('tr').eq(0).find('td').css({'fontWeight':'bold','background':'#f1f1f1','textAlign':'center'})
$('#IS_DBSYNCH').combobox({ $('#IS_DBSYNCH').combobox({
data : is_dbsynch_data, data : is_dbsynch_data,
...@@ -261,55 +282,101 @@ function initTableInsert(){ ...@@ -261,55 +282,101 @@ function initTableInsert(){
for(var i=0;i<list_default_field.length;i++){ for(var i=0;i<list_default_field.length;i++){
var tr2=tr; var tr2=tr;
var field=list_default_field[i]; var field=list_default_field[i];
tr2=replaceByJson(tr2,{ tr2=replaceByJson(tr2,fieldModel(i,field));
index:i+1,
opt:'<input type="checkbox" name="checkbox"/>',
field_name:'<input type="text" name="LIST['+i+'].NAME" value="'+field.FIELD_NAME+'" />',
content:'<input type="text" name="LIST['+i+'].CONTENT" value="'+field.CONTENT+'" />',
type:'<input type="combobox" name="LIST['+i+'].TYPE" value="'+field.TYPE+'" />',
length:'<input type="text" name="LIST['+i+'].LENGTH" value="'+field.LENGTH+'" />',
point:'<input type="text" name="LIST['+i+'].POINT" value="'+field.POINT+'" />',
field_default:'<input type="text" name="LIST['+i+'].FIELD_DEFAULT" value="'+field.FIELD_DEFAULT+'" />',
field_width:'<input type="text" name="LIST['+i+'].FIELD_WIDTH" value="'+field.FIELD_WIDTH+'" />',
is_key:'<input type="checkbox" value="'+field.IS_KEY+'" name="LIST['+i+'].IS_KEY" '+(field.IS_KEY==true?'checked':'')+' />',
is_null:'<input type="checkbox" value="'+field.IS_NULL+'" name="LIST['+i+'].IS_NULL" '+(field.IS_NULL==false?'':'checked')+' />',
order_num:'<input class="field_order_number" type="hidden" name="LIST['+i+'].ORDER_NUM" />',
is_show_list:'<input type="checkbox" value="'+field.IS_SHOW_LIST+'" name="LIST['+i+'].IS_SHOW_LIST" '+(field.IS_SHOW_LIST==false?'':'checked')+' />'
});
$(tr2).appendTo(fieldTable); $(tr2).appendTo(fieldTable);
$('input[name="LIST['+i+'].TYPE"]').combobox({ initEasyUiControl(i);
data : type_data,
valueField : 'CODE_ID',
textField : 'CODE_NAME',
editable:false,
panelHeight:'auto',
onSelect:function(record){
if(record.CODE_ID=='date'){
$(this).parents('td').next().children().attr("disabled","true")
$(this).parents('td').next().children().attr("value",null)
}
if(record.CODE_ID=='text'){
$(this).parents('td').next().children().attr("disabled","true")
$(this).parents('td').next().children().attr("value",0)
}
}
});
} }
//重置表的索引
$('#fieldTable tr').eq(0).nextAll().each(function(index,element){ resetFieldTableIndex();
if($(element).find('input[name="LIST['+ index +'].TYPE"]').val()=='date'){ //设置表的最大索引值(为了简单起见,第一次初始化为当前行数,以后每新增一行,该值+1)
$(element).find('input[name="LIST['+ index +'].LENGTH"]').attr("disabled","true"); $("#fieldTable").data('maxIndex',$('#fieldTable tr').length-2);
}
function fieldModel(i,field){
if(typeof field=='undefined'){
field={
FIELD_NAME:'',
CONTENT:'',
TYPE:'',
LENGTH:'',
POINT:'',
FIELD_DEFAULT:'',
FIELD_WIDTH:'',
IS_KEY:false,
IS_NULL:true,
IS_SHOW_LIST:false
};
}
if(typeof field.LENGTH=='undefined'){
field.LENGTH='';
}
if(typeof field.POINT=='undefined'){
field.POINT='';
}
if(typeof field.field_width == 'undefined'){
field.FIELD_WIDTH='';
}
return {
index:i+1,
opt:'<input style="width:25px;" type="checkbox" name="checkbox"/>',
field_name:'<input type="text" name="LIST['+i+'].NAME" value="'+field.FIELD_NAME+'" />',
content:'<input type="text" name="LIST['+i+'].CONTENT" value="'+field.CONTENT+'" />',
type:'<input type="combobox" name="LIST['+i+'].TYPE" value="'+field.TYPE+'" />',
length:'<input type="text" name="LIST['+i+'].LENGTH" value="'+field.LENGTH+'" />',
point:'<input type="text" name="LIST['+i+'].POINT" value="'+field.POINT+'" />',
field_default:'<input type="text" name="LIST['+i+'].FIELD_DEFAULT" value="'+field.FIELD_DEFAULT+'" />',
field_width:'<input type="text" name="LIST['+i+'].FIELD_WIDTH" value="'+field.FIELD_WIDTH+'" />',
is_key:'<input style="width:25px;" type="checkbox" value="'+field.IS_KEY+'" name="LIST['+i+'].IS_KEY" '+(field.IS_KEY==true?'checked':'')+' />',
is_null:'<input style="width:57px;" type="checkbox" value="'+field.IS_NULL+'" name="LIST['+i+'].IS_NULL" '+(field.IS_NULL==false?'':'checked')+' />',
order_num:'<input style="width:57px;" class="field_order_number" type="hidden" name="LIST['+i+'].ORDER_NUM" />',
is_show_list:'<input style="width:57px;" type="checkbox" value="'+field.IS_SHOW_LIST+'" name="LIST['+i+'].IS_SHOW_LIST" '+(field.IS_SHOW_LIST==false?'':'checked')+' />'
};
}
/**
* 初始化easyui控件
*/
function initEasyUiControl(i){
$('input[name="LIST['+i+'].NAME"]').textbox({
required: true
});
$('input[name="LIST['+i+'].CONTENT"]').textbox({
required: true
});
$('input[name="LIST['+i+'].LENGTH"]').textbox({
validType:'lengthPositive'
});
$('input[name="LIST['+i+'].POINT"]').textbox({
validType:'pointIsNatural'
});
$('input[name="LIST['+i+'].FIELD_DEFAULT"]').textbox({
});
$('input[name="LIST['+i+'].FIELD_WIDTH"]').textbox({
validType:'widthBigThanZero'
});
$('input[name="LIST['+i+'].TYPE"]').combobox({
data : type_data,
valueField : 'CODE_ID',
textField : 'CODE_NAME',
editable:false,
panelHeight:'auto',
onSelect:function(record){
} }
}); });
}
function resetFieldTableIndex(){
//除标题行外的所有行内寻找".field_order_number"元素,将值设置为当前索引
//并将序号设置为当前索引
$('#fieldTable tr').eq(0).nextAll().each(function(index,element){ $('#fieldTable tr').eq(0).nextAll().each(function(index,element){
$(element).find('.field_order_number').val(index+1); $(element).find('.field_order_number').val(index+1);
$(element).find('td').eq(0).html('<span style="width:50px;display:inline-block;text-align:center;">'+(index+1)+'</span>');
}); });
} }
//保存 //保存
function insertData(is_entity){ function insertData(is_entity){
console.log(is_entity);
return;
var v_result = formtableModule.act.insertFormTable(is_entity); var v_result = formtableModule.act.insertFormTable(is_entity);
$('#list').datagrid('reload'); $('#list').datagrid('reload');
return v_result; return v_result;
...@@ -321,7 +388,7 @@ function editRow(index) { ...@@ -321,7 +388,7 @@ function editRow(index) {
var is_row = $('#list').datagrid('getSelections'); var is_row = $('#list').datagrid('getSelections');
$('#list').datagrid('clearSelections'); $('#list').datagrid('clearSelections');
is_row[0].OPETYPE = 'update'; is_row[0].OPETYPE = 'update';
openEditRow("formtableView_formtableTabDetail",is_row[0],"编辑",true,0.65,0.95,0,0); openEditRow("formtableView_formtableTabDetail",is_row[0],"编辑",true,0.95,0.95,0,0);
} }
...@@ -331,7 +398,6 @@ function updateUrlOnloadCallback(is_row){ ...@@ -331,7 +398,6 @@ function updateUrlOnloadCallback(is_row){
} }
function initTableUpdate(is_row){ function initTableUpdate(is_row){
$.ajax({ $.ajax({
url:'formtableAct_listTableFile', url:'formtableAct_listTableFile',
type:'post', type:'post',
...@@ -339,7 +405,6 @@ function initTableUpdate(is_row){ ...@@ -339,7 +405,6 @@ function initTableUpdate(is_row){
UUID:is_row.UUID UUID:is_row.UUID
}, },
success: function(data){ success: function(data){
var fieldTable=$("#fieldTable"); var fieldTable=$("#fieldTable");
$(replaceByJson(tr,{ $(replaceByJson(tr,{
index:'序号', index:'序号',
...@@ -365,21 +430,7 @@ function initTableUpdate(is_row){ ...@@ -365,21 +430,7 @@ function initTableUpdate(is_row){
for(var i=0;i<data.listfield.length;i++){ for(var i=0;i<data.listfield.length;i++){
var tr2=tr; var tr2=tr;
var field=data.listfield[i]; var field=data.listfield[i];
tr2=replaceByJson(tr2,{ tr2=replaceByJson(tr2,fieldModel(i,field));
index:i+1,
opt:'<input type="checkbox" />',
field_name:'<input type="text" name="LIST['+i+'].NAME" value="'+field.FIELD_NAME+'" />',
content:'<input type="text" name="LIST['+i+'].CONTENT" value="'+field.CONTENT+'" />',
type:'<input type="combobox" name="LIST['+i+'].TYPE" value="'+field.TYPE+'" />',
length:'<input type="text" name="LIST['+i+'].LENGTH" value="'+field.LENGTH+'" />',
point:'<input type="text" name="LIST['+i+'].POINT" value="'+field.POINT+'" />',
field_default:'<input type="text" name="LIST['+i+'].FIELD_DEFAULT" value="'+field.FIELD_DEFAULT+'" />',
field_width:'<input type="text" name="LIST['+i+'].FIELD_WIDTH" value="'+field.FIELD_WIDTH+'" />',
is_key:'<input type="checkbox" value="'+field.IS_KEY+'" name="LIST['+i+'].IS_KEY" '+(field.IS_KEY==1?'checked':'')+' />',
is_null:'<input type="checkbox" value="'+field.IS_NULL+'" name="LIST['+i+'].IS_NULL" '+(field.IS_NULL==0?'':'checked')+' />',
order_num:'<input class="field_order_number" type="hidden" value="'+field.ORDER_NUM+'" name="LIST['+i+'].ORDER_NUM" /><input type="hidden" value="'+field.UUID+'" name="LIST['+i+'].UUID" />',
is_show_list:'<input type="checkbox" value="'+field.IS_SHOW_LIST+'" name="LIST['+i+'].IS_SHOW_LIST" '+(field.IS_SHOW_LIST==0?'':'checked')+' />'
});
$(tr2).appendTo(fieldTable); $(tr2).appendTo(fieldTable);
$('input[name="LIST['+i+'].TYPE"]').combobox({ $('input[name="LIST['+i+'].TYPE"]').combobox({
data : type_data, data : type_data,
...@@ -389,6 +440,11 @@ function initTableUpdate(is_row){ ...@@ -389,6 +440,11 @@ function initTableUpdate(is_row){
panelHeight:'auto' panelHeight:'auto'
}); });
} }
//重置表的索引
resetFieldTableIndex();
//设置表的最大索引值(为了简单起见,第一次初始化为当前行数,以后每新增一行,该值+1)
fieldTable.data('maxIndex',$('#fieldTable tr').length-2);
} }
}) })
...@@ -504,50 +560,16 @@ function replaceByJson(text,json){ ...@@ -504,50 +560,16 @@ function replaceByJson(text,json){
return text; return text;
} }
var j =list_default_field.length+1;
function addLine(){ function addLine(){
var aa={ var j=$("#fieldTable").data('maxIndex')+1;
index:j, $("#fieldTable").data('maxIndex',j);
opt:'<input type="checkbox" name="checkbox"/>', var aa=fieldModel(j);
field_name:'<input class="easyui-textbox" type="text" name="LIST['+j+'].NAME" required="true"/>',
content:'<input class="easyui-textbox" type="text" name="LIST['+j+'].CONTENT" required="required"/>',
type:'<input type="combobox" name="LIST['+j+'].TYPE" value="varchar"/>',
length:'<input type="text" name="LIST['+j+'].LENGTH" value="0"/>',
point:'<input type="text" name="LIST['+j+'].POINT" value="0" />',
field_default:'<input type="text" name="LIST['+j+'].FIELD_DEFAULT" />',
field_width:'<input type="text" name="LIST['+j+'].FIELD_WIDTH" value="20"/>',
is_key:'<input type="checkbox" name="LIST['+j+'].IS_KEY" />',
is_null:'<input type="checkbox" name="LIST['+j+'].IS_NULL" checked/>',
order_num:'<input class="field_order_number" type="hidden" name="LIST['+j+'].ORDER_NUM" />',
is_show_list:'<input type="checkbox" name="LIST['+j+'].IS_SHOW_LIST" />'
};
var fieldTable=$("#fieldTable"); var fieldTable=$("#fieldTable");
$(replaceByJson(tr,aa)).appendTo(fieldTable); $(replaceByJson(tr,aa)).appendTo(fieldTable);
$.parser.parse(); initEasyUiControl(j);
//重置表的索引
$('input[name="LIST['+j+'].TYPE"]').combobox({ resetFieldTableIndex();
data : type_data,
valueField : 'CODE_ID',
textField : 'CODE_NAME',
editable:false,
panelHeight:'auto',
onSelect:function(record){
if(record.CODE_ID=='date'||record.CODE_ID=='text'){
$(this).parents('td').next().children().attr("disabled","true")
$(this).parents('td').next().children().attr("value",null)
}
if(record.CODE_ID=='text'){
$(this).parents('td').next().children().attr("disabled","true")
$(this).parents('td').next().children().attr("value",0)
}
}
});
$('#fieldTable tr').eq(0).nextAll().each(function(index,element){
$(element).find('.field_order_number').val(index+1);
});
j++;
} }
function deleteLine(){ function deleteLine(){
...@@ -558,6 +580,8 @@ function deleteLine(){ ...@@ -558,6 +580,8 @@ function deleteLine(){
$(":checkbox[name='checkbox']:checked").each(function(){ $(":checkbox[name='checkbox']:checked").each(function(){
$(this).parent().parent().remove(); $(this).parent().parent().remove();
}); });
//重置表的索引
resetFieldTableIndex();
} }
function templateRow(index){ function templateRow(index){
...@@ -580,7 +604,6 @@ function synchRow(index){ ...@@ -580,7 +604,6 @@ function synchRow(index){
} }
is_row[0].IS_DBSYNCH=1; is_row[0].IS_DBSYNCH=1;
formtableModule.act.updateFormTable(is_row[0]) formtableModule.act.updateFormTable(is_row[0])
console.log(is_row[0]);
return; return;
} }
\ No newline at end of file
...@@ -15,7 +15,7 @@ procdefinitionModule.prototype.updateProcdefinition = function(){}; ...@@ -15,7 +15,7 @@ procdefinitionModule.prototype.updateProcdefinition = function(){};
//删除流程定义 //删除流程定义
procdefinitionModule.prototype.deleteProcdefinition = function(){}; procdefinitionModule.prototype.deleteProcdefinition = function(){};
//获取流程定义列表 //获取流程定义列表
procdefinitionModule.prototype.list = function(){}; procdefinitionModule.prototype.listAll = function(){};
//查找流程定义对应的表模板 //查找流程定义对应的表模板
procdefinitionModule.prototype.findFormModel = function(){}; procdefinitionModule.prototype.findFormModel = function(){};
......
...@@ -57,8 +57,8 @@ var v_formtable_data=formtableModule.data.listFormTable(); ...@@ -57,8 +57,8 @@ var v_formtable_data=formtableModule.data.listFormTable();
var ls_title="流程定义"; var ls_title="流程定义";
var is_column = [ [ var is_column = [ [
{field : 'PROC_NAME',title : '流程名',width : 100,align : 'center'}, {field : 'PROC_NAME',title : '流程名',width : 100,align : 'center'},
{field : 'DEPLOYMENT_KEY',title : 'KEY',width : 80,align : 'center'}, {field : 'DEPLOYMENT_KEY',title : 'KEY',width : 240,align : 'center'},
{field : 'CONTENT',title : '关联表',width : 80,align : 'center'}, {field : 'CONTENT',title : '关联表',width : 100,align : 'center'},
{field : 'DEPLOYMENT_ID',title : '部署id',width : 80,align : 'center',formatter:function(value,row,index){ {field : 'DEPLOYMENT_ID',title : '部署id',width : 80,align : 'center',formatter:function(value,row,index){
if(value==null||value==''){ if(value==null||value==''){
return '未部署'; return '未部署';
......
...@@ -18,13 +18,5 @@ ...@@ -18,13 +18,5 @@
<input class="easyui-textbox" data-options="required:true" id="TABLE_ID" name="FIELD_TABLE_ID" style="width:200px" /> <input class="easyui-textbox" data-options="required:true" id="TABLE_ID" name="FIELD_TABLE_ID" style="width:200px" />
</td> </td>
</tr> </tr>
<tr>
<td class="tableStyleLable">
<span>KEY:</span>
</td>
<td>
<input class="easyui-textbox" data-options="required:true" id="DEPLOYMENT_KEY" name="FIELD_DEPLOYMENT_KEY" style="width:200px" />
</td>
</tr>
</table> </table>
</form> </form>
\ No newline at end of file
...@@ -101,7 +101,8 @@ function formatMenu(value, data,index) { ...@@ -101,7 +101,8 @@ function formatMenu(value, data,index) {
//上浮横向菜单集里的具体菜单项(需更改) //上浮横向菜单集里的具体菜单项(需更改)
function getOptionMenu(data,index){ function getOptionMenu(data,index){
var returnData= "<span class=\"icon-edit\" style=\"padding-left:20px;*width:20px;\"></span><a href=\"javascript:void(0);\" onclick=\"design('" var returnData= "<span class=\"icon-edit\" style=\"padding-left:20px;*width:20px;\"></span><a href=\"javascript:void(0);\" onclick=\"design('"
+ index + "')\">设计</a> | <span class=\"icon-ext-file\" style=\"padding-left:20px;*width:20px;\"></span><a href=\"javascript:void(0);\" onclick=\"deploy('" + index + "')\">设计</a> | <span class=\"icon-ext-file\" style=\"padding-left:20px;*width:20px;\"></span><a href=\"javascript:void(0);\" onclick=\"configureUser('"
+ index + "')\">人员</a> | <span class=\"icon-ext-file\" style=\"padding-left:20px;*width:20px;\"></span><a href=\"javascript:void(0);\" onclick=\"deploy('"
+ 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-clear\" style=\"padding-left:20px;*width:20px;\"></span><a href=\"javascript:void(0);\" onclick=\"deleteRow('"
+ index + "')\">删除</a>"; + index + "')\">删除</a>";
return returnData; return returnData;
...@@ -381,5 +382,8 @@ function deploy(index){ ...@@ -381,5 +382,8 @@ function deploy(index){
$.messager.alert('提示',v_result.VALUE); $.messager.alert('提示',v_result.VALUE);
} }
}); });
}
function configureUser(index){
} }
//此乃本模块与后台交互的方法接口部分
var procinstanceModule = function(format) {
this.module = "";
this.action = "";
this.format = format;
};
//定义数据交互
procinstanceModule.prototype = BusinessObject;
//插入流程实例
procinstanceModule.prototype.insertInfo = function(){};
//修改流程实例
procinstanceModule.prototype.updateInfo = function(){};
//删除流程实例
procinstanceModule.prototype.deleteInfo = function(){};
//创建一个数据操作对象,然后再后续使用
procinstanceModule.act = new procinstanceModule("json").delegate("procinstanceAct");
//创建一个数据获取对象,然后再后续使用
procinstanceModule.data = new procinstanceModule("json").delegate("procinstanceData");
//说明: 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':'保存失败'}}}]
...@@ -70,10 +70,20 @@ for(var i=1;i<v_data_procdefinition.length;i++){ ...@@ -70,10 +70,20 @@ for(var i=1;i<v_data_procdefinition.length;i++){
**/ **/
//定义grid列表 //定义grid列表
var ls_title=null; var ls_title=null;
var is_column = [ [ var is_column = [[
{field : 'NAME',title : '模板名称',width : 100,align : 'center'}, {field:'PROC_NAME',title:'流程',width:100},
{field : 'KEY',title : 'KEY',width : 80,align : 'center'} {field:'INSTANCE_ID',title:'实例id',width:80},
] ]; {field:'CREATE_TIME',title:'新建时间',width:130,formatter:function(value,row,index){
return value;
}},
{field:'COMPLETE',title:'进度',width:80,formatter:function(value,row,index){
if(value==0){
return "进行中";
}else{
return "完成";
}
}}
]];
//列表加载完成回调 //列表加载完成回调
function dataOnLoadSuccess(){ function dataOnLoadSuccess(){
...@@ -112,8 +122,8 @@ function formatMenu(value, data,index) { ...@@ -112,8 +122,8 @@ function formatMenu(value, data,index) {
//上浮横向菜单集里的具体菜单项(需更改) //上浮横向菜单集里的具体菜单项(需更改)
function getOptionMenu(data,index){ function getOptionMenu(data,index){
var returnData= "<span class=\"icon-edit\" style=\"padding-left:20px;*width:20px;\"></span><a href=\"javascript:void(0);\" onclick=\"design('" var returnData= "<span class=\"icon-edit\" style=\"padding-left:20px;*width:20px;\"></span><a href=\"javascript:void(0);\" onclick=\"showProcinstanceImg('"
+ index + "')\">设计</a> | <span class=\"icon-ext-file\" style=\"padding-left:20px;*width:20px;\"></span><a href=\"javascript:void(0);\" onclick=\"deploy('" + index + "')\">流程图</a> | <span class=\"icon-ext-file\" style=\"padding-left:20px;*width:20px;\"></span><a href=\"javascript:void(0);\" onclick=\"deploy('"
+ 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-clear\" style=\"padding-left:20px;*width:20px;\"></span><a href=\"javascript:void(0);\" onclick=\"deleteRow('"
+ index + "')\">删除</a>"; + index + "')\">删除</a>";
return returnData; return returnData;
...@@ -145,7 +155,7 @@ function addRow(){ ...@@ -145,7 +155,7 @@ function addRow(){
} }
var is_row={OPETYPE:'insert',PROCDEFINITION_UUID:procdefinitionUuid}; var is_row={OPETYPE:'insert',PROCDEFINITION_UUID:procdefinitionUuid};
openEditRow("procinstanceView_procinstanceTabDetail",is_row,"新增",true,0.95,0.95,0,0); openProcEditRow("procinstanceView_procinstanceTabDetail",is_row,"新增",true,0.95,0.95,0,0);
} }
//加载增加子页面成功后的回调 //加载增加子页面成功后的回调
function addUrlOnloadCallback(is_row){ function addUrlOnloadCallback(is_row){
...@@ -163,8 +173,8 @@ function addUrlOnloadCallback(is_row){ ...@@ -163,8 +173,8 @@ function addUrlOnloadCallback(is_row){
} }
//保存 //保存
function insertData(is_entity){ function insertData(is_entity){
is_entity.FIELD_PROCID=$("#PROCID").val(); is_entity.FIELD_PROCID=$('#detail #FIELD_PROCDEFINITION_UUID').combobox("getValue");
var v_result = procdefinitionmodelsModule.act.insertProcdefinitionmodels(is_entity); var v_result = procinstanceModule.act.insertInfo(is_entity);
$('#list').datagrid('reload'); $('#list').datagrid('reload');
return v_result; return v_result;
} }
...@@ -282,8 +292,53 @@ function refreshRow(){ ...@@ -282,8 +292,53 @@ function refreshRow(){
* 备注:需更改 * 备注:需更改
**/ **/
function searchRow(){ function searchRow(){
var v_query = $("#procdefinitionmodelsTab_searchForm").getFormVal(); var v_query = $("#procinstanceTab_searchForm").getFormVal();
$('#list').datagrid('load',v_query); var FIELD_PROCDEFINITION_UUID=$('#FIELD_PROCDEFINITION_UUID').combobox('getValue');
if(FIELD_PROCDEFINITION_UUID=='-- 全部 --'||FIELD_PROCDEFINITION_UUID==''){
delete v_query.FIELD_PROCDEFINITION_UUID;
$('#list').datagrid({
columns:is_column,
queryParams:v_query
});
}else {
$('#list').datagrid({
columns : [ [ {
field : 'PEOPLE',
title : '请假人',
width : 80
}, {
field : 'REASON',
title : '原因',
width : 80
}, {
field : 'INSTANCE_ID',
title : '环节',
width : 80
}, {
field : 'CREATE_TIME',
title : '新建时间',
width : 130,
formatter : function(value, row, index) {
return value;
}
},
{
field : 'COMPLETE',
title : '进度',
width : 80,
formatter : function(value, row, index) {
if (value == 0) {
return "进行中";
} else {
return "完成";
}
}
} ] ],
queryParams:v_query
});
}
//$('#list').datagrid('load',v_query);
} }
/****/ /****/
...@@ -402,4 +457,17 @@ function fillTable(){ ...@@ -402,4 +457,17 @@ function fillTable(){
}else{ }else{
$("#table_content").html(table_content.MODEL_CONTENT); $("#table_content").html(table_content.MODEL_CONTENT);
} }
}
function showProcinstanceImg(index) {
$('#list').datagrid('selectRow', index);
var is_row = $('#list').datagrid('getSelections');
$('#list').datagrid('clearSelections');
easyui.dialog({
width : 1000,
height : 500,
title : '流程图',
content:'<img src="procinstanceData_showProcinstanceImg?instanceId='+is_row[0].INSTANCE_ID+'" />'
});
} }
\ No newline at end of file
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
流程: <input class="easyui-textbox" id="FIELD_PROCDEFINITION_UUID" name="FIELD_PROCDEFINITION_UUID" style="width:200px" value="${is_row.PROCDEFINITION_UUID}"/>&nbsp;&nbsp; 流程: <input class="easyui-textbox" id="FIELD_PROCDEFINITION_UUID" name="FIELD_PROCDEFINITION_UUID" style="width:200px" value="${is_row.PROCDEFINITION_UUID}"/>&nbsp;&nbsp;
</form> </form>
<form id="inputForm" method="post" style="width: 100%;"> <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}" /> <input type="hidden" name="FIELD_OPETYPE" id="OPETYPE" value="${is_row.OPETYPE}" />
<input type="hidden" name="FIELD_UUID" id="UUID" value="${is_row.UUID}" />
<div id="table_content"></div> <div id="table_content"></div>
</form> </form>
\ No newline at end of file
...@@ -6,8 +6,8 @@ userDefaultPass = 0000 ...@@ -6,8 +6,8 @@ userDefaultPass = 0000
uploadPath=c:/temp/ uploadPath=c:/temp/
uploadMaxSize=10485760 uploadMaxSize=10485760
#------------license---------------------------- #------------license----------------------------
licensenumber=A010000002 licensenumber=A010000003
licensedsoftware=A040000002 licensedsoftware=A040000007
licensemaccharset=gbk licensemaccharset=gbk
licensemacshowcmd=false licensemacshowcmd=false
licensemacadress=00-21-CC-C9-D2-29 licensemacadress=00-21-CC-C9-D2-29
......
...@@ -95,6 +95,14 @@ ...@@ -95,6 +95,14 @@
<result name="json" type="json"> <result name="json" type="json">
<param name="root">jsonObject</param> <param name="root">jsonObject</param>
</result> </result>
<result name="download" type="stream">
<!-- 下载的文件数据存放的方法,该方法返回一个InputStream 例如取值为inputStream的属性需要编写getInputStream()方法 -->
<param name="inputName">inputStream</param>
<!--下载时,客户端显示的下载的文件名 -->
<param name="contentDisposition"> filename=${fileName}</param>
<!-- 数据的缓冲大小 -->
<param name="bufferSize">1024</param>
</result>
</action> </action>
</package> </package>
</struts> </struts>
...@@ -3,6 +3,8 @@ package com.gaowj.activiti.listener; ...@@ -3,6 +3,8 @@ package com.gaowj.activiti.listener;
import org.activiti.engine.delegate.DelegateTask; import org.activiti.engine.delegate.DelegateTask;
import org.activiti.engine.delegate.TaskListener; import org.activiti.engine.delegate.TaskListener;
import com.gaowj.business.util.SessionUtil;
public class AssignmentTaskListener implements TaskListener { public class AssignmentTaskListener implements TaskListener {
/** /**
...@@ -12,7 +14,25 @@ public class AssignmentTaskListener implements TaskListener { ...@@ -12,7 +14,25 @@ public class AssignmentTaskListener implements TaskListener {
@Override @Override
public void notify(DelegateTask task) { public void notify(DelegateTask task) {
task.setAssignee("xiaohong"); /*System.out.println(task.getAssignee());
System.out.println(task.getCategory());
System.out.println(task.getDescription());
System.out.println(task.getEventName());
System.out.println(task.getExecutionId());
System.out.println(task.getFormKey());
System.out.println(task.getId());
System.out.println(task.getName());
System.out.println(task.getOwner());
System.out.println(task.getPriority());
System.out.println(task.getProcessDefinitionId());
System.out.println(task.getProcessInstanceId());
System.out.println(task.getTaskDefinitionKey());
System.out.println(task.getTenantId());
System.out.println(task.getVariables().toString());*/
task.setAssignee(SessionUtil.getCode());
//
} }
} }
...@@ -12,39 +12,44 @@ public interface FormfieldBusiness { ...@@ -12,39 +12,44 @@ public interface FormfieldBusiness {
/** /**
* 插入 * 插入
*
* @param entity * @param entity
* @throws BusinessException * @throws BusinessException
*/ */
void insert_form_field(Map<String,Object> entity) throws BusinessException ; void insert_form_field(Map<String, Object> entity) throws BusinessException;
/** /**
* 更新 * 更新
*
* @param entity * @param entity
* @throws BusinessException * @throws BusinessException
*/ */
void update_form_field(Map<String,Object> entity) throws BusinessException ; void update_form_field(List<Map<String, Object>> list, String tableId) throws BusinessException;
/** /**
* 删除记录 * 删除记录
*
* @param entity * @param entity
* @throws BusinessException * @throws BusinessException
*/ */
void delete_form_field(List<String> list)throws BusinessException; void delete_form_field(List<String> list) throws BusinessException;
/** /**
* 根据tableid做删除 * 根据tableid做删除
* @param list *
* @throws BusinessException * @param list
*/ * @throws BusinessException
void delete_form_field_byTableid(List<String> list)throws BusinessException; */
void delete_form_field_byTableid(List<String> list) throws BusinessException;
List<Map<String,Object>> list_form_field(Map<String, Object> query) throws BusinessException;
List<Map<String, Object>> list_form_field(Map<String, Object> query) throws BusinessException;
/**
* 根据tableid做查询 /**
* @param tableid * 根据tableid做查询
* @return *
* @throws BusinessException * @param tableid
*/ * @return
List<Map<String, Object>> list_form_field_byTableid(String tableid) throws BusinessException; * @throws BusinessException
*/
List<Map<String, Object>> list_form_field_byTableid(String tableid) throws BusinessException;
} }
package com.gaowj.business; package com.gaowj.business;
import java.io.InputStream;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -57,4 +58,14 @@ public interface ProcinstanceBusiness { ...@@ -57,4 +58,14 @@ public interface ProcinstanceBusiness {
* @throws BusinessException * @throws BusinessException
*/ */
int listCount_proc_instance(Map<String, Object> query) throws BusinessException; int listCount_proc_instance(Map<String, Object> query) throws BusinessException;
/**
* 根据流程实例id获取流程图(当前环节高亮显示)
*
* @param instanceId
* @param filename
* @return
* @throws BusinessException
*/
InputStream viewPic(String instanceId, StringBuffer filename) throws BusinessException;
} }
...@@ -63,29 +63,18 @@ public class FormfieldBusinessImpl implements FormfieldBusiness{ ...@@ -63,29 +63,18 @@ public class FormfieldBusinessImpl implements FormfieldBusiness{
} }
formfieldDAO.insert_form_field(entity); formfieldDAO.insert_form_field(entity);
entity.clear(); entity.clear();
} }
@Override @Override
public void update_form_field(Map<String, Object> entity) public void update_form_field(List<Map<String, Object>> list,String tableId)
throws BusinessException { throws BusinessException {
// TODO Auto-generated method stub //清除原先的所有字段信息
List<Map<String, Object>> updateList = new ArrayList<Map<String, Object>>(); List<String> listTable=new ArrayList<String>();
listTable.add(tableId);
if(entity.keySet()!=null){ formfieldDAO.delete_form_field_byTableid(listTable);
Set<String> key = entity.keySet(); //插入现在的字段信息
Map<String, Object> param=new HashMap<String, Object>(); for(Map<String, Object> field:list){
// 将map集合中的key和value 取出来分别放到list集合里 insert_form_field(field);
for (String str : key) {
Map<String, Object> updateMap = new HashMap<String, Object>();
if (StringUtils.equalsIgnoreCase("UUID",str)) continue;
updateMap.put("key", str);
updateMap.put("value", entity.get(str));
updateList.add(updateMap);
}
param.put("UUID", entity.get("UUID"));
param.put("info", updateList);
formfieldDAO.update_form_field(param);
} }
} }
......
...@@ -7,6 +7,7 @@ import java.util.HashMap; ...@@ -7,6 +7,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.UUID;
import org.activiti.engine.RepositoryService; import org.activiti.engine.RepositoryService;
import org.activiti.engine.delegate.Expression; import org.activiti.engine.delegate.Expression;
...@@ -22,11 +23,10 @@ import org.apache.ibatis.session.RowBounds; ...@@ -22,11 +23,10 @@ import org.apache.ibatis.session.RowBounds;
import com.gaowj.business.ProcdefinitionBusiness; import com.gaowj.business.ProcdefinitionBusiness;
import com.gaowj.business.exception.BusinessException; import com.gaowj.business.exception.BusinessException;
import com.gaowj.business.procdefinitionInitlink.procdefinitionInitlinkDAO; import com.gaowj.business.procdefinitionInitlink.procdefinitionInitlinkDAO;
import com.gaowj.business.formmodels.formmodelsDAO;
import com.gaowj.business.util.Page; import com.gaowj.business.util.Page;
import com.gaowj.business.util.SessionUtil; import com.gaowj.business.util.SessionUtil;
import com.gaowj.business.formmodels.formmodelsDAO;
public class ProcdefinitionBusinessImpl implements ProcdefinitionBusiness { public class ProcdefinitionBusinessImpl implements ProcdefinitionBusiness {
private procdefinitionDAO procdefinitionDAO; private procdefinitionDAO procdefinitionDAO;
...@@ -90,6 +90,7 @@ public class ProcdefinitionBusinessImpl implements ProcdefinitionBusiness { ...@@ -90,6 +90,7 @@ public class ProcdefinitionBusinessImpl implements ProcdefinitionBusiness {
if (entity.get("UPDATE_TIME") == null) { if (entity.get("UPDATE_TIME") == null) {
entity.put("UPDATE_TIME", new Date()); entity.put("UPDATE_TIME", new Date());
} }
entity.put("DEPLOYMENT_KEY", UUID.randomUUID().toString());
// 动态传值插入 // 动态传值插入
List<String> infoListKey = new ArrayList<String>(); List<String> infoListKey = new ArrayList<String>();
...@@ -113,6 +114,8 @@ public class ProcdefinitionBusinessImpl implements ProcdefinitionBusiness { ...@@ -113,6 +114,8 @@ public class ProcdefinitionBusinessImpl implements ProcdefinitionBusiness {
// 动态传值修改 // 动态传值修改
if (entity.keySet() != null) { if (entity.keySet() != null) {
convertEntity(entity); convertEntity(entity);
//禁止修改key值
entity.remove("DEPLOYMENT_KEY");
procdefinitionDAO.update_procde_finition(entity); procdefinitionDAO.update_procde_finition(entity);
entity.remove("info"); entity.remove("info");
} }
......
...@@ -19,4 +19,6 @@ public interface procdefinitionDAO { ...@@ -19,4 +19,6 @@ public interface procdefinitionDAO {
List<Map<String, Object>> list_procde_finition(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; int listCount_procde_finition(Map<String, Object> query) throws BusinessException;
void insert_custom_business(Map<String, Object> entity) throws BusinessException;
} }
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
<![CDATA[ <![CDATA[
select f.* select f.*
from ( from (
SELECT a.*,b.content FROM c_t_proc_definition a SELECT a.*,b.content,b.table_name FROM c_t_proc_definition a
LEFT JOIN c_t_form_table b ON a.table_id=b.uuid LEFT JOIN c_t_form_table b ON a.table_id=b.uuid
) f ) f
]]> ]]>
...@@ -73,4 +73,19 @@ ...@@ -73,4 +73,19 @@
<include refid="Where_Clause" /> <include refid="Where_Clause" />
</select> </select>
<insert id="insert_custom_business" parameterType="map">
insert into ${tableName}(
<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>
</mapper> </mapper>
\ No newline at end of file
...@@ -247,7 +247,7 @@ public class ProcdefinitionmodelsBusinessImpl implements ProcdefinitionmodelsBus ...@@ -247,7 +247,7 @@ public class ProcdefinitionmodelsBusinessImpl implements ProcdefinitionmodelsBus
String processName = modelData.getName() + ".bpmn20.xml"; String processName = modelData.getName() + ".bpmn20.xml";
Deployment deployment = repositoryService.createDeployment().name(modelData.getName()).addString(processName, new String(bpmnBytes)).deploy(); Deployment deployment = repositoryService.createDeployment().name(modelData.getName()).addString(processName, new String(bpmnBytes),"GBK").deploy();
// 将部署id存入流程定义表 // 将部署id存入流程定义表
Map<String, Object> entity = new HashMap<String, Object>(); Map<String, Object> entity = new HashMap<String, Object>();
entity.put("UUID", procId); entity.put("UUID", procId);
......
package com.gaowj.business.procinstance; package com.gaowj.business.procinstance;
import java.io.InputStream;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set;
import org.activiti.engine.ManagementService; import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
import org.activiti.bpmn.converter.BpmnXMLConverter;
import org.activiti.bpmn.model.BpmnModel;
import org.activiti.engine.HistoryService;
import org.activiti.engine.RepositoryService; import org.activiti.engine.RepositoryService;
import org.activiti.engine.RuntimeService; import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
import org.activiti.engine.history.HistoricActivityInstance;
import org.activiti.engine.history.HistoricProcessInstance;
import org.activiti.engine.repository.ProcessDefinition;
import org.activiti.engine.runtime.ProcessInstance; import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.runtime.ProcessInstanceQuery; import org.activiti.image.impl.DefaultProcessDiagramGenerator;
import org.apache.ibatis.session.RowBounds;
import com.gaowj.business.ProcinstanceBusiness; import com.gaowj.business.ProcinstanceBusiness;
import com.gaowj.business.exception.BusinessException; import com.gaowj.business.exception.BusinessException;
import com.gaowj.business.formtable.formtableDAO;
import com.gaowj.business.procdefinition.procdefinitionDAO; import com.gaowj.business.procdefinition.procdefinitionDAO;
import com.gaowj.business.util.Page; import com.gaowj.business.util.Page;
import com.gaowj.business.util.SessionUtil;
public class ProcinstanceBusinessImpl implements ProcinstanceBusiness { public class ProcinstanceBusinessImpl implements ProcinstanceBusiness {
private procinstanceDAO procinstanceDAO;
private procdefinitionDAO procdefinitionDAO; private procdefinitionDAO procdefinitionDAO;
private formtableDAO formtableDAO;
private RuntimeService runtimeService; private RuntimeService runtimeService;
private TaskService taskService;
private HistoryService historyService;
private RepositoryService repositoryService;
public RuntimeService getRuntimeService() { public RuntimeService getRuntimeService() {
return runtimeService; return runtimeService;
...@@ -40,10 +67,140 @@ public class ProcinstanceBusinessImpl implements ProcinstanceBusiness { ...@@ -40,10 +67,140 @@ public class ProcinstanceBusinessImpl implements ProcinstanceBusiness {
} }
public formtableDAO getFormtableDAO() {
return formtableDAO;
}
public void setFormtableDAO(formtableDAO formtableDAO) {
this.formtableDAO = formtableDAO;
}
public procinstanceDAO getProcinstanceDAO() {
return procinstanceDAO;
}
public void setProcinstanceDAO(procinstanceDAO procinstanceDAO) {
this.procinstanceDAO = procinstanceDAO;
}
public TaskService getTaskService() {
return taskService;
}
public void setTaskService(TaskService taskService) {
this.taskService = taskService;
}
public HistoryService getHistoryService() {
return historyService;
}
public void setHistoryService(HistoryService historyService) {
this.historyService = historyService;
}
public RepositoryService getRepositoryService() {
return repositoryService;
}
public void setRepositoryService(RepositoryService repositoryService) {
this.repositoryService = repositoryService;
}
@Override @Override
public Map<String, Object> insert_proc_instance(Map<String, Object> entity) throws BusinessException { public Map<String, Object> insert_proc_instance(Map<String, Object> entity) throws BusinessException {
// TODO Auto-generated method stub //流程定义id
return null; String procId=entity.get("PROCID").toString();
Map<String, Object> query=new HashMap<String, Object>();
query.put("UUID", procId);
Map<String, Object> procdeFinition=procdefinitionDAO.list_procde_finition(query).get(0);
//存储自定义表单的业务数据
String businessId=insert_custom_business(procdeFinition.get("TABLE_ID").toString(),entity);
//通过流程定义id启动流程
String deploymentKey=procdeFinition.get("DEPLOYMENT_KEY").toString();
ProcessInstance processInstance=runtimeService.startProcessInstanceByKey(deploymentKey);
//存储流程实例id和业务数据id的关联
insertProcInstance(procId,businessId,processInstance.getId());
/*//第一步,通过流程定义id启动流程
String deploymentKey=procdeFinition.get("DEPLOYMENT_KEY").toString();
ProcessInstance processInstance=runtimeService.startProcessInstanceByKey(deploymentKey);
//第二步,存储自定义表单的业务数据
String businessId=insert_custom_business(procdeFinition.get("TABLE_ID").toString(),entity);
//第三步,存储流程实例id和业务数据id的关联
insertProcInstance(businessId,processInstance.getId());*/
return entity;
}
private void insertProcInstance(String procId,String businessId, String instanceId) {
Map<String, Object> entity = new HashMap<String, Object>();
entity.put("BUSINESS_ID", businessId);
if (instanceId != null) {
entity.put("INSTANCE_ID", instanceId);
}
entity.put("PROC_DEFINITION_ID", procId);
entity.put("UUID", java.util.UUID.randomUUID().toString());
entity.put("CREATE_TIME", new Date());
entity.put("CREATE_ID", SessionUtil.getCode());
entity.put("UPDATE_ID", SessionUtil.getCode());
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);
}
procinstanceDAO.insert_proc_instance(entity);
}
private String insert_custom_business(String tableId,Map<String, Object> entity) {
entity.remove("PROCID");
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());
}
Map<String, Object> query=new HashMap<String, Object>();
query.put("UUID", tableId);
// 动态传值插入
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);
}
//设置表名
String tableName=formtableDAO.list_form_table(query).get(0).get("TABLE_NAME").toString();
entity.put("tableName", tableName);
procdefinitionDAO.insert_custom_business(entity);
return entity.get("UUID").toString();
} }
@Override @Override
...@@ -60,8 +217,59 @@ public class ProcinstanceBusinessImpl implements ProcinstanceBusiness { ...@@ -60,8 +217,59 @@ public class ProcinstanceBusinessImpl implements ProcinstanceBusiness {
@Override @Override
public Page<Map<String, Object>> list_proc_instance(int pageNo, int pageSize, Map<String, Object> query) throws BusinessException { public Page<Map<String, Object>> list_proc_instance(int pageNo, int pageSize, Map<String, Object> query) throws BusinessException {
/*List<Task> listTask=taskService.createTaskQuery().taskAssignee(SessionUtil.getCode()).list();
System.out.println(listTask.size());*/
//只查询当前登陆人的实例列表
query.put("CREATE_ID", SessionUtil.getCode());
String procdefinitionUuid = null;
String tableName=null;
boolean notExist=false;
if (query.get("PROCDEFINITION_UUID") != null && !"".equals(query.get("PROCDEFINITION_UUID"))) {
procdefinitionUuid = query.get("PROCDEFINITION_UUID").toString();
query.remove("PROCDEFINITION_UUID");
//通过流程定义id获取表名
Map<String, Object> query2=new HashMap<String, Object>();
query2.put("UUID", procdefinitionUuid);
tableName=procdefinitionDAO.list_procde_finition(query2).get(0).get("TABLE_NAME").toString();
}
// 计算起始记录 // 计算起始记录
int pageStart = (pageNo - 1) * pageSize; int pageStart = (pageNo - 1) * pageSize;
// 获取列表
List<Map<String, Object>> items = null;
if(tableName!=null){
query.put("tableName", tableName);
query.put("PROC_DEFINITION_ID", procdefinitionUuid);
try {
items = procinstanceDAO.list_proc_instance(new RowBounds(pageStart, pageSize), query);
} catch (Exception e) {
if(e.getMessage().indexOf("doesn't exist")!=-1){
//如果有XX不存在字样,说明当前需要查询的表不存在,则直接设置为空list
items=new ArrayList<Map<String, Object>>();
notExist=true;
}
}
}else{
items = procinstanceDAO.list_proc_instance_all(new RowBounds(pageStart, pageSize), query);
}
// 获取列表个数
int count = 0;
if (!notExist) {
// 如果表存在,则继续查询数量
count = listCount_proc_instance(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;
/*// 计算起始记录
int pageStart = (pageNo - 1) * pageSize;
ProcessInstanceQuery leaveDynamicQuery = runtimeService.createProcessInstanceQuery() ProcessInstanceQuery leaveDynamicQuery = runtimeService.createProcessInstanceQuery()
.orderByProcessInstanceId().desc().active(); .orderByProcessInstanceId().desc().active();
if(query.get("PROCDEFINITION_UUID")!=null&&!"".equals(query.get("PROCDEFINITION_UUID"))){ if(query.get("PROCDEFINITION_UUID")!=null&&!"".equals(query.get("PROCDEFINITION_UUID"))){
...@@ -89,7 +297,7 @@ public class ProcinstanceBusinessImpl implements ProcinstanceBusiness { ...@@ -89,7 +297,7 @@ public class ProcinstanceBusinessImpl implements ProcinstanceBusiness {
page.setLimit(pageSize); page.setLimit(pageSize);
page.setCount(count); page.setCount(count);
page.setItems(items); page.setItems(items);
return page; return page;*/
} }
@Override @Override
...@@ -100,8 +308,73 @@ public class ProcinstanceBusinessImpl implements ProcinstanceBusiness { ...@@ -100,8 +308,73 @@ public class ProcinstanceBusinessImpl implements ProcinstanceBusiness {
@Override @Override
public int listCount_proc_instance(Map<String, Object> query) throws BusinessException { public int listCount_proc_instance(Map<String, Object> query) throws BusinessException {
// TODO Auto-generated method stub if(query.get("tableName")==null){
return 0; return procinstanceDAO.listCount_proc_instance_all(query);
}
return procinstanceDAO.listCount_proc_instance(query);
}
@Override
public InputStream viewPic(String instanceId, StringBuffer filename) throws BusinessException {
InputStream imageStream = null;
// 获取历史流程实例
HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery().processInstanceId(instanceId).singleResult();
if (historicProcessInstance == null) {
throw new BusinessException("Instance doesn't exist.");
} else {
// 获取图片资源名称
List<String> list = repositoryService.getDeploymentResourceNames(historicProcessInstance.getProcessDefinitionId());
// 定义图片资源的名称(一个流程定义,默认都有两个资源文件,一个是png,一个是xml,这里只获取png)
String resourceName = "";
if (list != null && list.size() > 0) {
for (String name : list) {
if (name.indexOf(".png") >= 0) {
resourceName = name;
}
}
}
filename.append(resourceName);
// 获取流程历史中已执行节点,并按照节点在流程中执行先后顺序排序
List<HistoricActivityInstance> historicActivityInstanceList = historyService.createHistoricActivityInstanceQuery().processInstanceId(instanceId).orderByHistoricActivityInstanceId().asc().list();
// 已执行的节点ID集合
List<String> executedActivityIdList = new ArrayList<String>();
@SuppressWarnings("unused")
int index = 1;
for (HistoricActivityInstance activityInstance : historicActivityInstanceList) {
executedActivityIdList.add(activityInstance.getActivityId());
index++;
}
// 获取流程定义对象
ProcessDefinition processDefinition=repositoryService.createProcessDefinitionQuery().processDefinitionId(historicProcessInstance.getProcessDefinitionId()).singleResult();
String xmlName = processDefinition.getResourceName();
// 获取流程资源
InputStream inputStream = repositoryService.getResourceAsStream(processDefinition.getDeploymentId(), xmlName);
// 创建转换对象
BpmnXMLConverter converter = new BpmnXMLConverter();
// 读取xml文件
XMLInputFactory factory = XMLInputFactory.newInstance();
XMLStreamReader reader=null;
try {
reader = factory.createXMLStreamReader(inputStream);
} catch (XMLStreamException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
// 将xml文件转换成BpmnModel
BpmnModel bpmnModel = converter.convertToBpmnModel((XMLStreamReader) reader);
// BpmnModel bpmnModel =
// this.repositoryService.getBpmnModel(historicProcessInstance.getProcessDefinitionId());
//imageStream = new DefaultProcessDiagramGenerator().generateDiagram(bpmnModel, "png", executedActivityIdList);
imageStream = new DefaultProcessDiagramGenerator().generateDiagram(bpmnModel, "png", executedActivityIdList,
Collections.<String>emptyList(),
"宋体",
"宋体",
null, 1.0);
}
return imageStream;
} }
} }
package com.gaowj.business.procinstance; package com.gaowj.business.procinstance;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import com.gaowj.business.exception.BusinessException;
public interface procinstanceDAO { public interface procinstanceDAO {
void insert_proc_instance(Map<String, Object> entity) throws BusinessException;
void update_proc_instance(Map<String, Object> entity) throws BusinessException;
void delete_proc_instance(List<String> list) throws BusinessException;
List<Map<String, Object>> list_proc_instance(RowBounds rowbounds, Map<String, Object> query) throws BusinessException;
List<Map<String, Object>> list_proc_instance(Map<String, Object> query) throws BusinessException;
int listCount_proc_instance(Map<String, Object> query) throws BusinessException;
List<Map<String, Object>> list_proc_instance_all(RowBounds rowbounds, Map<String, Object> query) throws BusinessException;
List<Map<String, Object>> list_proc_instance_all(Map<String, Object> query) throws BusinessException;
int listCount_proc_instance_all(Map<String, Object> query) throws BusinessException;
} }
...@@ -9,16 +9,10 @@ ...@@ -9,16 +9,10 @@
<if test="PROC_DEFINITION_ID != null and PROC_DEFINITION_ID != ''"> <if test="PROC_DEFINITION_ID != null and PROC_DEFINITION_ID != ''">
and f.PROC_DEFINITION_ID = #{PROC_DEFINITION_ID} and f.PROC_DEFINITION_ID = #{PROC_DEFINITION_ID}
</if> </if>
<if test="listUUID != null and listUUID != ''">
and f.UUID IN
<foreach collection="listUUID" item="oneUUID" open="(" close=")" separator=",">
#{oneUUID}
</foreach>
</if>
</trim> </trim>
</sql> </sql>
<insert id="insert_procde_finition_models" parameterType="map"> <insert id="insert_proc_instance" parameterType="map">
insert into C_T_PROC_DEFINITION_MODELS( insert into C_T_PROC_INSTANCE(
<trim prefix="" suffixOverrides=","> <trim prefix="" suffixOverrides=",">
<foreach collection="infoListKey" item="key"> <foreach collection="infoListKey" item="key">
${key}, ${key},
...@@ -33,9 +27,9 @@ ...@@ -33,9 +27,9 @@
<![CDATA[ ) ]]> <![CDATA[ ) ]]>
</insert> </insert>
<update id="update_procde_finition_models" parameterType="map"> <update id="update_proc_instance" parameterType="map">
<![CDATA[ <![CDATA[
update C_T_PROC_DEFINITION_MODELS set update C_T_PROC_INSTANCE set
]]> ]]>
<trim prefix="" suffixOverrides=","> <trim prefix="" suffixOverrides=",">
<foreach collection="info" item="info"> <foreach collection="info" item="info">
...@@ -49,9 +43,9 @@ ...@@ -49,9 +43,9 @@
</where> </where>
</update> </update>
<delete id="delete_procde_finition_models" parameterType="list"> <delete id="delete_proc_instance" parameterType="list">
<![CDATA[ <![CDATA[
delete from C_T_PROC_DEFINITION_MODELS where UUID IN delete from C_T_PROC_INSTANCE where UUID IN
]]> ]]>
<foreach collection="list" item="UUID" open="(" separator="," <foreach collection="list" item="UUID" open="(" separator=","
close=")"> close=")">
...@@ -59,19 +53,54 @@ ...@@ -59,19 +53,54 @@
</foreach> </foreach>
</delete> </delete>
<select id="list_procde_finition_models" parameterType="map" resultType="upperCaseKeyMap"> <select id="list_proc_instance" parameterType="map" resultType="upperCaseKeyMap">
<![CDATA[
select f.*
from (
SELECT t.*,ins.proc_definition_id,ins.instance_id,ins.complete FROM ${tableName} t
LEFT JOIN c_t_proc_instance ins
ON t.uuid=ins.business_id
) f
]]>
<include refid="Where_Clause" />
order by f.CREATE_TIME DESC
</select>
<select id="listCount_proc_instance" parameterType="map"
resultType="int">
<![CDATA[
select count(*) c from
(
SELECT t.*,ins.proc_definition_id,ins.instance_id FROM ${tableName} t
LEFT JOIN c_t_proc_instance ins
ON t.uuid=ins.business_id
)
f
]]>
<include refid="Where_Clause" />
</select>
<select id="list_proc_instance_all" parameterType="map" resultType="upperCaseKeyMap">
<![CDATA[ <![CDATA[
select f.* select f.*
from C_T_PROC_DEFINITION_MODELS f from (
SELECT ins.*,def.proc_name from c_t_proc_instance ins
LEFT JOIN c_t_proc_definition def on ins.proc_definition_id=def.uuid
) f
]]> ]]>
<include refid="Where_Clause" /> <include refid="Where_Clause" />
order by f.CREATE_TIME DESC order by f.CREATE_TIME DESC
</select> </select>
<select id="listCount_procde_finition_models" parameterType="map" <select id="listCount_proc_instance_all" parameterType="map"
resultType="int"> resultType="int">
<![CDATA[ <![CDATA[
select count(*) c from C_T_PROC_DEFINITION_MODELS f select count(*) c from
(
SELECT ins.*,def.proc_name from c_t_proc_instance ins
LEFT JOIN c_t_proc_definition def on ins.proc_definition_id=def.uuid
)
f
]]> ]]>
<include refid="Where_Clause" /> <include refid="Where_Clause" />
</select> </select>
......
package com.gaowj.formtable.action; package com.gaowj.formtable.action;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -142,8 +143,10 @@ public class actAction extends BasicAction { ...@@ -142,8 +143,10 @@ public class actAction extends BasicAction {
entity = QueryParamUtil.StringToDate(entity); entity = QueryParamUtil.StringToDate(entity);
business.update_form_table(entity); business.update_form_table(entity);
//做子表的插入 //做子表的插入
Map<String, Object> param=new HashMap<String, Object>(); List<Map<String, Object>> listField=new ArrayList<Map<String, Object>>();
Map<String, Object> param=null;
for(Property property:LIST){ for(Property property:LIST){
param=new HashMap<String, Object>();
if(property==null){ if(property==null){
continue; continue;
} }
...@@ -152,6 +155,7 @@ public class actAction extends BasicAction { ...@@ -152,6 +155,7 @@ public class actAction extends BasicAction {
} }
param.put("UUID", property.getUUID()); param.put("UUID", property.getUUID());
param.put("FIELD_NAME", property.getNAME()); param.put("FIELD_NAME", property.getNAME());
param.put("FIELD_WIDTH", property.getFIELD_WIDTH());
param.put("LENGTH",property.getLENGTH() ); param.put("LENGTH",property.getLENGTH() );
param.put("POINT", property.getPOINT()); param.put("POINT", property.getPOINT());
param.put("TABLE_ID", entity.get("UUID")); param.put("TABLE_ID", entity.get("UUID"));
...@@ -175,8 +179,9 @@ public class actAction extends BasicAction { ...@@ -175,8 +179,9 @@ public class actAction extends BasicAction {
if(property.getFIELD_DEFAULT()!=null&&""!=property.getFIELD_DEFAULT()){ if(property.getFIELD_DEFAULT()!=null&&""!=property.getFIELD_DEFAULT()){
param.put("FIELD_DEFAULT", property.getFIELD_DEFAULT()); param.put("FIELD_DEFAULT", property.getFIELD_DEFAULT());
} }
fieldBusiness.update_form_field(param); listField.add(param);
} }
fieldBusiness.update_form_field(listField,entity.get("UUID").toString());
jsonObject.putAll(Status.getStatusSuccessMessage("修改成功")); jsonObject.putAll(Status.getStatusSuccessMessage("修改成功"));
} catch (Exception e) { } catch (Exception e) {
jsonObject.putAll(Status.getStatusErrorMessage("修改失败")); jsonObject.putAll(Status.getStatusErrorMessage("修改失败"));
......
...@@ -7,7 +7,6 @@ import java.util.Map; ...@@ -7,7 +7,6 @@ import java.util.Map;
import com.gaowj.business.ProcdefinitionBusiness; import com.gaowj.business.ProcdefinitionBusiness;
import com.gaowj.business.ProcdefinitionInitLinkBusiness; import com.gaowj.business.ProcdefinitionInitLinkBusiness;
import com.gaowj.business.StudentBusiness;
import com.gaowj.business.SystemOpeBusiness; import com.gaowj.business.SystemOpeBusiness;
import com.gaowj.business.action.BasicAction; import com.gaowj.business.action.BasicAction;
import com.gaowj.business.comp.BusinessManager; import com.gaowj.business.comp.BusinessManager;
......
package com.gaowj.procinstance.action; package com.gaowj.procinstance.action;
import java.util.List;
import java.util.Map; import java.util.Map;
import com.gaowj.business.ProcdefinitionBusiness;
import com.gaowj.business.ProcdefinitionmodelsBusiness; import com.gaowj.business.ProcdefinitionmodelsBusiness;
import com.gaowj.business.StudentBusiness; import com.gaowj.business.ProcinstanceBusiness;
import com.gaowj.business.SystemOpeBusiness; import com.gaowj.business.SystemOpeBusiness;
import com.gaowj.business.action.BasicAction; import com.gaowj.business.action.BasicAction;
import com.gaowj.business.comp.BusinessManager; import com.gaowj.business.comp.BusinessManager;
...@@ -39,8 +37,8 @@ public class actAction extends BasicAction { ...@@ -39,8 +37,8 @@ public class actAction extends BasicAction {
* @param entity * @param entity
* @throws BusinessException * @throws BusinessException
*/ */
public String insertProcdefinitionmodels() throws BusinessException { public String insertInfo() throws BusinessException {
ProcdefinitionmodelsBusiness business = BusinessManager.getBusiness(ProcdefinitionmodelsBusiness.class); ProcinstanceBusiness business = BusinessManager.getBusiness(ProcinstanceBusiness.class);
Map<String, Object> entity = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX); Map<String, Object> entity = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX);
jsonObject = new JSONObject(); jsonObject = new JSONObject();
...@@ -49,12 +47,12 @@ public class actAction extends BasicAction { ...@@ -49,12 +47,12 @@ public class actAction extends BasicAction {
//去除不要更新的字段 //去除不要更新的字段
entity.remove("OPETYPE"); entity.remove("OPETYPE");
//新增 //新增
Map<String,Object> procdefinitionmodels=business.insert_procde_finition_models(entity); Map<String,Object> procinstance=business.insert_proc_instance(entity);
// 操作日志 // 操作日志
//sysbusiness.insert_logBusiness(具体方法,操作内容,操作描述,操作记录ID,操作记录中文描述,分类) //sysbusiness.insert_logBusiness(具体方法,操作内容,操作描述,操作记录ID,操作记录中文描述,分类)
SystemOpeBusiness sysbusiness = BusinessManager.getBusiness(SystemOpeBusiness.class); SystemOpeBusiness sysbusiness = BusinessManager.getBusiness(SystemOpeBusiness.class);
sysbusiness.insert_logBusiness("insertProcdefinitionmodels", "" + procdefinitionmodels, sysbusiness.insert_logBusiness("insertInfo", "" + procinstance,
"增加流程定义模板数据", (String) entity.get("UUID"), (String) entity.get("CONTENT"), "procdefinitionmodels"); "增加流程实例数据", (String) entity.get("UUID"), (String) entity.get("CONTENT"), "procinstance");
// //
// //
jsonObject.putAll(Status.getStatusSuccessMessage("保存成功")); jsonObject.putAll(Status.getStatusSuccessMessage("保存成功"));
...@@ -65,72 +63,5 @@ public class actAction extends BasicAction { ...@@ -65,72 +63,5 @@ public class actAction extends BasicAction {
return "json"; return "json";
} }
public String updateProcdefinitionmodels() throws BusinessException {
ProcdefinitionmodelsBusiness business = BusinessManager.getBusiness(ProcdefinitionmodelsBusiness.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_models(entity);
// 操作日志
//sysbusiness.insert_logBusiness(具体方法,操作内容,操作描述,操作记录ID,操作记录中文描述,分类)
SystemOpeBusiness sysbusiness = BusinessManager.getBusiness(SystemOpeBusiness.class);
sysbusiness.insert_logBusiness("updateProcdefinitionmodels", "" + entity,
"修改流程定义模板数据", (String) entity.get("UUID"), (String) entity.get("CONTENT"), "procdefinitionmodels");
//
//
jsonObject.putAll(Status.getStatusSuccessMessage("保存成功"));
} catch (Exception e) {
jsonObject.putAll(Status.getStatusErrorMessage("保存失败"));
e.printStackTrace();
}
return "json";
}
public String deleteProcdefinitionmodels() throws BusinessException {
ProcdefinitionmodelsBusiness business = BusinessManager.getBusiness(ProcdefinitionmodelsBusiness.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_models(ListKey);
// 操作日志
SystemOpeBusiness sysbusiness = BusinessManager.getBusiness(SystemOpeBusiness.class);
sysbusiness.insert_logBusiness("deleteProcdefinitionmodels", "" + ListKey,
"删除流程定义模板数据", deletekey, "多个流水号","procdefinitionmodels");
//
jsonObject.putAll(Status.getStatusSuccessMessage("删除成功"));
} catch (Exception e) {
jsonObject.putAll(Status.getStatusErrorMessage("删除失败"));
e.printStackTrace();
}
return "json";
}
public String deploy() throws BusinessException {
ProcdefinitionmodelsBusiness business = BusinessManager.getBusiness(ProcdefinitionmodelsBusiness.class);
Map<String, Object> entity = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX);
try {
business.deploy(entity);
// 操作日志
SystemOpeBusiness sysbusiness = BusinessManager.getBusiness(SystemOpeBusiness.class);
sysbusiness.insert_logBusiness("deploy", "" + entity,
"部署流程定义模板数据", (String) entity.get("UUID"), (String) entity.get("CONTENT"), "procdefinitionmodels");
//
jsonObject.putAll(Status.getStatusSuccessMessage("部署成功"));
} catch (Exception e) {
jsonObject.putAll(Status.getStatusErrorMessage("部署失败"));
e.printStackTrace();
}
return "json";
}
} }
package com.gaowj.procinstance.action; package com.gaowj.procinstance.action;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.sql.SQLException; import java.sql.SQLException;
import java.text.ParseException; import java.text.ParseException;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import com.gaowj.business.ProcdefinitionBusiness;
import com.gaowj.business.ProcinstanceBusiness; import com.gaowj.business.ProcinstanceBusiness;
import com.gaowj.business.action.BasicAction; import com.gaowj.business.action.BasicAction;
import com.gaowj.business.comp.BusinessManager; import com.gaowj.business.comp.BusinessManager;
...@@ -22,6 +26,9 @@ public class dataAction extends BasicAction{ ...@@ -22,6 +26,9 @@ public class dataAction extends BasicAction{
*/ */
private static final long serialVersionUID = -5059421324729466816L; private static final long serialVersionUID = -5059421324729466816L;
private StringBuffer filename=new StringBuffer();
private InputStream is;
private JSONObject jsonObject = new JSONObject(); private JSONObject jsonObject = new JSONObject();
private int rows = 20;// 每页显示的记录数 private int rows = 20;// 每页显示的记录数
private int page = 1;// 当前第几页 private int page = 1;// 当前第几页
...@@ -57,7 +64,7 @@ public class dataAction extends BasicAction{ ...@@ -57,7 +64,7 @@ public class dataAction extends BasicAction{
Page<Map<String, Object>> pageRows = business.list_proc_instance(pageNo,pageSize, query); Page<Map<String, Object>> pageRows = business.list_proc_instance(pageNo,pageSize, query);
setPageCount((pageRows.getCount() - 1) / pageSize + 1); setPageCount((pageRows.getCount() - 1) / pageSize + 1);
Map<String, Object> data = new HashMap<String, Object>(); Map<String, Object> data = new HashMap<String, Object>();
data.put("rowSet", QueryParamUtil.DateToString(pageRows.getItems())); data.put("rowSet", QueryParamUtil.DateTimeToString(pageRows.getItems()));
data.put("pageNo", pageNo); data.put("pageNo", pageNo);
data.put("pageSize", pageSize); data.put("pageSize", pageSize);
data.put("pageCount", pageCount); data.put("pageCount", pageCount);
...@@ -74,4 +81,26 @@ public class dataAction extends BasicAction{ ...@@ -74,4 +81,26 @@ public class dataAction extends BasicAction{
} }
return "json"; return "json";
} }
public String showProcinstanceImg(){
ProcinstanceBusiness business = BusinessManager.getBusiness(ProcinstanceBusiness.class);
is=business.viewPic(request.getParameter("instanceId"),filename);
return "download";
}
public InputStream getInputStream() throws Exception {
return is;
}
public String getFileName() throws UnsupportedEncodingException{
String name=filename.toString();
String agent = request.getHeader("User-agent");
// 如果浏览器是IE浏览器,就得进行编码转换
if (agent.contains("MSIE")) {
name = URLEncoder.encode(name, "UTF-8");
} else {
name = new String(name.getBytes(), "ISO-8859-1");
}
return name;
}
} }
package com.gaowj.util; package com.gaowj.util;
import java.math.BigDecimal;
public class Property { public class Property {
private String IS_NULL; private String IS_NULL;
...@@ -13,7 +15,7 @@ public class Property { ...@@ -13,7 +15,7 @@ public class Property {
private Integer ORDER_NUM; private Integer ORDER_NUM;
private String UUID; private String UUID;
private String IS_SHOW_LIST; private String IS_SHOW_LIST;
private String FIELD_WIDTH; private BigDecimal FIELD_WIDTH;
public String getIS_KEY() { public String getIS_KEY() {
return IS_KEY; return IS_KEY;
} }
...@@ -102,11 +104,11 @@ public class Property { ...@@ -102,11 +104,11 @@ public class Property {
IS_SHOW_LIST = iS_SHOW_LIST; IS_SHOW_LIST = iS_SHOW_LIST;
} }
public String getFIELD_WIDTH() { public BigDecimal getFIELD_WIDTH() {
return FIELD_WIDTH; return FIELD_WIDTH;
} }
public void setFIELD_WIDTH(String fIELD_WIDTH) { public void setFIELD_WIDTH(BigDecimal fIELD_WIDTH) {
FIELD_WIDTH = fIELD_WIDTH; FIELD_WIDTH = fIELD_WIDTH;
} }
......
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