diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/ding/controller/DingInfoPullController.java b/pmapi/src/main/java/com/ningdatech/pmapi/ding/controller/DingInfoPullController.java index 0e3b3da..cc37265 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/ding/controller/DingInfoPullController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/ding/controller/DingInfoPullController.java @@ -2,6 +2,7 @@ package com.ningdatech.pmapi.ding.controller; import cn.hutool.core.util.StrUtil; import cn.hutool.crypto.SecureUtil; +import cn.hutool.crypto.digest.MD5; import com.google.common.collect.Maps; import com.ningdatech.irs.service.IRefreshTokenService; import com.ningdatech.pmapi.common.util.CryptUtils; @@ -109,14 +110,14 @@ public class DingInfoPullController { @ApiOperation(value = "测试项目归并", notes = "测试项目归并") @GetMapping("/test-guibing") - public String testGuibing() throws NoSuchAlgorithmException { + public String testGuibing() { long timestamp = System.currentTimeMillis(); String appSecret = "496f0f2a19994f76b4fd9dae087366c7"; String appKey = "A331101453557202109017383"; String method = "POST"; String secret = refreshTokenService.refreshToken(appKey,appSecret,govRequestTokenUrl,govRefreshTokenUrl,method); log.info("secret :{}",secret); - String sign = CryptUtils.MD5Encode(appKey + secret + timestamp); + String sign = MD5.create().digestHex(appKey + secret + timestamp); HttpComponentsClientHttpRequestFactory factory = HttpUtil.generateHttpRequestFactory(); RestTemplate restTemplate; if(Objects.nonNull(factory)){ @@ -126,7 +127,7 @@ public class DingInfoPullController { } String appId = "A330000100000202105005790"; String updateTime = "2023-07-26 00:00:00"; - String capCode = CryptUtils.MD5Encode(timestamp + updateTime + appId); + String capCode = MD5.create().digestHex(timestamp + updateTime + appId); String url = "https://interface.zjzwfw.gov.cn/gateway/api/proxy/001003001029/" + "dataSharing/5crv7i4727abLCv0.htm?requestTime=" + timestamp + "&sign=" + sign + "&appKey=" + appKey + @@ -137,4 +138,33 @@ public class DingInfoPullController { log.info(forEntity.getBody()); return forEntity.getBody(); } + + @ApiOperation(value = "测试项目详情推送", notes = "测试项目详情推送") + @GetMapping("/test-push-project") + public String testPushProject() { + long timestamp = System.currentTimeMillis(); + String appSecret = "496f0f2a19994f76b4fd9dae087366c7"; + String appKey = "A331101453557202109017383"; + String method = "POST"; + String secret = refreshTokenService.refreshToken(appKey,appSecret,govRequestTokenUrl,govRefreshTokenUrl,method); + log.info("secret :{}",secret); + String sign = MD5.create().digestHex(appKey + secret + timestamp); + HttpComponentsClientHttpRequestFactory factory = HttpUtil.generateHttpRequestFactory(); + RestTemplate restTemplate; + if(Objects.nonNull(factory)){ + restTemplate = new RestTemplate(factory); + }else{ + restTemplate = new RestTemplate(); + } + String appId = "A330000100000202105005790"; + String updateTime = "2023-07-26 00:00:00"; + String capCode = MD5.create().digestHex(timestamp + updateTime + appId); + String url = "https://interface.zjzwfw.gov.cn/gateway/api/proxy/001003001029/dataSharing/3XN9R93Pva6db7sf.htm?" + + "requestTime=" + timestamp + "&sign=" + sign + + "&appKey=" + appKey + "&baseProjPrincipal=abc&baseProjSetYear=abc&baseProjId=abc&baseManDeprt=abc&baseProjBasis=abc&baseLowestLevel=abc&ProjPrincipalCall=abc&baseConstructionType=abc&baseProjType=abc&baseProjContacts=abc&isEffective=abc&baseConsDeprtDing=abc&baseProjSetProg=abc&baseProjContactsCall=abc&baseProjName=abc&baseProjConsClass=abc&capCode=abc&baseManDeprtDing=abc&baseProvManDeprtDing=abc&baseBasisEstablish=abc&baseAreaCode=abc&capTime=abc&baseAreaName=abc"; + log.info("url :{}",url); + ResponseEntity forEntity = restTemplate.getForEntity(url, String.class); + log.info(forEntity.getBody()); + return forEntity.getBody(); + } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/organization/manage/GovBusinessStripManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/organization/manage/GovBusinessStripManage.java index 3e7bb31..8ead81d 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/organization/manage/GovBusinessStripManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/organization/manage/GovBusinessStripManage.java @@ -56,7 +56,10 @@ public class GovBusinessStripManage { public List getProvincialGovBusinessStripList(String businessStripName) { if(Objects.nonNull(canSearch) && canSearch){ - return joinReviewProvincialBureauService.searchGovUnits(); + List vos = joinReviewProvincialBureauService.searchGovUnits(); + return vos.stream() + .filter(b -> StringUtils.isBlank(businessStripName) || b.getBusinessStripName().contains(businessStripName)) + .collect(Collectors.toList()); } List strips = provincialGovBusinessStripService.list(Wrappers.lambdaQuery(ProvincialGovBusinessStrip.class)