feat:审批权限

This commit is contained in:
dzc committed 2025-07-05 15:10:14 +08:00
1 parent ececc877c4
commit b985ddf9ce
4 files changed
+33 -1

No files matched your search

@@ -37,4 +37,6 @@ public class WalletRechargeBindInvoiceDto extends WalletRechargeInvoiceVo {
* 审核时间
*/
private LocalDateTime[] processTimeList;
private Boolean isFindUserCheck = false;
}
@@ -8,4 +8,7 @@ public class WalletRechargeInvoiceVo extends WalletRechargeInvoiceEntity {
private String totalPriceCnStr;
private Boolean isCheckUser;
}
@@ -95,6 +95,7 @@ public class WalletRechargeInvoiceController {
public R getWalletRechargeInvoicePage(@ParameterObject Page page, @ParameterObject WalletRechargeBindInvoiceDto dto) {
DataScope dataScope = DataScope.of();
dataScope.setScopeDeptName("apply_dept_id");
dto.setIsCheckUser(true);
return R.ok(walletRechargeInvoiceService.scopePageList(page, dto, dataScope));
}
@@ -16,14 +16,17 @@ import com.bsd.pjcloud.admin.api.entity.SysDept;
import com.bsd.pjcloud.admin.api.feign.RemoteDeptService;
import com.bsd.pjcloud.admin.api.feign.RemoteFileService;
import com.bsd.pjcloud.admin.api.feign.RemoteUserService;
import com.bsd.pjcloud.common.core.util.CollectionUtils;
import com.bsd.pjcloud.common.core.util.R;
import com.bsd.pjcloud.common.data.datascope.DataScope;
import com.bsd.pjcloud.common.data.resolver.ParamResolver;
import com.bsd.pjcloud.common.data.tenant.TenantContextHolder;
import com.bsd.pjcloud.common.security.service.PjcloudUser;
import com.bsd.pjcloud.common.security.util.SecurityUtils;
import com.bsd.pjcloud.flow.task.api.feign.RemoteFlowEngineService;
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.flow.task.dto.TaskParamDto;
import com.bsd.pjcloud.wallet.api.constant.WalletBizRechargeEnum;
import com.bsd.pjcloud.wallet.api.constant.WalletRechargeInvoiceStatusEnum;
@@ -34,6 +37,7 @@ import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeImportEntity;
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeInvoiceEntity;
import com.bsd.pjcloud.wallet.api.feign.RemoteWalletSettingService;
import com.bsd.pjcloud.wallet.api.vo.WalletSettingVo;
import com.bsd.pjcloud.wallet.api.vo.recharge.WalletRechargeApplyVo;
import com.bsd.pjcloud.wallet.api.vo.recharge.WalletRechargeInvoiceItemVo;
import com.bsd.pjcloud.wallet.api.vo.recharge.WalletRechargeInvoiceVo;
import com.bsd.pjcloud.wallet.mapper.recharge.WalletRechargeApplyMapper;
@@ -109,7 +113,9 @@ public class WalletRechargeInvoiceServiceImpl extends ServiceImpl<WalletRecharge
*/
@Override
public Page<WalletRechargeInvoiceVo> scopePageList(Page page, WalletRechargeBindInvoiceDto dto, DataScope dataScope) {
return baseMapper.scopePageList(page, dto, dataScope);
Page<WalletRechargeInvoiceVo> pageList = baseMapper.scopePageList(page, dto, dataScope);
disposeList(pageList.getRecords(), dto);
return pageList;
}
/**
@@ -441,4 +447,24 @@ public class WalletRechargeInvoiceServiceImpl extends ServiceImpl<WalletRecharge
.eq(WalletRechargeApplyEntity::getId, entity.getApplyId());
applyMapper.update(updateWrapper);
}
private void disposeList(List<WalletRechargeInvoiceVo> list, WalletRechargeBindInvoiceDto dto,) {
// 审批流程
if (dto.getIsFindUserCheck()) {
List<String> processInstanceIds = list.stream().map(WalletRechargeInvoiceVo::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;
});
}
}
}
}
}