diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/scheduler/manage/SynManage.java b/kqapi/src/main/java/com/ningdatech/kqapi/scheduler/manage/SynManage.java index f0af5d5..4fa1224 100644 --- a/kqapi/src/main/java/com/ningdatech/kqapi/scheduler/manage/SynManage.java +++ b/kqapi/src/main/java/com/ningdatech/kqapi/scheduler/manage/SynManage.java @@ -14,6 +14,9 @@ import com.ningdatech.kqapi.zzsfw.service.INdKqZzsfwMenuService; import com.ningdatech.kqapi.zzsfw.service.INdKqZzsfwPolicyService; import lombok.RequiredArgsConstructor; 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.stereotype.Component; import org.springframework.web.client.RestTemplate; @@ -45,8 +48,13 @@ public class SynManage { List dups = deduplicateService.list(); for(NdKqZzsfwMattersDeduplicate dup : dups){ 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 formEntity = new HttpEntity(JSON.toJSONString(dto), headers); ResponseEntity 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)); } @@ -54,8 +62,13 @@ public class SynManage { List menus = menuService.list(); for(NdKqZzsfwMenu menu : menus){ 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 formEntity = new HttpEntity(JSON.toJSONString(dto), headers); ResponseEntity 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)); } @@ -63,8 +76,13 @@ public class SynManage { List policies = policyService.list(); for(NdKqZzsfwPolicy policy : policies){ 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 formEntity = new HttpEntity(JSON.toJSONString(dto), headers); ResponseEntity 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)); } } diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/scheduler/task/RemoveMattersTask.java b/kqapi/src/main/java/com/ningdatech/kqapi/scheduler/task/RemoveMattersTask.java index d7eddbe..9d0e9d7 100644 --- a/kqapi/src/main/java/com/ningdatech/kqapi/scheduler/task/RemoveMattersTask.java +++ b/kqapi/src/main/java/com/ningdatech/kqapi/scheduler/task/RemoveMattersTask.java @@ -51,9 +51,9 @@ public class RemoveMattersTask { stopWatch.start(); log.info("删除事项表 所有数据 等待新数据推上来"); -// if(kqService.remove(Wrappers.lambdaQuery(DscSxAdsShareItemQltQlsxCommonIDVKq.class))){ -// log.info("删除成功"); -// } + if(kqService.remove(Wrappers.lambdaQuery(DscSxAdsShareItemQltQlsxCommonIDVKq.class))){ + log.info("删除成功"); + } log.info("当前表里还有数据 :{}条",kqService.count());