Преглед изворни кода

修改获取工单列表(分页)

tags/v1.1.0^2
wanghaoran пре 1 година
родитељ
комит
e1cfdd974f
2 измењених фајлова са 29 додато и 10 уклоњено
  1. +19
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/entity/domain/WorkOrder.java
  2. +10
    -10
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/WorkOrderServiceImpl.java

+ 19
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/entity/domain/WorkOrder.java Прегледај датотеку

@@ -1,5 +1,6 @@
package com.tuoheng.admin.entity.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.tuoheng.common.common.BaseEntity;
@@ -59,4 +60,22 @@ public class WorkOrder extends BaseEntity implements Serializable {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date finishTime;

/**
* 问题总数
*/
@TableField(exist = false)
private Integer questionTotal;

/**
* 未处理问题数
*/
@TableField(exist = false)
private Integer unhandledTotal;

/**
* 指派负责人名称
*/
@TableField(exist = false)
private String assignUserName;

}

+ 10
- 10
tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/WorkOrderServiceImpl.java Прегледај датотеку

@@ -66,27 +66,27 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
.eq(WorkOrder::getMark, MarkTypeEnum.VALID.getCode())
.orderByDesc(WorkOrder::getCreateTime));

pageData.getRecords().stream().map(x ->{
WorkOrderInfoVO vo = new WorkOrderInfoVO();
BeanUtils.copyProperties(x, vo);
pageData.getRecords().stream().map(vo -> {

//查询问题总数
Integer questionTotal = workOrderQuestionMapper.selectCount(new LambdaQueryWrapper<WorkOrderQuestion>()
.eq(WorkOrderQuestion::getWorkOrderId, x.getId()));
.eq(WorkOrderQuestion::getWorkOrderId, vo.getId()));
vo.setQuestionTotal(questionTotal);

//查询未处理问题数
Integer unhandledTotal = workOrderQuestionMapper.selectCount(new LambdaQueryWrapper<WorkOrderQuestion>()
.eq(WorkOrderQuestion::getWorkOrderId, x.getId())
.eq(WorkOrderQuestion::getWorkOrderId, vo.getId())
.eq(WorkOrderQuestion::getStatus, 0));
vo.setUnhandledTotal(unhandledTotal);

//处理人员名称
List<String> assignUser = Arrays.asList(x.getAssignUser().split(","));
List<Integer> assignUserInteger = assignUser.stream().map(Integer::parseInt).collect(Collectors.toList());
List<User> userList = userMapper.selectList(new LambdaQueryWrapper<User>().in(User::getId, assignUserInteger));
List<String> assignUserNameList = userList.stream().map(User::getRealname).collect(Collectors.toList());
vo.setAssignUserName(String.join(",",assignUserNameList));
if (StringUtils.isNotEmpty(vo.getAssignUser())) {
List<String> assignUser = Arrays.asList(vo.getAssignUser().split(","));
List<Integer> assignUserInteger = assignUser.stream().map(Integer::parseInt).collect(Collectors.toList());
List<User> userList = userMapper.selectList(new LambdaQueryWrapper<User>().in(User::getId, assignUserInteger));
List<String> assignUserNameList = userList.stream().map(User::getRealname).collect(Collectors.toList());
vo.setAssignUserName(String.join(",", assignUserNameList));
}

return vo;
}).collect(Collectors.toList());

Loading…
Откажи
Сачувај