Commit 0ef3a16e by 陈玉兰

提交流程选人

parent 0bd100dc
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<value>classpath:com/gaowj/business/procdefinitionmodels/procdefinitionmodelsDAO.xml</value> <value>classpath:com/gaowj/business/procdefinitionmodels/procdefinitionmodelsDAO.xml</value>
<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>
</list> </list>
</property> </property>
</bean> </bean>
...@@ -34,6 +35,11 @@ ...@@ -34,6 +35,11 @@
<property name="mapperInterface" value="com.gaowj.business.procdefinitionmodels.procdefinitionmodelsDAO" /> <property name="mapperInterface" value="com.gaowj.business.procdefinitionmodels.procdefinitionmodelsDAO" />
<property name="sqlSessionFactory" ref="sqlSessionFactory-process" /> <property name="sqlSessionFactory" ref="sqlSessionFactory-process" />
</bean> </bean>
<bean id="procdefinitionInitlinkDAO" class="org.mybatis.spring.mapper.MapperFactoryBean">
<property name="mapperInterface" value="com.gaowj.business.procdefinitionInitlink.procdefinitionInitlinkDAO" />
<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">
...@@ -49,6 +55,8 @@ ...@@ -49,6 +55,8 @@
<property name="formmodelsDAO" ref="formmodelsDAO"></property> <property name="formmodelsDAO" ref="formmodelsDAO"></property>
<property name="repositoryService" ref="repositoryService"></property> <property name="repositoryService" ref="repositoryService"></property>
<property name="procdefinitionInitlinkDAO" ref="procdefinitionInitlinkDAO"></property>
</bean> </bean>
<bean id="procdefinitionmodelsBusiness" class="com.gaowj.business.procdefinitionmodels.ProcdefinitionmodelsBusinessImpl"> <bean id="procdefinitionmodelsBusiness" class="com.gaowj.business.procdefinitionmodels.ProcdefinitionmodelsBusinessImpl">
...@@ -73,4 +81,8 @@ ...@@ -73,4 +81,8 @@
<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>
</bean> </bean>
<bean id="ProcdefinitionInitLinkBusiness" class="com.gaowj.business.procdefinitionInitlink.ProcdefinitionInitLinkBusinessImpl">
<property name="procdefinitionInitlinkDAO" ref="procdefinitionInitlinkDAO"></property>
</bean>
</beans> </beans>
...@@ -130,7 +130,6 @@ function getOptionMenuCount(){ ...@@ -130,7 +130,6 @@ function getOptionMenuCount(){
//加载增加子页面 //加载增加子页面
function addRow(){ function addRow(){
var is_row={OPETYPE:'insert'}; var is_row={OPETYPE:'insert'};
openEditRow("formmodelView_formmodelTabDetail",is_row,"新增",true,0.95,0.95,0,0); openEditRow("formmodelView_formmodelTabDetail",is_row,"新增",true,0.95,0.95,0,0);
} }
//加载增加子页面成功后的回调 //加载增加子页面成功后的回调
......
...@@ -78,7 +78,7 @@ var list_default_field=[{ ...@@ -78,7 +78,7 @@ var list_default_field=[{
IS_SHOW_LIST:false IS_SHOW_LIST:false
},{ },{
FIELD_NAME:'create_time', FIELD_NAME:'create_time',
LENGTH:0, LENGTH:'',
POINT:0, POINT:0,
FIELD_MUST_INPUT:true, FIELD_MUST_INPUT:true,
IS_KEY:false, IS_KEY:false,
...@@ -102,7 +102,7 @@ var list_default_field=[{ ...@@ -102,7 +102,7 @@ var list_default_field=[{
IS_SHOW_LIST:false IS_SHOW_LIST:false
},{ },{
FIELD_NAME:'update_time', FIELD_NAME:'update_time',
LENGTH:0, LENGTH:'',
POINT:0, POINT:0,
FIELD_MUST_INPUT:true, FIELD_MUST_INPUT:true,
IS_KEY:false, IS_KEY:false,
...@@ -119,10 +119,10 @@ var tr=['<tr>', ...@@ -119,10 +119,10 @@ var tr=['<tr>',
' <td>@{opt}</td>', ' <td>@{opt}</td>',
' <td>@{field_name}</td>', ' <td>@{field_name}</td>',
' <td>@{content}</td>', ' <td>@{content}</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>@{type}</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>',
...@@ -195,9 +195,9 @@ function formatMenu(value, data,index) { ...@@ -195,9 +195,9 @@ 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=\"editRow('" var returnData= "<span class=\"icon-edit\" style=\"padding-left:20px;*width:20px;\"></span><a href=\"javascript:void(0);\" onclick=\"editRow('"
+ index + "')\">编辑</a> | <span class=\"icon-edit\" style=\"padding-left:20px;*width:20px;\"></span><a href=\"javascript:void(0);\" onclick=\"templateRow('" + index + "')\">编辑</a> | <span class=\"icon-edit\" style=\"padding-left:20px;*width:20px;\"></span><a href=\"javascript:void(0);\" onclick=\"templateRow('"
+ 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=\"synchRow('"
+ index + "')\">删除</a> | <span class=\"icon-ext-file\" style=\"padding-left:20px;*width:20px;\"></span><a href=\"javascript:void(0);\" onclick=\"uploadcommonRow('" + index + "')\">同步</a> | <span class=\"icon-ext-file\" style=\"padding-left:20px;*width:20px;\"></span><a href=\"javascript:void(0);\" onclick=\"deleteRow('"
+ index + "')\">附件</a>"; + index + "')\">删除</a>";
return returnData; return returnData;
} }
...@@ -227,6 +227,7 @@ function addRow(){ ...@@ -227,6 +227,7 @@ function addRow(){
} }
//加载增加子页面成功后的回调 //加载增加子页面成功后的回调
function addUrlOnloadCallback(is_row){ function addUrlOnloadCallback(is_row){
initTableInsert(); initTableInsert();
} }
...@@ -238,10 +239,10 @@ function initTableInsert(){ ...@@ -238,10 +239,10 @@ function initTableInsert(){
opt:'操作', opt:'操作',
field_name:'字段名称', field_name:'字段名称',
content:'备注', content:'备注',
type:'数据类型',
length:'长度', length:'长度',
point:'小数点', point:'小数点',
field_default:'默认值', field_default:'默认值',
type:'数据类型',
field_width:'字段宽度', field_width:'字段宽度',
is_key:'主键', is_key:'主键',
is_null:'允许空值', is_null:'允许空值',
...@@ -265,10 +266,10 @@ function initTableInsert(){ ...@@ -265,10 +266,10 @@ function initTableInsert(){
opt:'<input type="checkbox" name="checkbox"/>', opt:'<input type="checkbox" name="checkbox"/>',
field_name:'<input type="text" name="LIST['+i+'].NAME" value="'+field.FIELD_NAME+'" />', field_name:'<input type="text" name="LIST['+i+'].NAME" value="'+field.FIELD_NAME+'" />',
content:'<input type="text" name="LIST['+i+'].CONTENT" value="'+field.CONTENT+'" />', 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+'" />', length:'<input type="text" name="LIST['+i+'].LENGTH" value="'+field.LENGTH+'" />',
point:'<input type="text" name="LIST['+i+'].POINT" value="'+field.POINT+'" />', 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_default:'<input type="text" name="LIST['+i+'].FIELD_DEFAULT" value="'+field.FIELD_DEFAULT+'" />',
type:'<input type="combobox" name="LIST['+i+'].TYPE" value="'+field.TYPE+'" />',
field_width:'<input type="text" name="LIST['+i+'].FIELD_WIDTH" value="'+field.FIELD_WIDTH+'" />', 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_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')+' />', is_null:'<input type="checkbox" value="'+field.IS_NULL+'" name="LIST['+i+'].IS_NULL" '+(field.IS_NULL==false?'':'checked')+' />',
...@@ -281,15 +282,34 @@ function initTableInsert(){ ...@@ -281,15 +282,34 @@ function initTableInsert(){
valueField : 'CODE_ID', valueField : 'CODE_ID',
textField : 'CODE_NAME', textField : 'CODE_NAME',
editable:false, editable:false,
panelHeight:'auto' 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){
if($(element).find('input[name="LIST['+ index +'].TYPE"]').val()=='date'){
$(element).find('input[name="LIST['+ index +'].LENGTH"]').attr("disabled","true");
}
});
$('#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);
}); });
} }
//保存 //保存
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;
...@@ -326,10 +346,10 @@ function initTableUpdate(is_row){ ...@@ -326,10 +346,10 @@ function initTableUpdate(is_row){
opt:'操作', opt:'操作',
field_name:'字段名称', field_name:'字段名称',
content:'备注', content:'备注',
type:'数据类型',
length:'长度', length:'长度',
point:'小数点', point:'小数点',
field_default:'默认值', field_default:'默认值',
type:'数据类型',
field_width:'字段宽度', field_width:'字段宽度',
is_key:'主键', is_key:'主键',
is_null:'允许空值', is_null:'允许空值',
...@@ -350,10 +370,10 @@ function initTableUpdate(is_row){ ...@@ -350,10 +370,10 @@ function initTableUpdate(is_row){
opt:'<input type="checkbox" />', opt:'<input type="checkbox" />',
field_name:'<input type="text" name="LIST['+i+'].NAME" value="'+field.FIELD_NAME+'" />', field_name:'<input type="text" name="LIST['+i+'].NAME" value="'+field.FIELD_NAME+'" />',
content:'<input type="text" name="LIST['+i+'].CONTENT" value="'+field.CONTENT+'" />', 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+'" />', length:'<input type="text" name="LIST['+i+'].LENGTH" value="'+field.LENGTH+'" />',
point:'<input type="text" name="LIST['+i+'].POINT" value="'+field.POINT+'" />', 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_default:'<input type="text" name="LIST['+i+'].FIELD_DEFAULT" value="'+field.FIELD_DEFAULT+'" />',
type:'<input type="combobox" name="LIST['+i+'].TYPE" value="'+field.TYPE+'" />',
field_width:'<input type="text" name="LIST['+i+'].FIELD_WIDTH" value="'+field.FIELD_WIDTH+'" />', 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_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')+' />', is_null:'<input type="checkbox" value="'+field.IS_NULL+'" name="LIST['+i+'].IS_NULL" '+(field.IS_NULL==0?'':'checked')+' />',
...@@ -491,10 +511,10 @@ function addLine(){ ...@@ -491,10 +511,10 @@ function addLine(){
opt:'<input type="checkbox" name="checkbox"/>', opt:'<input type="checkbox" name="checkbox"/>',
field_name:'<input class="easyui-textbox" type="text" name="LIST['+j+'].NAME" required="true"/>', 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"/>', 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"/>', length:'<input type="text" name="LIST['+j+'].LENGTH" value="0"/>',
point:'<input type="text" name="LIST['+j+'].POINT" value="0" />', point:'<input type="text" name="LIST['+j+'].POINT" value="0" />',
field_default:'<input type="text" name="LIST['+j+'].FIELD_DEFAULT" />', field_default:'<input type="text" name="LIST['+j+'].FIELD_DEFAULT" />',
type:'<input type="combobox" name="LIST['+j+'].TYPE" value="varchar"/>',
field_width:'<input type="text" name="LIST['+j+'].FIELD_WIDTH" value="20"/>', field_width:'<input type="text" name="LIST['+j+'].FIELD_WIDTH" value="20"/>',
is_key:'<input type="checkbox" name="LIST['+j+'].IS_KEY" />', is_key:'<input type="checkbox" name="LIST['+j+'].IS_KEY" />',
is_null:'<input type="checkbox" name="LIST['+j+'].IS_NULL" checked/>', is_null:'<input type="checkbox" name="LIST['+j+'].IS_NULL" checked/>',
...@@ -511,7 +531,17 @@ function addLine(){ ...@@ -511,7 +531,17 @@ function addLine(){
valueField : 'CODE_ID', valueField : 'CODE_ID',
textField : 'CODE_NAME', textField : 'CODE_NAME',
editable:false, editable:false,
panelHeight:'auto' 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){ $('#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);
...@@ -534,7 +564,23 @@ function templateRow(index){ ...@@ -534,7 +564,23 @@ function templateRow(index){
$('#list').datagrid('selectRow',index); $('#list').datagrid('selectRow',index);
var is_row = $('#list').datagrid('getSelections'); var is_row = $('#list').datagrid('getSelections');
$('#list').datagrid('clearSelections'); $('#list').datagrid('clearSelections');
var code = is_row[0];
//openEditRow("formmodelView_formmodelTab",is_row[0],"编辑",true,0.65,0.95,0,0);
openViewIframRow("templateIframe","formmodelView_formmodelTab?tableId="+is_row[0].UUID,is_row[0],"流程模板列表",true,0.95,0.95,0,0); openViewIframRow("templateIframe","formmodelView_formmodelTab?tableId="+is_row[0].UUID,is_row[0],"流程模板列表",true,0.95,0.95,0,0);
}
/**
* 同步操作
* @param index
*/
function synchRow(index){
$('#list').datagrid('selectRow',index);
var is_row = $('#list').datagrid('getSelections');
$('#list').datagrid('clearSelections');
if(is_row[0].IS_DBSYNCH=='1'){
$.messager.alert('警告',"该表已同步到数据库",'info');
}
is_row[0].IS_DBSYNCH=1;
formtableModule.act.updateFormTable(is_row[0])
console.log(is_row[0]);
return;
} }
\ No newline at end of file
...@@ -109,13 +109,14 @@ function getOptionMenu(data,index){ ...@@ -109,13 +109,14 @@ function getOptionMenu(data,index){
+ index + "')\">编辑</a> | <span class=\"icon-ext-file\" style=\"padding-left:20px;*width:20px;\"></span><a href=\"javascript:void(0);\" onclick=\"modelList('" + index + "')\">编辑</a> | <span class=\"icon-ext-file\" style=\"padding-left:20px;*width:20px;\"></span><a href=\"javascript:void(0);\" onclick=\"modelList('"
+ index + "')\">模板</a> | <span class=\"icon-ext-file\" style=\"padding-left:20px;*width:20px;\"></span><a href=\"javascript:void(0);\" onclick=\"procdefinitionImg('" + index + "')\">模板</a> | <span class=\"icon-ext-file\" style=\"padding-left:20px;*width:20px;\"></span><a href=\"javascript:void(0);\" onclick=\"procdefinitionImg('"
+ 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> | <span class=\"icon-ext-file\" style=\"padding-left:20px;*width:20px;\"></span><a href=\"javascript:void(0);\" onclick=\"choosePeopleRow('"
+ index + "')\">选人</a> ";
return returnData; return returnData;
} }
//返回菜单集的菜单个数(需更改) //返回菜单集的菜单个数(需更改)
function getOptionMenuCount(){ function getOptionMenuCount(){
var is_menu_count = 4.5; var is_menu_count = 5;
return is_menu_count; return is_menu_count;
} }
...@@ -415,3 +416,20 @@ function procdefinitionImg(index){ ...@@ -415,3 +416,20 @@ function procdefinitionImg(index){
}); });
} }
function choosePeopleRow(index){
$('#list').datagrid('selectRow',index);
var is_row = $('#list').datagrid('getSelections');
$('#list').datagrid('clearSelections');
console.log(is_row[0]);
$.ajax({
url:'procdefinitionAct_procdefinitionInitLink',
type:'post',
data:{
DEPLOYMENT_ID:is_row[0].DEPLOYMENT_ID
},
success:function(data){
console.log(data);
}
})
}
...@@ -109,7 +109,7 @@ function getOptionMenu(data,index){ ...@@ -109,7 +109,7 @@ function getOptionMenu(data,index){
//返回菜单集的菜单个数(需更改) //返回菜单集的菜单个数(需更改)
function getOptionMenuCount(){ function getOptionMenuCount(){
var is_menu_count = 3; var is_menu_count = 4;
return is_menu_count; return is_menu_count;
} }
...@@ -382,4 +382,4 @@ function deploy(index){ ...@@ -382,4 +382,4 @@ function deploy(index){
} }
}); });
} }
\ No newline at end of file
...@@ -51,4 +51,6 @@ public interface FormtableBusiness { ...@@ -51,4 +51,6 @@ public interface FormtableBusiness {
* @throws BusinessException * @throws BusinessException
*/ */
int listCount_form_table(Map<String, Object> query) throws BusinessException ; int listCount_form_table(Map<String, Object> query) throws BusinessException ;
void create_form_table(Map<String, Object> query) throws BusinessException;
} }
...@@ -68,4 +68,7 @@ public interface ProcdefinitionBusiness { ...@@ -68,4 +68,7 @@ public interface ProcdefinitionBusiness {
InputStream viewPic(String deploymentId,StringBuffer filename) throws BusinessException; InputStream viewPic(String deploymentId,StringBuffer filename) throws BusinessException;
String findFormModel(String procdefinitionUuid) throws BusinessException; String findFormModel(String procdefinitionUuid) throws BusinessException;
int init_procde_finition_people_approval(String procdefinitionUuid)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;
@Service
public interface ProcdefinitionInitLinkBusiness {
List<Map<String, Object>> list_procde_finition_init_link(Map<String, Object> entity) throws BusinessException;
void insert_procde_finition_init_link(Map<String, Object> entity) throws BusinessException;
void update_procde_finition_init_link(Map<String, Object> entity) throws BusinessException;
}
...@@ -111,7 +111,7 @@ public class FormtableBusinessImpl implements FormtableBusiness { ...@@ -111,7 +111,7 @@ public class FormtableBusinessImpl implements FormtableBusiness {
@Override @Override
public int listCount_form_table(Map<String, Object> query) throws BusinessException { public int listCount_form_table(Map<String, Object> query) throws BusinessException {
// TODO Auto-generated method stub // TODO Auto-generated method stub
return 0; return formtableDAO.listCount_form_table(query);
} }
/** /**
...@@ -138,4 +138,11 @@ public class FormtableBusinessImpl implements FormtableBusiness { ...@@ -138,4 +138,11 @@ public class FormtableBusinessImpl implements FormtableBusiness {
entity.put("info", updateList); entity.put("info", updateList);
} }
@Override
public void create_form_table(Map<String, Object> query)
throws BusinessException {
// TODO Auto-generated method stub
formtableDAO.create_form_table(query);
}
} }
...@@ -19,4 +19,6 @@ public interface formtableDAO { ...@@ -19,4 +19,6 @@ public interface formtableDAO {
List<Map<String, Object>> list_form_table(Map<String, Object> query) throws BusinessException; List<Map<String, Object>> list_form_table(Map<String, Object> query) throws BusinessException;
int listCount_form_table(Map<String, Object> query) throws BusinessException; int listCount_form_table(Map<String, Object> query) throws BusinessException;
void create_form_table(Map<String, Object> query) throws BusinessException;
} }
...@@ -79,4 +79,19 @@ ...@@ -79,4 +79,19 @@
<include refid="Where_Clause" /> <include refid="Where_Clause" />
</select> </select>
<update id="create_form_table" parameterType="map">
CREATE TABLE ${tableName}(
<trim prefix="" suffixOverrides=",">
<foreach collection="list" item="item">
${item.FIELD_NAME} ${item.TYPE}
<if test="item.LENGTH == null">
#{item.LENGTH},
</if>
<if test="item.LENGTH != null">
(#{item.LENGTH}),
</if>
</foreach>
</trim>
<![CDATA[ ) ]]>
</update>
</mapper> </mapper>
\ No newline at end of file
...@@ -9,11 +9,19 @@ import java.util.Map; ...@@ -9,11 +9,19 @@ import java.util.Map;
import java.util.Set; import java.util.Set;
import org.activiti.engine.RepositoryService; import org.activiti.engine.RepositoryService;
import org.activiti.engine.delegate.Expression;
import org.activiti.engine.impl.bpmn.behavior.UserTaskActivityBehavior;
import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity;
import org.activiti.engine.impl.pvm.delegate.ActivityBehavior;
import org.activiti.engine.impl.pvm.process.ActivityImpl;
import org.activiti.engine.impl.task.TaskDefinition;
import org.activiti.engine.repository.ProcessDefinition;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.ibatis.session.RowBounds; 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.util.Page; import com.gaowj.business.util.Page;
import com.gaowj.business.util.SessionUtil; import com.gaowj.business.util.SessionUtil;
...@@ -27,6 +35,8 @@ public class ProcdefinitionBusinessImpl implements ProcdefinitionBusiness { ...@@ -27,6 +35,8 @@ public class ProcdefinitionBusinessImpl implements ProcdefinitionBusiness {
private RepositoryService repositoryService; private RepositoryService repositoryService;
private procdefinitionInitlinkDAO procdefinitionInitlinkDAO;
public formmodelsDAO getFormmodelsDAO() { public formmodelsDAO getFormmodelsDAO() {
return formmodelsDAO; return formmodelsDAO;
} }
...@@ -43,10 +53,26 @@ public class ProcdefinitionBusinessImpl implements ProcdefinitionBusiness { ...@@ -43,10 +53,26 @@ public class ProcdefinitionBusinessImpl implements ProcdefinitionBusiness {
this.procdefinitionDAO = procdefinitionDAO; this.procdefinitionDAO = procdefinitionDAO;
} }
public RepositoryService getRepositoryService() {
return repositoryService;
}
public void setRepositoryService(RepositoryService repositoryService) { public void setRepositoryService(RepositoryService repositoryService) {
this.repositoryService = repositoryService; this.repositoryService = repositoryService;
} }
public procdefinitionInitlinkDAO getProcdefinitionInitlinkDAO() {
return procdefinitionInitlinkDAO;
}
public void setProcdefinitionInitlinkDAO(
procdefinitionInitlinkDAO procdefinitionInitlinkDAO) {
this.procdefinitionInitlinkDAO = procdefinitionInitlinkDAO;
}
@Override @Override
public Map<String, Object> insert_procde_finition(Map<String, Object> entity) throws BusinessException { public Map<String, Object> insert_procde_finition(Map<String, Object> entity) throws BusinessException {
if (entity.get("UUID") == null) { if (entity.get("UUID") == null) {
...@@ -197,4 +223,83 @@ public class ProcdefinitionBusinessImpl implements ProcdefinitionBusiness { ...@@ -197,4 +223,83 @@ public class ProcdefinitionBusinessImpl implements ProcdefinitionBusiness {
query.put("PROC_NAME", "%" + query.get("PROC_NAME") + "%"); query.put("PROC_NAME", "%" + query.get("PROC_NAME") + "%");
} }
} }
@Override
public int init_procde_finition_people_approval(String DEPLOYMENT_ID)
throws BusinessException {
// TODO Auto-generated method stub
ProcessDefinition processDefinition =repositoryService.createProcessDefinitionQuery().deploymentId(DEPLOYMENT_ID).singleResult();
if(processDefinition == null) {
return -1;
}
Map<String, Object> entity=new HashMap<String, Object>();
entity.put("DEPLOYMENT_ID", DEPLOYMENT_ID);
List<Map<String, Object>> list=procdefinitionInitlinkDAO.list_procde_finition_init_link(entity);
String proDefKey = processDefinition.getKey();
ProcessDefinitionEntity processDef = (ProcessDefinitionEntity) repositoryService.getProcessDefinition(processDefinition.getId());
List<ActivityImpl> activitiList = processDef.getActivities();
for (ActivityImpl activity : activitiList) {
ActivityBehavior activityBehavior = activity.getActivityBehavior();
boolean isFound = false;
//是否为用户任务
if (activityBehavior instanceof UserTaskActivityBehavior) {
UserTaskActivityBehavior userTaskActivityBehavior = (UserTaskActivityBehavior) activityBehavior;
TaskDefinition taskDefinition = userTaskActivityBehavior.getTaskDefinition();
//任务所属角色
String taskDefKey = taskDefinition.getKey();
Expression taskName = taskDefinition.getNameExpression();
//判断表中是否存在此节点
if(list.size() != 0){
for(Map<String, Object> map : list){
Map<String, Object> param=new HashMap<String, Object>();
if(taskDefKey.equals(map.get("LINK_KEY"))){
param.put("UUID", map.get("UUID"));
param.put("DEPLOYMENT_ID", DEPLOYMENT_ID);
param.put("LINK_KEY", taskDefKey);
param.put("LINK_NAME", taskName.toString());
param.put("PROC_DEFIN_KEY", processDefinition.getKey());
param.put("PROC_DEFIN_ID", processDefinition.getId());
param.put("PROC_DEFIN_NAME", processDefinition.getName());
param.put("PROC_DEFIN_VERSION", processDefinition.getVersion());
isFound = true;
break;
}
}
}
if(!isFound){
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());
}
entity.put("DEPLOYMENT_ID", DEPLOYMENT_ID);
entity.put("LINK_KEY", taskDefKey);
entity.put("LINK_NAME", taskName.toString());
entity.put("PROC_DEFIN_KEY", processDefinition.getKey());
entity.put("PROC_DEFIN_ID", processDefinition.getId());
entity.put("PROC_DEFIN_NAME", processDefinition.getName());
entity.put("PROC_DEFIN_VERSION", processDefinition.getVersion());
// 动态传值插入
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);
}
procdefinitionInitlinkDAO.insert_procde_finition_init_link(entity);
entity.clear();
}
}
}
return 1;
}
} }
package com.gaowj.business.procdefinitionInitlink;
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 com.gaowj.business.ProcdefinitionInitLinkBusiness;
import com.gaowj.business.exception.BusinessException;
import com.gaowj.business.util.SessionUtil;
public class ProcdefinitionInitLinkBusinessImpl implements ProcdefinitionInitLinkBusiness{
private procdefinitionInitlinkDAO procdefinitionInitlinkDAO;
public procdefinitionInitlinkDAO getProcdefinitionInitlinkDAO() {
return procdefinitionInitlinkDAO;
}
public void setProcdefinitionInitlinkDAO(
procdefinitionInitlinkDAO procdefinitionInitlinkDAO) {
this.procdefinitionInitlinkDAO = procdefinitionInitlinkDAO;
}
@Override
public void insert_procde_finition_init_link(Map<String, Object> entity)
throws BusinessException {
// TODO Auto-generated method stub
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);
}
procdefinitionInitlinkDAO.insert_procde_finition_init_link(entity);
}
@Override
public List<Map<String, Object>> list_procde_finition_init_link(
Map<String, Object> entity) throws BusinessException {
// TODO Auto-generated method stub
List<Map<String, Object>> result=procdefinitionInitlinkDAO.list_procde_finition_init_link(entity);
return result;
}
@Override
public void update_procde_finition_init_link(Map<String, Object> entity)
throws BusinessException {
// TODO Auto-generated method stub
List<Map<String, Object>> updateList = new ArrayList<Map<String, Object>>();
if(entity.keySet()!=null){
Set<String> key = entity.keySet();
Map<String, Object> param=new HashMap<String, Object>();
// 将map集合中的key和value 取出来分别放到list集合里
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);
procdefinitionInitlinkDAO.update_procde_finition_init_link(entity);
}
}
}
package com.gaowj.business.procdefinitionInitlink;
import java.util.List;
import java.util.Map;
import com.gaowj.business.exception.BusinessException;
public interface procdefinitionInitlinkDAO {
List<Map<String, Object>> list_procde_finition_init_link(Map<String, Object> entity) throws BusinessException;
void insert_procde_finition_init_link(Map<String, Object> entity) throws BusinessException;
void update_procde_finition_init_link(Map<String, Object> entity) 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.procdefinitionInitlink.procdefinitionInitlinkDAO">
<sql id="Where_Clause">
<trim prefix="WHERE" prefixOverrides="AND |OR">
<if test="UUID != null and UUID != ''">
and f.UUID = #{UUID}
</if>
<if test="DEPLOYMENT_ID != null and DEPLOYMENT_ID != ''">
and f.DEPLOYMENT_ID = #{DEPLOYMENT_ID}
</if>
</trim>
</sql>
<insert id="insert_procde_finition_init_link" parameterType="map">
insert into C_T_PROC_DEFINITION_INIT_LINK(
<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_init_link" parameterType="map">
<![CDATA[
update C_T_PROC_DEFINITION_INIT_LINK 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>
<select id="list_procde_finition_init_link" parameterType="map" resultType="upperCaseKeyMap">
<![CDATA[
select f.*
from C_T_PROC_DEFINITION_INIT_LINK f
]]>
<include refid="Where_Clause" />
order by f.CREATE_TIME DESC
</select>
</mapper>
\ No newline at end of file
...@@ -6,6 +6,7 @@ import java.util.List; ...@@ -6,6 +6,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import org.activiti.engine.ManagementService; import org.activiti.engine.ManagementService;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.RuntimeService; import org.activiti.engine.RuntimeService;
import org.activiti.engine.runtime.ProcessInstance; import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.runtime.ProcessInstanceQuery; import org.activiti.engine.runtime.ProcessInstanceQuery;
...@@ -17,6 +18,7 @@ import com.gaowj.business.util.Page; ...@@ -17,6 +18,7 @@ import com.gaowj.business.util.Page;
public class ProcinstanceBusinessImpl implements ProcinstanceBusiness { public class ProcinstanceBusinessImpl implements ProcinstanceBusiness {
private procdefinitionDAO procdefinitionDAO; private procdefinitionDAO procdefinitionDAO;
private RuntimeService runtimeService; private RuntimeService runtimeService;
...@@ -36,6 +38,7 @@ public class ProcinstanceBusinessImpl implements ProcinstanceBusiness { ...@@ -36,6 +38,7 @@ public class ProcinstanceBusinessImpl implements ProcinstanceBusiness {
public void setProcdefinitionDAO(procdefinitionDAO procdefinitionDAO) { public void setProcdefinitionDAO(procdefinitionDAO procdefinitionDAO) {
this.procdefinitionDAO = procdefinitionDAO; this.procdefinitionDAO = procdefinitionDAO;
} }
@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 {
......
...@@ -74,9 +74,13 @@ public class actAction extends BasicAction { ...@@ -74,9 +74,13 @@ public class actAction extends BasicAction {
if(property.getCONTENT()!=null&&""!=property.getCONTENT()){ if(property.getCONTENT()!=null&&""!=property.getCONTENT()){
param.put("CONTENT", property.getCONTENT()); param.put("CONTENT", property.getCONTENT());
} }
if(property.getTYPE().equals("date")||property.getTYPE().equals("text")){
param.put("LENGTH", null);
}else{
param.put("LENGTH", property.getLENGTH());
}
param.put("FIELD_WIDTH", property.getFIELD_WIDTH()); param.put("FIELD_WIDTH", property.getFIELD_WIDTH());
param.put("FIELD_NAME", property.getNAME()); param.put("FIELD_NAME", property.getNAME());
param.put("LENGTH",property.getLENGTH() );
param.put("POINT", property.getPOINT()); param.put("POINT", property.getPOINT());
param.put("TABLE_ID", formTable.get("UUID")); param.put("TABLE_ID", formTable.get("UUID"));
param.put("TYPE", property.getTYPE()); param.put("TYPE", property.getTYPE());
...@@ -102,6 +106,16 @@ public class actAction extends BasicAction { ...@@ -102,6 +106,16 @@ public class actAction extends BasicAction {
fieldBusiness.insert_form_field(param); fieldBusiness.insert_form_field(param);
} }
if(entity.get("IS_DBSYNCH").equals("1")){
String TABLE_ID=formTable.get("UUID").toString();
String TABLE_NAME=formTable.get("TABLE_NAME").toString();
List<Map<String, Object>> result=fieldBusiness.list_form_field_byTableid(TABLE_ID);
Map<String, Object> query=new HashMap<String, Object>();
query.put("tableName", TABLE_NAME);
query.put("list", result);
business.create_form_table(query);
}
jsonObject.putAll(Status.getStatusSuccessMessage("保存成功")); jsonObject.putAll(Status.getStatusSuccessMessage("保存成功"));
} catch (Exception e) { } catch (Exception e) {
jsonObject.putAll(Status.getStatusErrorMessage("保存失败")); jsonObject.putAll(Status.getStatusErrorMessage("保存失败"));
......
...@@ -112,4 +112,11 @@ public class actAction extends BasicAction { ...@@ -112,4 +112,11 @@ public class actAction extends BasicAction {
return "json"; return "json";
} }
public String procdefinitionInitLink() throws BusinessException{
String proce_defin_id=RequestUtils.getString(request, "DEPLOYMENT_ID");
ProcdefinitionBusiness business = BusinessManager.getBusiness(ProcdefinitionBusiness.class);
int code=business.init_procde_finition_people_approval(proce_defin_id);
jsonObject.putAll(Status.getStatusSuccessMessage("成功"));
return "json";
}
} }
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