Commit 96f58d9c by chenweisong

更新

parent e895d7df
......@@ -6,6 +6,7 @@ import com.keymobile.rest.common.utils.BeanUti;
import com.keymobile.rest.common.utils.DateUtil;
import com.keymobile.rest.common.validator.CommonValidator;
import com.keymobile.rest.controller.constant.TaskConstant;
import com.keymobile.rest.dto.LoginUser;
import com.keymobile.rest.model.*;
import com.keymobile.rest.model.Process;
import com.keymobile.rest.service.*;
......@@ -41,6 +42,9 @@ public class TaskController {
private String process;
@Autowired
private SessionService sessionService;
@Autowired
private ActivityService activityService;
@Autowired
private TemplateService templateService;
......@@ -91,14 +95,11 @@ public class TaskController {
}
@ApiOperation(value = "获取我的任务", notes = "任务列表")
@ApiImplicitParams({
@ApiImplicitParam(name = "userId", value = "用户id", paramType = "query", required = true, dataType = "long", defaultValue = "3")
})
@GetMapping(value = "/task/getMyTasks")
public List<Mission> getMyMissions(long userId) {
Map user = feignAuthService.getUserById(userId);
public List<Mission> getMyMissions() {
LoginUser user = sessionService.getLoginUser();
CommonValidator.notNull(user, "用户不存在");
String username = user.get("name").toString();
String username = user.getName();
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:
region: default
serviceUrl:
defaultZone: http://192.168.0.240:8081/eureka/
enabled: false
enabled: true
instance:
prefer-ip-address: false
# hostname: 192.168.0.48
hostname: 192.168.0.68
hostname: 192.168.0.48
# hostname: 192.168.0.68
hystrix:
command:
default:
......@@ -57,10 +57,10 @@ 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
# permit: false
permit: true
\ No newline at end of file
permit: false
# permit: true
\ No newline at end of file
......@@ -40,9 +40,9 @@ public class ProcessTest {
private HistoryService historyService;
// 默认启动的固化流程
// @Value("${app.active-process}")
private String process = "MoreSubProcessStandard.bpmn";
private String process = "SubProcessStandard.bpmn";
// @Test
@Test
public void createActivitiTask() {
// 加载的我们创建好的demo.bpmn 文件还有png文件
// 获取流的引擎
......@@ -236,7 +236,12 @@ public class ProcessTest {
public void asdsa() {
try {
// 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) {
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