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

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

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