Browse Source

修改代办工单接口

tags/v1.0.0^2
chengwang 1 year ago
parent
commit
3783e3e925
1 changed files with 39 additions and 39 deletions
  1. +39
    -39
      tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/impl/WorkOrderServiceImpl.java

+ 39
- 39
tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/impl/WorkOrderServiceImpl.java View File

@@ -469,45 +469,45 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
query.setOrderEndTime(endTime);
//用户角色为2部门管理员 3普通用户
if (RoleEnum.SUPER_ADMIN.getCode() == type) {
//超级管理员可查看系统内所有已处理工单
IPage<WorkOrder> workPageData = workOrderMapper.selectPage(page, new LambdaQueryWrapper<WorkOrder>()
.eq(WorkOrder::getStatus, 15)
.eq(WorkOrder::getTenantId, tenantId)
.between(null != query.getOrderStartTime() && null != query.getOrderEndTime(), WorkOrder::getCreateTime, query.getOrderStartTime(), query.getOrderEndTime())
.eq(WorkOrder::getMark, 1));
//设置每条工单对应的已完成问题数量 问题状态为25问题已处理
List<WorkOrderInfoVo> collect = workPageData.getRecords().stream().map(s -> {
WorkOrderInfoVo vo = new WorkOrderInfoVo();
BeanUtils.copyProperties(s, vo);
//被分配人员对应的id
String assignUser = s.getAssignUser();
if (StringUtils.isEmpty(assignUser)) {
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL);
}
String[] assignUserId = assignUser.split(",");
List<String> list = new ArrayList<>();
for (String userId : assignUserId) {
User userInfo = userMapper.selectById(userId);
if (ObjectUtil.isNotNull(userInfo)) {
list.add(userInfo.getUsername());
}
}
String usernames = list.stream().map(String::valueOf).collect(Collectors.joining("、"));
vo.setAssignUserName(usernames);
//问题总数
List<WorkOrderFile> workOrderFiles = workOrderFileMapper.selectList(Wrappers.<WorkOrderFile>lambdaQuery()
.eq(WorkOrderFile::getWorkOrderId, s.getId()));
if (null == workOrderFiles) {
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL);
}
vo.setPromTotal(workOrderFiles.size());
//已解决问题=问题总数
vo.setPromProcessed(workOrderFiles.size());
return vo;
}).collect(Collectors.toList());
pageData.setRecords(collect);
return JsonResult.success(pageData);
// //超级管理员可查看系统内所有已处理工单
// IPage<WorkOrder> workPageData = workOrderMapper.selectPage(page, new LambdaQueryWrapper<WorkOrder>()
// .eq(WorkOrder::getStatus, 15)
// .eq(WorkOrder::getTenantId, tenantId)
// .between(null != query.getOrderStartTime() && null != query.getOrderEndTime(), WorkOrder::getCreateTime, query.getOrderStartTime(), query.getOrderEndTime())
// .eq(WorkOrder::getMark, 1));
// //设置每条工单对应的已完成问题数量 问题状态为25问题已处理
// List<WorkOrderInfoVo> collect = workPageData.getRecords().stream().map(s -> {
// WorkOrderInfoVo vo = new WorkOrderInfoVo();
// BeanUtils.copyProperties(s, vo);
// //被分配人员对应的id
// String assignUser = s.getAssignUser();
// if (StringUtils.isEmpty(assignUser)) {
// throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL);
// }
// String[] assignUserId = assignUser.split(",");
// List<String> list = new ArrayList<>();
// for (String userId : assignUserId) {
// User userInfo = userMapper.selectById(userId);
// if (ObjectUtil.isNotNull(userInfo)) {
// list.add(userInfo.getUsername());
// }
// }
// String usernames = list.stream().map(String::valueOf).collect(Collectors.joining("、"));
// vo.setAssignUserName(usernames);
// //问题总数
// List<WorkOrderFile> workOrderFiles = workOrderFileMapper.selectList(Wrappers.<WorkOrderFile>lambdaQuery()
// .eq(WorkOrderFile::getWorkOrderId, s.getId()));
// if (null == workOrderFiles) {
// throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL);
// }
// vo.setPromTotal(workOrderFiles.size());
// //已解决问题=问题总数
// vo.setPromProcessed(workOrderFiles.size());
// return vo;
// }).collect(Collectors.toList());
// pageData.setRecords(collect);
//
return JsonResult.success(null,"超级管理员代办工单不显示数据");
}
//用户角色为2部门管理员 3普通用户
if (RoleEnum.ADMIN.getCode() == user.getRoleId() || RoleEnum.ORDINARY_USER.getCode() == user.getRoleId()) {

Loading…
Cancel
Save