提交 01504290 authored 作者: ww1xhqc's avatar ww1xhqc

Merge remote-tracking branch 'origin/master'

......@@ -90,7 +90,6 @@ public class ModelController {
}
}
modelService.NewTable(tableVO);
return ResultUtil.success("","新建成功");
}
......@@ -120,7 +119,6 @@ public class ModelController {
@ApiOperation("根据表名查询所有数据")
@GetMapping("/getAll")
public ResponseEntity getAll(String tableName) {
try {
return ResultUtil.success( modelService.findAllByName(tableName),"");
} catch (SQLException throwables) {
......
......@@ -132,15 +132,11 @@ public class ModelImpl implements ModelService {
Session session = creatTableUtil.getSession(entityManagerFactory, XML_MAPPING);
List<ColumnVO> dataList = tableVO.getDataList();
TableInfo tableInfo = new TableInfo();
tableInfo.setName(tableVO.getModelName()+"_");
tableInfo.setCnName(tableVO.getModelTitle());
tableInfo.setXML(XML_MAPPING);
tableInfo.setType(2);
tableInfoDao.save(tableInfo);
for (ColumnVO columnVO : dataList) {
......@@ -152,7 +148,6 @@ public class ModelImpl implements ModelService {
columnInfo.setDbName(tableInfo.getCnName());
columnInfo.setDbId(tableInfo.getId());
columnInfoDao.save(columnInfo);
}
//关闭会话
session.close();
......
......@@ -2,9 +2,7 @@ package com.tykj.workflowcore.workflow_editer.controller;
import com.tykj.workflowcore.base.result.ResultUtil;
import com.tykj.workflowcore.workflow_editer.entity.FlowsInfo;
import com.tykj.workflowcore.workflow_editer.entity.NodePage;
import com.tykj.workflowcore.workflow_editer.entity.VariableStorage;
import com.tykj.workflowcore.workflow_editer.entity.WorkFlowUser;
import com.tykj.workflowcore.workflow_editer.entity.vo.VariableStorageVo;
import com.tykj.workflowcore.workflow_editer.service.*;
import com.tykj.workflowcore.workflow_editer.vo.DeployedVo;
......@@ -18,7 +16,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.io.FileNotFoundException;
import java.util.ArrayList;
......@@ -44,10 +41,7 @@ public class FlowsInfoController {
private WorkFlowService workFlowService;
@Autowired
private NodePageService nodePageService;
@Autowired
private UserService userService;
private NodeInfoService nodeInfoService;
@Autowired
private VariableStorageService variableStorageService;
......@@ -60,10 +54,11 @@ public class FlowsInfoController {
}
return flowInfoService.getAllFlowsInfo(pageVo);
}
@PostMapping("/getDeployedFlowsInfo")
@ApiOperation(value = "查询已经部署的流程")
public List<DeployedVo> getDeployedFlowsInfo(){
ArrayList<DeployedVo> deployedVos = new ArrayList<>();
//查询已经部署的流程
List<FlowsInfo> deployedFlowsInfo = flowInfoService.getDeployedFlowsInfo();
......@@ -75,7 +70,7 @@ public class FlowsInfoController {
DeployedVo deployedVo = new DeployedVo();
BeanUtils.copyProperties(flowsInfo,deployedVo);
//通过节点id得到pageId
Long pageId = nodePageService.findByNodeId(startId);
Long pageId = nodeInfoService.findByNodeId(startId);
deployedVo.setPageId(pageId);
deployedVos.add(deployedVo);
}
......@@ -83,7 +78,7 @@ public class FlowsInfoController {
}
@GetMapping("/deploy")
@ApiOperation(value = "部署流程",notes = "0 部署成功")
@ApiOperation(value = "部署流程",notes = "部署成功")
public ResponseEntity deploy(Long id) throws FileNotFoundException {
//根据id 查询出flowsInfo
FlowsInfo flowsInfo = flowInfoService.findById(id);
......@@ -94,15 +89,26 @@ public class FlowsInfoController {
return ResultUtil.success(flowsInfo.getState(),"流程部署成功");
}
@PostMapping("/saveXml02")
@ApiOperation(value = "保存xml02")
public ResponseEntity saveXml02(@RequestBody FlowsInfoVo flowsInfoVo) {
List<NodePage> nodePages = flowsInfoVo.getNodePages();
nodePageService.saveNodePages(nodePages);
@PostMapping("/disableFlow")
@ApiOperation(value = "禁用流程",notes = "分页查询")
public ResponseEntity disableFlow(@RequestBody Long flowId){
flowInfoService.disableFlow(flowId);
return ResultUtil.success("禁用成功");
}
@PostMapping("/saveXml")
@ApiOperation(value = "保存xml以及其他流程信息")
public ResponseEntity saveXml(@RequestBody FlowsInfoVo flowsInfoVo) {
//保存节点信息
nodeInfoService.saveNodeInfoList(flowsInfoVo.getNodeInfoList());
//保存xml信息
workFlowService.flowXml(flowsInfoVo);
return ResultUtil.success("文件保存成功");
}
//保存流程中的 节点信息和节点内容
@PostMapping("/updateByProcessName")
@ApiOperation(value = "通过流程名称修改")
public ResponseEntity updateByProcessName(@RequestBody FlowsInfoVo flowsInfoVo) {
......@@ -130,10 +136,5 @@ public class FlowsInfoController {
VariableStorage variableStorage = variableStorageService.saveVariableStorageService(variableStorageVo.toEntity());
return ResultUtil.success(variableStorage,"调用接口成功");
}
@PostMapping("/test")
public WorkFlowUser test(){
return userService.getCurrentUser();
}
}
......@@ -25,8 +25,8 @@ import javax.persistence.Id;
@NoArgsConstructor
@Entity
@WorkFlowCoreNoScan
@Api("节点所在页面")
public class NodePage {
@Api("节点信息")
public class NodeInfo {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
......@@ -39,8 +39,31 @@ public class NodePage {
@ApiModelProperty("页面id")
private long pageId;
@ApiModelProperty("流程key")
private String flowKey;
@ApiModelProperty("流程名")
private String flowName;
@ApiModelProperty("候选人类型")
private String candidateType;
@ApiModelProperty("候选人显示值")
private String candidateLabel;
@ApiModelProperty("候选人显示值")
private String candidateValue;
@ApiModelProperty("0为默认,1为可视,2为公式")
private Integer expressionType;
@ApiModelProperty("输入框中的值 例如: 同意,不同意")
private Integer expressionValue;
@ApiModelProperty("连接条件")
private String expressionConnectionConditions;
@ApiModelProperty("判断条件拼接字段 例如:[{'resource':'${people.id}','comparator':'>=','value':'10'}]")
private String expressionCondition;
}
package com.tykj.workflowcore.workflow_editer.entity.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author HuangXiahao
* @version V1.0
* @class NodeInfoVo
* @packageName com.tykj.workflowcore.workflow_editer.entity.vo
**/
@AllArgsConstructor
@NoArgsConstructor
@Data
public class NodeInfoVo {
@ApiModelProperty("主键id")
private Long id;
@ApiModelProperty("节点id")
private String nodeId;
@ApiModelProperty("页面id")
private long pageId;
@ApiModelProperty("流程key")
private String flowKey;
@ApiModelProperty("流程名")
private String flowName;
@ApiModelProperty("0为默认,1为可视,2为公式")
private Integer type;
@ApiModelProperty("输入框中的值 例如: 同意,不同意")
private Integer value;
@ApiModelProperty("连接条件")
private String connectionConditions;
@ApiModelProperty("判断条件拼接字段 例如:[{'resource':'${people.id}','comparator':'>=','value':'10'}]")
private String expressionCondition;
}
package com.tykj.workflowcore.workflow_editer.mapper;
import com.tykj.workflowcore.workflow_editer.entity.NodePage;
import com.tykj.workflowcore.workflow_editer.entity.NodeInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
......@@ -12,7 +12,7 @@ import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
*
* @Author: zsp
*/
public interface NodePageMapper extends JpaRepository<NodePage,Long>, JpaSpecificationExecutor<NodePage> {
public interface NodePageMapper extends JpaRepository<NodeInfo,Long>, JpaSpecificationExecutor<NodeInfo> {
/**
* 通过节点id得到pageId
......
......@@ -35,8 +35,8 @@ public interface FlowInfoService {
* @param id flowInfo Id
* @return FlowInfo对象
*/
FlowsInfo findById(Long id);
FlowsInfo findById(Long id);
/**
* 根据流程主键修改
* @param flowsInfoVo flowsInfo
......@@ -71,4 +71,11 @@ public interface FlowInfoService {
*/
FlowsInfo findByFlowKey(String flowKey);
/**
* 停用流程
* @param flowInfoId
* @return
*/
FlowsInfo disableFlow(Long flowInfoId);
}
package com.tykj.workflowcore.workflow_editer.service;
import com.tykj.workflowcore.workflow_editer.entity.NodePage;
import com.tykj.workflowcore.workflow_editer.entity.NodeInfo;
import java.util.List;
......@@ -12,7 +12,7 @@ import java.util.List;
*
* @Author: zsp
*/
public interface NodePageService {
public interface NodeInfoService {
/**
* 通过节点id得到pageId
* @param nodeId 节点id
......@@ -22,13 +22,14 @@ public interface NodePageService {
/**
* 保存节点和页面的关系
* @param nodePage
* @param nodeInfo
*/
void saveNodePage(NodePage nodePage);
void saveNodePage(NodeInfo nodeInfo);
/**
* @param nodePages 集合
* 保存nodeInfo集合 至数据库中
* @param nodeInfoList 集合
*/
void saveNodePages(List<NodePage> nodePages);
void saveNodeInfoList(List<NodeInfo> nodeInfoList);
}
package com.tykj.workflowcore.workflow_editer.service.impl;
import com.github.wenhao.jpa.Specifications;
import com.tykj.workflowcore.base.result.ApiException;
import com.tykj.workflowcore.workflow_editer.entity.FlowsInfo;
import com.tykj.workflowcore.workflow_editer.mapper.FlowsInfoMapper;
import com.tykj.workflowcore.workflow_editer.service.FlowInfoService;
......@@ -14,6 +15,7 @@ import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
import java.util.Optional;
/**
* ClassName: FlowInfoServiceImpl
......@@ -36,12 +38,9 @@ public class FlowInfoServiceImpl implements FlowInfoService {
@Override
public List<FlowsInfo> getDeployedFlowsInfo() {
FlowsInfo flowsInfo = new FlowsInfo();
flowsInfo.setState(0);
Specification<FlowsInfo> state = Specifications.<FlowsInfo>and().eq("state", flowsInfo.getState()).build();
return flowsInfoMapper.findAll(state);
}
......@@ -89,4 +88,17 @@ public class FlowInfoServiceImpl implements FlowInfoService {
public FlowsInfo findByFlowKey(String flowKey) {
return flowsInfoMapper.findByFlowKey(flowKey);
}
@Override
public FlowsInfo disableFlow(Long flowInfoId) {
Optional<FlowsInfo> byId = flowsInfoMapper.findById(flowInfoId);
if (byId.isPresent()){
FlowsInfo flowsInfo = byId.get();
flowsInfo.setState(1);
flowsInfoMapper.save(flowsInfo);
}else {
throw new ApiException("要禁用的流程不存在");
}
return null;
}
}
package com.tykj.workflowcore.workflow_editer.service.impl;
import com.tykj.workflowcore.workflow_editer.entity.NodePage;
import com.tykj.workflowcore.workflow_editer.entity.NodeInfo;
import com.tykj.workflowcore.workflow_editer.mapper.NodePageMapper;
import com.tykj.workflowcore.workflow_editer.service.NodePageService;
import com.tykj.workflowcore.workflow_editer.service.NodeInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -17,7 +17,7 @@ import java.util.List;
* @Author: zsp
*/
@Service
public class NodePageServiceImpl implements NodePageService {
public class NodeInfoServiceImpl implements NodeInfoService {
@Autowired
private NodePageMapper nodePageMapper;
......@@ -27,13 +27,15 @@ public class NodePageServiceImpl implements NodePageService {
}
@Override
public void saveNodePage(NodePage nodePage) {
public void saveNodePage(NodeInfo nodeInfo) {
nodePageMapper.save(nodePage);
nodePageMapper.save(nodeInfo);
}
@Override
public void saveNodePages(List<NodePage> nodePages) {
nodePageMapper.saveAll(nodePages);
public void saveNodeInfoList(List<NodeInfo> nodeInfos) {
if (nodeInfos!=null){
nodePageMapper.saveAll(nodeInfos);
}
}
}
package com.tykj.workflowcore.workflow_editer.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.tykj.workflowcore.api.entity.InvokeRequest;
import com.tykj.workflowcore.api.entity.Parameter;
import com.tykj.workflowcore.workflow_editer.entity.*;
import com.tykj.workflowcore.workflow_editer.mapper.FlowsInfoMapper;
import com.tykj.workflowcore.workflow_editer.service.NodePageService;
import com.tykj.workflowcore.workflow_editer.service.NodeInfoService;
import com.tykj.workflowcore.workflow_editer.service.UserService;
import com.tykj.workflowcore.workflow_editer.service.VariableStorageService;
import com.tykj.workflowcore.workflow_editer.service.WorkFlowService;
......@@ -22,14 +21,13 @@ import org.flowable.common.engine.impl.identity.Authentication;
import org.flowable.engine.*;
import org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl;
import org.flowable.engine.repository.Deployment;
import org.flowable.engine.repository.DeploymentBuilder;
import org.flowable.engine.runtime.Execution;
import org.flowable.engine.runtime.ProcessInstance;
import org.flowable.image.ProcessDiagramGenerator;
import org.flowable.task.api.Task;
import org.flowable.task.api.TaskQuery;
import org.flowable.task.api.history.HistoricTaskInstance;
import org.flowable.task.api.history.HistoricTaskInstanceQuery;
import org.flowable.variable.api.history.HistoricVariableInstance;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -66,8 +64,7 @@ public class WorkFlowServiceImpl implements WorkFlowService {
@Autowired
private HistoryService historyService;
@Autowired
private NodePageService nodePageService;
private NodeInfoService nodeInfoService;
@Autowired
ProcessEngineConfigurationImpl processEngineConfiguration;
@Autowired
......@@ -203,7 +200,6 @@ public class WorkFlowServiceImpl implements WorkFlowService {
@Override
public Long createFlow(FlowsInfo flowsInfo ) {
FlowsInfo flowsInfo1 = flowsInfoMapper.save(flowsInfo);
return flowsInfo1.getId();
}
......@@ -211,7 +207,6 @@ public class WorkFlowServiceImpl implements WorkFlowService {
@Override
public void deployXml(FlowsInfo flowsInfo) throws FileNotFoundException {
Deployment deploy = null;
try {
deploy = repositoryService.createDeployment().addInputStream(flowsInfo.getResourceName(),
......
package com.tykj.workflowcore.workflow_editer.vo;
import com.tykj.workflowcore.workflow_editer.entity.FlowsInfo;
import com.tykj.workflowcore.workflow_editer.entity.NodePage;
import com.tykj.workflowcore.workflow_editer.entity.NodeInfo;
import com.tykj.workflowcore.workflow_editer.entity.vo.NodeInfoVo;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
......@@ -54,7 +55,7 @@ public class FlowsInfoVo {
private String startId;
@ApiModelProperty()
private List<NodePage> nodePages;
private List<NodeInfo> nodeInfoList;
public FlowsInfo toEntity(){
FlowsInfo flowsInfo = new FlowsInfo();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论