|
@@ -2,7 +2,6 @@ package cn.start.tz.module.pressure2.service.synchronization;
|
|
|
|
|
|
|
|
import cn.hutool.core.date.DateTime;
|
|
import cn.hutool.core.date.DateTime;
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
-import cn.hutool.core.thread.ThreadUtil;
|
|
|
|
|
import cn.hutool.http.HttpResponse;
|
|
import cn.hutool.http.HttpResponse;
|
|
|
import cn.hutool.http.HttpUtil;
|
|
import cn.hutool.http.HttpUtil;
|
|
|
|
|
|
|
@@ -22,12 +21,10 @@ import cn.start.tz.module.system.api.dept.dto.DeptRespDTO;
|
|
|
import cn.start.tz.module.system.api.dict.DictDataApi;
|
|
import cn.start.tz.module.system.api.dict.DictDataApi;
|
|
|
import cn.start.tz.module.system.api.dict.dto.DictDataRespDTO;
|
|
import cn.start.tz.module.system.api.dict.dto.DictDataRespDTO;
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
-import com.fasterxml.jackson.core.JsonProcessingException;
|
|
|
|
|
import jakarta.annotation.Resource;
|
|
import jakarta.annotation.Resource;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
-import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
@@ -36,8 +33,6 @@ import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
-import java.util.concurrent.ThreadPoolExecutor;
|
|
|
|
|
-import java.util.concurrent.atomic.AtomicBoolean;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
|
|
@@ -91,14 +86,16 @@ public class SynchronizationServiceImpl implements SynchronizationService {
|
|
|
* @param updateDate 更新时间,只同步此时间之后的数据
|
|
* @param updateDate 更新时间,只同步此时间之后的数据
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
- public void boiler(String updateDate) {
|
|
|
|
|
|
|
+ public void boiler(String updateDate, String REGISTERNO) {
|
|
|
log.info("同步锅炉设备定时任务执行中...");
|
|
log.info("同步锅炉设备定时任务执行中...");
|
|
|
initDict();
|
|
initDict();
|
|
|
|
|
|
|
|
Map<String, Object> form = new HashMap<>();
|
|
Map<String, Object> form = new HashMap<>();
|
|
|
form.put("pageNum", 0);
|
|
form.put("pageNum", 0);
|
|
|
form.put("pageSize", DEFAULT_PAGE_SIZE);
|
|
form.put("pageSize", DEFAULT_PAGE_SIZE);
|
|
|
-// form.put("REGISTERNO", "11204401152024120003");
|
|
|
|
|
|
|
+ if (REGISTERNO != null) {
|
|
|
|
|
+ form.put("REGISTERNO", REGISTERNO);
|
|
|
|
|
+ }
|
|
|
if (updateDate != null) {
|
|
if (updateDate != null) {
|
|
|
form.put("UPDATEDATE_gt", updateDate);
|
|
form.put("UPDATEDATE_gt", updateDate);
|
|
|
}
|
|
}
|
|
@@ -131,7 +128,7 @@ public class SynchronizationServiceImpl implements SynchronizationService {
|
|
|
log.info("同步,添加锅炉:{},更新锅炉:{}", addList.size(), updateList.size());
|
|
log.info("同步,添加锅炉:{},更新锅炉:{}", addList.size(), updateList.size());
|
|
|
equipBoilerService.saveBatch(addList);
|
|
equipBoilerService.saveBatch(addList);
|
|
|
|
|
|
|
|
- updateList.parallelStream().forEach(equipBoilerDO -> {
|
|
|
|
|
|
|
+ updateList.forEach(equipBoilerDO -> {
|
|
|
try {
|
|
try {
|
|
|
equipBoilerService.updateEquipBoiler(equipBoilerDO);
|
|
equipBoilerService.updateEquipBoiler(equipBoilerDO);
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
@@ -149,7 +146,7 @@ public class SynchronizationServiceImpl implements SynchronizationService {
|
|
|
* @param updateDate 更新时间,只同步此时间之后的数据
|
|
* @param updateDate 更新时间,只同步此时间之后的数据
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
- public void pipe(String updateDate) {
|
|
|
|
|
|
|
+ public void pipe(String updateDate, String PROJECT_NO) {
|
|
|
log.info("同步管道设备定时任务执行中...");
|
|
log.info("同步管道设备定时任务执行中...");
|
|
|
|
|
|
|
|
initDict();
|
|
initDict();
|
|
@@ -158,6 +155,9 @@ public class SynchronizationServiceImpl implements SynchronizationService {
|
|
|
Map<String, Object> form = new HashMap<>();
|
|
Map<String, Object> form = new HashMap<>();
|
|
|
form.put("pageNum", 0);
|
|
form.put("pageNum", 0);
|
|
|
form.put("pageSize", DEFAULT_PAGE_SIZE);
|
|
form.put("pageSize", DEFAULT_PAGE_SIZE);
|
|
|
|
|
+ if (PROJECT_NO != null) {
|
|
|
|
|
+ form.put("PROJECT_NO", PROJECT_NO);
|
|
|
|
|
+ }
|
|
|
if (updateDate != null) {
|
|
if (updateDate != null) {
|
|
|
form.put("UPDATEDATE_gt", updateDate);
|
|
form.put("UPDATEDATE_gt", updateDate);
|
|
|
}
|
|
}
|
|
@@ -165,7 +165,7 @@ public class SynchronizationServiceImpl implements SynchronizationService {
|
|
|
ResponseDto pipeDtoResponseDto = JSONObject.parseObject(pipeequipment, ResponseDto.class);
|
|
ResponseDto pipeDtoResponseDto = JSONObject.parseObject(pipeequipment, ResponseDto.class);
|
|
|
log.info("同步数据中台返回管道数据:{}", pipeDtoResponseDto);
|
|
log.info("同步数据中台返回管道数据:{}", pipeDtoResponseDto);
|
|
|
// 获取所有管道详情数据
|
|
// 获取所有管道详情数据
|
|
|
- List<PipeDetailDto> pipeDetailDtoS = fetchAllPipeDetailData(updateDate);
|
|
|
|
|
|
|
+ List<PipeDetailDto> pipeDetailDtoS = fetchAllPipeDetailData(updateDate, PROJECT_NO);
|
|
|
if (pipeDtoResponseDto.getTotal() > 0) {
|
|
if (pipeDtoResponseDto.getTotal() > 0) {
|
|
|
List<PipeDto> list = pipeDtoResponseDto.getData().stream()
|
|
List<PipeDto> list = pipeDtoResponseDto.getData().stream()
|
|
|
.map(data -> ((JSONObject) data).toJavaObject(PipeDto.class))
|
|
.map(data -> ((JSONObject) data).toJavaObject(PipeDto.class))
|
|
@@ -197,11 +197,14 @@ public class SynchronizationServiceImpl implements SynchronizationService {
|
|
|
/**
|
|
/**
|
|
|
* 分页获取所有管道详情数据
|
|
* 分页获取所有管道详情数据
|
|
|
*/
|
|
*/
|
|
|
- private List<PipeDetailDto> fetchAllPipeDetailData(String updateDate) {
|
|
|
|
|
|
|
+ private List<PipeDetailDto> fetchAllPipeDetailData(String updateDate, String PROJECT_NO) {
|
|
|
|
|
|
|
|
Map<String, Object> detailForm = new HashMap<>();
|
|
Map<String, Object> detailForm = new HashMap<>();
|
|
|
detailForm.put("pageNum", 0);
|
|
detailForm.put("pageNum", 0);
|
|
|
detailForm.put("pageSize", DEFAULT_DETAIL_PAGE_SIZE);
|
|
detailForm.put("pageSize", DEFAULT_DETAIL_PAGE_SIZE);
|
|
|
|
|
+ if (PROJECT_NO != null) {
|
|
|
|
|
+ detailForm.put("PROJECT_NO", PROJECT_NO);
|
|
|
|
|
+ }
|
|
|
if (updateDate != null) {
|
|
if (updateDate != null) {
|
|
|
detailForm.put("UPDATEDATE_gt", updateDate);
|
|
detailForm.put("UPDATEDATE_gt", updateDate);
|
|
|
}
|
|
}
|