From 665380dad5f3c169a0540565f75a459af8f2ae3a Mon Sep 17 00:00:00 2001 From: anthonywj Date: Thu, 22 Feb 2024 10:51:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=A4=87=E4=BB=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/dataSync/DeviceSyncService.java | 49 ------------------- .../udi/impl/ProductClassifyServiceImpl.java | 6 +-- .../udidl/admin/thread/DownloadTask2.java | 44 ----------------- .../udidl/admin/thread/UdiTransferUtils.java | 2 - 4 files changed, 3 insertions(+), 98 deletions(-) delete mode 100644 src/main/java/com/glxp/udidl/admin/thread/DownloadTask2.java diff --git a/src/main/java/com/glxp/udidl/admin/service/dataSync/DeviceSyncService.java b/src/main/java/com/glxp/udidl/admin/service/dataSync/DeviceSyncService.java index 145aae8..ac5846e 100644 --- a/src/main/java/com/glxp/udidl/admin/service/dataSync/DeviceSyncService.java +++ b/src/main/java/com/glxp/udidl/admin/service/dataSync/DeviceSyncService.java @@ -68,41 +68,6 @@ public class DeviceSyncService { return; } int insertCount = deviceSaveService.DeviceSave(result.getData(), DateUtil.parseDate(rangeValue), dlType); - //2.下载历史记录 -// List keyList = new ArrayList(); -// for (DataSetResult.DataSet ds : result.getData()) { -// List list = ds.getDeviceInfo(); -// if (list != null && list.size() > 0) { -// for (DataSetResult.DeviceInfo deviceInfo : list) -// keyList.add(deviceInfo.getDeviceRecordKey()); -// } -// } -// if (keyList.size() > 0) { -// DataSetTotalResult res = deviceDownloadService.getHistoryData2(keyList); -// if (res.getCode() == 1) { -// if (res.getData() != null && res.getData().size() > 0) { -// int count = result.getTotalRecordCount(); -// count = count + res.getTotalRecordCount(); -// result.setTotalRecordCount(count); -// List data = result.getData(); -// data.addAll(res.getData()); -// result.setData(data); -// int hisInsertCount = deviceSaveService.DeviceSave(res.getData(), null, dlType); -// insertCount = insertCount + hisInsertCount; -// } -// } else { -// JobLog jobLog = new JobLog(); -// jobLog.setDownloadType(downloadType); -// jobLog.setTaskType(Constant.JOB_TASK_TYPE_DOWNLOAD); -// jobLog.setDownloadDate(DateUtil.parseDate(rangeValue)); -// jobLog.setType(Constant.LOG_TYPE_ERROR); -// jobLog.setMsg("下载历史记录出错:" + res.getMsg()); -// jobLog.setCreateTime(new Date()); -// jobLogService.insert(jobLog); -// } -// -// } - JobLog jobLog = new JobLog(); jobLog.setDownloadType(downloadType); jobLog.setTaskType(Constant.JOB_TASK_TYPE_DOWNLOAD); @@ -219,20 +184,6 @@ public class DeviceSyncService { return ResultVOUtils.success(productInfoEntityList); } - -// public void dlHistory(DataSetSingleResult result1) { -// -// DataSetSingleHistoryResult result = new DataSetSingleHistoryResult(); -// result.setDataSet(result1.getDataSet()); -// if (result1.getDataSet().getDeviceInfo() != null && result1.getDataSet().getDeviceInfo().size() > 0) { -// List keyList = deviceDownloadService.getKeyList(result1.getDataSet()); -// if (keyList.size() > 0) { -// DataSetTotalResult result2 = deviceDownloadService.getHistoryData(keyList); -// result.setDataList(result2.getData()); -// } -// } -// } - public BaseResponse downloadByDi(String deviceId) { DataSetSingleResult result1 = deviceDownloadService.downloadByDi(deviceId); if (result1.getReturnCode() != 1) diff --git a/src/main/java/com/glxp/udidl/admin/service/udi/impl/ProductClassifyServiceImpl.java b/src/main/java/com/glxp/udidl/admin/service/udi/impl/ProductClassifyServiceImpl.java index 25afa79..262e239 100644 --- a/src/main/java/com/glxp/udidl/admin/service/udi/impl/ProductClassifyServiceImpl.java +++ b/src/main/java/com/glxp/udidl/admin/service/udi/impl/ProductClassifyServiceImpl.java @@ -17,11 +17,11 @@ public class ProductClassifyServiceImpl implements ProductClassifyService { ProductClassifyMapper productClassifyMapper; @Override - public ProductClassify findByCode(String code, String qxlb) { + public ProductClassify findByCode(String code, String cplx) { - List productClassifyList = productClassifyMapper.selectList(new QueryWrapper().eq("code", code).eq("qxlb", qxlb)); + List productClassifyList = productClassifyMapper.selectList(new QueryWrapper().eq("code", code).eq("qxlb", cplx)); if (CollUtil.isNotEmpty(productClassifyList)) { - productClassifyList.get(0); + return productClassifyList.get(0); } return new ProductClassify(); diff --git a/src/main/java/com/glxp/udidl/admin/thread/DownloadTask2.java b/src/main/java/com/glxp/udidl/admin/thread/DownloadTask2.java deleted file mode 100644 index 51c657d..0000000 --- a/src/main/java/com/glxp/udidl/admin/thread/DownloadTask2.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.glxp.udidl.admin.thread; - -import com.glxp.udidl.admin.dao.info.ScheduledMapper; -import com.glxp.udidl.admin.service.dataSync.DeviceSyncService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.scheduling.annotation.EnableScheduling; -import org.springframework.scheduling.annotation.SchedulingConfigurer; -import org.springframework.scheduling.config.ScheduledTaskRegistrar; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; - -@Component -@EnableScheduling -public class DownloadTask2 implements SchedulingConfigurer { - - final Logger logger = LoggerFactory.getLogger(DownloadTask.class); - - @Resource - private ScheduledMapper scheduledDao; - @Resource - DeviceSyncService deviceSyncService; - - @Override - public void configureTasks(ScheduledTaskRegistrar scheduledTaskRegistrar) { - /*scheduledTaskRegistrar.addTriggerTask(() -> process(), - triggerContext -> { - ScheduledRequest scheduledRequest = new ScheduledRequest(); - scheduledRequest.setCronName("downloadUdi2"); - ScheduledEntity scheduledEntity = scheduledDao.findScheduled(scheduledRequest); - String cron = scheduledEntity.getCron();//"0 55 5 * * ?"; - if (cron.isEmpty()) { - logger.error("cron is null"); - } - return new CronTrigger(cron).nextExecutionTime(triggerContext); - });*/ - } - - private void process() { - deviceSyncService.downloadUdi(1); - } - -} diff --git a/src/main/java/com/glxp/udidl/admin/thread/UdiTransferUtils.java b/src/main/java/com/glxp/udidl/admin/thread/UdiTransferUtils.java index 594e7f3..f5c727e 100644 --- a/src/main/java/com/glxp/udidl/admin/thread/UdiTransferUtils.java +++ b/src/main/java/com/glxp/udidl/admin/thread/UdiTransferUtils.java @@ -98,8 +98,6 @@ public class UdiTransferUtils { ProductClassify productClassifyEntity = productClassifyService.findByCode(productInfoEntity.getFlbm(), productInfoEntity.getCplx()); productInfoEntity.setCategoryName(productClassifyEntity.getName()); - - productInfoEntity.setVersionNumber(Integer.parseInt(deviceEntity.getVersionnumber())); if (deviceEntity.getSydycpbs() != null && !deviceEntity.getSydycpbs().equals("")) { productInfoEntity.setBhxjcpbm("");