Browse Source

修改拆单问题

dev
陈龙 3 days ago
parent
commit
3653c6f01a
  1. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSplitOrderTaskServiceImpl.java
  2. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/vo/DistributionSplitOrderTaskVO.java

7
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSplitOrderTaskServiceImpl.java

@ -90,11 +90,16 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
List<DistributionSplitOrderTaskVO> listVo = new ArrayList<>(); List<DistributionSplitOrderTaskVO> listVo = new ArrayList<>();
if (list != null && !list.isEmpty()) { if (list != null && !list.isEmpty()) {
Map<Long, String> userIdNameMap = getUserIdNameMap(list.stream().map(DistributionSplitOrderTaskEntity::getCreateUser).collect(Collectors.toList())); Map<Long, String> userIdNameMap = getUserIdNameMap(list.stream().map(DistributionSplitOrderTaskEntity::getCreateUser).collect(Collectors.toList()));
List<Long> allTaskInfo = list.stream().map(DistributionSplitOrderTaskEntity::getSplitOrderAllTaskId).collect(Collectors.toList());
List<DistributionSplitOrderAllTaskEntity> allTaskList = distributionSplitOrderAllTaskService.listByIds(allTaskInfo);
Map<Long, DistributionSplitOrderAllTaskEntity> allTaskListById = allTaskList.stream().collect(Collectors.toMap(DistributionSplitOrderAllTaskEntity::getId, u -> u));
listVo = list.stream().map(item -> { listVo = list.stream().map(item -> {
DistributionSplitOrderTaskVO distributionSplitOrderTaskVO = new DistributionSplitOrderTaskVO(); DistributionSplitOrderTaskVO distributionSplitOrderTaskVO = new DistributionSplitOrderTaskVO();
BeanUtil.copyProperties(item, distributionSplitOrderTaskVO); BeanUtil.copyProperties(item, distributionSplitOrderTaskVO);
distributionSplitOrderTaskVO.setCreateUserName(userIdNameMap.get(item.getCreateUser())); distributionSplitOrderTaskVO.setCreateUserName(userIdNameMap.get(item.getCreateUser()));
distributionSplitOrderTaskVO.setAllTaskStatus(allTaskListById.get(item.getSplitOrderAllTaskId()).getState());
return distributionSplitOrderTaskVO; return distributionSplitOrderTaskVO;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
} }
@ -917,6 +922,8 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
queryWrapper.eq(DistributionSplitOrderAllTaskEntity::getId, splitOrderAllTaskId); queryWrapper.eq(DistributionSplitOrderAllTaskEntity::getId, splitOrderAllTaskId);
} }
queryWrapper.orderByDesc(DistributionSplitOrderAllTaskEntity::getCreateTime);
List<DistributionSplitOrderAllTaskEntity> list = distributionSplitOrderAllTaskService.list(page, queryWrapper); List<DistributionSplitOrderAllTaskEntity> list = distributionSplitOrderAllTaskService.list(page, queryWrapper);
List<DistributionSplitOrderAllTaskVO> listVo = new ArrayList<>(); List<DistributionSplitOrderAllTaskVO> listVo = new ArrayList<>();
if (list != null && !list.isEmpty()) { if (list != null && !list.isEmpty()) {

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/vo/DistributionSplitOrderTaskVO.java

@ -8,4 +8,5 @@ import lombok.EqualsAndHashCode;
@Data @Data
public class DistributionSplitOrderTaskVO extends DistributionSplitOrderTaskEntity { public class DistributionSplitOrderTaskVO extends DistributionSplitOrderTaskEntity {
private String createUserName; private String createUserName;
private Integer allTaskStatus;
} }

Loading…
Cancel
Save