Merge branch 'master' of http://dev.vci-tech.com:1065/r/ubcs
| | |
| | | data |
| | | }) |
| | | } |
| | | |
| | | //已发布数据更改 |
| | | export function upSaveCode(data) { |
| | | return request({ |
| | | url: 'api/ubcs-code/mdmEngineController/upSaveCode', |
| | | method: 'POST', |
| | | data |
| | | }) |
| | | } |
| | | //流程执行中表头 |
| | | export function FlowTable(data){ |
| | | return request({ |
| | |
| | | data: [] |
| | | }, |
| | | exportArr:{}, |
| | | exportArrTwo:{}, |
| | | ids:"" |
| | | }; |
| | | }, |
| | |
| | | //表头数据 用来渲染穿梭框 |
| | | tableHeadData: { |
| | | handler(newval, oldval) { |
| | | console.log(newval) |
| | | if (newval) { |
| | | // 清空data数组 |
| | | this.data = []; |
| | |
| | | key: index, |
| | | }); |
| | | }); |
| | | console.log(this.data) |
| | | // excel表格数据转换 |
| | | this.option.column[0].children = newval.map(obj => { |
| | | return { |
| | |
| | | codeClassifyOid:{ |
| | | handler(newval,oldval){ |
| | | } |
| | | }, |
| | | value:{ |
| | | handler(newval,oldval){ |
| | | console.log('value',newval) |
| | | } |
| | | } |
| | | }, |
| | | computed:{ |
| | |
| | | this.$emit('update:visible', false); |
| | | }, |
| | | handleExcel(){ |
| | | if(this.value <= 0){ |
| | | this.$message.warning('请选择属性') |
| | | }else { |
| | | this.value.map(index => this.tableHeadData[index].prop).forEach((item, index) => { |
| | | this.exportArr[`attrIdIndexMap[${index}]`] = item |
| | | }) |
| | | if(this.radio === 0){ |
| | | if(this.selectRow.length<=0){ |
| | | this.ids=this.tableData.map(item => item.oid).join(',') |
| | | exportCode({codeClassifyOid:this.codeClassifyOid,...this.exportArr,limit:-1}).then(res=>{ |
| | | this.$message.warning('请选择要导出的模板') |
| | | }else { |
| | | //已选择多选 |
| | | const selectList=[] |
| | | //已选择属性 |
| | | let exportArr={} |
| | | this.ids = this.selectRow.map(item => item.oid).join(',') |
| | | this.selectRow.forEach(item=>{ |
| | | selectList.push( |
| | | item.oid |
| | | ) |
| | | }) |
| | | if(this.value <= 0){ |
| | | this.tableHeadData.map(item => item.prop) |
| | | .forEach((prop, index) => { |
| | | this.exportArrTwo[`attrIdIndexMap[${index}]`] = prop; |
| | | }); |
| | | exportCode({codeClassifyOid:this.codeClassifyOid,'conditionMap[oid]':this.ids,...this.exportArrTwo,limit:-1}).then(res=>{ |
| | | // console.log('res',res) |
| | | if(res){ |
| | | func.downloadFileByBlobHandler(res); |
| | | this.escHandler() |
| | | } |
| | | }) |
| | | }else { |
| | | |
| | | exportCode({codeClassifyOid:this.codeClassifyOid,'conditionMap[oid]':this.ids,...this.exportArr}).then(res=>{ |
| | | // console.log('res',res) |
| | | if(res){ |
| | | func.downloadFileByBlobHandler(res); |
| | | this.escHandler() |
| | | } |
| | | }) |
| | | |
| | | } |
| | | } |
| | | }else if(this.radio === 1){ |
| | | if(this.value <= 0){ |
| | | this.tableHeadData.map(item => item.prop) |
| | | .forEach((prop, index) => { |
| | | this.exportArrTwo[`attrIdIndexMap[${index}]`] = prop; |
| | | }); |
| | | exportCode({codeClassifyOid:this.codeClassifyOid,...this.exportArrTwo,limit:-1}).then(res=>{ |
| | | // console.log('res',res) |
| | | if(res){ |
| | | func.downloadFileByBlobHandler(res); |
| | |
| | | } |
| | | }) |
| | | }else { |
| | | //已选择多选 |
| | | const selectList=[] |
| | | //已选择属性 |
| | | let exportArr={} |
| | | const ids = this.selectRow.map(item => item.oid).join(',') |
| | | this.selectRow.forEach(item=>{ |
| | | selectList.push( |
| | | item.oid |
| | | ) |
| | | }) |
| | | exportCode({codeClassifyOid:this.codeClassifyOid,'conditionMap[oid]':this.ids,...this.exportArr}).then(res=>{ |
| | | exportCode({codeClassifyOid:this.codeClassifyOid,...this.exportArr,limit:-1}).then(res=>{ |
| | | // console.log('res',res) |
| | | if(res){ |
| | | func.downloadFileByBlobHandler(res); |
| | | this.escHandler() |
| | | } |
| | | }) |
| | | |
| | | } |
| | | }else if(this.radio === 1){ |
| | | this.ids=this.tableData.map(item => item.oid).join(',') |
| | | exportCode({codeClassifyOid:this.codeClassifyOid,...this.exportArr,limit:-1}).then(res=>{ |
| | | // console.log('res',res) |
| | | if(res){ |
| | | func.downloadFileByBlobHandler(res); |
| | | this.escHandler() |
| | | } |
| | | }) |
| | | }else if(this.radio === 2){ |
| | | const input = this.pageExport.trim(); |
| | | let start, end; |
| | |
| | | return; |
| | | } |
| | | } |
| | | exportCode({ codeClassifyOid: this.codeClassifyOid, ...this.exportArr, limit: this.limit, page: start, endPage: end }).then((res) => { |
| | | // console.log('res',res) |
| | | if (res) { |
| | | func.downloadFileByBlobHandler(res); |
| | | this.escHandler() |
| | | } |
| | | }); |
| | | if(this.value >=1 ){ |
| | | exportCode({ codeClassifyOid: this.codeClassifyOid, ...this.exportArr, limit: this.limit, page: start, endPage: end }).then((res) => { |
| | | // console.log('res',res) |
| | | if (res) { |
| | | func.downloadFileByBlobHandler(res); |
| | | this.escHandler() |
| | | } |
| | | }); |
| | | }else { |
| | | this.tableHeadData.map(item => item.prop) |
| | | .forEach((prop, index) => { |
| | | this.exportArrTwo[`attrIdIndexMap[${index}]`] = prop; |
| | | }); |
| | | exportCode({codeClassifyOid:this.codeClassifyOid,...this.exportArrTwo,limit:this.limit,page: start, endPage: end}).then(res=>{ |
| | | // console.log('res',res) |
| | | if(res){ |
| | | func.downloadFileByBlobHandler(res); |
| | | this.escHandler() |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | }, |
| | | } |
| | | } |
| | |
| | | :disabledProp="disabledProp" :rowOid="rowOid" :templateOid="templateOid" |
| | | :title="'已发布数据更改'" |
| | | type="edit" |
| | | :visible.sync="DataVisible"></FormTemplateDialog> |
| | | :visible.sync="DataVisible" @submit="updataSumbit"></FormTemplateDialog> |
| | | <!-- 发布--> |
| | | <set-personnel :parameter="this.parameter" :title="title" :visible.sync="visibleFlow" |
| | | @onLoad="onLoad"></set-personnel> |
| | |
| | | </basic-container> |
| | | </template> |
| | | <script> |
| | | import {MasterTable, TableData, FindData, addSaveCode, editSaveCode, deleteCode} from "@/api/GetItem"; |
| | | import {MasterTable, TableData, FindData, addSaveCode, editSaveCode, deleteCode, upSaveCode} from "@/api/GetItem"; |
| | | import {processTS, changeStatus} from "@/api/template/setPersonnel" |
| | | import {listCodeAttributeByClassId} from "@/api/integration/integration.js"; |
| | | import integrationTransfer from "@/views/integration/integrationTransfer"; |
| | |
| | | }, |
| | | tableDataArray: { |
| | | handler(newval, oldval) { |
| | | this.keyWordFind=''; |
| | | this.WupinFindValue='' |
| | | this.tableData = newval; |
| | | this.searchResults = newval |
| | | this.doLayout() |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | if(_index==0){ |
| | | this.keyWordFind=record.field |
| | | } |
| | | }) |
| | | this.tableHeadFindDatas = newval; |
| | | this.WupinFindValue='' |
| | | }, |
| | | }, |
| | | total: { |
| | |
| | | this.$message.warning("只有状态为已发布的数据才能进行数据更改"); |
| | | } else { |
| | | this.DataVisible = true; |
| | | this.rowOid = this.selectRow[0]['oid'] |
| | | } |
| | | }, |
| | | //增加保存 |
| | |
| | | }) |
| | | }) |
| | | }, |
| | | //修改回调 |
| | | EditSumbit(val) { |
| | | this.editvisible = false; |
| | | editSaveCode(val).then(res => { |
| | | this.$nextTick(() => { |
| | | this.onLoad() |
| | | }) |
| | | }) |
| | | }, |
| | | //数据更改回调 |
| | | updataSumbit(val){ |
| | | this.DataVisible = false; |
| | | val.copyfromversion = this.rowOid; |
| | | val.oid='' |
| | | console.log(val) |
| | | upSaveCode(val).then(res=>{ |
| | | console.log(res) |
| | | this.$nextTick(() => { |
| | | this.onLoad() |
| | | }) |
| | |
| | | }, |
| | | //输入回车搜索 |
| | | tableFindInp() { |
| | | if (this.WupinFindValue.trim() === '') { |
| | | /*if (this.WupinFindValue.trim() === '') { |
| | | this.$message.warning('输入值不能为空') |
| | | return; |
| | | } |
| | | }*/ |
| | | TableData({ |
| | | templateOid: this.templateOid, |
| | | codeClassifyOid: this.codeClassifyOid, |
| | |
| | | limit: this.page.pageSize, |
| | | [ 'conditionMap[' + this.keyWordFind + ']']: '*' + this.WupinFindValue + '*' |
| | | }).then(res => { |
| | | console.log(res) |
| | | this.tableData = res.data.data |
| | | }) |
| | | } |
| | |
| | | </div> |
| | | </el-dialog> |
| | | <!-- 模板克隆 --> |
| | | <el-dialog :visible.sync="CloneVisible" append-to-body title="克隆模板"> |
| | | <el-dialog :visible.sync="CloneVisible" append-to-body title="克隆模板" :before-close="cloneClose"> |
| | | <el-container> |
| | | <el-aside width="300px"> |
| | | <div style="margin-bottom: 5px"><el-tag>主题库分类</el-tag></div> |
| | | <!-- 克隆模板的树 沿用首页树的loading和option,但是data和v-model绑定的数据创建一个新的变量,另外点击方法也是重新获取来操作克隆模板的数据--> |
| | | <avue-tree v-model="TreeAvueform" v-loading="loading" :data="Treedata" |
| | | <avue-tree ref="cloneTree" v-model="TreeAvueform" v-loading="loading" :data="Treedata" |
| | | :defaultExpandAll="false" |
| | | :option="Treeoption" |
| | | style="height: 50.5vh;margin-right: 10px" |
| | |
| | | </el-container > |
| | | <div style="display: flex; justify-content: flex-end; align-items: center;margin-top: 10px" > |
| | | <el-button size="small " type="primary" @click="Clonehandler">确定</el-button> |
| | | <el-button size="small" @click="CloneVisible=false" >取消</el-button> |
| | | <el-button size="small" @click="cloneClose" >取消</el-button> |
| | | </div> |
| | | <el-dialog |
| | | width="30%" |
| | |
| | | }); |
| | | }) |
| | | }, |
| | | //克隆取消 |
| | | cloneClose(){ |
| | | this.$refs.cloneTree.setCurrentKey(null) |
| | | this.ClonenodeClickList = {} |
| | | this.CloneFormlist=[] |
| | | this.CloneVisible=false; |
| | | }, |
| | | //克隆模板查询 |
| | | CloneEnterFind(){ |
| | | gridCodeClassifyTemplate().then(res => { |
| | |
| | | }, |
| | | //克隆模板单选框改变 |
| | | selectionChange(row) { |
| | | Object.assign(this.CloneModel, row[0]); |
| | | this.CloneSelect = [row[0]]; |
| | | this.CloneSelect = row; |
| | | const { id, name } = row[0]; |
| | | this.CloneModel = { id, name }; |
| | | this.CloneSelect[0].codeclassifyoid = this.nodeClickList.oid; |
| | | console.log('row',row) |
| | | console.log('CloneSelect',this.CloneSelect) |
| | | console.log('CloneModel',this.CloneModel) |
| | | }, |
| | | //克隆表单提交 |
| | | Clonesubmit(row, done) { |
| | | // 重新赋值CloneSelect传递的数据为输入框可以修改的数据,CloneModel提交表单输入框双向绑定数据 |
| | | Object.assign(this.CloneSelect[0], this.CloneModel); |
| | | // CloneSelect数组第一项 匹配CloneModel对象 |
| | | copy(this.CloneSelect[0]) |
| | | .then(() => { |
| | | // 因为是嵌套弹窗所以手动关闭CloneinnerVisible,CloneVisible两个弹窗。 |
| | |
| | | <attrCrud :ProData="ProData" :crudOid="crudOid" :checkStatus="checkStatus" :crudLCStatus="crudLCStatus" :crudArray="crudArray" :Formlist="Formlist" :codeClassifyOid="codeClassifyOid"></attrCrud> |
| | | </span> |
| | | <span v-else-if="type.prop==='tab2'"> |
| | | <FlowPath ref="FlowPath" :code="this.crudOid" :checkStatus="checkStatus" :crudLCStatus="crudLCStatus" :Formlist="Formlist"></FlowPath> |
| | | <FlowPath ref="FlowPath" :code="this.crudOid" :checkStatus="checkStatus" :crudLCStatus="crudLCStatus" :Formlist="Formlist"></FlowPath> |
| | | </span> |
| | | <span v-else-if="type.prop==='tab3'"> |
| | | <stage ref="stage" :code="this.crudOid" :Formlist="Formlist"></stage> |
| | |
| | | <avue-crud ref="crud" :table-loading="loading" :data="data" v-model="form" :option="option" :page.sync="page" |
| | | :search.sync="search" @on-load="getDataList" @row-save="handleSave" @row-del="handleDelete" |
| | | @row-update="handleEdit" @refresh-change="handleRefresh" @size-change="handleSizePage" |
| | | @current-change="handleCurrentPage"> |
| | | @current-change="handleCurrentPage" v-if="Formlist.length>0"> |
| | | </avue-crud> |
| | | </template> |
| | | |
| | |
| | | <template> |
| | | <div> |
| | | <div v-if="Formlist.length>0"> |
| | | <avue-crud ref="crud" :table-loading="loading" :data="data" :option="option" :page.sync="page" |
| | | @on-load="getDataList" @size-change="handleSizePage" @current-change="handleCurrentPage" |
| | | @row-click="handleRowClick"> |
| | |
| | | typeof: String, |
| | | required: true, |
| | | default: "" |
| | | } |
| | | }, |
| | | Formlist:{ |
| | | type:Array, |
| | | default:[] |
| | | } |
| | | }, |
| | | watch: { |
| | | code: { |
| | |
| | | package com.vci.ubcs.flow.engine.envent; |
| | | |
| | | import com.vci.ubcs.flow.core.dto.FlowStatusDTO; |
| | | import com.vci.ubcs.flow.engine.constant.FlowEngineConstant; |
| | | import com.vci.ubcs.flow.engine.utils.FlowableUtils; |
| | | import com.vci.ubcs.starter.exception.VciBaseException; |
| | | import com.vci.ubcs.starter.web.util.LangBaseUtil; |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.flowable.engine.HistoryService; |
| | | import org.flowable.engine.TaskService; |
| | | import org.flowable.engine.delegate.DelegateExecution; |
| | | import org.flowable.engine.delegate.ExecutionListener; |
| | | import org.flowable.engine.impl.el.FixedValue; |
| | | import org.springblade.core.jwt.JwtUtil; |
| | | import org.springblade.core.launch.constant.TokenConstant; |
| | | import org.springblade.core.tool.utils.WebUtil; |
| | | import org.springframework.beans.BeansException; |
| | | import org.springframework.context.ApplicationContext; |
| | | import org.springframework.context.ApplicationContextAware; |
| | | import org.springframework.http.HttpEntity; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.client.HttpClientErrorException; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | public class FlowExecutionEndListener implements ExecutionListener { |
| | | public class FlowExecutionEndListener implements ExecutionListener, ApplicationContextAware { |
| | | |
| | | /** |
| | | * 远程调用地址。切记:名称要与流程中定义的一样 |
| | | */ |
| | | private FixedValue remoteMethod; |
| | | |
| | | /** |
| | | * 状态值。切记:名称要与流程中定义的一样 |
| | | */ |
| | | private FixedValue statusValue; |
| | | |
| | | private static ApplicationContext applicationContext; |
| | | |
| | | @Override |
| | | public void setApplicationContext(ApplicationContext arg0) throws BeansException { |
| | | applicationContext = arg0; |
| | | } |
| | | |
| | | @Override |
| | | public void notify(DelegateExecution execution) { |
| | | Map var = execution.getVariableInstances(); |
| | | log.info("执行流程FlowExecutionEndListener",var); |
| | | Map variables = execution.getVariables(); |
| | | String restURL = remoteMethod.getExpressionText(); |
| | | String status = statusValue.getExpressionText(); |
| | | //获取业务数据信息 |
| | | List<String> oids = (List<String>) variables.get(FlowEngineConstant.OIDS); |
| | | String btmType = (String) variables.get(FlowEngineConstant.BTMTYPE); |
| | | |
| | | variables.put(FlowEngineConstant.REMOTE_METHOD,restURL); |
| | | variables.put(FlowEngineConstant.STATUS_VALUE,status); |
| | | |
| | | if(CollectionUtils.isEmpty(oids)){ |
| | | throw new VciBaseException("执行状态修改事件时,业务数据oid为空!"); |
| | | } |
| | | if(StringUtils.isEmpty(btmType)){ |
| | | throw new VciBaseException("执行状态修改事件时,业务类型btmType为空!"); |
| | | } |
| | | if(StringUtils.isEmpty(restURL)){ |
| | | throw new VciBaseException("执行状态修改事件时,远程调用地址为空!"); |
| | | } |
| | | if(StringUtils.isEmpty(status)){ |
| | | throw new VciBaseException("执行状态修改事件时,状态为空!"); |
| | | } |
| | | |
| | | HistoryService historyService = applicationContext.getBean(HistoryService.class); |
| | | TaskService taskService = applicationContext.getBean(TaskService.class); |
| | | |
| | | FlowStatusDTO flowStatusDTO = new FlowStatusDTO(); |
| | | flowStatusDTO.setBtmType(btmType); |
| | | flowStatusDTO.setOids(oids); |
| | | flowStatusDTO.setVariableMap(variables); |
| | | flowStatusDTO.setTaskHisVOList(FlowableUtils.listTaskHistory(execution.getProcessInstanceId(),historyService,taskService)); |
| | | |
| | | String token = JwtUtil.getToken(WebUtil.getRequest().getHeader(TokenConstant.HEADER)); |
| | | |
| | | HttpComponentsClientHttpRequestFactory requestFactory=new HttpComponentsClientHttpRequestFactory(); |
| | | requestFactory.setReadTimeout(300000); |
| | | requestFactory.setConnectionRequestTimeout(300000); |
| | | requestFactory.setConnectTimeout(300000); |
| | | RestTemplate restTemplate = new RestTemplate(requestFactory); |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | headers.add(TokenConstant.HEADER,token); |
| | | headers.setContentType(MediaType.APPLICATION_JSON); |
| | | HttpEntity httpEntity = new HttpEntity<>(flowStatusDTO,headers); |
| | | Map<String, Object> result = null; |
| | | try { |
| | | result = restTemplate.postForObject(restURL, httpEntity, Map.class); |
| | | } catch (HttpClientErrorException e) { |
| | | throw new VciBaseException(LangBaseUtil.getErrorMsg(e),new String[]{},e); |
| | | }catch (Throwable e){ |
| | | throw new VciBaseException(LangBaseUtil.getErrorMsg(e),new String[]{},e); |
| | | } |
| | | if(result == null){ |
| | | throw new VciBaseException("业务事件时候没有返回值,不确定是否执行成功"); |
| | | } |
| | | if(CollectionUtils.isEmpty(result) && !(Boolean) result.get("success")){ |
| | | throw new VciBaseException((String) result.get("message")); |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.vci.ubcs.flow.engine.envent; |
| | | |
| | | import com.vci.ubcs.code.feign.IFlowEventClient; |
| | | import com.vci.ubcs.flow.core.dto.FlowStatusDTO; |
| | | import com.vci.ubcs.flow.engine.constant.FlowEngineConstant; |
| | | import com.vci.ubcs.starter.exception.VciBaseException; |
| | | import com.vci.ubcs.starter.web.util.LangBaseUtil; |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.flowable.engine.delegate.DelegateExecution; |
| | | import org.flowable.engine.delegate.ExecutionListener; |
| | | import org.flowable.engine.impl.el.FixedValue; |
| | | import org.springblade.core.jwt.JwtUtil; |
| | | import org.springblade.core.launch.constant.TokenConstant; |
| | | import org.springblade.core.tool.utils.WebUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpEntity; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.client.HttpClientErrorException; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Slf4j |
| | | //@Component |
| | | @Component |
| | | public class FlowExecutionStartListener implements ExecutionListener { |
| | | @Autowired(required = false) |
| | | private IFlowEventClient iFlowEventClient; |
| | | |
| | | /** |
| | | * 远程调用地址。切记:名称要与流程中定义的一样 |
| | | */ |
| | | private FixedValue remoteMethod; |
| | | |
| | | /** |
| | | * 状态值。切记:名称要与流程中定义的一样 |
| | | */ |
| | | private FixedValue statusValue; |
| | | |
| | | @Override |
| | | public void notify(DelegateExecution execution) { |
| | | Map var = execution.getVariableInstances(); |
| | | iFlowEventClient.flowStart(var); |
| | | log.info("执行流程FlowExecutionStartListener",var); |
| | | Map variables = execution.getVariables(); |
| | | |
| | | String restURL = remoteMethod.getExpressionText(); |
| | | String status = statusValue.getExpressionText(); |
| | | //获取业务数据信息 |
| | | List<String> oids = (List<String>) variables.get(FlowEngineConstant.OIDS); |
| | | String btmType = (String) variables.get(FlowEngineConstant.BTMTYPE); |
| | | |
| | | variables.put(FlowEngineConstant.REMOTE_METHOD,restURL); |
| | | variables.put(FlowEngineConstant.STATUS_VALUE,status); |
| | | |
| | | if(CollectionUtils.isEmpty(oids)){ |
| | | throw new VciBaseException("执行状态修改事件时,业务数据oid为空!"); |
| | | } |
| | | if(StringUtils.isEmpty(btmType)){ |
| | | throw new VciBaseException("执行状态修改事件时,业务类型btmType为空!"); |
| | | } |
| | | if(StringUtils.isEmpty(restURL)){ |
| | | throw new VciBaseException("执行状态修改事件时,远程调用地址为空!"); |
| | | } |
| | | if(StringUtils.isEmpty(status)){ |
| | | throw new VciBaseException("执行状态修改事件时,状态为空!"); |
| | | } |
| | | |
| | | FlowStatusDTO flowStatusDTO = new FlowStatusDTO(); |
| | | flowStatusDTO.setBtmType(btmType); |
| | | flowStatusDTO.setOids(oids); |
| | | flowStatusDTO.setVariableMap(variables); |
| | | |
| | | String token = JwtUtil.getToken(WebUtil.getRequest().getHeader(TokenConstant.HEADER)); |
| | | HttpComponentsClientHttpRequestFactory requestFactory=new HttpComponentsClientHttpRequestFactory(); |
| | | requestFactory.setReadTimeout(300000); |
| | | requestFactory.setConnectionRequestTimeout(300000); |
| | | requestFactory.setConnectTimeout(300000); |
| | | RestTemplate restTemplate = new RestTemplate(requestFactory); |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | headers.add(TokenConstant.HEADER,token); |
| | | headers.setContentType(MediaType.APPLICATION_JSON); |
| | | HttpEntity httpEntity = new HttpEntity<>(flowStatusDTO,headers); |
| | | Map<String, Object> result = null; |
| | | try { |
| | | result = restTemplate.postForObject(restURL, httpEntity, Map.class); |
| | | } catch (HttpClientErrorException e) { |
| | | throw new VciBaseException(LangBaseUtil.getErrorMsg(e),new String[]{},e); |
| | | }catch (Throwable e){ |
| | | throw new VciBaseException(LangBaseUtil.getErrorMsg(e),new String[]{},e); |
| | | } |
| | | if(result == null){ |
| | | throw new VciBaseException("业务事件时候没有返回值,不确定是否执行成功"); |
| | | } |
| | | if(CollectionUtils.isEmpty(result) && !(Boolean) result.get("success")){ |
| | | throw new VciBaseException((String) result.get("message")); |
| | | } |
| | | } |
| | | } |
| | |
| | | import org.springframework.web.client.HttpClientErrorException; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Slf4j |
| | |
| | | String restURL = remoteMethod.getExpressionText(); |
| | | String status = statusValue.getExpressionText(); |
| | | //获取业务数据信息 |
| | | String oids = (String) taskVariable.get(FlowEngineConstant.OIDS); |
| | | List<String> oids = (List<String>) taskVariable.get(FlowEngineConstant.OIDS); |
| | | String btmType = (String) taskVariable.get(FlowEngineConstant.BTMTYPE); |
| | | |
| | | taskVariable.put(FlowEngineConstant.REMOTE_METHOD,restURL); |
| | | taskVariable.put(FlowEngineConstant.STATUS_VALUE,status); |
| | | |
| | | if(StringUtils.isEmpty(oids)){ |
| | | if(CollectionUtils.isEmpty(oids)){ |
| | | throw new VciBaseException("执行状态修改事件时,业务数据oid为空!"); |
| | | } |
| | | if(StringUtils.isEmpty(btmType)){ |
| | |
| | | |
| | | FlowStatusDTO flowStatusDTO = new FlowStatusDTO(); |
| | | flowStatusDTO.setBtmType(btmType); |
| | | flowStatusDTO.setOids(VciBaseUtil.str2List(oids)); |
| | | flowStatusDTO.setOids(oids); |
| | | flowStatusDTO.setVariableMap(taskVariable); |
| | | flowStatusDTO.setTaskHisVOList(FlowableUtils.listTaskHistory(delegateTask.getProcessInstanceId(),historyService,taskService)); |
| | | |
| | |
| | | if(CollectionUtils.isEmpty(result) && !(Boolean) result.get("success")){ |
| | | throw new VciBaseException((String) result.get("message")); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | // .selectOne(Condition.getQueryWrapper(condition,CodeClassify.class)); |
| | | if(detail == null){//不是最新的不让改 |
| | | throw new ServiceException("当前数据不是最新,请刷新后再修改!"); |
| | | // return R.fail("当前数据不是最新,请刷新后再修改!"); |
| | | } |
| | | //校验下级是否有引用 |
| | | if(checkChildIsLinked(detail.getOid())){ |
| | | return R.fail("dataCascadeLinkedNotDelete"); |
| | | } |
| | | if(checkHasChild(detail.getOid())){ |
| | | return R.fail("此数据有下级,无法进行删除!"); |
| | | } |
| | | return R.status(!checkHasChild(detail.getOid())); |
| | | } |
| | | |
| | |
| | | query.setCurrent(pageHelper.getPage()); |
| | | } |
| | | IPage<CodeClassifyTemplateAttr> doList = baseMapper. |
| | | selectPage(Condition.getPage(query), UBCSCondition.getQueryWrapperByMapString(conditionMap,CodeClassifyTemplateAttr.class)); |
| | | selectPage(Condition.getPage(query), UBCSCondition.getQueryWrapperByMapString(conditionMap,CodeClassifyTemplateAttr.class).orderByAsc("ordernum")); |
| | | if (!CollectionUtils.isEmpty(doList.getRecords())) { |
| | | dataGrid.setData(codeClassifyTemplateAttrDO2VOs(doList.getRecords())); |
| | | dataGrid.setTotal(VciBaseUtil.getInt(String.valueOf(baseMapper.selectCount(UBCSCondition.getQueryWrapperByMapString(conditionMap,CodeClassifyTemplateAttr.class))))); |