Commit 96f58d9c by chenweisong

更新

parent e895d7df
...@@ -6,6 +6,7 @@ import com.keymobile.rest.common.utils.BeanUti; ...@@ -6,6 +6,7 @@ import com.keymobile.rest.common.utils.BeanUti;
import com.keymobile.rest.common.utils.DateUtil; import com.keymobile.rest.common.utils.DateUtil;
import com.keymobile.rest.common.validator.CommonValidator; import com.keymobile.rest.common.validator.CommonValidator;
import com.keymobile.rest.controller.constant.TaskConstant; import com.keymobile.rest.controller.constant.TaskConstant;
import com.keymobile.rest.dto.LoginUser;
import com.keymobile.rest.model.*; import com.keymobile.rest.model.*;
import com.keymobile.rest.model.Process; import com.keymobile.rest.model.Process;
import com.keymobile.rest.service.*; import com.keymobile.rest.service.*;
...@@ -41,6 +42,9 @@ public class TaskController { ...@@ -41,6 +42,9 @@ public class TaskController {
private String process; private String process;
@Autowired @Autowired
private SessionService sessionService;
@Autowired
private ActivityService activityService; private ActivityService activityService;
@Autowired @Autowired
private TemplateService templateService; private TemplateService templateService;
...@@ -91,14 +95,11 @@ public class TaskController { ...@@ -91,14 +95,11 @@ public class TaskController {
} }
@ApiOperation(value = "获取我的任务", notes = "任务列表") @ApiOperation(value = "获取我的任务", notes = "任务列表")
@ApiImplicitParams({
@ApiImplicitParam(name = "userId", value = "用户id", paramType = "query", required = true, dataType = "long", defaultValue = "3")
})
@GetMapping(value = "/task/getMyTasks") @GetMapping(value = "/task/getMyTasks")
public List<Mission> getMyMissions(long userId) { public List<Mission> getMyMissions() {
Map user = feignAuthService.getUserById(userId); LoginUser user = sessionService.getLoginUser();
CommonValidator.notNull(user, "用户不存在"); CommonValidator.notNull(user, "用户不存在");
String username = user.get("name").toString(); String username = user.getName();
List<Mission> missions = new ArrayList<>(); List<Mission> missions = new ArrayList<>();
// 获取个人任务 // 获取个人任务
......
package com.keymobile.rest.dto;
import lombok.Builder;
import lombok.Data;
@Data
@Builder
public class LoginUser {
private long id;
private String name;
}
package com.keymobile.rest.service;
import com.keymobile.rest.dto.LoginUser;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Service;
@Service
public class SessionService {
public LoginUser getLoginUser() {
Authentication auth = SecurityContextHolder.getContext().getAuthentication();
String userName = "NO_USER";
if (auth != null) {
userName = auth.getName();
String[] info = userName.split(":");
return LoginUser.builder().id(Long.parseLong(info[1])).name(info[2]).build();
} else {
return null;
}
}
}
...@@ -6,11 +6,11 @@ eureka: ...@@ -6,11 +6,11 @@ eureka:
region: default region: default
serviceUrl: serviceUrl:
defaultZone: http://192.168.0.240:8081/eureka/ defaultZone: http://192.168.0.240:8081/eureka/
enabled: false enabled: true
instance: instance:
prefer-ip-address: false prefer-ip-address: false
# hostname: 192.168.0.48 hostname: 192.168.0.48
hostname: 192.168.0.68 # hostname: 192.168.0.68
hystrix: hystrix:
command: command:
default: default:
...@@ -57,10 +57,10 @@ app: ...@@ -57,10 +57,10 @@ 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
# permit: false permit: false
permit: true # permit: true
\ No newline at end of file \ No newline at end of file
...@@ -40,9 +40,9 @@ public class ProcessTest { ...@@ -40,9 +40,9 @@ public class ProcessTest {
private HistoryService historyService; private HistoryService historyService;
// 默认启动的固化流程 // 默认启动的固化流程
// @Value("${app.active-process}") // @Value("${app.active-process}")
private String process = "MoreSubProcessStandard.bpmn"; private String process = "SubProcessStandard.bpmn";
// @Test @Test
public void createActivitiTask() { public void createActivitiTask() {
// 加载的我们创建好的demo.bpmn 文件还有png文件 // 加载的我们创建好的demo.bpmn 文件还有png文件
// 获取流的引擎 // 获取流的引擎
...@@ -236,7 +236,12 @@ public class ProcessTest { ...@@ -236,7 +236,12 @@ public class ProcessTest {
public void asdsa() { public void asdsa() {
try { try {
// taskService.complete( "28", ImmutableMap.of("needDataAudit", false, "needConfirm", false, "NeedDataBack", false)); // taskService.complete( "28", ImmutableMap.of("needDataAudit", false, "needConfirm", false, "NeedDataBack", false));
taskService.complete("52504", ImmutableMap.of("DataAudit", true, "NeedDataAudit", true,"auditUser","asdsa", "NeedConfirm", false, "NeedDataBack", false)); // taskService.complete("60039", ImmutableMap.of("DataAudit", true, "NeedDataAudit", true,"auditUser","asdsa", "NeedConfirm", false, "NeedDataBack", false));
// taskService.claim("60039", "asdsadsadsa");
// taskService.complete("67504", ImmutableMap.of( "NeedDataAudit", true,"auditUser","asdsa"));
taskService.complete("70003", ImmutableMap.of( "DataAudit", false));
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
......
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