【数据资产】
1、连接器入驻作废旧数据报错
Showing
1 changed file
with
25 additions
and
1 deletions
| ... | @@ -167,7 +167,31 @@ public class DataPortServiceImpl implements DataPortService { | ... | @@ -167,7 +167,31 @@ public class DataPortServiceImpl implements DataPortService { |
| 167 | log.info("======法人用户更新开始======"); | 167 | log.info("======法人用户更新开始======"); |
| 168 | MfEnterprise mfEnterprise = csbrBeanUtil.convert(entity, MfEnterprise.class); | 168 | MfEnterprise mfEnterprise = csbrBeanUtil.convert(entity, MfEnterprise.class); |
| 169 | EnterpriseRegisterRQVO enterpriseRegisterRQVO = beforeEnterprise(mfEnterprise); | 169 | EnterpriseRegisterRQVO enterpriseRegisterRQVO = beforeEnterprise(mfEnterprise); |
| 170 | dataPortConnectUtil.postByAuthKey(enterpriseRegisterRQVO, dataPortConfig.getEnterpriseUpdateUri()); | 170 | ByteArrayResource resource = dataPortConnectUtil.postByAuthKeyForFile(enterpriseRegisterRQVO, dataPortConfig.getEnterpriseUpdateUri()); |
| 171 | if (ObjectUtils.isNotEmpty(resource)) { | ||
| 172 | byte[] resourceByteArray = resource.getByteArray(); | ||
| 173 | String resp = new String(resourceByteArray); | ||
| 174 | |||
| 175 | // 判断返回值 | ||
| 176 | if (resp.contains("code")) { | ||
| 177 | JSONObject respJson = JSON.parseObject(resp); | ||
| 178 | Integer code = respJson.getInteger("code"); | ||
| 179 | if (code != 200 && !resp.contains("统一社会信用代码已存在")) { | ||
| 180 | throw new CsbrSystemException(SystemError.DATA_GET_ERROR, respJson.getString("message")); | ||
| 181 | } | ||
| 182 | } else { | ||
| 183 | String fileName = "身份凭证.png"; | ||
| 184 | MultipartFile image = new MockMultipartFile(fileName, fileName, "application/octet-stream", resourceByteArray); | ||
| 185 | String url = (String) daopCommonFeign.uploadImage(image).getData(); | ||
| 186 | log.info("======url======, {}", url); | ||
| 187 | LambdaUpdateWrapper<MfEnterprise> updateWrapper = new LambdaUpdateWrapper<>(); | ||
| 188 | updateWrapper.set(MfEnterprise::getTrustedIdentityCredential, url); | ||
| 189 | updateWrapper.set(MfEnterprise::getCredentialTime, new Date()); | ||
| 190 | updateWrapper.eq(MfEnterprise::getGuid, entity.getGuid()); | ||
| 191 | mfEnterpriseService.update(updateWrapper); | ||
| 192 | |||
| 193 | } | ||
| 194 | } | ||
| 171 | log.info("======法人用户更新结束======"); | 195 | log.info("======法人用户更新结束======"); |
| 172 | } | 196 | } |
| 173 | 197 | ... | ... |
-
Please register or sign in to post a comment