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)); } } 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