Commit 85ae98a0 by chenweisong

更新

parent e5d34b2c
......@@ -85,8 +85,8 @@ public class ExcelController {
@ApiImplicitParams(
@ApiImplicitParam(name = "excelId", required = true, value = "当前模板id", dataType = "long", paramType = "query")
)
@PostMapping(value = "/excel/getData")
public Object getRecordData(long excelId) {
@GetMapping(value = "/excel/getData/{excelId}")
public Object getRecordData(@PathVariable long excelId) {
return "成功";
}
......
......@@ -68,7 +68,7 @@ public class TaskController {
@ApiImplicitParam(name = "pageSize", value = "当前页条数", paramType = "query", required = true, dataType = "int", defaultValue = "10"),
@ApiImplicitParam(name = "name", value = "活动名称", paramType = "query", dataType = "string")
})
@PostMapping(value = "/task/list")
@GetMapping(value = "/tasks")
public SimplePage getTaskList(int pageNo, int pageSize, String name) {
Page<Activity> taskList;
String orderBy = "descending"; //
......@@ -81,23 +81,23 @@ public class TaskController {
return SimplePage.of(taskList);
}
@ApiOperation(value = "单个活动详情")
@ApiOperation(value = "获取单个活动详情")
@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")
public SimpleTask get(long taskId) {
Activity activity = activityService.get(taskId);
@GetMapping(value = "/task/get/{taskId}")
public SimpleTask get(@PathVariable long taskId) {
Activity activity = activityService.findById(taskId);
CommonValidator.notNull(activity, "活动不存在");
return SimpleTask.convert(activity);
}
@ApiOperation(value = "我的任务", notes = "任务列表")
@ApiOperation(value = "获取我的任务", notes = "任务列表")
@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")
public List<Mission> getMyMissions(long userId) {
@GetMapping(value = "/task/getMyTasks/{userId}")
public List<Mission> getMyMissions(@PathVariable long userId) {
Map user = feignAuthService.getUserById(userId);
CommonValidator.notNull(user, "用户不存在");
String username = user.get("name").toString();
......@@ -187,18 +187,21 @@ public class TaskController {
}
@ApiOperation(value = "修改活动")
@PostMapping(value = "/task/update")
public Object updateTask(@RequestBody TaskForm form) {
@ApiImplicitParams({
@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 "修改成功";
}
@ApiOperation(value = "发起活动")
@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")
public Object runTask(long taskId) {
Activity activity = activityService.get(taskId);
@PostMapping(value = "/task/run/{taskId}")
public Object runTask(@PathVariable long taskId) {
Activity activity = activityService.findById(taskId);
CommonValidator.notNull(activity, "活动不存在");
CommonValidator.isTrue(activity.getStatus() == Activity.STATUS_WAIT, "活动正在运行,不能重复启动");
......@@ -245,35 +248,24 @@ public class TaskController {
@ApiOperation(value = "审核通过活动")
@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")
public Object passTask(long taskId) {
Activity activity = activityService.get(taskId);
@PostMapping(value = "/task/pass/{taskId}")
public Object passTask(@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", "true"));
// assignment.setStatus(Assignment.STATUS_COMPLETED);
// activityService.update(activity);
return "审核通过成功";
}
@ApiOperation(value = "审核驳回活动")
@PostMapping(value = "/task/reject")
public Object rejectTask(@RequestParam Long taskId) {
Activity activity = activityService.get(taskId);
@ApiImplicitParams({
@ApiImplicitParam(name = "taskId", value = "活动id", paramType = "path", required = true, dataType = "long")
})
@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 "审核驳回成功";
}
......@@ -286,7 +278,7 @@ public class TaskController {
@ApiOperation(value = "查看当前活动进度", hidden = true)
@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}")
public Object viewTaskProgress(@PathVariable long taskId) {
......
......@@ -16,8 +16,8 @@ public class ActivityService {
@Autowired
private ActivityDao activityDao;
public Activity get(long id) {
return activityDao.getOne(id);
public Activity findById(long id) {
return activityDao.findById(id).get();
}
public Activity update(Activity activity) {
......
......@@ -57,8 +57,8 @@ app:
active-process: MoreSubProcessStandard.bpmn
swagger2:
host: 192.168.0.240:8762/api/datacollector
# host: localhost:8110
# host: 192.168.0.240:8762/api/datacollector
host: localhost:8110
security:
authUser: root
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