Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
6b85132f25
9 files changed
+101
-77
No files matched your search
+1
-1
@@ -304,7 +304,7 @@ public class EngineFlowController {
|
||||
long count = taskQuery.count();
|
||||
if (count != 1) {
|
||||
log.debug("queryAssignTaskOne查询错误,count!=1,processInstanceId:{}", processInstanceId);
|
||||
return null;
|
||||
return R.failed();
|
||||
}
|
||||
Task task = taskQuery.singleResult();
|
||||
String taskId = task.getId();
|
||||
|
||||
+1
@@ -14,5 +14,6 @@ public class WalletForeignDto extends WalletForeignEntity {
|
||||
|
||||
private List<Long> deptIds;
|
||||
|
||||
private Boolean isFindCheckUser = false;
|
||||
|
||||
}
|
||||
+2
@@ -12,4 +12,6 @@ public class WalletStrideDto extends WalletStrideEntity {
|
||||
|
||||
private List<Long> deptIds;
|
||||
|
||||
private Boolean isFindCheckUser = false;
|
||||
|
||||
}
|
||||
+5
@@ -22,4 +22,9 @@ public class WalletForeignVo extends WalletForeignEntity implements BaseUserInte
|
||||
*/
|
||||
private String deptName;
|
||||
|
||||
/**
|
||||
* 当前用户是否为审批用户
|
||||
*/
|
||||
private Boolean isCheckUser = false;
|
||||
|
||||
}
|
||||
+5
@@ -21,4 +21,9 @@ public class WalletStrideVo extends WalletStrideEntity implements BaseUserInterf
|
||||
* 部门相关
|
||||
*/
|
||||
private String deptName;
|
||||
|
||||
/**
|
||||
* 当前用户是否为审批用户
|
||||
*/
|
||||
private Boolean isCheckUser = false;
|
||||
}
|
||||
+1
@@ -94,6 +94,7 @@ public class WalletForeignController {
|
||||
@GetMapping("/page-join")
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletForeign_view')")
|
||||
public R getWalletForeignPageJoin(@ParameterObject Page page, @ParameterObject WalletForeignDto dto) {
|
||||
dto.setIsFindCheckUser(true);
|
||||
return R.ok(walletForeignService.scopePageList(page, dto));
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -90,6 +90,7 @@ public class WalletStrideController {
|
||||
@GetMapping("/page-join")
|
||||
@PreAuthorize("@pms.hasPermission('admin_walletStride_view')")
|
||||
public R getWalletStrideJoin(@ParameterObject Page page, @ParameterObject WalletStrideDto dto) {
|
||||
dto.setIsFindCheckUser(true);
|
||||
return R.ok(walletStrideService.scopePageList(page, dto));
|
||||
}
|
||||
|
||||
|
||||
+43
-38
@@ -15,9 +15,10 @@ import com.bsd.pjcloud.admin.api.feign.RemoteUserService;
|
||||
import com.bsd.pjcloud.admin.api.utils.DataUtil;
|
||||
import com.bsd.pjcloud.common.core.util.CollectionUtils;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.flow.task.constant.NodeStatusEnum;
|
||||
import com.bsd.pjcloud.common.security.util.SecurityUtils;
|
||||
import com.bsd.pjcloud.flow.task.constant.TaskCheckStatusEnum;
|
||||
import com.bsd.pjcloud.flow.task.dto.ProcessNodeRecordAssignUserParamDto;
|
||||
import com.bsd.pjcloud.flow.task.dto.TaskDto;
|
||||
import com.bsd.pjcloud.wallet.api.constant.WalletCodeBizEnum;
|
||||
import com.bsd.pjcloud.wallet.api.dto.WalletForeignDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletForeignEntity;
|
||||
@@ -59,6 +60,7 @@ public class WalletForeignServiceImpl extends ServiceImpl<WalletForeignMapper, W
|
||||
private final FlowUtil flowUtil;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long create(WalletForeignDto dto) {
|
||||
// 查询发起人
|
||||
UserInfo userData = userService.getInnerByUserId(dto.getUserId()).getData();
|
||||
@@ -89,48 +91,14 @@ public class WalletForeignServiceImpl extends ServiceImpl<WalletForeignMapper, W
|
||||
@Override
|
||||
public Page<WalletForeignVo> pageJoin(Page page, WalletForeignDto dto) {
|
||||
Page<WalletForeignVo> list = baseMapper.pageJoin(page, dto);
|
||||
if (ObjectUtil.isNotEmpty(list.getRecords())) {
|
||||
// 用户
|
||||
List<Long> userIds = list.getRecords().stream().map(WalletForeignVo::getUserId).distinct().toList();
|
||||
if (ObjectUtil.isNotEmpty(userIds)) {
|
||||
R<List<SysUser>> userList = userService.getUserById(new ArrayList<>(userIds));
|
||||
if (ObjectUtil.isNotEmpty(userList.getData())) {
|
||||
DataUtil.convertUserList(list.getRecords(), CollectionUtils.convertMap(userList.getData(), SysUser::getUserId));
|
||||
}
|
||||
}
|
||||
// 部门
|
||||
List<Long> deptIds = list.getRecords().stream().map(WalletForeignVo::getDeptId).distinct().toList();
|
||||
if (ObjectUtil.isNotEmpty(deptIds)) {
|
||||
R<Map<Long, SysDept>> deptList = deptService.getDeptByDeptIds(deptIds);
|
||||
if (ObjectUtil.isNotEmpty(deptList.getData())) {
|
||||
DataUtil.convertDeptList(list.getRecords(), deptList.getData());
|
||||
}
|
||||
}
|
||||
}
|
||||
disposeList(list.getRecords(), dto);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<WalletForeignVo> scopePageList(Page page, WalletForeignDto dto) {
|
||||
Page<WalletForeignVo> list = baseMapper.scopePageList(page, dto);
|
||||
if (ObjectUtil.isNotEmpty(list.getRecords())) {
|
||||
// 用户
|
||||
List<Long> userIds = list.getRecords().stream().map(WalletForeignVo::getUserId).distinct().toList();
|
||||
if (ObjectUtil.isNotEmpty(userIds)) {
|
||||
R<List<SysUser>> userList = userService.getUserById(new ArrayList<>(userIds));
|
||||
if (ObjectUtil.isNotEmpty(userList.getData())) {
|
||||
DataUtil.convertUserList(list.getRecords(), CollectionUtils.convertMap(userList.getData(), SysUser::getUserId));
|
||||
}
|
||||
}
|
||||
// 部门
|
||||
List<Long> deptIds = list.getRecords().stream().map(WalletForeignVo::getDeptId).distinct().toList();
|
||||
if (ObjectUtil.isNotEmpty(deptIds)) {
|
||||
R<Map<Long, SysDept>> deptList = deptService.getDeptByDeptIds(deptIds);
|
||||
if (ObjectUtil.isNotEmpty(deptList.getData())) {
|
||||
DataUtil.convertDeptList(list.getRecords(), deptList.getData());
|
||||
}
|
||||
}
|
||||
}
|
||||
disposeList(list.getRecords(), dto);
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -173,8 +141,45 @@ public class WalletForeignServiceImpl extends ServiceImpl<WalletForeignMapper, W
|
||||
private boolean isCheckData(Long walletId) {
|
||||
Long count = baseMapper.selectCount(new LambdaQueryWrapper<WalletForeignEntity>()
|
||||
.eq(WalletForeignEntity::getUserId, walletId)
|
||||
.eq(WalletForeignEntity::getProcessStatus, NodeStatusEnum.JXZ.getCode())
|
||||
.eq(WalletForeignEntity::getProcessStatus, TaskCheckStatusEnum.PADDING.getCode())
|
||||
);
|
||||
return count > 0;
|
||||
}
|
||||
|
||||
private void disposeList(List<WalletForeignVo> list, WalletForeignDto dto) {
|
||||
if (ObjectUtil.isEmpty(list)) return;
|
||||
// 用户
|
||||
List<Long> userIds = list.stream().map(WalletForeignVo::getUserId).distinct().toList();
|
||||
if (ObjectUtil.isNotEmpty(userIds)) {
|
||||
R<List<SysUser>> userList = userService.getUserById(new ArrayList<>(userIds));
|
||||
if (ObjectUtil.isNotEmpty(userList.getData())) {
|
||||
DataUtil.convertUserList(list, CollectionUtils.convertMap(userList.getData(), SysUser::getUserId));
|
||||
}
|
||||
}
|
||||
// 部门
|
||||
List<Long> deptIds = list.stream().map(WalletForeignVo::getDeptId).distinct().toList();
|
||||
if (ObjectUtil.isNotEmpty(deptIds)) {
|
||||
R<Map<Long, SysDept>> deptList = deptService.getDeptByDeptIds(deptIds);
|
||||
if (ObjectUtil.isNotEmpty(deptList.getData())) {
|
||||
DataUtil.convertDeptList(list, deptList.getData());
|
||||
}
|
||||
}
|
||||
// 审批
|
||||
if (dto.getIsFindCheckUser()) {
|
||||
List<String> processInstanceIds = list.stream().map(WalletForeignVo::getProcessId).filter(ObjectUtil::isNotEmpty).distinct().toList();
|
||||
if (ObjectUtil.isNotEmpty(processInstanceIds)) {
|
||||
List<TaskDto> taskList = flowUtil.queryProcessInstanceList(SecurityUtils.getUser().getId().toString(), processInstanceIds);
|
||||
if (ObjectUtil.isNotEmpty(taskList)) {
|
||||
Map<String, TaskDto> taskMap = CollectionUtils.convertMap(taskList, TaskDto::getProcessInstanceId);
|
||||
CollectionUtils.convertList(list, v -> {
|
||||
TaskDto task = taskMap.get(v.getProcessId());
|
||||
if (ObjectUtil.isNotEmpty(task)) {
|
||||
v.setIsCheckUser(true);
|
||||
}
|
||||
return v;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+42
-38
@@ -15,10 +15,11 @@ import com.bsd.pjcloud.admin.api.feign.RemoteUserService;
|
||||
import com.bsd.pjcloud.admin.api.utils.DataUtil;
|
||||
import com.bsd.pjcloud.common.core.util.CollectionUtils;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.security.util.SecurityUtils;
|
||||
import com.bsd.pjcloud.flow.task.api.feign.RemoteFlowApiFlowService;
|
||||
import com.bsd.pjcloud.flow.task.constant.NodeStatusEnum;
|
||||
import com.bsd.pjcloud.flow.task.constant.TaskCheckStatusEnum;
|
||||
import com.bsd.pjcloud.flow.task.dto.ProcessNodeRecordAssignUserParamDto;
|
||||
import com.bsd.pjcloud.flow.task.dto.TaskDto;
|
||||
import com.bsd.pjcloud.wallet.api.constant.WalletCodeBizEnum;
|
||||
import com.bsd.pjcloud.wallet.api.dto.WalletStrideDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletStrideEntity;
|
||||
@@ -98,48 +99,14 @@ public class WalletStrideServiceImpl extends ServiceImpl<WalletStrideMapper, Wal
|
||||
@Override
|
||||
public Page<WalletStrideVo> pageJoin(Page page, WalletStrideDto dto) {
|
||||
Page<WalletStrideVo> list = baseMapper.pageJoin(page, dto);
|
||||
if (ObjectUtil.isNotEmpty(list.getRecords())) {
|
||||
// 用户
|
||||
List<Long> userIds = list.getRecords().stream().map(WalletStrideVo::getUserId).distinct().toList();
|
||||
if (ObjectUtil.isNotEmpty(userIds)) {
|
||||
R<List<SysUser>> userList = userService.getUserById(new ArrayList<>(userIds));
|
||||
if (ObjectUtil.isNotEmpty(userList.getData())) {
|
||||
DataUtil.convertUserList(list.getRecords(), CollectionUtils.convertMap(userList.getData(), SysUser::getUserId));
|
||||
}
|
||||
}
|
||||
// 部门
|
||||
List<Long> deptIds = list.getRecords().stream().map(WalletStrideVo::getDeptId).distinct().toList();
|
||||
if (ObjectUtil.isNotEmpty(userIds)) {
|
||||
R<Map<Long, SysDept>> deptList = deptService.getDeptByDeptIds(deptIds);
|
||||
if (ObjectUtil.isNotEmpty(deptList.getData())) {
|
||||
DataUtil.convertDeptList(list.getRecords(), deptList.getData());
|
||||
}
|
||||
}
|
||||
}
|
||||
disposeList(list.getRecords(), dto);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<WalletStrideVo> scopePageList(Page page, WalletStrideDto dto) {
|
||||
Page<WalletStrideVo> list = baseMapper.scopePageList(page, dto);
|
||||
if (ObjectUtil.isNotEmpty(list.getRecords())) {
|
||||
// 用户
|
||||
List<Long> userIds = list.getRecords().stream().map(WalletStrideVo::getUserId).distinct().toList();
|
||||
if (ObjectUtil.isNotEmpty(userIds)) {
|
||||
R<List<SysUser>> userList = userService.getUserById(new ArrayList<>(userIds));
|
||||
if (ObjectUtil.isNotEmpty(userList.getData())) {
|
||||
DataUtil.convertUserList(list.getRecords(), CollectionUtils.convertMap(userList.getData(), SysUser::getUserId));
|
||||
}
|
||||
}
|
||||
// 部门
|
||||
List<Long> deptIds = list.getRecords().stream().map(WalletStrideVo::getDeptId).distinct().toList();
|
||||
if (ObjectUtil.isNotEmpty(userIds)) {
|
||||
R<Map<Long, SysDept>> deptList = deptService.getDeptByDeptIds(deptIds);
|
||||
if (ObjectUtil.isNotEmpty(deptList.getData())) {
|
||||
DataUtil.convertDeptList(list.getRecords(), deptList.getData());
|
||||
}
|
||||
}
|
||||
}
|
||||
disposeList(list.getRecords(), dto);
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -179,10 +146,47 @@ public class WalletStrideServiceImpl extends ServiceImpl<WalletStrideMapper, Wal
|
||||
}
|
||||
}
|
||||
|
||||
private void disposeList(List<WalletStrideVo> list, WalletStrideDto dto) {
|
||||
if (ObjectUtil.isEmpty(list)) return;
|
||||
// 用户
|
||||
List<Long> userIds = list.stream().map(WalletStrideVo::getUserId).distinct().toList();
|
||||
if (ObjectUtil.isNotEmpty(userIds)) {
|
||||
R<List<SysUser>> userList = userService.getUserById(new ArrayList<>(userIds));
|
||||
if (ObjectUtil.isNotEmpty(userList.getData())) {
|
||||
DataUtil.convertUserList(list, CollectionUtils.convertMap(userList.getData(), SysUser::getUserId));
|
||||
}
|
||||
}
|
||||
// 部门
|
||||
List<Long> deptIds = list.stream().map(WalletStrideVo::getDeptId).distinct().toList();
|
||||
if (ObjectUtil.isNotEmpty(userIds)) {
|
||||
R<Map<Long, SysDept>> deptList = deptService.getDeptByDeptIds(deptIds);
|
||||
if (ObjectUtil.isNotEmpty(deptList.getData())) {
|
||||
DataUtil.convertDeptList(list, deptList.getData());
|
||||
}
|
||||
}
|
||||
// 审批
|
||||
if (dto.getIsFindCheckUser()) {
|
||||
List<String> processInstanceIds = list.stream().map(WalletStrideVo::getProcessId).filter(ObjectUtil::isNotEmpty).distinct().toList();
|
||||
if (ObjectUtil.isNotEmpty(processInstanceIds)) {
|
||||
List<TaskDto> taskList = flowUtil.queryProcessInstanceList(SecurityUtils.getUser().getId().toString(), processInstanceIds);
|
||||
if (ObjectUtil.isNotEmpty(taskList)) {
|
||||
Map<String, TaskDto> taskMap = CollectionUtils.convertMap(taskList, TaskDto::getProcessInstanceId);
|
||||
CollectionUtils.convertList(list, v -> {
|
||||
TaskDto task = taskMap.get(v.getProcessId());
|
||||
if (ObjectUtil.isNotEmpty(task)) {
|
||||
v.setIsCheckUser(true);
|
||||
}
|
||||
return v;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isCheckData(Long walletId) {
|
||||
Long count = baseMapper.selectCount(new LambdaQueryWrapper<WalletStrideEntity>()
|
||||
.eq(WalletStrideEntity::getUserId, walletId)
|
||||
.eq(WalletStrideEntity::getProcessStatus, NodeStatusEnum.JXZ.getCode())
|
||||
.eq(WalletStrideEntity::getProcessStatus, TaskCheckStatusEnum.PADDING.getCode())
|
||||
);
|
||||
return count > 0;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user