From 846880b25671df6888ec1187a93d3e7bcab9d519 Mon Sep 17 00:00:00 2001 From: duwenyuan <15600000461@163.com> Date: Thu, 17 Apr 2025 17:31:15 +0800 Subject: [PATCH] =?UTF-8?q?Beta=20Detector=20Calibration=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=20=E8=BF=94=E5=9B=9E=E7=BB=93=E6=9E=9C=E6=B7=BB=E5=8A=A0acqSta?= =?UTF-8?q?rtTime=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/jeecg/common/util/DateUtils.java | 20 +++++++++++++++++++ .../mapper/xml/SpectrumAnalysisMapper.xml | 4 ++-- .../service/impl/SelfStationServiceImpl.java | 3 +++ 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/DateUtils.java b/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/DateUtils.java index d8dba299..2a58e03f 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/DateUtils.java +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/DateUtils.java @@ -205,6 +205,26 @@ public class DateUtils extends PropertyEditorSupport { } return sformat.format(nowDate); } + /** + * 时间字符串格式转换 + * @param date 时间字符串 + * @param sourceFormat 字符串原有格式 + * @param targetFormat 需要转换成的格式 + * @return 字符串 + */ + public static String dateformat(String date,String sourceFormat,String targetFormat) + { + SimpleDateFormat sformat = new SimpleDateFormat(sourceFormat); + Date nowDate = null; + try { + nowDate = sformat.parse(date); + sformat=new SimpleDateFormat(targetFormat); + } catch (ParseException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return sformat.format(nowDate); + } /** * 日期转换为字符串 diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/mapper/xml/SpectrumAnalysisMapper.xml b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/mapper/xml/SpectrumAnalysisMapper.xml index 42cb2d02..5574b66d 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/mapper/xml/SpectrumAnalysisMapper.xml +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/mapper/xml/SpectrumAnalysisMapper.xml @@ -99,10 +99,10 @@ - ORDER BY ${orderField} ${orderType} + ORDER BY ${orderField} ${orderType},acquisitionRealSec DESC - ORDER BY collectStop DESC + ORDER BY collectStop DESC,acquisitionRealSec DESC diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SelfStationServiceImpl.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SelfStationServiceImpl.java index 3728f988..e77d5b93 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SelfStationServiceImpl.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SelfStationServiceImpl.java @@ -2333,6 +2333,9 @@ public class SelfStationServiceImpl extends AbstractLogOrReport implements ISelf long gChannels = struct.g_channels; long[][] hCounts = struct.h_count_arr; int bRecordCount = struct.b_record_count; + String acqStartTime = String.format("%s %s", struct.acquisition_start_date, struct.acquisition_start_time); + String acqStartTimeFormat = DateUtils.dateformat(acqStartTime, "yyyy/MM/dd HH:mm:ss.S", "yyyy-MM-dd HH:mm:ss"); + map.put("acqStartTime", acqStartTimeFormat); //散点图坐标点关联beta部分相关数据 List> betaEnergyList = new LinkedList<>(); List betaParam = EnergySpectrumHandler.GetFileFittingPara(bChannel, bElectronEnergy);