Browse Source

修改:提供销售订单分页表selectSysSalesOrderList转换

dev
zhangsiqi 3 months ago
parent
commit
f3e5f90a59
  1. 11
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderServiceImpl.java

11
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderServiceImpl.java

@ -128,9 +128,9 @@ public class SysSalesOrderServiceImpl implements ISysSalesOrderService
SysUser curUser = ShiroUtils.getSysUser();
String loginName = ShiroUtils.getLoginName();
Long userId = curUser.getUserId();
List<SysSalesOrderVo> returnList = new ArrayList<>();
Page<SysSalesOrderVo> returnList = new Page<>();
//PageHelper 仅对第一List分页有效
List<SysSalesOrderVo> list =sysSalesOrderMapper.selectSysSalesOrderList(sysSalesOrderVo1);
Page<SysSalesOrderVo> list = (Page<SysSalesOrderVo>)sysSalesOrderMapper.selectSysSalesOrderList(sysSalesOrderVo1);
Set<String> roleKeys = roleService.selectRoleKeys(userId);
List<SysUser> sysUserlist = sysUserService.selectRoleToUserList("ywyRole");
sysUserlist.add(curUser);
@ -141,11 +141,11 @@ public class SysSalesOrderServiceImpl implements ISysSalesOrderService
List<String> user = findUser.stream().map(SysUser::getLoginName).collect(Collectors.toList());
String userStr = String.join(",", user);
sysSalesOrderVo1.setApplyUsers(user);
list = sysSalesOrderMapper.selectSysSalesOrderList(sysSalesOrderVo1);
list = (Page<SysSalesOrderVo>) sysSalesOrderMapper.selectSysSalesOrderList(sysSalesOrderVo1);
}
if (roleKeys.contains("ywyRole")) {
sysSalesOrderVo1.setApplyUser(curUser.getLoginName());
list = list.stream().filter(item -> item.getApplyUser().equals(curUser.getLoginName())).collect(Collectors.toList());
list = (Page<SysSalesOrderVo>) list.stream().filter(item -> item.getApplyUser().equals(curUser.getLoginName())).collect(Collectors.toList());
}
for(SysSalesOrderVo sysSalesOrderVo : list){
SysUser sysUser = userMapper.selectUserByLoginName(sysSalesOrderVo.getCreateBy());
@ -188,6 +188,9 @@ public class SysSalesOrderServiceImpl implements ISysSalesOrderService
}
returnList.add(sysSalesOrderVo);
}
returnList.setTotal(CollectionUtils.isEmpty(list) ? 0 : list.getTotal());
returnList.setPageNum(pageNum);
returnList.setPageSize(pageSize);
return returnList;
}

Loading…
Cancel
Save