提交 5b6209a2 authored 作者: zjm's avatar zjm

修改job的bug

上级 0c5bdffe
流水线 #90 已取消 于阶段
...@@ -134,21 +134,25 @@ public class WorkController { ...@@ -134,21 +134,25 @@ public class WorkController {
@ApiImplicitParam(name="workId",value="任务id",dataType="String", paramType = "query",required = true), @ApiImplicitParam(name="workId",value="任务id",dataType="String", paramType = "query",required = true),
@ApiImplicitParam(name="userId",value="人员id",dataType="String", paramType = "query",required = true), @ApiImplicitParam(name="userId",value="人员id",dataType="String", paramType = "query",required = true),
@ApiImplicitParam(name="status",value="状态",dataType="String", paramType = "query",required = true), @ApiImplicitParam(name="status",value="状态",dataType="String", paramType = "query",required = true),
@ApiImplicitParam(name="msg",value="消息",dataType="String", paramType = "query",required = true) @ApiImplicitParam(name="msg",value="消息",dataType="String", paramType = "query",required = true),
@ApiImplicitParam(name="re",value = "操作1是撤回2是不同",dataType="String", paramType = "query",required = true)
}) })
public ResponseEntity<JobResponse> alterTaskStatus(@RequestParam String workId, public ResponseEntity<JobResponse> alterTaskStatus(@RequestParam String workId,
@RequestParam String userId, @RequestParam String userId,
@RequestParam String status, @RequestParam String status,
@RequestParam String msg) { @RequestParam String msg,
@RequestParam String re) {
switch (status) { switch (status) {
case "ongoing": case "ongoing":
Work work=workService.findById(workId); Work work=workService.findById(workId);
workService.alterTaskStatus(workId,status,userId);
if (work.getExecutor().equals(userId)){ if ("1".equals(re)){
//撤回 //撤回
businessTreeManagement.saveAction(userId,workId,Action.COMMIT_BACK_WORK,new Date(),msg); businessTreeManagement.saveAction(userId,workId,Action.COMMIT_BACK_WORK,new Date(),msg);
}else { workService.alterTaskStatus1(workId,status,userId);
}else{
workService.alterTaskStatus(workId,status,userId);
businessTreeManagement.saveAction(userId,workId,Action.BACK_WORK,new Date(),msg); businessTreeManagement.saveAction(userId,workId,Action.BACK_WORK,new Date(),msg);
//审核不通过 //审核不通过
} }
......
...@@ -89,6 +89,14 @@ public interface WorkService { ...@@ -89,6 +89,14 @@ public interface WorkService {
*/ */
void alterTaskStatus(String taskId, String status,String userId); void alterTaskStatus(String taskId, String status,String userId);
/**
* 撤回任务的状态
* @param taskId 任务id
* @param status 要修改的状态
*/
void alterTaskStatus1(String taskId, String status,String userId);
/** /**
* 逻辑删除任务 * 逻辑删除任务
* @param taskId 任务id * @param taskId 任务id
......
...@@ -143,11 +143,8 @@ public class WorkServiceImpl implements WorkService { ...@@ -143,11 +143,8 @@ public class WorkServiceImpl implements WorkService {
ob.setStatus(status); ob.setStatus(status);
Date time=new Date(); Date time=new Date();
if (WorkStatus.ONGOING.equals(status)){ if (WorkStatus.ONGOING.equals(status)){
if (ob.getPublisher().equals(userId)){
ob.setAuditTime(time); ob.setAuditTime(time);
workTimeService.saveWorkEndTime(ob,time); workTimeService.saveWorkEndTime(ob,time);
}
}else if (WorkStatus.AUDIT.equals(status)){ }else if (WorkStatus.AUDIT.equals(status)){
ob.setSubmitTime(time); ob.setSubmitTime(time);
...@@ -178,6 +175,13 @@ public class WorkServiceImpl implements WorkService { ...@@ -178,6 +175,13 @@ public class WorkServiceImpl implements WorkService {
workRepository.save(ob); workRepository.save(ob);
} }
@Override
public void alterTaskStatus1(String taskId, String status, String userId) {
Work ob = workRepository.findById(taskId).get();
ob.setStatus(status);
workRepository.save(ob);
}
private Float practical(String workId){ private Float practical(String workId){
Float count=0.0f; Float count=0.0f;
List<WorkTime> workTimes=workTimeService.selectWorkTime(workId); List<WorkTime> workTimes=workTimeService.selectWorkTime(workId);
...@@ -243,6 +247,7 @@ return 0.0f; ...@@ -243,6 +247,7 @@ return 0.0f;
Work ob = workRepository.findById(taskId).get(); Work ob = workRepository.findById(taskId).get();
ob.setPWorkload(personalWorkload); ob.setPWorkload(personalWorkload);
ob.setWorkloadCount(workloadCount); ob.setWorkloadCount(workloadCount);
ob.setStatus(WorkStatus.DELETE);
workRepository.save(ob); workRepository.save(ob);
} }
......
...@@ -180,10 +180,11 @@ public class BusinessTreeManagementImpl implements BusinessTreeManagement { ...@@ -180,10 +180,11 @@ public class BusinessTreeManagementImpl implements BusinessTreeManagement {
break; break;
case 9: case 9:
String actionMsg; ScoreCoefficient scoreCoefficient= scoreCoefficientRepository.findByWordId(work.getId()).get(0);
if (!noteResource.getId().equals(work.getPublisher())){ String actionMsg = null;
if (scoreCoefficient.getScore1()!=null){
actionMsg=name+"对任务进行了自我评价"; actionMsg=name+"对任务进行了自我评价";
}else { }else if (scoreCoefficient.getScore2()!=null){
actionMsg=name+"对任务进行了发布者评价"; actionMsg=name+"对任务进行了发布者评价";
} }
actionHistory.setActionMsg(actionMsg); actionHistory.setActionMsg(actionMsg);
......
...@@ -52,6 +52,7 @@ public class MyUserDetailsServiceImpl implements UserDetailsService { ...@@ -52,6 +52,7 @@ public class MyUserDetailsServiceImpl implements UserDetailsService {
@Override @Override
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException{ public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException{
System.out.println("userService验证:" + username); System.out.println("userService验证:" + username);
if(username.equals("root")){ if(username.equals("root")){
User root = init.root; User root = init.root;
// root.setPassword("root"); // root.setPassword("root");
......
...@@ -27,7 +27,7 @@ public class UnionApplication { ...@@ -27,7 +27,7 @@ public class UnionApplication {
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(UnionApplication.class, args); SpringApplication.run(UnionApplication.class, args);
} }
// 开始支持http //// 开始支持http
@Bean @Bean
public ServletWebServerFactory servletContainer() { public ServletWebServerFactory servletContainer() {
TomcatServletWebServerFactory tomcat = new TomcatServletWebServerFactory(); TomcatServletWebServerFactory tomcat = new TomcatServletWebServerFactory();
...@@ -35,14 +35,14 @@ public class UnionApplication { ...@@ -35,14 +35,14 @@ public class UnionApplication {
return tomcat; return tomcat;
} }
private Connector createHTTPConnector() { private Connector createHTTPConnector() {
Connector connector = new Connector("org.apache.coyote.http11.Http11NioProtocol"); Connector connector = new Connector("org.apache.coyote.http11.Http11NioProtocol");
//同时启用http(8080)、https(8443)两个端口 //同时启用http(8080)、https(8443)两个端口
connector.setScheme("http"); connector.setScheme("http");
connector.setSecure(false); connector.setSecure(false);
connector.setPort(8084); connector.setPort(8084);
connector.setRedirectPort(8289); connector.setRedirectPort(8289);
return connector; return connector;
} }
} }
...@@ -3,7 +3,7 @@ spring.application.name=workbook ...@@ -3,7 +3,7 @@ spring.application.name=workbook
# https端口号. # https端口号.
server.port=8289 server.port=8289
## 证书的路径. # 证书的路径.
server.ssl.key-store=classpath:2586377_workbook.zjtys.com.cn.pfx server.ssl.key-store=classpath:2586377_workbook.zjtys.com.cn.pfx
# 证书密码,请修改为您自己证书的密码. # 证书密码,请修改为您自己证书的密码.
server.ssl.key-store-password=bMEPW9BG server.ssl.key-store-password=bMEPW9BG
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论