【数据资产】
数据港接口
Showing
14 changed files
with
703 additions
and
6 deletions
| 1 | package com.csbr.qingcloud.portal.config; | ||
| 2 | |||
| 3 | import lombok.Data; | ||
| 4 | import org.springframework.boot.context.properties.ConfigurationProperties; | ||
| 5 | import org.springframework.stereotype.Component; | ||
| 6 | |||
| 7 | /** | ||
| 8 | * @program: | ||
| 9 | * @description: 数据港配置 | ||
| 10 | * @author: yio | ||
| 11 | * @create: 2024-05-31 14:16 | ||
| 12 | **/ | ||
| 13 | @Component | ||
| 14 | @ConfigurationProperties(prefix = "dataport") | ||
| 15 | @Data | ||
| 16 | public class DataPortConfig { | ||
| 17 | private String username; | ||
| 18 | private String password; | ||
| 19 | private String authKey; | ||
| 20 | private String registerAuthKey; | ||
| 21 | private String requestUri; | ||
| 22 | private String operatorRegisterUri; | ||
| 23 | private String enterpriseRegisterUri; | ||
| 24 | } |
| ... | @@ -2,11 +2,14 @@ package com.csbr.qingcloud.portal.controller; | ... | @@ -2,11 +2,14 @@ package com.csbr.qingcloud.portal.controller; |
| 2 | 2 | ||
| 3 | import com.csbr.cloud.common.entity.CsbrUpdate; | 3 | import com.csbr.cloud.common.entity.CsbrUpdate; |
| 4 | import com.csbr.cloud.common.response.CommonRes; | 4 | import com.csbr.cloud.common.response.CommonRes; |
| 5 | import com.csbr.cloud.workflow.domain.dto.callback.BizCallbackDTO; | ||
| 5 | import com.csbr.qingcloud.portal.domain.vo.*; | 6 | import com.csbr.qingcloud.portal.domain.vo.*; |
| 7 | import com.csbr.qingcloud.portal.mybatis.entity.MfEnterprise; | ||
| 8 | import com.csbr.qingcloud.portal.mybatis.service.MfEnterpriseService; | ||
| 9 | import com.csbr.qingcloud.portal.service.DataPortService; | ||
| 10 | import com.csbr.qingcloud.portal.service.DemandService; | ||
| 6 | import csbr.cloud.entity.annotation.SystemLog; | 11 | import csbr.cloud.entity.annotation.SystemLog; |
| 7 | import csbr.cloud.entity.domain.base.vo.PageListVO; | 12 | import csbr.cloud.entity.domain.base.vo.PageListVO; |
| 8 | import com.csbr.cloud.workflow.domain.dto.callback.BizCallbackDTO; | ||
| 9 | import com.csbr.qingcloud.portal.service.DemandService; | ||
| 10 | import io.swagger.v3.oas.annotations.Operation; | 13 | import io.swagger.v3.oas.annotations.Operation; |
| 11 | import io.swagger.v3.oas.annotations.Parameter; | 14 | import io.swagger.v3.oas.annotations.Parameter; |
| 12 | import io.swagger.v3.oas.annotations.tags.Tag; | 15 | import io.swagger.v3.oas.annotations.tags.Tag; |
| ... | @@ -128,6 +131,20 @@ public class DemandController { | ... | @@ -128,6 +131,20 @@ public class DemandController { |
| 128 | List<ProcessOrderProcessDtlRSVO> pageVO = demandService.listByProcessOrderNo(); | 131 | List<ProcessOrderProcessDtlRSVO> pageVO = demandService.listByProcessOrderNo(); |
| 129 | return CommonRes.success(pageVO); | 132 | return CommonRes.success(pageVO); |
| 130 | } | 133 | } |
| 134 | |||
| 135 | @Resource | ||
| 136 | private MfEnterpriseService mfEnterpriseService; | ||
| 137 | |||
| 138 | @Resource | ||
| 139 | private DataPortService dataPortService; | ||
| 140 | |||
| 141 | @GetMapping("/test") | ||
| 142 | public CommonRes getToken(@RequestParam String guid) { | ||
| 143 | MfEnterprise entity = mfEnterpriseService.getById(guid); | ||
| 144 | dataPortService.operatorRegister(entity); | ||
| 145 | dataPortService.enterpriseRegister(entity); | ||
| 146 | return CommonRes.success(Boolean.TRUE); | ||
| 147 | } | ||
| 131 | 148 | ||
| 132 | //endregion | 149 | //endregion |
| 133 | 150 | ... | ... |
| 1 | package com.csbr.qingcloud.portal.domain.vo.dataPort; | ||
| 2 | |||
| 3 | import io.swagger.v3.oas.annotations.media.Schema; | ||
| 4 | import lombok.Data; | ||
| 5 | |||
| 6 | /** | ||
| 7 | * @program: daop-projects | ||
| 8 | * @description: | ||
| 9 | * @author: xiaojie | ||
| 10 | * @create: 2025-10-11 15:43 | ||
| 11 | **/ | ||
| 12 | @Data | ||
| 13 | @Schema(title = "公共身份附件信息参数") | ||
| 14 | public class AttachmentCommonVO { | ||
| 15 | |||
| 16 | @Schema(title = "附件类型") | ||
| 17 | private String attachType; | ||
| 18 | |||
| 19 | @Schema(title = "附件名称") | ||
| 20 | private String attachName; | ||
| 21 | |||
| 22 | @Schema(title = "附件编号") | ||
| 23 | private String attachCode; | ||
| 24 | |||
| 25 | @Schema(title = "附件签发机构") | ||
| 26 | private String issueOrg; | ||
| 27 | |||
| 28 | @Schema(title = "签发日期") | ||
| 29 | private String issueDate; | ||
| 30 | |||
| 31 | @Schema(title = "到期日期") | ||
| 32 | private String expireDate; | ||
| 33 | |||
| 34 | @Schema(title = "附件验证地址或区块链凭证索引") | ||
| 35 | private String verifyUrl; | ||
| 36 | |||
| 37 | @Schema(title = "附件描述信息") | ||
| 38 | private String description; | ||
| 39 | |||
| 40 | } | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | package com.csbr.qingcloud.portal.domain.vo.dataPort; | ||
| 2 | |||
| 3 | import io.swagger.v3.oas.annotations.media.Schema; | ||
| 4 | import lombok.Data; | ||
| 5 | |||
| 6 | import java.io.Serializable; | ||
| 7 | |||
| 8 | /** | ||
| 9 | * @program: | ||
| 10 | * @description: 数据港返回结果 | ||
| 11 | * @author: makejava | ||
| 12 | * @create: 2025-09-05 10:35 | ||
| 13 | **/ | ||
| 14 | @Data | ||
| 15 | @Schema(title = "数据港返回结果") | ||
| 16 | public class DataPortRes<T> implements Serializable { | ||
| 17 | |||
| 18 | /** | ||
| 19 | * 返回码 | ||
| 20 | */ | ||
| 21 | @Schema(description = "返回码") | ||
| 22 | private Integer code; | ||
| 23 | |||
| 24 | /** | ||
| 25 | * 返回描述 | ||
| 26 | */ | ||
| 27 | @Schema(description = "返回描述") | ||
| 28 | private String message; | ||
| 29 | |||
| 30 | /** | ||
| 31 | * 数据 | ||
| 32 | */ | ||
| 33 | @Schema(description = "数据") | ||
| 34 | private T data; | ||
| 35 | |||
| 36 | public DataPortRes(Integer code, T data){ | ||
| 37 | this.code = code; | ||
| 38 | this.data = data; | ||
| 39 | } | ||
| 40 | |||
| 41 | public DataPortRes(Integer code, String message){ | ||
| 42 | this.code = code; | ||
| 43 | this.message = message; | ||
| 44 | } | ||
| 45 | |||
| 46 | /** | ||
| 47 | * 返回成功 | ||
| 48 | * @param data | ||
| 49 | * @param <T> | ||
| 50 | * @return | ||
| 51 | */ | ||
| 52 | public static <T> DataPortRes<T> success(T data) { | ||
| 53 | return new DataPortRes<T>(200, data); | ||
| 54 | } | ||
| 55 | |||
| 56 | /** | ||
| 57 | * 返回失败 | ||
| 58 | * @param message | ||
| 59 | * @return | ||
| 60 | */ | ||
| 61 | public static DataPortRes fail(String message) { | ||
| 62 | return new DataPortRes(500, message); | ||
| 63 | } | ||
| 64 | } |
| 1 | package com.csbr.qingcloud.portal.domain.vo.dataPort; | ||
| 2 | |||
| 3 | import io.swagger.v3.oas.annotations.media.Schema; | ||
| 4 | import lombok.Data; | ||
| 5 | |||
| 6 | import java.util.List; | ||
| 7 | |||
| 8 | /** | ||
| 9 | * @program: daop-projects | ||
| 10 | * @description: | ||
| 11 | * @author: xiaojie | ||
| 12 | * @create: 2025-10-11 15:38 | ||
| 13 | **/ | ||
| 14 | @Data | ||
| 15 | @Schema(title = "法人注册参数") | ||
| 16 | public class EnterpriseRegisterRQVO { | ||
| 17 | |||
| 18 | @Schema(title = "唯一身份标识") | ||
| 19 | private String identityCode; | ||
| 20 | |||
| 21 | @Schema(title = "法人或其他组织名称") | ||
| 22 | private String enterpriseName; | ||
| 23 | |||
| 24 | @Schema(title = "统一社会信用代码") | ||
| 25 | private String enterpriseCode; | ||
| 26 | |||
| 27 | @Schema(title = "法人或其他组织类型") | ||
| 28 | private String enterpriseType; | ||
| 29 | |||
| 30 | @Schema(title = "经营期限起始") | ||
| 31 | private String operatingPeriodBegin; | ||
| 32 | |||
| 33 | @Schema(title = "经营期限截止") | ||
| 34 | private String operatingPeriodEnd; | ||
| 35 | |||
| 36 | @Schema(title = "实名认证方式") | ||
| 37 | private String authType; | ||
| 38 | |||
| 39 | @Schema(title = "实名认证状态") | ||
| 40 | private String authStatus; | ||
| 41 | |||
| 42 | @Schema(title = "实名认证时间") | ||
| 43 | private String authDate; | ||
| 44 | |||
| 45 | @Schema(title = "法定代表人或负责人姓名") | ||
| 46 | private String legalPerson; | ||
| 47 | |||
| 48 | @Schema(title = "法定代表人或负责人证件号") | ||
| 49 | private String legalPersonCertno; | ||
| 50 | |||
| 51 | @Schema(title = "法定代表人或负责人实名等级") | ||
| 52 | private String legalPersonAuthLevel; | ||
| 53 | |||
| 54 | @Schema(title = "个人实名认证方式") | ||
| 55 | private String legalPersonAuthType; | ||
| 56 | |||
| 57 | @Schema(title = "法人用户状态") | ||
| 58 | private String identityStatus; | ||
| 59 | |||
| 60 | @Schema(title = "法人用户身份附属信息") | ||
| 61 | private EnterpriseSubordinateRQVO extendInfo; | ||
| 62 | |||
| 63 | @Schema(title = "法人用户身份附件信息") | ||
| 64 | private List<AttachmentCommonVO> attachInfo; | ||
| 65 | |||
| 66 | } | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
src/main/java/com/csbr/qingcloud/portal/domain/vo/dataPort/EnterpriseSubordinateRQVO.java
0 → 100644
| 1 | package com.csbr.qingcloud.portal.domain.vo.dataPort; | ||
| 2 | |||
| 3 | import io.swagger.v3.oas.annotations.media.Schema; | ||
| 4 | import lombok.Data; | ||
| 5 | |||
| 6 | /** | ||
| 7 | * @program: daop-projects | ||
| 8 | * @description: | ||
| 9 | * @author: xiaojie | ||
| 10 | * @create: 2025-10-11 15:43 | ||
| 11 | **/ | ||
| 12 | @Data | ||
| 13 | @Schema(title = "法人身份附属信息参数") | ||
| 14 | public class EnterpriseSubordinateRQVO extends SubordinateCommonVO { | ||
| 15 | |||
| 16 | @Schema(title = "注册地址") | ||
| 17 | private String enterpriseAddress; | ||
| 18 | |||
| 19 | @Schema(title = "注册金额") | ||
| 20 | private String regAmount; | ||
| 21 | |||
| 22 | @Schema(title = "注册日期") | ||
| 23 | private String regDate; | ||
| 24 | |||
| 25 | @Schema(title = "经营范围") | ||
| 26 | private String businessScope; | ||
| 27 | |||
| 28 | @Schema(title = "行业类型") | ||
| 29 | private String industryCategory; | ||
| 30 | |||
| 31 | @Schema(title = "行业小类") | ||
| 32 | private String industryCategory2; | ||
| 33 | |||
| 34 | @Schema(title = "核准机构") | ||
| 35 | private String approvalAuthority; | ||
| 36 | |||
| 37 | @Schema(title = "法定代表人或负责人手机号") | ||
| 38 | private String legalPersonPhone; | ||
| 39 | |||
| 40 | @Schema(title = "法定代表人或负责人邮箱") | ||
| 41 | private String legalPersonEmail; | ||
| 42 | |||
| 43 | @Schema(title = "法定代表人或负责人身份状态") | ||
| 44 | private String legalPersonStatus; | ||
| 45 | |||
| 46 | } | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | package com.csbr.qingcloud.portal.domain.vo.dataPort; | ||
| 2 | |||
| 3 | import io.swagger.v3.oas.annotations.media.Schema; | ||
| 4 | import lombok.Data; | ||
| 5 | |||
| 6 | import java.util.List; | ||
| 7 | |||
| 8 | /** | ||
| 9 | * @program: daop-projects | ||
| 10 | * @description: | ||
| 11 | * @author: xiaojie | ||
| 12 | * @create: 2025-10-11 15:38 | ||
| 13 | **/ | ||
| 14 | @Data | ||
| 15 | @Schema(title = "经办人注册参数") | ||
| 16 | public class OperatorRegisterRQVO { | ||
| 17 | |||
| 18 | @Schema(title = "经办人姓名") | ||
| 19 | private String operator; | ||
| 20 | |||
| 21 | @Schema(title = "经办人身份标识") | ||
| 22 | private String identityCode; | ||
| 23 | |||
| 24 | @Schema(title = "证件类型") | ||
| 25 | private String operatorIdType; | ||
| 26 | |||
| 27 | @Schema(title = "证件号码") | ||
| 28 | private String operatorId; | ||
| 29 | |||
| 30 | @Schema(title = "实名认证等级") | ||
| 31 | private String operatorAuthLevel; | ||
| 32 | |||
| 33 | @Schema(title = "经办人授权方式") | ||
| 34 | private String authorizationType; | ||
| 35 | |||
| 36 | @Schema(title = "实名认证方式") | ||
| 37 | private String operatorAuthType; | ||
| 38 | |||
| 39 | @Schema(title = "认证日期") | ||
| 40 | private String authTime; | ||
| 41 | |||
| 42 | @Schema(title = "身份状态") | ||
| 43 | private String authStatus; | ||
| 44 | |||
| 45 | @Schema(title = "统一社会信用代码") | ||
| 46 | private String enterpriseCode; | ||
| 47 | |||
| 48 | @Schema(title = "经办人用户身份附属信息") | ||
| 49 | private OperatorSubordinateRQVO extendInfo; | ||
| 50 | |||
| 51 | @Schema(title = "经办人用户身份附件信息") | ||
| 52 | private List<AttachmentCommonVO> attachInfo; | ||
| 53 | |||
| 54 | } | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | package com.csbr.qingcloud.portal.domain.vo.dataPort; | ||
| 2 | |||
| 3 | import io.swagger.v3.oas.annotations.media.Schema; | ||
| 4 | import lombok.Data; | ||
| 5 | |||
| 6 | /** | ||
| 7 | * @program: daop-projects | ||
| 8 | * @description: | ||
| 9 | * @author: xiaojie | ||
| 10 | * @create: 2025-10-11 15:43 | ||
| 11 | **/ | ||
| 12 | @Data | ||
| 13 | @Schema(title = "经办人身份附属信息参数") | ||
| 14 | public class OperatorSubordinateRQVO extends SubordinateCommonVO { | ||
| 15 | |||
| 16 | @Schema(title = "法人组织名称") | ||
| 17 | private String enterpriseName; | ||
| 18 | |||
| 19 | @Schema(title = "支付宝账号") | ||
| 20 | private String alipayAccount; | ||
| 21 | |||
| 22 | @Schema(title = "微信账号") | ||
| 23 | private String weixinAccount; | ||
| 24 | |||
| 25 | } | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | package com.csbr.qingcloud.portal.domain.vo.dataPort; | ||
| 2 | |||
| 3 | import io.swagger.v3.oas.annotations.media.Schema; | ||
| 4 | import lombok.Data; | ||
| 5 | |||
| 6 | /** | ||
| 7 | * @program: daop-projects | ||
| 8 | * @description: | ||
| 9 | * @author: xiaojie | ||
| 10 | * @create: 2025-10-11 15:43 | ||
| 11 | **/ | ||
| 12 | @Data | ||
| 13 | @Schema(title = "公共身份附属信息参数") | ||
| 14 | public class SubordinateCommonVO { | ||
| 15 | |||
| 16 | @Schema(title = "电子营业执照") | ||
| 17 | private String businessLicense; | ||
| 18 | |||
| 19 | @Schema(title = "社保卡卡号") | ||
| 20 | private String socialSecurityCard; | ||
| 21 | |||
| 22 | @Schema(title = "社保卡发放地") | ||
| 23 | private String socialSecurityCardSite; | ||
| 24 | |||
| 25 | } | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | package com.csbr.qingcloud.portal.service; | ||
| 2 | |||
| 3 | import com.csbr.qingcloud.portal.mybatis.entity.MfEnterprise; | ||
| 4 | import com.csbr.qingcloud.portal.mybatis.entity.MfEnterpriseChangeApprove; | ||
| 5 | |||
| 6 | /** | ||
| 7 | * @program: daop-projects | ||
| 8 | * @description: | ||
| 9 | * @author: xiaojie | ||
| 10 | * @create: 2025-10-11 15:13 | ||
| 11 | **/ | ||
| 12 | public interface DataPortService { | ||
| 13 | |||
| 14 | /** | ||
| 15 | * 经办人用户注册 | ||
| 16 | * @param entity | ||
| 17 | */ | ||
| 18 | void operatorRegister(MfEnterprise entity); | ||
| 19 | |||
| 20 | /** | ||
| 21 | * 经办人用户更新 | ||
| 22 | * @param entity | ||
| 23 | */ | ||
| 24 | void operatorUpdate(MfEnterpriseChangeApprove entity); | ||
| 25 | |||
| 26 | /** | ||
| 27 | * 法人用户注册 | ||
| 28 | * @param entity | ||
| 29 | */ | ||
| 30 | void enterpriseRegister(MfEnterprise entity); | ||
| 31 | |||
| 32 | /** | ||
| 33 | * 法人用户更新 | ||
| 34 | * @param entity | ||
| 35 | */ | ||
| 36 | void enterpriseUpdate(MfEnterpriseChangeApprove entity); | ||
| 37 | } | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | package com.csbr.qingcloud.portal.service.impl; | ||
| 2 | |||
| 3 | import com.alibaba.fastjson.JSON; | ||
| 4 | import com.csbr.cloud.common.enums.RedisKeyEnum; | ||
| 5 | import com.csbr.cloud.distributelock.util.RedisUtil; | ||
| 6 | import com.csbr.qingcloud.portal.config.DataPortConfig; | ||
| 7 | import com.csbr.qingcloud.portal.domain.vo.dataPort.EnterpriseRegisterRQVO; | ||
| 8 | import com.csbr.qingcloud.portal.domain.vo.dataPort.EnterpriseSubordinateRQVO; | ||
| 9 | import com.csbr.qingcloud.portal.domain.vo.dataPort.OperatorRegisterRQVO; | ||
| 10 | import com.csbr.qingcloud.portal.domain.vo.dataPort.OperatorSubordinateRQVO; | ||
| 11 | import com.csbr.qingcloud.portal.mybatis.entity.MfEnterprise; | ||
| 12 | import com.csbr.qingcloud.portal.mybatis.entity.MfEnterpriseChangeApprove; | ||
| 13 | import com.csbr.qingcloud.portal.service.DataPortService; | ||
| 14 | import com.csbr.qingcloud.portal.util.DataPortConnectUtil; | ||
| 15 | import jakarta.annotation.Resource; | ||
| 16 | import lombok.extern.slf4j.Slf4j; | ||
| 17 | import org.apache.commons.lang3.ObjectUtils; | ||
| 18 | import org.apache.commons.lang3.StringUtils; | ||
| 19 | import org.jetbrains.annotations.NotNull; | ||
| 20 | import org.springframework.stereotype.Service; | ||
| 21 | |||
| 22 | import java.text.SimpleDateFormat; | ||
| 23 | import java.util.Date; | ||
| 24 | import java.util.HashMap; | ||
| 25 | import java.util.Map; | ||
| 26 | |||
| 27 | /** | ||
| 28 | * @program: daop-projects | ||
| 29 | * @description: | ||
| 30 | * @author: xiaojie | ||
| 31 | * @create: 2025-10-11 15:13 | ||
| 32 | **/ | ||
| 33 | @Slf4j | ||
| 34 | @Service | ||
| 35 | public class DataPortServiceImpl implements DataPortService { | ||
| 36 | |||
| 37 | @Resource | ||
| 38 | private DataPortConnectUtil dataPortConnectUtil; | ||
| 39 | |||
| 40 | @Resource | ||
| 41 | private DataPortConfig dataPortConfig; | ||
| 42 | |||
| 43 | @Resource | ||
| 44 | private RedisUtil redisUtil; | ||
| 45 | |||
| 46 | @Override | ||
| 47 | public void operatorRegister(MfEnterprise entity) { | ||
| 48 | OperatorRegisterRQVO operatorRegisterRQVO = beforeOperator(entity); | ||
| 49 | dataPortConnectUtil.postByAuthKey(operatorRegisterRQVO, dataPortConfig.getOperatorRegisterUri()); | ||
| 50 | } | ||
| 51 | |||
| 52 | @Override | ||
| 53 | public void operatorUpdate(MfEnterpriseChangeApprove entity) { | ||
| 54 | |||
| 55 | } | ||
| 56 | |||
| 57 | @Override | ||
| 58 | public void enterpriseRegister(MfEnterprise entity) { | ||
| 59 | EnterpriseRegisterRQVO enterpriseRegisterRQVO = beforeEnterprise(entity); | ||
| 60 | dataPortConnectUtil.postByAuthKey(enterpriseRegisterRQVO, dataPortConfig.getEnterpriseRegisterUri()); | ||
| 61 | } | ||
| 62 | |||
| 63 | @Override | ||
| 64 | public void enterpriseUpdate(MfEnterpriseChangeApprove entity) { | ||
| 65 | |||
| 66 | } | ||
| 67 | |||
| 68 | /** | ||
| 69 | * 经办人注册前置 | ||
| 70 | * @param entity | ||
| 71 | * @return | ||
| 72 | */ | ||
| 73 | private OperatorRegisterRQVO beforeOperator(MfEnterprise entity) { | ||
| 74 | Map<String, String> documentsDicMap = getSystemParamsMap("证件类型"); | ||
| 75 | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); | ||
| 76 | OperatorRegisterRQVO operatorRegisterRQVO = new OperatorRegisterRQVO(); | ||
| 77 | operatorRegisterRQVO.setOperator(entity.getContacts()); | ||
| 78 | // operatorRegisterRQVO.setIdentityCode(entity.getManagerPersonId()); | ||
| 79 | operatorRegisterRQVO.setOperatorIdType(documentsDicMap.get(entity.getHandlePersonIdType())); | ||
| 80 | operatorRegisterRQVO.setOperatorId(entity.getManagerPersonId()); | ||
| 81 | // operatorRegisterRQVO.setOperatorAuthLevel(entity.getAuthenticationLevel()); | ||
| 82 | operatorRegisterRQVO.setOperatorAuthLevel("1"); | ||
| 83 | // operatorRegisterRQVO.setAuthorizationType(entity.getAuthenticationMethod()); | ||
| 84 | operatorRegisterRQVO.setAuthorizationType("1"); | ||
| 85 | // operatorRegisterRQVO.setAuthTime(simpleDateFormat.format(entity.getAuthenticationTime())); | ||
| 86 | operatorRegisterRQVO.setAuthTime(simpleDateFormat.format(new Date())); | ||
| 87 | // operatorRegisterRQVO.setAuthStatus(entity.getIdentityState()); | ||
| 88 | operatorRegisterRQVO.setAuthStatus("1"); | ||
| 89 | operatorRegisterRQVO.setOperatorAuthType("1"); | ||
| 90 | operatorRegisterRQVO.setEnterpriseCode(entity.getSocialCreditCode()); | ||
| 91 | OperatorSubordinateRQVO operatorSubordinateRQVO = new OperatorSubordinateRQVO(); | ||
| 92 | operatorSubordinateRQVO.setEnterpriseName(entity.getTenantName()); | ||
| 93 | operatorSubordinateRQVO.setBusinessLicense(getUrl(entity.getBusinessLicenseJson())); | ||
| 94 | operatorRegisterRQVO.setExtendInfo(operatorSubordinateRQVO); | ||
| 95 | return operatorRegisterRQVO; | ||
| 96 | } | ||
| 97 | |||
| 98 | /** | ||
| 99 | * 法人注册前置 | ||
| 100 | * @param entity | ||
| 101 | * @return | ||
| 102 | */ | ||
| 103 | private EnterpriseRegisterRQVO beforeEnterprise(MfEnterprise entity) { | ||
| 104 | Map<String, String> industryDicMap = getSystemParamsMap("行业分类"); | ||
| 105 | EnterpriseRegisterRQVO enterpriseRegisterRQVO = new EnterpriseRegisterRQVO(); | ||
| 106 | enterpriseRegisterRQVO.setEnterpriseName(entity.getTenantName()); | ||
| 107 | enterpriseRegisterRQVO.setIdentityCode(entity.getSocialCreditCode()); | ||
| 108 | enterpriseRegisterRQVO.setEnterpriseCode(entity.getSocialCreditCode()); | ||
| 109 | enterpriseRegisterRQVO.setEnterpriseType("4"); | ||
| 110 | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); | ||
| 111 | enterpriseRegisterRQVO.setOperatingPeriodBegin(simpleDateFormat.format(entity.getBusinessLicenseStartDate())); | ||
| 112 | enterpriseRegisterRQVO.setOperatingPeriodEnd(simpleDateFormat.format(entity.getBusinessLicenseEndDate())); | ||
| 113 | // enterpriseRegisterRQVO.setAuthType(entity.getAuthenticationMethod()); | ||
| 114 | enterpriseRegisterRQVO.setAuthType("3"); | ||
| 115 | // enterpriseRegisterRQVO.setAuthStatus(entity.getAuthenticationState()); | ||
| 116 | enterpriseRegisterRQVO.setAuthStatus("1"); | ||
| 117 | // enterpriseRegisterRQVO.setAuthDate(simpleDateFormat.format(entity.getAuthenticationTime())); | ||
| 118 | enterpriseRegisterRQVO.setAuthDate(simpleDateFormat.format(new Date())); | ||
| 119 | enterpriseRegisterRQVO.setLegalPerson(entity.getJuridicalPerson()); | ||
| 120 | enterpriseRegisterRQVO.setLegalPersonCertno(entity.getJuridicalPersonId()); | ||
| 121 | enterpriseRegisterRQVO.setLegalPersonAuthLevel("1"); | ||
| 122 | enterpriseRegisterRQVO.setLegalPersonAuthType("1"); | ||
| 123 | // enterpriseRegisterRQVO.setIdentityStatus(entity.getIdentityState()); | ||
| 124 | enterpriseRegisterRQVO.setIdentityStatus("1"); | ||
| 125 | EnterpriseSubordinateRQVO extendInfo = new EnterpriseSubordinateRQVO(); | ||
| 126 | extendInfo.setEnterpriseAddress(entity.getDetailedAddress()); | ||
| 127 | extendInfo.setRegAmount(entity.getRegisteredCapital().toString()); | ||
| 128 | extendInfo.setRegDate(simpleDateFormat.format(entity.getRegistrationDate())); | ||
| 129 | extendInfo.setBusinessScope(entity.getBusinessLicenseScope()); | ||
| 130 | extendInfo.setIndustryCategory(industryDicMap.get(entity.getIndustry())); | ||
| 131 | extendInfo.setIndustryCategory2(industryDicMap.get(entity.getIndustrySmallcode())); | ||
| 132 | extendInfo.setBusinessLicense(getUrl(entity.getBusinessLicenseJson())); | ||
| 133 | enterpriseRegisterRQVO.setExtendInfo(extendInfo); | ||
| 134 | return enterpriseRegisterRQVO; | ||
| 135 | } | ||
| 136 | |||
| 137 | /** | ||
| 138 | * 取数据字典 | ||
| 139 | * @param paramCode | ||
| 140 | * @return | ||
| 141 | */ | ||
| 142 | private Map<String, String> getSystemParamsMap(String paramCode) { | ||
| 143 | //获取平台字典信息 | ||
| 144 | Object dictMapValue= redisUtil.get(String.format(RedisKeyEnum.DICT_ITEM_MAP.getCode(), paramCode)); | ||
| 145 | if(ObjectUtils.isEmpty(dictMapValue)){ | ||
| 146 | return new HashMap<>(); | ||
| 147 | } | ||
| 148 | return (Map<String, String>) dictMapValue; | ||
| 149 | } | ||
| 150 | |||
| 151 | private String getUrl(String businessLicenseJson) { | ||
| 152 | if (StringUtils.isEmpty(businessLicenseJson)) { | ||
| 153 | return null; | ||
| 154 | } | ||
| 155 | if (businessLicenseJson.contains("[")) { | ||
| 156 | return JSON.parseArray(businessLicenseJson).getJSONObject(0).getString("url"); | ||
| 157 | } | ||
| 158 | return JSON.parseObject(businessLicenseJson).getString("url"); | ||
| 159 | } | ||
| 160 | } | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| ... | @@ -19,10 +19,7 @@ import com.csbr.qingcloud.portal.mybatis.entity.MfEnterprise; | ... | @@ -19,10 +19,7 @@ import com.csbr.qingcloud.portal.mybatis.entity.MfEnterprise; |
| 19 | import com.csbr.qingcloud.portal.mybatis.entity.MfEnterpriseChangeApprove; | 19 | import com.csbr.qingcloud.portal.mybatis.entity.MfEnterpriseChangeApprove; |
| 20 | import com.csbr.qingcloud.portal.mybatis.service.MfEnterpriseChangeApproveService; | 20 | import com.csbr.qingcloud.portal.mybatis.service.MfEnterpriseChangeApproveService; |
| 21 | import com.csbr.qingcloud.portal.mybatis.service.MfEnterpriseService; | 21 | import com.csbr.qingcloud.portal.mybatis.service.MfEnterpriseService; |
| 22 | import com.csbr.qingcloud.portal.service.EnterpriseAttachmentService; | 22 | import com.csbr.qingcloud.portal.service.*; |
| 23 | import com.csbr.qingcloud.portal.service.EnterpriseChangeApproveService; | ||
| 24 | import com.csbr.qingcloud.portal.service.EnterpriseDomainService; | ||
| 25 | import com.csbr.qingcloud.portal.service.EnterpriseService; | ||
| 26 | import com.csbr.qingcloud.portal.util.ChangeInfoUtil; | 23 | import com.csbr.qingcloud.portal.util.ChangeInfoUtil; |
| 27 | import com.csbr.qingcloud.portal.util.InvokeUtil; | 24 | import com.csbr.qingcloud.portal.util.InvokeUtil; |
| 28 | import com.csbr.qingcloud.portal.util.ZQConfig; | 25 | import com.csbr.qingcloud.portal.util.ZQConfig; |
| ... | @@ -95,6 +92,9 @@ public class EnterpriseChangeApproveServiceImpl implements EnterpriseChangeAppro | ... | @@ -95,6 +92,9 @@ public class EnterpriseChangeApproveServiceImpl implements EnterpriseChangeAppro |
| 95 | @Resource | 92 | @Resource |
| 96 | private EnterpriseDomainService enterpriseDomainService; | 93 | private EnterpriseDomainService enterpriseDomainService; |
| 97 | 94 | ||
| 95 | @Resource | ||
| 96 | private DataPortService dataPortService; | ||
| 97 | |||
| 98 | /** 保存变更数据 */ | 98 | /** 保存变更数据 */ |
| 99 | @Override | 99 | @Override |
| 100 | public void changeSave(ChangeApproveVO vo) { | 100 | public void changeSave(ChangeApproveVO vo) { |
| ... | @@ -248,6 +248,10 @@ public class EnterpriseChangeApproveServiceImpl implements EnterpriseChangeAppro | ... | @@ -248,6 +248,10 @@ public class EnterpriseChangeApproveServiceImpl implements EnterpriseChangeAppro |
| 248 | 248 | ||
| 249 | //同步更新会员表 | 249 | //同步更新会员表 |
| 250 | enterpriseService.updateTenant(vo); | 250 | enterpriseService.updateTenant(vo); |
| 251 | |||
| 252 | // 调用数据港法人和经办人更新接口 | ||
| 253 | dataPortService.operatorUpdate(entity); | ||
| 254 | dataPortService.enterpriseUpdate(entity); | ||
| 251 | } | 255 | } |
| 252 | } | 256 | } |
| 253 | 257 | ... | ... |
| ... | @@ -34,6 +34,7 @@ import com.csbr.qingcloud.portal.mybatis.entity.MfEnterpriseChangeApprove; | ... | @@ -34,6 +34,7 @@ import com.csbr.qingcloud.portal.mybatis.entity.MfEnterpriseChangeApprove; |
| 34 | import com.csbr.qingcloud.portal.mybatis.service.MfDemandService; | 34 | import com.csbr.qingcloud.portal.mybatis.service.MfDemandService; |
| 35 | import com.csbr.qingcloud.portal.mybatis.service.MfEnterpriseChangeApproveService; | 35 | import com.csbr.qingcloud.portal.mybatis.service.MfEnterpriseChangeApproveService; |
| 36 | import com.csbr.qingcloud.portal.mybatis.service.MfEnterpriseService; | 36 | import com.csbr.qingcloud.portal.mybatis.service.MfEnterpriseService; |
| 37 | import com.csbr.qingcloud.portal.service.DataPortService; | ||
| 37 | import com.csbr.qingcloud.portal.service.EnterpriseAttachmentService; | 38 | import com.csbr.qingcloud.portal.service.EnterpriseAttachmentService; |
| 38 | import com.csbr.qingcloud.portal.service.EnterpriseDomainService; | 39 | import com.csbr.qingcloud.portal.service.EnterpriseDomainService; |
| 39 | import com.csbr.qingcloud.portal.service.EnterpriseService; | 40 | import com.csbr.qingcloud.portal.service.EnterpriseService; |
| ... | @@ -124,6 +125,9 @@ public class EnterpriseServiceImpl extends FlowAbstractImpl implements Enterpris | ... | @@ -124,6 +125,9 @@ public class EnterpriseServiceImpl extends FlowAbstractImpl implements Enterpris |
| 124 | @Resource | 125 | @Resource |
| 125 | private ValidatorUtil validatorUtil; | 126 | private ValidatorUtil validatorUtil; |
| 126 | 127 | ||
| 128 | @Resource | ||
| 129 | private DataPortService dataPortService; | ||
| 130 | |||
| 127 | /** | 131 | /** |
| 128 | * 企业信息分页查询 | 132 | * 企业信息分页查询 |
| 129 | * @author xcq | 133 | * @author xcq |
| ... | @@ -472,6 +476,9 @@ public class EnterpriseServiceImpl extends FlowAbstractImpl implements Enterpris | ... | @@ -472,6 +476,9 @@ public class EnterpriseServiceImpl extends FlowAbstractImpl implements Enterpris |
| 472 | else{ | 476 | else{ |
| 473 | updateTenant(entity); | 477 | updateTenant(entity); |
| 474 | } | 478 | } |
| 479 | // 调用数据港法人和经办人注册接口 | ||
| 480 | dataPortService.operatorRegister(entity); | ||
| 481 | dataPortService.enterpriseRegister(entity); | ||
| 475 | } | 482 | } |
| 476 | 483 | ||
| 477 | } | 484 | } | ... | ... |
| 1 | package com.csbr.qingcloud.portal.util; | ||
| 2 | |||
| 3 | import com.alibaba.fastjson.JSONObject; | ||
| 4 | import com.csbr.cloud.common.enums.SystemError; | ||
| 5 | import com.csbr.cloud.common.exception.CsbrSystemException; | ||
| 6 | import com.csbr.qingcloud.portal.config.DataPortConfig; | ||
| 7 | import com.csbr.qingcloud.portal.domain.vo.dataPort.DataPortRes; | ||
| 8 | import jakarta.annotation.Resource; | ||
| 9 | import lombok.extern.slf4j.Slf4j; | ||
| 10 | import org.apache.commons.lang3.ObjectUtils; | ||
| 11 | import org.springframework.beans.factory.annotation.Autowired; | ||
| 12 | import org.springframework.http.HttpEntity; | ||
| 13 | import org.springframework.http.HttpHeaders; | ||
| 14 | import org.springframework.stereotype.Component; | ||
| 15 | import org.springframework.web.client.RestTemplate; | ||
| 16 | |||
| 17 | /** | ||
| 18 | * @program: daop-projects | ||
| 19 | * @description: | ||
| 20 | * @author: xiaojie | ||
| 21 | * @create: 2025-10-11 11:01 | ||
| 22 | **/ | ||
| 23 | @Slf4j | ||
| 24 | @Component | ||
| 25 | public class DataPortConnectUtil { | ||
| 26 | |||
| 27 | @Resource | ||
| 28 | private DataPortConfig dataPortConfig; | ||
| 29 | |||
| 30 | @Autowired | ||
| 31 | private RestTemplate restTemplate; | ||
| 32 | |||
| 33 | /** | ||
| 34 | * 获取数据港token | ||
| 35 | * @return | ||
| 36 | */ | ||
| 37 | public String getToken() { | ||
| 38 | HttpHeaders headers = new HttpHeaders(); | ||
| 39 | headers.set("Content-Type", "application/json"); | ||
| 40 | headers.set("authKey", dataPortConfig.getAuthKey()); | ||
| 41 | |||
| 42 | JSONObject params = new JSONObject(); | ||
| 43 | params.put("username", dataPortConfig.getUsername()); | ||
| 44 | params.put("password", dataPortConfig.getPassword()); | ||
| 45 | HttpEntity<JSONObject> request = new HttpEntity<>(params, headers); | ||
| 46 | DataPortRes dataPortRes = restTemplate.postForObject( | ||
| 47 | dataPortConfig.getRequestUri() + "/api/user/singleLogin/getThreeUserToken" | ||
| 48 | , request, DataPortRes.class); | ||
| 49 | |||
| 50 | if (ObjectUtils.isEmpty(dataPortRes)) { | ||
| 51 | throw new CsbrSystemException(SystemError.DATA_GET_ERROR, "获取token失败."); | ||
| 52 | } | ||
| 53 | if (200 != dataPortRes.getCode() && 201 != dataPortRes.getCode()) { | ||
| 54 | throw new CsbrSystemException(SystemError.DATA_GET_ERROR, dataPortRes.getMessage()); | ||
| 55 | } | ||
| 56 | return (String) dataPortRes.getData(); | ||
| 57 | } | ||
| 58 | |||
| 59 | /** | ||
| 60 | * 经办人用户注册 | ||
| 61 | * @return | ||
| 62 | */ | ||
| 63 | public String operatorRegister(Object obj) { | ||
| 64 | HttpHeaders headers = new HttpHeaders(); | ||
| 65 | headers.set("Content-Type", "application/json"); | ||
| 66 | headers.set("authKey", dataPortConfig.getAuthKey()); | ||
| 67 | |||
| 68 | HttpEntity<Object> request = new HttpEntity<>(obj, headers); | ||
| 69 | DataPortRes dataPortRes = restTemplate.postForObject( | ||
| 70 | dataPortConfig.getRequestUri() + "/api/user/user/operatorRegister" | ||
| 71 | , request, DataPortRes.class); | ||
| 72 | |||
| 73 | if (ObjectUtils.isEmpty(dataPortRes)) { | ||
| 74 | throw new CsbrSystemException(SystemError.DATA_GET_ERROR, "经办人用户注册失败."); | ||
| 75 | } | ||
| 76 | if (200 != dataPortRes.getCode() && 201 != dataPortRes.getCode()) { | ||
| 77 | throw new CsbrSystemException(SystemError.DATA_GET_ERROR, dataPortRes.getMessage()); | ||
| 78 | } | ||
| 79 | return (String) dataPortRes.getData(); | ||
| 80 | } | ||
| 81 | |||
| 82 | /** | ||
| 83 | * 法人用户注册 | ||
| 84 | * @return | ||
| 85 | */ | ||
| 86 | public String enterpriseRegister(Object obj) { | ||
| 87 | HttpHeaders headers = new HttpHeaders(); | ||
| 88 | headers.set("Content-Type", "application/json"); | ||
| 89 | headers.set("authKey", dataPortConfig.getAuthKey()); | ||
| 90 | |||
| 91 | HttpEntity<Object> request = new HttpEntity<>(obj, headers); | ||
| 92 | DataPortRes dataPortRes = restTemplate.postForObject( | ||
| 93 | dataPortConfig.getRequestUri() + "/api/user/user/enterpriseRegister" | ||
| 94 | , request, DataPortRes.class); | ||
| 95 | |||
| 96 | if (ObjectUtils.isEmpty(dataPortRes)) { | ||
| 97 | throw new CsbrSystemException(SystemError.DATA_GET_ERROR, "法人用户注册失败."); | ||
| 98 | } | ||
| 99 | if (200 != dataPortRes.getCode() && 201 != dataPortRes.getCode()) { | ||
| 100 | throw new CsbrSystemException(SystemError.DATA_GET_ERROR, dataPortRes.getMessage()); | ||
| 101 | } | ||
| 102 | return (String) dataPortRes.getData(); | ||
| 103 | } | ||
| 104 | |||
| 105 | /** | ||
| 106 | * 调用数据港接口 | ||
| 107 | * @return | ||
| 108 | */ | ||
| 109 | public Object postByAuthKey(Object obj, String uri) { | ||
| 110 | HttpHeaders headers = new HttpHeaders(); | ||
| 111 | headers.set("Content-Type", "application/json"); | ||
| 112 | headers.set("authKey", dataPortConfig.getRegisterAuthKey()); | ||
| 113 | |||
| 114 | HttpEntity<Object> request = new HttpEntity<>(obj, headers); | ||
| 115 | DataPortRes dataPortRes = restTemplate.postForObject( | ||
| 116 | dataPortConfig.getRequestUri() + uri | ||
| 117 | , request, DataPortRes.class); | ||
| 118 | |||
| 119 | if (ObjectUtils.isEmpty(dataPortRes)) { | ||
| 120 | throw new CsbrSystemException(SystemError.DATA_GET_ERROR, "调用数据港接口失败."); | ||
| 121 | } | ||
| 122 | if (200 != dataPortRes.getCode() && 201 != dataPortRes.getCode()) { | ||
| 123 | throw new CsbrSystemException(SystemError.DATA_GET_ERROR, dataPortRes.getMessage()); | ||
| 124 | } | ||
| 125 | return dataPortRes.getData(); | ||
| 126 | } | ||
| 127 | |||
| 128 | } | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
-
Please register or sign in to post a comment