提交 21c81f3f authored 作者: 黄夏豪's avatar 黄夏豪

[工作流模块] 修改了一些类型不匹配的请客

上级 f1a05331
...@@ -23,9 +23,6 @@ import javax.persistence.*; ...@@ -23,9 +23,6 @@ import javax.persistence.*;
@SQLDelete(sql = "update column_info set deleted = 1 where id = ?") @SQLDelete(sql = "update column_info set deleted = 1 where id = ?")
@Where(clause = "deleted = 0") @Where(clause = "deleted = 0")
public class ColumnInfo extends BaseEntity { public class ColumnInfo extends BaseEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private long id;
/** /**
* 是否primary key, 0是,1否 * 是否primary key, 0是,1否
...@@ -41,11 +38,11 @@ public class ColumnInfo extends BaseEntity { ...@@ -41,11 +38,11 @@ public class ColumnInfo extends BaseEntity {
@ApiModelProperty("列类型") @ApiModelProperty("列类型")
private String type; private String type;
@ApiModelProperty("长度") @ApiModelProperty("长度")
private int length; private Integer length;
@ApiModelProperty("所属表名") @ApiModelProperty("所属表名")
private String dbName; private String dbName;
@ApiModelProperty("所属表id") @ApiModelProperty("所属表id")
private Long dbId; private Integer dbId;
......
...@@ -31,9 +31,7 @@ import java.util.Date; ...@@ -31,9 +31,7 @@ import java.util.Date;
@Where(clause = "deleted = 0") @Where(clause = "deleted = 0")
public class TableInfo extends BaseEntity implements Serializable { public class TableInfo extends BaseEntity implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private long id;
@ApiModelProperty("表名,不能为空") @ApiModelProperty("表名,不能为空")
@Column(nullable = false) @Column(nullable = false)
private String name; private String name;
......
...@@ -262,7 +262,7 @@ public class ModelImpl implements ModelService { ...@@ -262,7 +262,7 @@ public class ModelImpl implements ModelService {
genericType = declaredField.getGenericType(); genericType = declaredField.getGenericType();
//是否主键 //是否主键
if (declaredField.isAnnotationPresent(javax.persistence.Id.class)){ if (declaredField.isAnnotationPresent(javax.persistence.Id.class)){
columnVO.setPrimarykey(0); columnVO.setPrimaryKey(0);
} }
columnVO.setFiledType(getTypeName(genericType.toString())); columnVO.setFiledType(getTypeName(genericType.toString()));
...@@ -300,7 +300,7 @@ public class ModelImpl implements ModelService { ...@@ -300,7 +300,7 @@ public class ModelImpl implements ModelService {
columnInfo.setType(columnVO.getFiledType()); columnInfo.setType(columnVO.getFiledType());
columnInfo.setLength(columnVO.getFiledLength()); columnInfo.setLength(columnVO.getFiledLength());
columnInfo.setCnName(columnVO.getFiledDescription()); columnInfo.setCnName(columnVO.getFiledDescription());
columnInfo.setPrimarykey(columnVO.getPrimarykey()); columnInfo.setPrimaryKey(columnVO.getPrimaryKey());
//暂定 简单类型 //暂定 简单类型
if ("class java.lang.String".equals(genericType.toString())){ if ("class java.lang.String".equals(genericType.toString())){
columnInfo.setLength(255); columnInfo.setLength(255);
......
...@@ -58,12 +58,12 @@ public class FlowsInfoController { ...@@ -58,12 +58,12 @@ public class FlowsInfoController {
@GetMapping("editFlow") @GetMapping("editFlow")
@ApiOperation(value = "编辑流程") @ApiOperation(value = "编辑流程")
public String editFlow(Long id){ public String editFlow(Integer id){
return flowInfoService.editFlow(id).getFilePath(); return flowInfoService.editFlow(id).getFilePath();
} }
@GetMapping("/deploy") @GetMapping("/deploy")
@ApiOperation(value = "部署流程",notes = "部署成功") @ApiOperation(value = "部署流程",notes = "部署成功")
public ResponseEntity deploy(Long id) throws FileNotFoundException { public ResponseEntity deploy(Integer id) throws FileNotFoundException {
//根据id 查询出flowsInfo //根据id 查询出flowsInfo
FlowsInfo flowsInfo = flowInfoService.findById(id); FlowsInfo flowsInfo = flowInfoService.findById(id);
if (flowsInfo.getState() == 0){ if (flowsInfo.getState() == 0){
......
...@@ -42,7 +42,7 @@ public class FormPageController { ...@@ -42,7 +42,7 @@ public class FormPageController {
@PostMapping("/savePage") @PostMapping("/savePage")
public ResponseEntity savePage(@RequestBody InFormPageVo inFormPageVo){ public ResponseEntity savePage(@RequestBody InFormPageVo inFormPageVo){
if (inFormPageVo.getId() == null){ if (inFormPageVo.getId() == null){
Long pageId = formPageService.savePage(inFormPageVo); Integer pageId = formPageService.savePage(inFormPageVo);
return ResultUtil.success(pageId,"页面保存成功"); return ResultUtil.success(pageId,"页面保存成功");
}else { }else {
//修改 //修改
...@@ -58,7 +58,7 @@ public class FormPageController { ...@@ -58,7 +58,7 @@ public class FormPageController {
} }
@ApiOperation("查看页面") @ApiOperation("查看页面")
@GetMapping("/findPages") @PostMapping("/findPages")
public ResponseEntity findPages(@RequestBody PageFormPageVo pageFormPageVo){ public ResponseEntity findPages(@RequestBody PageFormPageVo pageFormPageVo){
return ResultUtil.success(formPageService.getAllPages(pageFormPageVo),"查询成功"); return ResultUtil.success(formPageService.getAllPages(pageFormPageVo),"查询成功");
......
...@@ -38,17 +38,6 @@ public class WorkFlowController { ...@@ -38,17 +38,6 @@ public class WorkFlowController {
@Autowired @Autowired
private WorkFlowService workFlowService; private WorkFlowService workFlowService;
@PostMapping("/deploy")
@ApiOperation(value = "部署流程",notes = "0 部署成功")
public Integer deploy(Long id) throws FileNotFoundException {
//根据id 查询出flowsInfo
FlowsInfo flowsInfo = flowInfoService.findById(id);
if (flowsInfo.getState() == 0){
return 0;
}
workFlowService.deployXml(flowsInfo);
return flowsInfo.getState();
}
@PostMapping("/startFlow") @PostMapping("/startFlow")
@ApiOperation("开启流程") @ApiOperation("开启流程")
...@@ -85,16 +74,16 @@ public class WorkFlowController { ...@@ -85,16 +74,16 @@ public class WorkFlowController {
return ResultUtil.success("该任务转交成功"); return ResultUtil.success("该任务转交成功");
} }
@PostMapping("/isSuspension") @GetMapping("/isSuspension")
@ApiOperation("是否挂起") @ApiOperation("是否挂起")
public void isSuspension(Long id){ public ResponseEntity isSuspension(Integer id){
workFlowService.suspendOrActivateProcessDefinitionByKey(id); workFlowService.suspendOrActivateProcessDefinitionByKey(id);
// return ResultUtil.success("该流程已被暂停"); return ResultUtil.success("该流程已经成功"+(id==0?"启用":"禁用"));
} }
@DeleteMapping("/deleteFlow") @DeleteMapping("/deleteFlow")
@ApiOperation("是否删除") @ApiOperation("是否删除")
public ResponseEntity deleteFlow(Long id){ public ResponseEntity deleteFlow(Integer id){
workFlowService.deleteFlow(id); workFlowService.deleteFlow(id);
return ResultUtil.success("该流程已被删除"); return ResultUtil.success("该流程已被删除");
} }
......
...@@ -11,7 +11,7 @@ import org.springframework.data.jpa.repository.JpaSpecificationExecutor; ...@@ -11,7 +11,7 @@ import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
* Datetime: 2021/2/23 14:06 * Datetime: 2021/2/23 14:06
* @Author: zsp * @Author: zsp
*/ */
public interface FlowsInfoMapper extends JpaRepository<FlowsInfo,Long>, JpaSpecificationExecutor<FlowsInfo> { public interface FlowsInfoMapper extends JpaRepository<FlowsInfo,Integer>, JpaSpecificationExecutor<FlowsInfo> {
/** /**
* 根据流程主键查询 * 根据流程主键查询
......
...@@ -25,7 +25,7 @@ public interface FlowInfoService { ...@@ -25,7 +25,7 @@ public interface FlowInfoService {
* @return FlowInfo对象 * @return FlowInfo对象
*/ */
FlowsInfo findById(Long id); FlowsInfo findById(Integer id);
/** /**
* 根据流程主键修改 * 根据流程主键修改
* @param flowsInfoVo flowsInfo * @param flowsInfoVo flowsInfo
...@@ -59,7 +59,7 @@ public interface FlowInfoService { ...@@ -59,7 +59,7 @@ public interface FlowInfoService {
* @param flowInfoId * @param flowInfoId
* @return * @return
*/ */
FlowsInfo disableFlow(Long flowInfoId); FlowsInfo disableFlow(Integer flowInfoId);
/** /**
* 有条件的查询flowInfo * 有条件的查询flowInfo
...@@ -73,7 +73,7 @@ public interface FlowInfoService { ...@@ -73,7 +73,7 @@ public interface FlowInfoService {
* @param id 流程id * @param id 流程id
* @return * @return
*/ */
FlowsInfo editFlow(Long id); FlowsInfo editFlow(Integer id);
} }
...@@ -26,7 +26,7 @@ public interface FormPageService { ...@@ -26,7 +26,7 @@ public interface FormPageService {
* @param inFormPageVo 页面实体 * @param inFormPageVo 页面实体
* @return 主键id * @return 主键id
*/ */
Long savePage(@RequestBody InFormPageVo inFormPageVo); Integer savePage(@RequestBody InFormPageVo inFormPageVo);
/** /**
* 保存页面 * 保存页面
......
...@@ -42,7 +42,7 @@ public interface WorkFlowService { ...@@ -42,7 +42,7 @@ public interface WorkFlowService {
* @param flowsInfo * @param flowsInfo
* @return 主键id * @return 主键id
*/ */
Long createFlow(@RequestBody FlowsInfo flowsInfo); Integer createFlow(@RequestBody FlowsInfo flowsInfo);
/** /**
* 部署xml流程文件 * 部署xml流程文件
...@@ -112,13 +112,13 @@ public interface WorkFlowService { ...@@ -112,13 +112,13 @@ public interface WorkFlowService {
* 是否挂起 * 是否挂起
* @param id 流程id * @param id 流程id
*/ */
void suspendOrActivateProcessDefinitionByKey(Long id); void suspendOrActivateProcessDefinitionByKey(Integer id);
/** /**
* 删除流程 * 删除流程
* @param id 流程id * @param id 流程id
*/ */
void deleteFlow(Long id); void deleteFlow(Integer id);
/** /**
......
...@@ -34,7 +34,7 @@ public class FlowInfoServiceImpl implements FlowInfoService { ...@@ -34,7 +34,7 @@ public class FlowInfoServiceImpl implements FlowInfoService {
private FlowsInfoMapper flowsInfoMapper; private FlowsInfoMapper flowsInfoMapper;
@Override @Override
public FlowsInfo findById(Long id) { public FlowsInfo findById(Integer id) {
return flowsInfoMapper.findById(id).get(); return flowsInfoMapper.findById(id).get();
} }
...@@ -73,7 +73,7 @@ public class FlowInfoServiceImpl implements FlowInfoService { ...@@ -73,7 +73,7 @@ public class FlowInfoServiceImpl implements FlowInfoService {
} }
@Override @Override
public FlowsInfo disableFlow(Long flowInfoId) { public FlowsInfo disableFlow(Integer flowInfoId) {
Optional<FlowsInfo> byId = flowsInfoMapper.findById(flowInfoId); Optional<FlowsInfo> byId = flowsInfoMapper.findById(flowInfoId);
if (byId.isPresent()){ if (byId.isPresent()){
FlowsInfo flowsInfo = byId.get(); FlowsInfo flowsInfo = byId.get();
...@@ -95,7 +95,7 @@ public class FlowInfoServiceImpl implements FlowInfoService { ...@@ -95,7 +95,7 @@ public class FlowInfoServiceImpl implements FlowInfoService {
} }
@Override @Override
public FlowsInfo editFlow(Long id) { public FlowsInfo editFlow(Integer id) {
return flowsInfoMapper.findById(id).get(); return flowsInfoMapper.findById(id).get();
} }
......
...@@ -38,11 +38,11 @@ public class FormPageServiceImpl implements FormPageService { ...@@ -38,11 +38,11 @@ public class FormPageServiceImpl implements FormPageService {
@Autowired @Autowired
private TableInfoDao tableInfoDao; private TableInfoDao tableInfoDao;
@Override @Override
public Long savePage(@RequestBody InFormPageVo inFormPageVo) { public Integer savePage(@RequestBody InFormPageVo inFormPageVo) {
inFormPageVo.setCreateTime(new Date()); inFormPageVo.setCreateTime(new Date());
FormPage formPage = inFormPageVo.toEntity(); FormPage formPage = inFormPageVo.toEntity();
FormPage formPage1 = formPageMapper.save(formPage); FormPage formPage1 = formPageMapper.save(formPage);
Long id = formPage1.getId(); Integer id = formPage1.getId();
return id; return id;
} }
......
...@@ -147,7 +147,7 @@ public class WorkFlowServiceImpl implements WorkFlowService { ...@@ -147,7 +147,7 @@ public class WorkFlowServiceImpl implements WorkFlowService {
@Override @Override
public void flowXml(@RequestBody FlowsInfoVo flowsInfoVo) { public void flowXml(@RequestBody FlowsInfoVo flowsInfoVo) {
Long id = flowsInfoVo.getId(); Integer id = flowsInfoVo.getId();
String flowKey = flowsInfoVo.getFlowKey(); String flowKey = flowsInfoVo.getFlowKey();
String fileXml = flowsInfoVo.getFileXml(); String fileXml = flowsInfoVo.getFileXml();
//生成xml文件 //生成xml文件
...@@ -192,24 +192,24 @@ public class WorkFlowServiceImpl implements WorkFlowService { ...@@ -192,24 +192,24 @@ public class WorkFlowServiceImpl implements WorkFlowService {
} }
FlowsInfo flowsInfo = new FlowsInfo(); FlowsInfo flowsInfo = new FlowsInfo();
BeanUtils.copyProperties(flowsInfoVo,flowsInfo); BeanUtils.copyProperties(flowsInfoVo,flowsInfo);
flowsInfo.setResourceName(flowKey+"bpmn20.xml"); flowsInfo.setResourceName(flowKey+"bpmn.xml");
//状态为未部署
flowsInfo.setState(1);
flowsInfo.setFilePath(classLoader.getResource("").getPath()+"/xml/"+flowKey+"bpmn20.xml"); flowsInfo.setFilePath(classLoader.getResource("").getPath()+"/xml/"+flowKey+"bpmn20.xml");
flowsInfo.setId(id); flowsInfo.setId(id);
//更新并保存 //更新并保存
flowsInfoMapper.save(flowsInfo); FlowsInfo save = flowsInfoMapper.save(flowsInfo);
//自动部署
deployXml(save);
} }
@Override @Override
public Long createFlow(FlowsInfo flowsInfo ) { public Integer createFlow(FlowsInfo flowsInfo ) {
FlowsInfo flowsInfo1 = flowsInfoMapper.save(flowsInfo); FlowsInfo flowsInfo1 = flowsInfoMapper.save(flowsInfo);
return flowsInfo1.getId(); return flowsInfo1.getId();
} }
@Override @Override
public void deployXml(FlowsInfo flowsInfo) throws FileNotFoundException { public void deployXml(FlowsInfo flowsInfo) {
Deployment deploy = null; Deployment deploy = null;
try { try {
deploy = repositoryService.createDeployment().addInputStream(flowsInfo.getResourceName(), deploy = repositoryService.createDeployment().addInputStream(flowsInfo.getResourceName(),
...@@ -335,10 +335,9 @@ public class WorkFlowServiceImpl implements WorkFlowService { ...@@ -335,10 +335,9 @@ public class WorkFlowServiceImpl implements WorkFlowService {
@Override @Override
public void suspendOrActivateProcessDefinitionByKey(Long id) { public void suspendOrActivateProcessDefinitionByKey(Integer id) {
//通过流程ID 查询出flowsInfo //通过流程ID 查询出flowsInfo
FlowsInfo flowsInfo = flowsInfoMapper.findById(id).get(); FlowsInfo flowsInfo = flowsInfoMapper.findById(id).get();
String flowKey = flowsInfo.getFlowKey(); String flowKey = flowsInfo.getFlowKey();
if (flowsInfo.getState() == 0){ if (flowsInfo.getState() == 0){
//挂起 //挂起
...@@ -354,7 +353,7 @@ public class WorkFlowServiceImpl implements WorkFlowService { ...@@ -354,7 +353,7 @@ public class WorkFlowServiceImpl implements WorkFlowService {
@Override @Override
public void deleteFlow(Long id) { public void deleteFlow(Integer id) {
//通过流程id查询出flowsInfo //通过流程id查询出flowsInfo
FlowsInfo flowsInfo = flowsInfoMapper.findById(id).get(); FlowsInfo flowsInfo = flowsInfoMapper.findById(id).get();
if(flowsInfo.getState() == 0){ if(flowsInfo.getState() == 0){
......
...@@ -26,7 +26,7 @@ import java.util.List; ...@@ -26,7 +26,7 @@ import java.util.List;
@NoArgsConstructor @NoArgsConstructor
public class FlowsInfoVo { public class FlowsInfoVo {
@ApiModelProperty("主键id") @ApiModelProperty("主键id")
private Long id; private Integer id;
@ApiModelProperty("发起人的名字") @ApiModelProperty("发起人的名字")
private Long userName; private Long userName;
...@@ -38,7 +38,7 @@ public class FlowsInfoVo { ...@@ -38,7 +38,7 @@ public class FlowsInfoVo {
private String flowKey; private String flowKey;
@ApiModelProperty(value = "部署状态",notes = "0 已部署,1 未部署") @ApiModelProperty(value = "部署状态",notes = "0 已部署,1 未部署")
private Integer state; private Integer state = 1;
@ApiModelProperty("流程创建时间") @ApiModelProperty("流程创建时间")
private Date createTime; private Date createTime;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论