|
@@ -2,6 +2,7 @@ package com.dragoninfo.dcuc.auth.auth.business.impl;
|
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
+import com.dragoninfo.dcuc.app.dto.ServiceResourceDTO;
|
|
|
import com.dragoninfo.dcuc.app.entity.ApplyInfo;
|
|
|
import com.dragoninfo.dcuc.app.entity.ServiceResource;
|
|
|
import com.dragoninfo.dcuc.app.facade.IApplyInfoFacade;
|
|
@@ -38,6 +39,7 @@ import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
+import javax.validation.constraints.NotBlank;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
@@ -120,9 +122,10 @@ public class ServiceAuthBusinessImpl implements IServiceAuthBusiness {
|
|
|
}
|
|
|
String serviceCodes = dto.getServiceCodes();
|
|
|
String[] serviceCodArray = serviceCodes.split(StrUtil.COMMA);
|
|
|
+ List<ServiceResourceDTO> serviceResourceDTOS = serviceResourceFacade.getServiceByServiceCodes(Arrays.asList(serviceCodArray));
|
|
|
+ Set<String> existServiceCodes = serviceResourceDTOS.stream().map(ServiceResourceDTO::getServiceCode).collect(Collectors.toSet());
|
|
|
for (String serviceCode : serviceCodArray) {
|
|
|
- ServiceResource serviceResource = serviceResourceFacade.detailByCode(serviceCode);
|
|
|
- if (serviceResource == null) {
|
|
|
+ if (!existServiceCodes.contains(serviceCode)) {
|
|
|
return ResponseDTO.fail(ResponseStatus.FAIL_CODE, String.format("服务代码 %s 不存在", serviceCode), null);
|
|
|
}
|
|
|
}
|