【数据资产】
1、认证校验
Showing
2 changed files
with
22 additions
and
4 deletions
| ... | @@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSON; | ... | @@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSON; |
| 4 | import com.alibaba.fastjson.JSONArray; | 4 | import com.alibaba.fastjson.JSONArray; |
| 5 | import com.alibaba.fastjson.JSONObject; | 5 | import com.alibaba.fastjson.JSONObject; |
| 6 | import com.csbr.cloud.common.enums.RedisKeyEnum; | 6 | import com.csbr.cloud.common.enums.RedisKeyEnum; |
| 7 | import com.csbr.cloud.common.enums.SystemError; | ||
| 8 | import com.csbr.cloud.common.exception.CsbrSystemException; | ||
| 7 | import com.csbr.cloud.common.util.CsbrBeanUtil; | 9 | import com.csbr.cloud.common.util.CsbrBeanUtil; |
| 8 | import com.csbr.cloud.distributelock.util.RedisUtil; | 10 | import com.csbr.cloud.distributelock.util.RedisUtil; |
| 9 | import com.csbr.cloud.external.config.DataPortConfig; | 11 | import com.csbr.cloud.external.config.DataPortConfig; |
| ... | @@ -27,6 +29,7 @@ import org.apache.commons.lang3.StringUtils; | ... | @@ -27,6 +29,7 @@ import org.apache.commons.lang3.StringUtils; |
| 27 | import org.springframework.stereotype.Service; | 29 | import org.springframework.stereotype.Service; |
| 28 | 30 | ||
| 29 | import java.text.SimpleDateFormat; | 31 | import java.text.SimpleDateFormat; |
| 32 | import java.util.Calendar; | ||
| 30 | import java.util.Date; | 33 | import java.util.Date; |
| 31 | import java.util.HashMap; | 34 | import java.util.HashMap; |
| 32 | import java.util.Map; | 35 | import java.util.Map; |
| ... | @@ -72,7 +75,10 @@ public class DataPortServiceImpl implements DataPortService { | ... | @@ -72,7 +75,10 @@ public class DataPortServiceImpl implements DataPortService { |
| 72 | public void operatorRegister(MfEnterprise entity) { | 75 | public void operatorRegister(MfEnterprise entity) { |
| 73 | log.info("======经办人用户注册开始======"); | 76 | log.info("======经办人用户注册开始======"); |
| 74 | OperatorRegisterRQVO operatorRegisterRQVO = beforeOperator(entity); | 77 | OperatorRegisterRQVO operatorRegisterRQVO = beforeOperator(entity); |
| 75 | dataPortConnectUtil.postByAuthKey(operatorRegisterRQVO, dataPortConfig.getOperatorRegisterUri()); | 78 | String message = dataPortConnectUtil.postByAuthKey(operatorRegisterRQVO, dataPortConfig.getOperatorRegisterUri()); |
| 79 | if (StringUtils.isNotEmpty(message) && !message.contains("经办人账号身份标识已存在,无法注册")) { | ||
| 80 | throw new CsbrSystemException(SystemError.DATA_GET_ERROR, message); | ||
| 81 | } | ||
| 76 | log.info("======经办人用户注册结束======"); | 82 | log.info("======经办人用户注册结束======"); |
| 77 | } | 83 | } |
| 78 | 84 | ||
| ... | @@ -89,7 +95,10 @@ public class DataPortServiceImpl implements DataPortService { | ... | @@ -89,7 +95,10 @@ public class DataPortServiceImpl implements DataPortService { |
| 89 | public void enterpriseRegister(MfEnterprise entity) { | 95 | public void enterpriseRegister(MfEnterprise entity) { |
| 90 | log.info("======法人用户注册开始======"); | 96 | log.info("======法人用户注册开始======"); |
| 91 | EnterpriseRegisterRQVO enterpriseRegisterRQVO = beforeEnterprise(entity); | 97 | EnterpriseRegisterRQVO enterpriseRegisterRQVO = beforeEnterprise(entity); |
| 92 | dataPortConnectUtil.postByAuthKey(enterpriseRegisterRQVO, dataPortConfig.getEnterpriseRegisterUri()); | 98 | String message = dataPortConnectUtil.postByAuthKey(enterpriseRegisterRQVO, dataPortConfig.getEnterpriseRegisterUri()); |
| 99 | if (StringUtils.isNotEmpty(message) && !message.contains("统一社会信用代码已存在")) { | ||
| 100 | throw new CsbrSystemException(SystemError.DATA_GET_ERROR, message); | ||
| 101 | } | ||
| 93 | log.info("======法人用户注册结束======"); | 102 | log.info("======法人用户注册结束======"); |
| 94 | } | 103 | } |
| 95 | 104 | ||
| ... | @@ -233,7 +242,16 @@ public class DataPortServiceImpl implements DataPortService { | ... | @@ -233,7 +242,16 @@ public class DataPortServiceImpl implements DataPortService { |
| 233 | enterpriseRegisterRQVO.setEnterpriseType("4"); | 242 | enterpriseRegisterRQVO.setEnterpriseType("4"); |
| 234 | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); | 243 | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| 235 | enterpriseRegisterRQVO.setOperatingPeriodBegin(simpleDateFormat.format(entity.getBusinessLicenseStartDate())); | 244 | enterpriseRegisterRQVO.setOperatingPeriodBegin(simpleDateFormat.format(entity.getBusinessLicenseStartDate())); |
| 236 | enterpriseRegisterRQVO.setOperatingPeriodEnd(simpleDateFormat.format(entity.getBusinessLicenseEndDate())); | 245 | Date businessLicenseEndDate = entity.getBusinessLicenseEndDate(); |
| 246 | if (ObjectUtils.isEmpty(businessLicenseEndDate)) { | ||
| 247 | Calendar calendar = Calendar.getInstance(); | ||
| 248 | calendar.setTime(new Date()); | ||
| 249 | calendar.add(Calendar.YEAR, 1); | ||
| 250 | Date nextYearDate = calendar.getTime(); | ||
| 251 | enterpriseRegisterRQVO.setOperatingPeriodEnd(simpleDateFormat.format(nextYearDate)); | ||
| 252 | } else { | ||
| 253 | enterpriseRegisterRQVO.setOperatingPeriodEnd(simpleDateFormat.format(entity.getBusinessLicenseEndDate())); | ||
| 254 | } | ||
| 237 | // enterpriseRegisterRQVO.setAuthType(entity.getAuthenticationMethod()); | 255 | // enterpriseRegisterRQVO.setAuthType(entity.getAuthenticationMethod()); |
| 238 | enterpriseRegisterRQVO.setAuthType("3"); | 256 | enterpriseRegisterRQVO.setAuthType("3"); |
| 239 | // enterpriseRegisterRQVO.setAuthStatus(entity.getAuthenticationState()); | 257 | // enterpriseRegisterRQVO.setAuthStatus(entity.getAuthenticationState()); | ... | ... |
| ... | @@ -521,7 +521,7 @@ public class EnterpriseServiceImpl extends FlowAbstractImpl implements Enterpris | ... | @@ -521,7 +521,7 @@ public class EnterpriseServiceImpl extends FlowAbstractImpl implements Enterpris |
| 521 | } | 521 | } |
| 522 | // 调用数据港法人和经办人注册接口 | 522 | // 调用数据港法人和经办人注册接口 |
| 523 | dataPortService.enterpriseRegister(entity); | 523 | dataPortService.enterpriseRegister(entity); |
| 524 | // dataPortService.operatorRegister(entity); | 524 | dataPortService.operatorRegister(entity); |
| 525 | } | 525 | } |
| 526 | } | 526 | } |
| 527 | 527 | ... | ... |
-
Please register or sign in to post a comment