Skip to content

Commit

Permalink
#48 proceed user task
Browse files Browse the repository at this point in the history
  • Loading branch information
gavin2lee committed May 18, 2021
1 parent f3ebea7 commit de041a4
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import com.webank.taskman.base.LocalPageableQueryResult;
import com.webank.taskman.commons.AuthenticationContextHolder;
import com.webank.taskman.dto.TaskInfoDto;
import com.webank.taskman.dto.req.ProcessingTasksReqDto;
import com.webank.taskman.dto.req.ProceedTasksReqDto;
import com.webank.taskman.dto.req.TaskInfoQueryReqDto;
import com.webank.taskman.dto.req.TemplateQueryReqDto;
import com.webank.taskman.dto.req.TaskTemplateSaveReqDto;
Expand Down Expand Up @@ -134,9 +134,9 @@ public JsonResponse getTaskInfoInstance(@RequestParam("requestId") String reques
* @param req
* @return
*/
@PostMapping("/processing")
public JsonResponse taskInfoProcessing(@Valid @RequestBody ProcessingTasksReqDto req) {
return taskInfoService.taskInfoProcessing(req);
@PostMapping("/proceed")
public JsonResponse taskInfoProcessing(@Valid @RequestBody ProceedTasksReqDto req) {
return taskInfoService.proceedUserTask(req);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import java.util.List;

public class ProcessingTasksReqDto {
public class ProceedTasksReqDto {

public static final String RESULT_SUCCESSFUL="Successful/Approved";
public static final String RESULT_FAILED="Failed/Rejected";
Expand Down Expand Up @@ -35,7 +35,7 @@ public String getResultMessage() {
return resultMessage;
}

public ProcessingTasksReqDto setResultMessage(String resultMessage) {
public ProceedTasksReqDto setResultMessage(String resultMessage) {
this.resultMessage = resultMessage;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import com.webank.taskman.domain.TaskInfo;
import com.webank.taskman.dto.TaskInfoDto;
import com.webank.taskman.dto.platform.CoreCancelTaskDto;
import com.webank.taskman.dto.req.ProcessingTasksReqDto;
import com.webank.taskman.dto.req.ProceedTasksReqDto;
import com.webank.taskman.dto.req.TaskInfoQueryReqDto;
import com.webank.taskman.dto.resp.RequestInfoInstanceResqDto;
import com.webank.taskman.dto.resp.TaskInfoRespDto;
Expand All @@ -23,7 +23,7 @@ public interface TaskInfoService extends IService<TaskInfo> {

// CommonResponseDto createTask(PlatformTaskCreationReqDto req);

JsonResponse taskInfoProcessing(ProcessingTasksReqDto ptr);
JsonResponse proceedUserTask(ProceedTasksReqDto ptr);

CommonPlatformResponseDto cancelTask(CoreCancelTaskDto req);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import com.webank.taskman.domain.TaskInfo;
import com.webank.taskman.dto.TaskInfoDto;
import com.webank.taskman.dto.platform.CoreCancelTaskDto;
import com.webank.taskman.dto.req.ProcessingTasksReqDto;
import com.webank.taskman.dto.req.ProceedTasksReqDto;
import com.webank.taskman.dto.req.TaskInfoQueryReqDto;
import com.webank.taskman.dto.resp.FormInfoResqDto;
import com.webank.taskman.dto.resp.RequestInfoInstanceResqDto;
Expand Down Expand Up @@ -96,8 +96,7 @@ public LocalPageableQueryResult<TaskInfoDto> selectTaskInfo(Integer page, Intege
}

@Override
@Transactional
public JsonResponse taskInfoProcessing(ProcessingTasksReqDto req) {
public JsonResponse proceedUserTask(ProceedTasksReqDto req) {
TaskInfo taskInfo = getBaseMapper().selectById(req.getRecordId());
String currentUsername = AuthenticationContextHolder.getCurrentUsername();
if (!currentUsername.equals(taskInfo.getReporter())) {
Expand All @@ -106,7 +105,10 @@ public JsonResponse taskInfoProcessing(ProcessingTasksReqDto req) {
if (!"already_received".equals(taskInfo.getStatus())) {
throw new TaskmanRuntimeException("Processing failed. The current task is not claimed");
}
callbackByTaskInfo(req, taskInfo);

//TODO
asyncProceedUserTask();
// callbackByTaskInfo(req, taskInfo);
// List<FormItemInfo> formItemInfos =
// formItemInfoConverter.toEntityByReq(req.getFormItemInfoList());
// formInfoService.saveFormInfoAndItems(formItemInfos,
Expand Down Expand Up @@ -151,7 +153,7 @@ private String convertTaskFormValueDtoToJson(TaskFormValueDto taskFormValueDto)
}
}

private void callbackByTaskInfo(ProcessingTasksReqDto req, TaskInfo taskInfo) {
private void callbackByTaskInfo(ProceedTasksReqDto req, TaskInfo taskInfo) {
// CallbackRequestDto callbackRequest = new CallbackRequestDto();
// CallbackRequestResultDataDto callbackRequestResultDataDto = new
// CallbackRequestResultDataDto();
Expand Down

0 comments on commit de041a4

Please sign in to comment.