|
@@ -14,6 +14,9 @@ import com.ningdatech.kqapi.zzsfw.service.INdKqZzsfwMenuService; |
|
|
import com.ningdatech.kqapi.zzsfw.service.INdKqZzsfwPolicyService; |
|
|
import com.ningdatech.kqapi.zzsfw.service.INdKqZzsfwPolicyService; |
|
|
import lombok.RequiredArgsConstructor; |
|
|
import lombok.RequiredArgsConstructor; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
|
import org.springframework.http.HttpEntity; |
|
|
|
|
|
import org.springframework.http.HttpHeaders; |
|
|
|
|
|
import org.springframework.http.MediaType; |
|
|
import org.springframework.http.ResponseEntity; |
|
|
import org.springframework.http.ResponseEntity; |
|
|
import org.springframework.stereotype.Component; |
|
|
import org.springframework.stereotype.Component; |
|
|
import org.springframework.web.client.RestTemplate; |
|
|
import org.springframework.web.client.RestTemplate; |
|
@@ -45,8 +48,13 @@ public class SynManage { |
|
|
List<NdKqZzsfwMattersDeduplicate> dups = deduplicateService.list(); |
|
|
List<NdKqZzsfwMattersDeduplicate> dups = deduplicateService.list(); |
|
|
for(NdKqZzsfwMattersDeduplicate dup : dups){ |
|
|
for(NdKqZzsfwMattersDeduplicate dup : dups){ |
|
|
NdKqZzsfwMattersDeduplicateDTO dto = BeanUtil.copyProperties(dup,NdKqZzsfwMattersDeduplicateDTO.class); |
|
|
NdKqZzsfwMattersDeduplicateDTO dto = BeanUtil.copyProperties(dup,NdKqZzsfwMattersDeduplicateDTO.class); |
|
|
|
|
|
HttpHeaders headers = new HttpHeaders(); |
|
|
|
|
|
MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8"); |
|
|
|
|
|
headers.setContentType(type); |
|
|
|
|
|
headers.add("Accept", MediaType.APPLICATION_JSON.toString()); |
|
|
|
|
|
HttpEntity<String> formEntity = new HttpEntity(JSON.toJSONString(dto), headers); |
|
|
ResponseEntity<String> stringResponseEntity = restTemplate.postForEntity( |
|
|
ResponseEntity<String> stringResponseEntity = restTemplate.postForEntity( |
|
|
"localhost:33061/kq/api/v1/zzsfw/save-dup", dto, String.class); |
|
|
|
|
|
|
|
|
"http://localhost:33061/kq/api/v1/zzsfw/save-dup", formEntity, String.class); |
|
|
log.info("结果:{}", JSON.toJSONString(stringResponseEntity)); |
|
|
log.info("结果:{}", JSON.toJSONString(stringResponseEntity)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@@ -54,8 +62,13 @@ public class SynManage { |
|
|
List<NdKqZzsfwMenu> menus = menuService.list(); |
|
|
List<NdKqZzsfwMenu> menus = menuService.list(); |
|
|
for(NdKqZzsfwMenu menu : menus){ |
|
|
for(NdKqZzsfwMenu menu : menus){ |
|
|
NdKqZzsfwMenuDTO dto = BeanUtil.copyProperties(menu,NdKqZzsfwMenuDTO.class); |
|
|
NdKqZzsfwMenuDTO dto = BeanUtil.copyProperties(menu,NdKqZzsfwMenuDTO.class); |
|
|
|
|
|
HttpHeaders headers = new HttpHeaders(); |
|
|
|
|
|
MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8"); |
|
|
|
|
|
headers.setContentType(type); |
|
|
|
|
|
headers.add("Accept", MediaType.APPLICATION_JSON.toString()); |
|
|
|
|
|
HttpEntity<String> formEntity = new HttpEntity(JSON.toJSONString(dto), headers); |
|
|
ResponseEntity<String> stringResponseEntity = restTemplate.postForEntity( |
|
|
ResponseEntity<String> stringResponseEntity = restTemplate.postForEntity( |
|
|
"localhost:33061/kq/api/v1/zzsfw/save", dto, String.class); |
|
|
|
|
|
|
|
|
"http://localhost:33061/kq/api/v1/zzsfw/save", formEntity, String.class); |
|
|
log.info("结果:{}", JSON.toJSONString(stringResponseEntity)); |
|
|
log.info("结果:{}", JSON.toJSONString(stringResponseEntity)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@@ -63,8 +76,13 @@ public class SynManage { |
|
|
List<NdKqZzsfwPolicy> policies = policyService.list(); |
|
|
List<NdKqZzsfwPolicy> policies = policyService.list(); |
|
|
for(NdKqZzsfwPolicy policy : policies){ |
|
|
for(NdKqZzsfwPolicy policy : policies){ |
|
|
NdKqZzsfwPolicyDTO dto = BeanUtil.copyProperties(policy,NdKqZzsfwPolicyDTO.class); |
|
|
NdKqZzsfwPolicyDTO dto = BeanUtil.copyProperties(policy,NdKqZzsfwPolicyDTO.class); |
|
|
|
|
|
HttpHeaders headers = new HttpHeaders(); |
|
|
|
|
|
MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8"); |
|
|
|
|
|
headers.setContentType(type); |
|
|
|
|
|
headers.add("Accept", MediaType.APPLICATION_JSON.toString()); |
|
|
|
|
|
HttpEntity<String> formEntity = new HttpEntity(JSON.toJSONString(dto), headers); |
|
|
ResponseEntity<String> stringResponseEntity = restTemplate.postForEntity( |
|
|
ResponseEntity<String> stringResponseEntity = restTemplate.postForEntity( |
|
|
"localhost:33061/kq/api/v1/poclicy/save", dto, String.class); |
|
|
|
|
|
|
|
|
"http://localhost:33061/kq/api/v1/poclicy/save", formEntity, String.class); |
|
|
log.info("结果:{}", JSON.toJSONString(stringResponseEntity)); |
|
|
log.info("结果:{}", JSON.toJSONString(stringResponseEntity)); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|