|
@@ -1,5 +1,6 @@
|
|
|
package com.qmth.distributed.print.api;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.qmth.boot.api.annotation.Aac;
|
|
@@ -75,15 +76,14 @@ public class TFFlowController {
|
|
|
@ApiResponses({@ApiResponse(code = 200, message = "常规信息", response = ResultUtil.class)})
|
|
|
@RequestMapping(value = "/register", method = RequestMethod.POST)
|
|
|
public Result register(@ApiParam(value = "上传文件", required = true) @RequestParam MultipartFile file,
|
|
|
- @ApiParam(value = "流程文件名称", required = false) @RequestParam(required = false) String name,
|
|
|
- @ApiParam(value = "流程是否发布,true:发布,false:不发布", required = false) @RequestParam(required = false) Boolean publish) {
|
|
|
+ @ApiParam(value = "流程文件名称", required = true) @RequestParam String name) {
|
|
|
BasicAttachment basicAttachment = null;
|
|
|
try {
|
|
|
int temp = file.getOriginalFilename().lastIndexOf(".");
|
|
|
String fileName = file.getOriginalFilename().substring(0, temp);
|
|
|
String format = file.getOriginalFilename().substring(temp, file.getOriginalFilename().length());
|
|
|
- if (!format.equalsIgnoreCase(".bpmn") && !format.contains("bpmn20.xml")) {
|
|
|
- throw ExceptionResultEnum.ERROR.exception("上传的流程文件格式只能为.bmpn或bpmn20.xml");
|
|
|
+ if (!format.equalsIgnoreCase(".bpmn")) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("上传的流程文件格式只能为.bmpn");
|
|
|
}
|
|
|
basicAttachment = printCommonService.saveAttachment(file, ServletUtil.getRequestMd5(), UploadFileEnum.FILE);
|
|
|
if (Objects.isNull(basicAttachment)) {
|
|
@@ -91,7 +91,7 @@ public class TFFlowController {
|
|
|
}
|
|
|
activitiService.uploadDeployment(file);
|
|
|
SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
|
- TFFlow tfFlow = new TFFlow(SystemConstant.getHeadOrUserSchoolId(), sysUser.getOrgId(), Objects.isNull(name) ? fileName : name, publish, sysUser.getId());
|
|
|
+ TFFlow tfFlow = new TFFlow(SystemConstant.getHeadOrUserSchoolId(), sysUser.getOrgId(), name, sysUser.getId(), fileName);
|
|
|
tfFlowService.save(tfFlow);
|
|
|
} catch (Exception e) {
|
|
|
log.error("请求出错", e);
|
|
@@ -111,17 +111,24 @@ public class TFFlowController {
|
|
|
return ResultUtil.ok(new EditResult(basicAttachment.getId()));
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "发布流程")
|
|
|
+// @ApiOperation(value = "发布流程")
|
|
|
+// @ApiResponses({@ApiResponse(code = 200, message = "常规信息", response = ResultUtil.class)})
|
|
|
+// @RequestMapping(value = "/publish", method = RequestMethod.POST)
|
|
|
+// public Result publish(@ApiParam(value = "流程文件id", required = true) @RequestParam String id) {
|
|
|
+// SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
|
+// UpdateWrapper tfFlowUpdateWrapper = new UpdateWrapper<>();
|
|
|
+// tfFlowUpdateWrapper.lambda().eq(TFFlow::getId, Long.parseLong(id))
|
|
|
+// .set(TFFlow::getPublish, true)
|
|
|
+// .set(TFFlow::getUpdateId, sysUser.getId())
|
|
|
+// .set(TFFlow::getUpdateTime, System.currentTimeMillis());
|
|
|
+// return ResultUtil.ok(tfFlowService.update(tfFlowUpdateWrapper));
|
|
|
+// }
|
|
|
+
|
|
|
+ @ApiOperation(value = "删除流程")
|
|
|
@ApiResponses({@ApiResponse(code = 200, message = "常规信息", response = ResultUtil.class)})
|
|
|
- @RequestMapping(value = "/publish", method = RequestMethod.POST)
|
|
|
+ @RequestMapping(value = "/delete", method = RequestMethod.POST)
|
|
|
public Result publish(@ApiParam(value = "流程文件id", required = true) @RequestParam String id) {
|
|
|
- SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
|
- UpdateWrapper<TFFlow> tfFlowUpdateWrapper = new UpdateWrapper<>();
|
|
|
- tfFlowUpdateWrapper.lambda().eq(TFFlow::getId, id)
|
|
|
- .set(TFFlow::getPublish, true)
|
|
|
- .set(TFFlow::getUpdateId, sysUser.getId())
|
|
|
- .set(TFFlow::getUpdateTime, System.currentTimeMillis());
|
|
|
- return ResultUtil.ok(tfFlowService.update(tfFlowUpdateWrapper));
|
|
|
+ return ResultUtil.ok();
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "流程列表")
|