From ef74a4c8e17be594673d516467a65ad2de3f840a Mon Sep 17 00:00:00 2001 From: xiachao Date: Wed, 25 Dec 2024 13:56:36 +0800 Subject: [PATCH 1/2] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/IotVisualComponentServiceImpl.java | 8 ++++---- .../service/impl/IotVisualGroupServiceImpl.java | 12 ++++++------ .../service/impl/IotVisualMaterialServiceImpl.java | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/visual-design/src/main/java/com/thing/visual/component/service/impl/IotVisualComponentServiceImpl.java b/modules/visual-design/src/main/java/com/thing/visual/component/service/impl/IotVisualComponentServiceImpl.java index 017be9a..032fddd 100644 --- a/modules/visual-design/src/main/java/com/thing/visual/component/service/impl/IotVisualComponentServiceImpl.java +++ b/modules/visual-design/src/main/java/com/thing/visual/component/service/impl/IotVisualComponentServiceImpl.java @@ -68,7 +68,7 @@ public class IotVisualComponentServiceImpl extends BaseServiceImpl Date: Wed, 25 Dec 2024 15:36:16 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=A2=B3=E6=8E=92=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=EF=BC=8Cbug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/IotCarbonProductionResultEntity.java | 2 +- .../impl/IotCarbonProductionResultServiceImpl.java | 11 ++--------- .../mapper/IotCarbonProductionRecordMapper.xml | 2 +- .../service/impl/IotVisualManageServiceImpl.java | 4 +++- 4 files changed, 7 insertions(+), 12 deletions(-) diff --git a/modules/carbon-track/src/main/java/com/thing/carbontrack/productionResult/entity/IotCarbonProductionResultEntity.java b/modules/carbon-track/src/main/java/com/thing/carbontrack/productionResult/entity/IotCarbonProductionResultEntity.java index 1edaee8..331b950 100644 --- a/modules/carbon-track/src/main/java/com/thing/carbontrack/productionResult/entity/IotCarbonProductionResultEntity.java +++ b/modules/carbon-track/src/main/java/com/thing/carbontrack/productionResult/entity/IotCarbonProductionResultEntity.java @@ -198,7 +198,7 @@ public class IotCarbonProductionResultEntity implements Serializable { entity.setW_unit(info.getWUnit()); entity.setP_weight(info.getPWeight()); if(ObjectUtils.isEmpty(info.getPrDur())){ - long prDur = (info.getEndTime().getTime() - info.getStartTime().getTime())/ (1000 * 60 * 60); + long prDur = (info.getEndTime().getTime() - info.getStartTime().getTime()+1)/ (1000 * 60 * 60*60); entity.setPrDur((int) prDur); }else { entity.setPrDur(info.getPrDur().intValue()); diff --git a/modules/carbon-track/src/main/java/com/thing/carbontrack/productionResult/service/impl/IotCarbonProductionResultServiceImpl.java b/modules/carbon-track/src/main/java/com/thing/carbontrack/productionResult/service/impl/IotCarbonProductionResultServiceImpl.java index e8f02c8..4437979 100644 --- a/modules/carbon-track/src/main/java/com/thing/carbontrack/productionResult/service/impl/IotCarbonProductionResultServiceImpl.java +++ b/modules/carbon-track/src/main/java/com/thing/carbontrack/productionResult/service/impl/IotCarbonProductionResultServiceImpl.java @@ -168,10 +168,8 @@ public class IotCarbonProductionResultServiceImpl return new LotCarbonBaseInfoOnYear(); } LotCarbonBaseInfoOnYear res = LotCarbonBaseInfoOnYear.init(production); - Date start = new Date(DateTimeUtils.yearStartTs()); - Date end = new Date(DateTimeUtils.yearEndTs()); - List aggCarbons = aggCarbon(productId, start, end); + List aggCarbons = aggCarbon(productId); Map> aggMap = AggCarbon.agg(aggCarbons); res.setCarbonAvgMap(aggMap.get(AggCarbon.AVG)); @@ -666,7 +664,7 @@ public class IotCarbonProductionResultServiceImpl return mapper.selectListByQueryAs(queryWrapper, IotCarbonProductionResultDTO.class); } - private List aggCarbon(Long productId, Date start, Date end) { + private List aggCarbon(Long productId) { return mapper.selectListByQueryAs( QueryWrapper.create() .select( @@ -677,11 +675,6 @@ public class IotCarbonProductionResultServiceImpl sum(IOT_CARBON_PRODUCTION_RESULT_ENTITY.F_CARBON_AVG).as(AggCarbon::getFCarbonAvg)) .from(IOT_CARBON_PRODUCTION_RESULT_ENTITY) .eq(IotCarbonProductionResultEntity::getM_id, productId) - .between( - IotCarbonProductionResultEntity::getFinishTime, - start, - end, - Objects.nonNull(start) && Objects.nonNull(end)) .groupBy( IOT_CARBON_PRODUCTION_RESULT_ENTITY.CARBON_TYPE, IOT_CARBON_PRODUCTION_RESULT_ENTITY.PR_CODE), diff --git a/modules/carbon-track/src/main/resources/mapper/IotCarbonProductionRecordMapper.xml b/modules/carbon-track/src/main/resources/mapper/IotCarbonProductionRecordMapper.xml index d12c7b3..ae13177 100644 --- a/modules/carbon-track/src/main/resources/mapper/IotCarbonProductionRecordMapper.xml +++ b/modules/carbon-track/src/main/resources/mapper/IotCarbonProductionRecordMapper.xml @@ -266,7 +266,7 @@ .pr_code, MIN ( P.start_time ) AS start_time, MAX ( P.end_time ) AS end_time, - SUM (P.pr_dur) as pr_dur, + MAX(P.pr_dur) as pr_dur, aa.ID AS m_id, aa.p_weight AS "p_weight", aa.w_unit AS "w_unit", diff --git a/modules/visual-design/src/main/java/com/thing/visual/board/service/impl/IotVisualManageServiceImpl.java b/modules/visual-design/src/main/java/com/thing/visual/board/service/impl/IotVisualManageServiceImpl.java index 6ee02d5..6c3a8c7 100644 --- a/modules/visual-design/src/main/java/com/thing/visual/board/service/impl/IotVisualManageServiceImpl.java +++ b/modules/visual-design/src/main/java/com/thing/visual/board/service/impl/IotVisualManageServiceImpl.java @@ -234,7 +234,9 @@ public class IotVisualManageServiceImpl extends BaseServiceImpl menuIdList = sysMenuDTOList.stream().map(SysMenuDTO::getId).collect(Collectors.toList()); sysRoleMenuDao.deleteByMenuIds(menuIdList); //删除菜单表 - sysMenuService.batchDelete((Long[]) menuIdList.toArray()); + menuIdList.forEach(temp->{ + sysMenuService.delete(temp); + }); sysLanguageDao.deleteByQuery(QueryWrapper.create().in(SysLanguageEntity::getTableId, menuIdList)); } }