Ver código fonte

Merge branch 'release/v2.1.0-beta' of http://192.168.0.144/dcuc-tjdsj/auth-service into release/v2.1.0-beta

mazq 4 anos atrás
pai
commit
fd284595f7

+ 4 - 4
Jenkinsfile

@@ -46,12 +46,12 @@ pipeline {
                     script {
                         version = build.GetMvnParentVersion()
                         systime = systemtime.GetSysTime('yyMMdd')
-                        //将打出来的tar包,按照命名规范命名。根据实际情况,修改对应的系统简称和区域标识(DCUC-AUTH-SERVICE_TJDSJ)
+                        //将打出来的tar包,按照命名规范命名。根据实际情况,修改对应的系统简称和区域标识(DCUC-AUTH-SERVICE-TJDSJ)
                         sh """cd dcuc-auth-service/target
-                            cp dcuc-auth-service-*.tar.gz DCUC-AUTH-SERVICE_TJDSJ-${version}-${env.GIT_COMMIT.take(8)}-BETA-${systime}.tar.gz
+                            cp dcuc-auth-service-*.tar.gz DCUC-AUTH-SERVICE-TJDSJ-${version}-${env.GIT_COMMIT.take(8)}-BETA-${systime}.tar.gz
                         """
-                        //将复制的按照命名规范的tar包提取到Jenkins的面板,方便下载。根据实际情况,修改对应的系统简称和区域标识(DCUC-AUTH-SERVICE_TJDSJ)
-                        archiveArtifacts artifacts: 'dcuc-auth-service/target/DCUC-AUTH-SERVICE_TJDSJ-*.tar.gz'
+                        //将复制的按照命名规范的tar包提取到Jenkins的面板,方便下载。根据实际情况,修改对应的系统简称和区域标识(DCUC-AUTH-SERVICE-TJDSJ)
+                        archiveArtifacts artifacts: 'dcuc-auth-service/target/DCUC-AUTH-SERVICE-TJDSJ-*.tar.gz'
                     }
                 }
             }

+ 9 - 0
dcuc-auth-api/src/main/java/com/dragoninfo/dcuc/auth/auth/facade/IServiceAuthFacade.java

@@ -59,4 +59,13 @@ public interface IServiceAuthFacade {
     @PostMapping(value = "serviceAuthentication")
     Object serviceAuthentication(@RequestParam("appCode")String appCode);
 
+
+    /**
+     * 校验申请单id
+     * @param applicantId
+     * @return
+     */
+    @PostMapping(value = "checkApplicantId")
+    boolean checkApplicantId(@RequestParam("applicantId")String applicantId);
+
 }

+ 16 - 0
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/bpo/ServiceAuthFlowBPO.java

@@ -3,6 +3,8 @@ package com.dragoninfo.dcuc.auth.auth.bpo;
 
 import com.dragoninfo.dcuc.auth.auth.entity.ServiceAuthFlow;
 import com.dragoninfo.duceap.core.persistent.BaseBPO;
+import com.dragonsoft.duceap.base.enums.BooleanEnum;
+import com.dragonsoft.duceap.core.persistent.factory.PersistentFactory;
 import org.springframework.stereotype.Repository;
 
 /**
@@ -12,4 +14,18 @@ import org.springframework.stereotype.Repository;
  */
 @Repository
 public class ServiceAuthFlowBPO extends BaseBPO<ServiceAuthFlow,String> {
+
+    /**
+     * 校验申请单id
+     * @param applicantId
+     * @return
+     */
+    public boolean checkApplicantId(String applicantId){
+        String sql="select  count(*) from  t_service_auth_flow where applicant_id = ? and deleted= ?";
+        int i = PersistentFactory.getJdbcDao().queryForInt(sql, new Object[]{applicantId, BooleanEnum.FALSE.value});
+        if (i==0){
+            return false;
+        }
+        return true;
+    }
 }

+ 2 - 2
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/business/impl/ServiceAuthBusinessImpl.java

@@ -97,7 +97,8 @@ public class ServiceAuthBusinessImpl implements IServiceAuthBusiness {
         //校验应用和服务是否存在
         ApplyInfo applyInfo = applyInfoFacade.getAppByCode(dto.getAppCode());
         if (applyInfo == null) {
-            return ResponseDTO.fail(ResponseStatus.FAIL_CODE,String.format("应用代码 %s 不存在", dto.getAppCode()),null);
+            return ResponseDTO.fail(
+                    ResponseStatus.FAIL_CODE,String.format("应用代码 %s 不存在", dto.getAppCode()),null);
         }
         String serviceCodes = dto.getServiceCodes();
         String[] serviceCodArray = serviceCodes.split(StrUtil.COMMA);
@@ -107,7 +108,6 @@ public class ServiceAuthBusinessImpl implements IServiceAuthBusiness {
                 return ResponseDTO.fail(ResponseStatus.FAIL_CODE ,String.format("服务代码 %s 不存在", serviceCode),null);
             }
         }
-
         String flowStatus = WorkFlowStatusEnum.APPLYING.getValue();
         //生成消息id
         dto.setMessageId(UUIDUtils.getUUID());

+ 5 - 0
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/facade/ServiceAuthFacade.java

@@ -98,4 +98,9 @@ public class ServiceAuthFacade implements IServiceAuthFacade {
     public Object serviceAuthentication(String appCode){
         return authResultService.serviceAuthentication(appCode);
     }
+
+    @Override
+    public boolean checkApplicantId(String applicantId) {
+        return authFlowService.checkApplicantId(applicantId);
+    }
 }

+ 7 - 0
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/service/IAuthFlowService.java

@@ -57,4 +57,11 @@ public interface IAuthFlowService {
      * @return
      */
     List<ServiceAuthFlow> getByFlowIds(List<String> flowIds);
+
+    /**
+     * 校验申请单id
+     * @param applicantId
+     * @return
+     */
+    boolean checkApplicantId(String applicantId);
 }

+ 10 - 0
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/service/impl/AuthFlowServiceImpl.java

@@ -109,4 +109,14 @@ public class AuthFlowServiceImpl implements IAuthFlowService {
         return serviceAuthFlowBPO.find(ServiceAuthFlow.class, searchable);
     }
 
+    /**
+     * 校验申请单id
+     * @param applicantId
+     * @return
+     */
+    @Override
+    public boolean checkApplicantId(String applicantId){
+        return serviceAuthFlowBPO.checkApplicantId(applicantId);
+    }
+
 }