Browse Source

重新部署 数据

master
PoffyZhang 1 year ago
parent
commit
9c960885b0
2 changed files with 24 additions and 6 deletions
  1. +21
    -3
      kqapi/src/main/java/com/ningdatech/kqapi/scheduler/manage/SynManage.java
  2. +3
    -3
      kqapi/src/main/java/com/ningdatech/kqapi/scheduler/task/RemoveMattersTask.java

+ 21
- 3
kqapi/src/main/java/com/ningdatech/kqapi/scheduler/manage/SynManage.java View File

@@ -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<NdKqZzsfwMattersDeduplicate> 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<String> formEntity = new HttpEntity(JSON.toJSONString(dto), headers);
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));
}

@@ -54,8 +62,13 @@ public class SynManage {
List<NdKqZzsfwMenu> 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<String> formEntity = new HttpEntity(JSON.toJSONString(dto), headers);
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));
}

@@ -63,8 +76,13 @@ public class SynManage {
List<NdKqZzsfwPolicy> 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<String> formEntity = new HttpEntity(JSON.toJSONString(dto), headers);
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));
}
}


+ 3
- 3
kqapi/src/main/java/com/ningdatech/kqapi/scheduler/task/RemoveMattersTask.java View File

@@ -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());



Loading…
Cancel
Save