fix:审批功能重构-安能添加行程和变更行程-细节问题修复

This commit is contained in:
lulz1 2024-07-02 14:48:42 +08:00
parent 708226b3c8
commit 2ba217d23d
2 changed files with 15 additions and 11 deletions

View File

@ -108,7 +108,7 @@ public class ApprovalPlatformAN implements ApprovalPlatform {
approvalScheduleParam.setSourceSystem(systemNum()); approvalScheduleParam.setSourceSystem(systemNum());
RouteOrder routeOrder = approvalData.getRouteOrder(); RouteOrder routeOrder = approvalData.getRouteOrder();
ApproveOrderNo approveOrderNo = routeOrder.getApproveOrderNo(); ApproveOrderNo approveOrderNo = routeOrder.getApproveOrderNo();
approvalScheduleParam.setSourceSystemNum(legChangeTag() + routeOrder.getRouteOrderNo()); approvalScheduleParam.setSourceSystemNum(approvalData.getApprovalRecordNo());
approvalScheduleParam.setApplicant(routeOrder.getUserId()); approvalScheduleParam.setApplicant(routeOrder.getUserId());
approvalScheduleParam.setApplicantDate(DateTimeUtil.timeToStr(LocalDateTime.now())); approvalScheduleParam.setApplicantDate(DateTimeUtil.timeToStr(LocalDateTime.now()));
approvalScheduleParam.setApplyNo(approveOrderNo.getActualOrderNo()); approvalScheduleParam.setApplyNo(approveOrderNo.getActualOrderNo());

View File

@ -135,16 +135,20 @@ public class RouteApprovalDomainService {
String approvalType = systemOrganizationRepository.findByOrgCodeContainingOrOrgNameContaining(approveOrderNo.getAccountCompany(), String approvalType = systemOrganizationRepository.findByOrgCodeContainingOrOrgNameContaining(approveOrderNo.getAccountCompany(),
approveOrderNo.getAccountCompany()).map(SystemOrganization::getApprovalType).orElseGet( approveOrderNo.getAccountCompany()).map(SystemOrganization::getApprovalType).orElseGet(
() -> systemCodeRepository.findBySysCode(approveOrderNo.getSysCode()).getApprovalType()); () -> systemCodeRepository.findBySysCode(approveOrderNo.getSysCode()).getApprovalType());
routeOrder.setRoutePermissionSet( if(approvalType != null){
permissionConfigRepository.findByPermissionName(approvalType) routeOrder.setRoutePermissionSet(
.map(permissionConfig -> { permissionConfigRepository.findByPermissionName(approvalType)
List<String> permissions = permissionConfig.permissions(); .map(permissionConfig -> {
return permissions.stream() List<String> permissions = permissionConfig.permissions();
.distinct() return permissions.stream()
.map(permission -> Enum.valueOf(RoutePermission.class, permission)) .distinct()
.collect(Collectors.toSet()); .map(permission -> Enum.valueOf(RoutePermission.class, permission))
}).orElseGet(Set::of) .collect(Collectors.toSet());
); }).orElseGet(Set::of)
);
} else {
routeOrder.setRoutePermissionSet(Collections.emptySet());
}
return routeOrder; return routeOrder;
} }