Browse Source

#检修工作票拨打电话

zhongwei
yang_shj 2 weeks ago
parent
commit
491600a274
  1. 7
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/accessTicket/dto/response/AccessTicketPageRspDTO.java
  2. 1
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/controller/PlanController.java
  3. 7
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/controller/AccessTicketController.java
  4. 3
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/service/AccessTicketService.java
  5. 45
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/service/impl/AccessTicketServiceImpl.java

7
hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/accessTicket/dto/response/AccessTicketPageRspDTO.java

@ -1,8 +1,13 @@
package com.hnac.hzims.ticket.accessTicket.dto.response; package com.hnac.hzims.ticket.accessTicket.dto.response;
import com.hnac.hzims.ticket.accessTicket.entity.AccessTicketEntity; import com.hnac.hzims.ticket.accessTicket.entity.AccessTicketEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import org.springblade.system.user.entity.User;
import java.util.List;
/** /**
* @author ysj * @author ysj
@ -11,4 +16,6 @@ import lombok.EqualsAndHashCode;
@Data @Data
public class AccessTicketPageRspDTO extends AccessTicketEntity { public class AccessTicketPageRspDTO extends AccessTicketEntity {
@ApiModelProperty("下一步执行人")
private List<User> executors;
} }

1
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/controller/PlanController.java

@ -239,4 +239,5 @@ public class PlanController extends BladeController {
} }
return result; return result;
} }
} }

7
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/controller/AccessTicketController.java

@ -111,11 +111,4 @@ public class AccessTicketController extends BladeController {
public R<List<User>> roleQueryUser(@RequestParam("roleAlias") String roleAlias) { public R<List<User>> roleQueryUser(@RequestParam("roleAlias") String roleAlias) {
return R.data(accessTicketService.roleQueryUser(roleAlias)); return R.data(accessTicketService.roleQueryUser(roleAlias));
} }
@GetMapping("/stageExecutor")
@ApiOperationSupport(order = 7)
@ApiOperation(value = "阶段执行人查询")
public R<List<User>> stageExecutor(@RequestParam("processInstanceId") String processInstanceId) {
return R.data(accessTicketService.stageExecutor(processInstanceId));
}
} }

3
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/service/AccessTicketService.java

@ -14,7 +14,6 @@ import com.hnac.hzims.ticket.accessTicket.vo.AccessTicketTaskCountVo;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.system.user.entity.User; import org.springblade.system.user.entity.User;
import javax.servlet.http.HttpServletResponse;
import java.util.List; import java.util.List;
/** /**
@ -37,6 +36,4 @@ public interface AccessTicketService extends IService<AccessTicketEntity> {
List<User> roleQueryUser(String roleAlias); List<User> roleQueryUser(String roleAlias);
AccessTicketTaskCountVo taskCount(AccessTicketTaskCountReqDTO param); AccessTicketTaskCountVo taskCount(AccessTicketTaskCountReqDTO param);
List<User> stageExecutor(String processInstanceId);
} }

45
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/service/impl/AccessTicketServiceImpl.java

@ -52,6 +52,7 @@ import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
* @author ysj * @author ysj
@ -272,7 +273,26 @@ public class AccessTicketServiceImpl extends ServiceImpl<AccessTicketMapper, Acc
*/ */
@Override @Override
public IPage<AccessTicketPageRspDTO> pageCondition(AccessTicketPageReqDTO param, Query query) { public IPage<AccessTicketPageRspDTO> pageCondition(AccessTicketPageReqDTO param, Query query) {
return super.baseMapper.pageCondition(Condition.getPage(query),param); IPage<AccessTicketPageRspDTO> ipage = super.baseMapper.pageCondition(Condition.getPage(query),param);
if(CollectionUtil.isEmpty(ipage.getRecords())){
return ipage;
}
List<AccessTicketPageRspDTO> records = ipage.getRecords();
ipage.setRecords(records.stream().peek(record->{
List<User> users = new ArrayList<>();
Arrays.stream(record.getNextStepExecutor().split(",")).forEach(account->{
User user = UserCache.getUser(Long.valueOf(account));
if(ObjectUtil.isNotEmpty(user)){
users.add(user);
}
});
if(CollectionUtil.isEmpty(users)){
record.setExecutors(new ArrayList<>());
}else{
record.setExecutors(users);
}
}).collect(Collectors.toList()));
return ipage;
} }
/** /**
@ -537,27 +557,4 @@ public class AccessTicketServiceImpl extends ServiceImpl<AccessTicketMapper, Acc
task.setTaskIncomplete((int) entitys.stream().filter(o->!"流程结束".equals(o.getTaskName())).count()); task.setTaskIncomplete((int) entitys.stream().filter(o->!"流程结束".equals(o.getTaskName())).count());
return task; return task;
} }
/**
* 阶段执行人查询
* @param processInstanceId
* @return
*/
@Override
public List<User> stageExecutor(String processInstanceId) {
AccessTicketEntity entity = this.getOne(Wrappers.<AccessTicketEntity>lambdaQuery()
.eq(AccessTicketEntity::getProcessInstanceId,processInstanceId)
);
if(ObjectUtil.isEmpty(entity) || StringUtils.isEmpty(entity.getNextStepExecutor())){
return new ArrayList<>();
}
List<User> users = new ArrayList<>();
Arrays.stream(entity.getNextStepExecutor().split(",")).forEach(account->{
User user = UserCache.getUser(Long.valueOf(account));
if(ObjectUtil.isNotEmpty(user)){
users.add(user);
}
});
return users;
}
} }
Loading…
Cancel
Save