081fa014 by xiaojie

【数据资产】

1、认证审核管理:从列表打开详情和从待办打开详情的地址不一致
1 parent 9ce95786
1 package com.csbr.qingcloud.portal.service.impl; 1 package com.csbr.qingcloud.portal.service.impl;
2 2
3 import com.alibaba.fastjson.JSON; 3 import com.alibaba.fastjson.JSON;
4 import com.alibaba.fastjson.JSONObject;
4 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 5 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
5 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; 6 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
6 import com.baomidou.mybatisplus.core.toolkit.Wrappers; 7 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
...@@ -13,6 +14,8 @@ import com.csbr.qingcloud.portal.feign.ConfigureFeign; ...@@ -13,6 +14,8 @@ import com.csbr.qingcloud.portal.feign.ConfigureFeign;
13 import com.csbr.qingcloud.portal.feign.DataProcessBasicFeign; 14 import com.csbr.qingcloud.portal.feign.DataProcessBasicFeign;
14 import com.csbr.qingcloud.portal.feign.PersonelFeign; 15 import com.csbr.qingcloud.portal.feign.PersonelFeign;
15 import com.csbr.qingcloud.portal.util.DateUtil; 16 import com.csbr.qingcloud.portal.util.DateUtil;
17 import com.csbr.qingcloud.portal.util.InvokeUtil;
18 import com.csbr.qingcloud.portal.util.ZQConfig;
16 import csbr.cloud.entity.domain.user.UserInfo; 19 import csbr.cloud.entity.domain.user.UserInfo;
17 import csbr.cloud.entity.enums.ApprovalStateEnum; 20 import csbr.cloud.entity.enums.ApprovalStateEnum;
18 import com.csbr.cloud.common.exception.CsbrSystemException; 21 import com.csbr.cloud.common.exception.CsbrSystemException;
...@@ -34,6 +37,7 @@ import lombok.extern.slf4j.Slf4j; ...@@ -34,6 +37,7 @@ import lombok.extern.slf4j.Slf4j;
34 import org.apache.commons.collections.CollectionUtils; 37 import org.apache.commons.collections.CollectionUtils;
35 import org.apache.commons.lang3.ObjectUtils; 38 import org.apache.commons.lang3.ObjectUtils;
36 import org.apache.commons.lang3.StringUtils; 39 import org.apache.commons.lang3.StringUtils;
40 import org.springframework.beans.factory.annotation.Autowired;
37 import org.springframework.beans.factory.annotation.Value; 41 import org.springframework.beans.factory.annotation.Value;
38 import org.springframework.stereotype.Service; 42 import org.springframework.stereotype.Service;
39 import io.seata.spring.annotation.GlobalTransactional; 43 import io.seata.spring.annotation.GlobalTransactional;
...@@ -56,11 +60,19 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService ...@@ -56,11 +60,19 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService
56 */ 60 */
57 private static final String FUNCTION_NAME = "数据需求"; 61 private static final String FUNCTION_NAME = "数据需求";
58 62
63 private static final String SysFuncCode = "SJXQ";
64
59 /** 65 /**
60 * 流程类型 66 * 流程类型
61 */ 67 */
62 private static final String FLOW_TYPE = WorkFlowBizEnum.DATA_DEMAND.getValue(); 68 private static final String FLOW_TYPE = WorkFlowBizEnum.DATA_DEMAND.getValue();
63 69
70 @Autowired
71 private ZQConfig zqConfig;
72
73 @Autowired
74 private InvokeUtil invokeUtil;
75
64 @Resource 76 @Resource
65 private MfDemandService mfDemandService; 77 private MfDemandService mfDemandService;
66 78
...@@ -261,6 +273,7 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService ...@@ -261,6 +273,7 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService
261 throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00012", 273 throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00012",
262 String.format("删除%s数据", FUNCTION_NAME), "数据唯一标识")); 274 String.format("删除%s数据", FUNCTION_NAME), "数据唯一标识"));
263 } 275 }
276 String crossPlatformApproveState = "";
264 for (String guid : guids) { 277 for (String guid : guids) {
265 MfDemand entity = mfDemandService.getById(guid); 278 MfDemand entity = mfDemandService.getById(guid);
266 beforeRemove(entity); 279 beforeRemove(entity);
...@@ -269,9 +282,19 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService ...@@ -269,9 +282,19 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService
269 throw new CsbrSystemException(SystemError.DATA_DEL_ERROR, messageSourceUtil.delMessage(FUNCTION_NAME)); 282 throw new CsbrSystemException(SystemError.DATA_DEL_ERROR, messageSourceUtil.delMessage(FUNCTION_NAME));
270 } 283 }
271 afterRemove(entity); 284 afterRemove(entity);
285 crossPlatformApproveState = entity.getCrossPlatformApproveState();
272 } 286 }
273 // 删除流程数据 287 // 删除流程数据
274 approvalFlowUtil.removeApproveByBizGuids(guids); 288 approvalFlowUtil.removeApproveByBizGuids(guids);
289
290 // 删除主平台数据
291 if (!zqConfig.getIsMain() && StringUtils.isNotEmpty(crossPlatformApproveState)) {
292 JSONObject jsonObject = new JSONObject();
293 jsonObject.put("zqSystemCode", SysFuncCode);
294 jsonObject.put("zqBizGuids", JSON.toJSONString(guids));
295 jsonObject.put("isCollection", true);
296 invokeUtil.invokeMainDel(jsonObject, zqConfig.getAppKey(), zqConfig.getZqDelUrl());
297 }
275 } 298 }
276 299
277 /** 300 /**
...@@ -418,7 +441,7 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService ...@@ -418,7 +441,7 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService
418 private AddApprovalDTO getAddApprovalDTO(MfDemand entity, DemandRQVO rqVO) { 441 private AddApprovalDTO getAddApprovalDTO(MfDemand entity, DemandRQVO rqVO) {
419 AddApprovalDTO approvalDTO = new AddApprovalDTO(FLOW_TYPE, entity.getGuid()); 442 AddApprovalDTO approvalDTO = new AddApprovalDTO(FLOW_TYPE, entity.getGuid());
420 // todo 443 // todo
421 approvalDTO.setFuncCode("SJXQ"); 444 approvalDTO.setFuncCode(SysFuncCode);
422 approvalDTO.setUrlParam(String.format("guid=%s&name=%s",entity.getGuid(),entity.getDataDemandName())); 445 approvalDTO.setUrlParam(String.format("guid=%s&name=%s",entity.getGuid(),entity.getDataDemandName()));
423 // 流程消息中的变量替换参数 446 // 流程消息中的变量替换参数
424 approvalDTO.setFlowMessageBody(String.format("%s,%s", CommonUtil.getUserInfo().getUserName(),entity.getDataDemandName())); 447 approvalDTO.setFlowMessageBody(String.format("%s,%s", CommonUtil.getUserInfo().getUserName(),entity.getDataDemandName()));
......
...@@ -34,6 +34,8 @@ import com.csbr.qingcloud.portal.mybatis.service.MfEnterpriseService; ...@@ -34,6 +34,8 @@ import com.csbr.qingcloud.portal.mybatis.service.MfEnterpriseService;
34 import com.csbr.qingcloud.portal.service.EnterpriseService; 34 import com.csbr.qingcloud.portal.service.EnterpriseService;
35 import com.csbr.qingcloud.portal.util.ChangeInfoUtil; 35 import com.csbr.qingcloud.portal.util.ChangeInfoUtil;
36 import com.csbr.qingcloud.portal.util.DateUtil; 36 import com.csbr.qingcloud.portal.util.DateUtil;
37 import com.csbr.qingcloud.portal.util.InvokeUtil;
38 import com.csbr.qingcloud.portal.util.ZQConfig;
37 import csbr.cloud.entity.domain.base.vo.PageListVO; 39 import csbr.cloud.entity.domain.base.vo.PageListVO;
38 import csbr.cloud.entity.enums.ApprovalStateEnum; 40 import csbr.cloud.entity.enums.ApprovalStateEnum;
39 import io.seata.spring.annotation.GlobalTransactional; 41 import io.seata.spring.annotation.GlobalTransactional;
...@@ -42,6 +44,7 @@ import lombok.extern.slf4j.Slf4j; ...@@ -42,6 +44,7 @@ import lombok.extern.slf4j.Slf4j;
42 import org.apache.commons.collections.CollectionUtils; 44 import org.apache.commons.collections.CollectionUtils;
43 import org.apache.commons.lang3.ObjectUtils; 45 import org.apache.commons.lang3.ObjectUtils;
44 import org.apache.commons.lang3.StringUtils; 46 import org.apache.commons.lang3.StringUtils;
47 import org.springframework.beans.factory.annotation.Autowired;
45 import org.springframework.stereotype.Service; 48 import org.springframework.stereotype.Service;
46 import org.springframework.transaction.annotation.Transactional; 49 import org.springframework.transaction.annotation.Transactional;
47 import java.util.ArrayList; 50 import java.util.ArrayList;
...@@ -66,6 +69,14 @@ public class EnterpriseServiceImpl extends FlowAbstractImpl implements Enterpris ...@@ -66,6 +69,14 @@ public class EnterpriseServiceImpl extends FlowAbstractImpl implements Enterpris
66 */ 69 */
67 private static final String FUNCTION_NAME = "企业信息"; 70 private static final String FUNCTION_NAME = "企业信息";
68 71
72 private static final String SysFuncCode = "QYRZ";
73
74 @Autowired
75 private ZQConfig zqConfig;
76
77 @Autowired
78 private InvokeUtil invokeUtil;
79
69 @Resource 80 @Resource
70 private MfEnterpriseService mfEnterpriseService; 81 private MfEnterpriseService mfEnterpriseService;
71 82
...@@ -333,6 +344,7 @@ public class EnterpriseServiceImpl extends FlowAbstractImpl implements Enterpris ...@@ -333,6 +344,7 @@ public class EnterpriseServiceImpl extends FlowAbstractImpl implements Enterpris
333 throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00012", 344 throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00012",
334 String.format("删除%s数据", FUNCTION_NAME), "数据唯一标识")); 345 String.format("删除%s数据", FUNCTION_NAME), "数据唯一标识"));
335 } 346 }
347 String crossPlatformApproveState = "";
336 for (String guid : guids) { 348 for (String guid : guids) {
337 MfEnterprise entity = mfEnterpriseService.getById(guid); 349 MfEnterprise entity = mfEnterpriseService.getById(guid);
338 beforeRemove(entity); 350 beforeRemove(entity);
...@@ -341,9 +353,19 @@ public class EnterpriseServiceImpl extends FlowAbstractImpl implements Enterpris ...@@ -341,9 +353,19 @@ public class EnterpriseServiceImpl extends FlowAbstractImpl implements Enterpris
341 throw new CsbrSystemException(SystemError.DATA_DEL_ERROR, messageSourceUtil.delMessage(FUNCTION_NAME)); 353 throw new CsbrSystemException(SystemError.DATA_DEL_ERROR, messageSourceUtil.delMessage(FUNCTION_NAME));
342 } 354 }
343 afterRemove(entity); 355 afterRemove(entity);
356 crossPlatformApproveState = entity.getCrossPlatformApproveState();
344 } 357 }
345 // 删除流程数据 358 // 删除流程数据
346 approvalFlowUtil.removeApproveByBizGuids(guids); 359 approvalFlowUtil.removeApproveByBizGuids(guids);
360
361 // 删除主平台数据
362 if (!zqConfig.getIsMain() && StringUtils.isNotEmpty(crossPlatformApproveState)) {
363 JSONObject jsonObject = new JSONObject();
364 jsonObject.put("zqSystemCode", SysFuncCode);
365 jsonObject.put("zqBizGuids", JSON.toJSONString(guids));
366 jsonObject.put("isCollection", true);
367 invokeUtil.invokeMainDel(jsonObject, zqConfig.getAppKey(), zqConfig.getZqDelUrl());
368 }
347 } 369 }
348 370
349 /** 371 /**
...@@ -535,7 +557,7 @@ public class EnterpriseServiceImpl extends FlowAbstractImpl implements Enterpris ...@@ -535,7 +557,7 @@ public class EnterpriseServiceImpl extends FlowAbstractImpl implements Enterpris
535 private AddApprovalDTO getAddApprovalDTO(MfEnterprise entity, EnterpriseRQVO rqVO) { 557 private AddApprovalDTO getAddApprovalDTO(MfEnterprise entity, EnterpriseRQVO rqVO) {
536 RedisStaffPOJO staffPOJO = redisUtil.getRedisStaff(); 558 RedisStaffPOJO staffPOJO = redisUtil.getRedisStaff();
537 AddApprovalDTO approvalDTO = new AddApprovalDTO(WorkFlowBizEnum.ENTERPRISE_APPLY.getValue(), entity.getGuid()); 559 AddApprovalDTO approvalDTO = new AddApprovalDTO(WorkFlowBizEnum.ENTERPRISE_APPLY.getValue(), entity.getGuid());
538 approvalDTO.setFuncCode("QYRZ"); 560 approvalDTO.setFuncCode(SysFuncCode);
539 approvalDTO.setUrlParam(String.format("guid=%s&name=%s&tName=%s&fType=%s&bizGuid=%s&type=detail", entity.getGuid(), entity.getTenantName(), 561 approvalDTO.setUrlParam(String.format("guid=%s&name=%s&tName=%s&fType=%s&bizGuid=%s&type=detail", entity.getGuid(), entity.getTenantName(),
540 entity.getTenantName(), WorkFlowBizEnum.ENTERPRISE_APPLY.getValue(), entity.getGuid())); 562 entity.getTenantName(), WorkFlowBizEnum.ENTERPRISE_APPLY.getValue(), entity.getGuid()));
541 // 流程消息中的变量替换参数 563 // 流程消息中的变量替换参数
......
1 package com.csbr.qingcloud.portal.util;
2
3 import com.alibaba.fastjson.JSON;
4 import com.alibaba.fastjson.JSONObject;
5 import com.csbr.cloud.common.enums.SystemError;
6 import com.csbr.cloud.common.exception.CsbrSystemException;
7 import com.csbr.cloud.common.response.CommonRes;
8 import lombok.extern.slf4j.Slf4j;
9 import org.apache.hc.client5.http.config.RequestConfig;
10 import org.apache.hc.client5.http.impl.classic.CloseableHttpClient;
11 import org.apache.hc.client5.http.impl.classic.HttpClientBuilder;
12 import org.apache.hc.core5.util.Timeout;
13 import org.springframework.beans.factory.annotation.Autowired;
14 import org.springframework.http.HttpEntity;
15 import org.springframework.http.HttpHeaders;
16 import org.springframework.http.MediaType;
17 import org.springframework.http.client.ClientHttpRequestFactory;
18 import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
19 import org.springframework.stereotype.Component;
20 import org.springframework.web.client.RestTemplate;
21
22 /**
23 * @program: daop-projects
24 * @description:
25 * @author: xiaojie
26 * @create: 2025-03-13 14:52
27 **/
28 @Component
29 @Slf4j
30 public class InvokeUtil {
31
32 @Autowired
33 private RestTemplate restTemplate;
34
35 /**
36 * open调用接口
37 * @param jsonObject
38 * @param appKey
39 * @param zqDelUrl
40 */
41 public void invokeMainDel(JSONObject jsonObject, String appKey, String zqDelUrl) {
42 HttpHeaders headers = new HttpHeaders();
43 headers.setContentType(MediaType.APPLICATION_JSON);
44 headers.set("appKey", appKey);
45 HttpEntity<JSONObject> requestEntity = new HttpEntity<>(jsonObject, headers);
46 restTemplate.setRequestFactory(getFactory());
47 CommonRes commonRes = restTemplate.postForObject(zqDelUrl, requestEntity, CommonRes.class);
48 if (!CommonRes.success().getCode().equals(commonRes.getCode())) {
49 throw new CsbrSystemException(SystemError.ERROR_CODE, commonRes.getMsg());
50 } else {
51 CommonRes commonResData = JSON.parseObject(String.valueOf(commonRes.getData()), CommonRes.class);
52 if (!CommonRes.success().getCode().equals(commonResData.getCode())) {
53 throw new CsbrSystemException(SystemError.ERROR_CODE, commonResData.getMsg());
54 }
55 }
56 }
57
58 private ClientHttpRequestFactory getFactory() {
59 RequestConfig config = RequestConfig.custom()
60 .setConnectTimeout(Timeout.ofSeconds(5000)) // 连接超时
61 .setConnectionRequestTimeout(Timeout.ofSeconds(5000)) // 从连接池获取连接的超时时间
62 .setResponseTimeout(Timeout.ofSeconds(10000)) // 数据读取超时
63 .build();
64
65 CloseableHttpClient httpClient = HttpClientBuilder.create()
66 .setDefaultRequestConfig(config)
67 .build();
68
69 return new HttpComponentsClientHttpRequestFactory(httpClient);
70 }
71 }
...\ No newline at end of file ...\ No newline at end of file
1 package com.csbr.qingcloud.portal.util;
2
3 import lombok.Data;
4 import org.springframework.boot.context.properties.ConfigurationProperties;
5 import org.springframework.stereotype.Component;
6
7 /**
8 * @program: daop-projects
9 * @description:
10 * @author: xiaojie
11 * @create: 2025-02-28 14:09
12 **/
13 @Data
14 @Component
15 @ConfigurationProperties(prefix = "csbr.zq")
16 public class ZQConfig {
17
18 private String appKey = "672c2c38e4b0cac8732a6106";
19
20 private String zqName = "";
21
22 private String zqDelUrl = "";
23
24 private Boolean isMain = false;
25
26 }
...\ No newline at end of file ...\ No newline at end of file
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!