Commit 85ae98a0 by chenweisong

更新

parent e5d34b2c
...@@ -85,8 +85,8 @@ public class ExcelController { ...@@ -85,8 +85,8 @@ public class ExcelController {
@ApiImplicitParams( @ApiImplicitParams(
@ApiImplicitParam(name = "excelId", required = true, value = "当前模板id", dataType = "long", paramType = "query") @ApiImplicitParam(name = "excelId", required = true, value = "当前模板id", dataType = "long", paramType = "query")
) )
@PostMapping(value = "/excel/getData") @GetMapping(value = "/excel/getData/{excelId}")
public Object getRecordData(long excelId) { public Object getRecordData(@PathVariable long excelId) {
return "成功"; return "成功";
} }
......
...@@ -68,7 +68,7 @@ public class TaskController { ...@@ -68,7 +68,7 @@ public class TaskController {
@ApiImplicitParam(name = "pageSize", value = "当前页条数", paramType = "query", required = true, dataType = "int", defaultValue = "10"), @ApiImplicitParam(name = "pageSize", value = "当前页条数", paramType = "query", required = true, dataType = "int", defaultValue = "10"),
@ApiImplicitParam(name = "name", value = "活动名称", paramType = "query", dataType = "string") @ApiImplicitParam(name = "name", value = "活动名称", paramType = "query", dataType = "string")
}) })
@PostMapping(value = "/task/list") @GetMapping(value = "/tasks")
public SimplePage getTaskList(int pageNo, int pageSize, String name) { public SimplePage getTaskList(int pageNo, int pageSize, String name) {
Page<Activity> taskList; Page<Activity> taskList;
String orderBy = "descending"; // String orderBy = "descending"; //
...@@ -81,23 +81,23 @@ public class TaskController { ...@@ -81,23 +81,23 @@ public class TaskController {
return SimplePage.of(taskList); return SimplePage.of(taskList);
} }
@ApiOperation(value = "单个活动详情") @ApiOperation(value = "获取单个活动详情")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "taskId", value = "活动id", paramType = "query", required = true, dataType = "long") @ApiImplicitParam(name = "taskId", value = "活动id", paramType = "path", required = true, dataType = "long")
}) })
@PostMapping(value = "/task/get") @GetMapping(value = "/task/get/{taskId}")
public SimpleTask get(long taskId) { public SimpleTask get(@PathVariable long taskId) {
Activity activity = activityService.get(taskId); Activity activity = activityService.findById(taskId);
CommonValidator.notNull(activity, "活动不存在"); CommonValidator.notNull(activity, "活动不存在");
return SimpleTask.convert(activity); return SimpleTask.convert(activity);
} }
@ApiOperation(value = "我的任务", notes = "任务列表") @ApiOperation(value = "获取我的任务", notes = "任务列表")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "userId", value = "用户id", paramType = "query", required = true, dataType = "long", defaultValue = "3") @ApiImplicitParam(name = "userId", value = "用户id", paramType = "path", required = true, dataType = "long", defaultValue = "3")
}) })
@PostMapping(value = "/task/getMyTasks") @GetMapping(value = "/task/getMyTasks/{userId}")
public List<Mission> getMyMissions(long userId) { public List<Mission> getMyMissions(@PathVariable long userId) {
Map user = feignAuthService.getUserById(userId); Map user = feignAuthService.getUserById(userId);
CommonValidator.notNull(user, "用户不存在"); CommonValidator.notNull(user, "用户不存在");
String username = user.get("name").toString(); String username = user.get("name").toString();
...@@ -187,18 +187,21 @@ public class TaskController { ...@@ -187,18 +187,21 @@ public class TaskController {
} }
@ApiOperation(value = "修改活动") @ApiOperation(value = "修改活动")
@PostMapping(value = "/task/update") @ApiImplicitParams({
public Object updateTask(@RequestBody TaskForm form) { @ApiImplicitParam(name = "taskId", value = "活动id", paramType = "path", required = true, dataType = "long")
})
@PostMapping(value = "/task/edit/{taskId}")
public Object editTask(@RequestBody TaskForm form, @PathVariable long taskId) {
return "修改成功"; return "修改成功";
} }
@ApiOperation(value = "发起活动") @ApiOperation(value = "发起活动")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "taskId", value = "活动id", paramType = "query", required = true, dataType = "long") @ApiImplicitParam(name = "taskId", value = "活动id", paramType = "path", required = true, dataType = "long")
}) })
@PostMapping(value = "/task/start") @PostMapping(value = "/task/run/{taskId}")
public Object runTask(long taskId) { public Object runTask(@PathVariable long taskId) {
Activity activity = activityService.get(taskId); Activity activity = activityService.findById(taskId);
CommonValidator.notNull(activity, "活动不存在"); CommonValidator.notNull(activity, "活动不存在");
CommonValidator.isTrue(activity.getStatus() == Activity.STATUS_WAIT, "活动正在运行,不能重复启动"); CommonValidator.isTrue(activity.getStatus() == Activity.STATUS_WAIT, "活动正在运行,不能重复启动");
...@@ -245,35 +248,24 @@ public class TaskController { ...@@ -245,35 +248,24 @@ public class TaskController {
@ApiOperation(value = "审核通过活动") @ApiOperation(value = "审核通过活动")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "taskId", value = "活动id", paramType = "query", required = true, dataType = "long") @ApiImplicitParam(name = "taskId", value = "活动id", paramType = "path", required = true, dataType = "long")
}) })
@PostMapping(value = "/task/pass") @PostMapping(value = "/task/pass/{taskId}")
public Object passTask(long taskId) { public Object passTask(@PathVariable long taskId) {
Activity activity = activityService.get(taskId); Activity activity = activityService.findById(taskId);
// 完结活动, 流程跑完 // 完结活动, 流程跑完
// User judge = userService.getAudit();
// List<Task> taskList = taskService.createTaskQuery().processInstanceId(assignment.getProcessId())
// .taskAssignee(judge.getUsername()).list();
// TwinkleValidator.notLessThan(taskList.size(), 1, "启动失败");
// Task task = taskList.get(0);
// taskService.complete(task.getId(), ImmutableMap.of("pass", "true"));
// assignment.setStatus(Assignment.STATUS_COMPLETED);
// activityService.update(activity);
return "审核通过成功"; return "审核通过成功";
} }
@ApiOperation(value = "审核驳回活动") @ApiOperation(value = "审核驳回活动")
@PostMapping(value = "/task/reject") @ApiImplicitParams({
public Object rejectTask(@RequestParam Long taskId) { @ApiImplicitParam(name = "taskId", value = "活动id", paramType = "path", required = true, dataType = "long")
Activity activity = activityService.get(taskId); })
@PostMapping(value = "/task/reject/{taskId}")
public Object rejectTask(@PathVariable long taskId) {
Activity activity = activityService.findById(taskId);
// 完结活动, 流程跑完 // 完结活动, 流程跑完
// User judge = userService.getAudit();
// List<Task> taskList = taskService.createTaskQuery().processInstanceId(assignment.getProcessId())
// .taskAssignee(judge.getUsername()).list();
// TwinkleValidator.notLessThan(taskList.size(), 1, "启动失败");
// Task task = taskList.get(0);
// taskService.complete(task.getId(), ImmutableMap.of("pass", "false"));
return "审核驳回成功"; return "审核驳回成功";
} }
...@@ -286,7 +278,7 @@ public class TaskController { ...@@ -286,7 +278,7 @@ public class TaskController {
@ApiOperation(value = "查看当前活动进度", hidden = true) @ApiOperation(value = "查看当前活动进度", hidden = true)
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "taskId", value = "活动id", paramType = "query", required = true, dataType = "long") @ApiImplicitParam(name = "taskId", value = "活动id", paramType = "path", required = true, dataType = "long")
}) })
@PostMapping(value = "/task/progress/{taskId}") @PostMapping(value = "/task/progress/{taskId}")
public Object viewTaskProgress(@PathVariable long taskId) { public Object viewTaskProgress(@PathVariable long taskId) {
......
...@@ -16,8 +16,8 @@ public class ActivityService { ...@@ -16,8 +16,8 @@ public class ActivityService {
@Autowired @Autowired
private ActivityDao activityDao; private ActivityDao activityDao;
public Activity get(long id) { public Activity findById(long id) {
return activityDao.getOne(id); return activityDao.findById(id).get();
} }
public Activity update(Activity activity) { public Activity update(Activity activity) {
......
...@@ -57,8 +57,8 @@ app: ...@@ -57,8 +57,8 @@ app:
active-process: MoreSubProcessStandard.bpmn active-process: MoreSubProcessStandard.bpmn
swagger2: swagger2:
host: 192.168.0.240:8762/api/datacollector # host: 192.168.0.240:8762/api/datacollector
# host: localhost:8110 host: localhost:8110
security: security:
authUser: root authUser: root
authPwd: pwd authPwd: pwd
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment