From 81eae83295642387de38a97fdc5a35f485307587 Mon Sep 17 00:00:00 2001 From: Lius <Lius2225@163.com> Date: 星期四, 07 十一月 2024 22:20:11 +0800 Subject: [PATCH] license --- lxzn-module-mdc/src/main/java/org/jeecg/modules/mdcJc/service/impl/MdcProductDayScheduleServiceImpl.java | 31 +++++++++++++-- lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/EquipmentAlarmServiceImpl.java | 20 ++++++++-- lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/EquipmentAlarmMapper.xml | 6 ++- lxzn-module-mdc/src/main/java/org/jeecg/modules/screen/service/impl/MdcLargeScreenServiceImpl.java | 10 +++- lxzn-boot-base-core/src/main/java/org/jeecg/config/LicenseConfig.java | 6 +- lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcOeeInfoServiceImpl.java | 2 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/MdcFakeDataSub.java | 5 ++ lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentServiceImpl.java | 6 +- lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/dto/EquipmentAlarmDto.java | 2 + 9 files changed, 67 insertions(+), 21 deletions(-) diff --git a/lxzn-boot-base-core/src/main/java/org/jeecg/config/LicenseConfig.java b/lxzn-boot-base-core/src/main/java/org/jeecg/config/LicenseConfig.java index cf2998b..f81dcb8 100644 --- a/lxzn-boot-base-core/src/main/java/org/jeecg/config/LicenseConfig.java +++ b/lxzn-boot-base-core/src/main/java/org/jeecg/config/LicenseConfig.java @@ -24,9 +24,9 @@ //娣诲姞瑕佹嫤鎴殑url registry.addInterceptor(licenseCheckInterceptor) // 鎷︽埅鐨勮矾寰� - .addPathPatterns("/**") + .addPathPatterns("/sys/login"); // 鏀捐鐨勮矾寰� - .excludePathPatterns("/swagger-resources/**", "/webjars/**", "/v2/**", "/swagger-ui.html/**", "/doc.html")//swagger - .excludePathPatterns("/base/license/**");//鐢熸垚license鍜岃幏鍙栨湇鍔″櫒纭欢淇℃伅 +// .excludePathPatterns("/swagger-resources/**", "/webjars/**", "/v2/**", "/swagger-ui.html/**", "/doc.html")//swagger +// .excludePathPatterns("/base/license/**");//鐢熸垚license鍜岃幏鍙栨湇鍔″櫒纭欢淇℃伅 } } diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/dto/EquipmentAlarmDto.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/dto/EquipmentAlarmDto.java index b41a7d4..edfd688 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/dto/EquipmentAlarmDto.java +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/dto/EquipmentAlarmDto.java @@ -25,4 +25,6 @@ private String alarmNo; @Excel(name = "鎶ヨ鎻忚堪", width = 50) private String alarmContent; + + private String driveType; } diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/MdcFakeDataSub.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/MdcFakeDataSub.java index ef3e882..1bd8aa6 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/MdcFakeDataSub.java +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/MdcFakeDataSub.java @@ -1,5 +1,7 @@ package org.jeecg.modules.mdc.entity; +import com.baomidou.mybatisplus.annotation.FieldStrategy; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -32,16 +34,19 @@ * label */ @ApiModelProperty("label") + @TableField(updateStrategy = FieldStrategy.IGNORED) private String label; /** * value1 */ @ApiModelProperty("value1") + @TableField(updateStrategy = FieldStrategy.IGNORED) private String value1; /** * value2 */ @ApiModelProperty("value2") + @TableField(updateStrategy = FieldStrategy.IGNORED) private String value2; } diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/EquipmentAlarmMapper.xml b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/EquipmentAlarmMapper.xml index 4204d28..ca5498a 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/EquipmentAlarmMapper.xml +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/EquipmentAlarmMapper.xml @@ -8,7 +8,8 @@ t2.equipment_name, t1.collectTime, t1.AlarmNo, - t1.AlarmContent + t1.AlarmContent, + t2.drive_type FROM EquipmentAlarm t1 LEFT JOIN mdc_equipment t2 ON t1.EquipmentID = t2.equipment_id <where> @@ -41,7 +42,8 @@ t2.equipment_name, t1.collectTime, t1.AlarmNo, - t1.AlarmContent + t1.AlarmContent, + t2.drive_type FROM EquipmentAlarm t1 LEFT JOIN mdc_equipment t2 ON t1.EquipmentID = t2.equipment_id <where> diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/EquipmentAlarmServiceImpl.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/EquipmentAlarmServiceImpl.java index aa42389..0b4e3e9 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/EquipmentAlarmServiceImpl.java +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/EquipmentAlarmServiceImpl.java @@ -93,12 +93,14 @@ } IPage<EquipmentAlarmDto> pageList = this.baseMapper.pageList(page, equipmentAlarmVo); pageList.getRecords().forEach(item -> { - List<MdcAlarmInfo> mdcAlarmInfoList = mdcAlarmInfoService.list(new LambdaQueryWrapper<MdcAlarmInfo>().eq(MdcAlarmInfo::getAlarmCode, item.getAlarmNo()).eq(MdcAlarmInfo::getIsUse, CommonConstant.STATUS_0)); - if (mdcAlarmInfoList != null && !mdcAlarmInfoList.isEmpty()) { - item.setAlarmContent(mdcAlarmInfoList.get(0).getAlarmContent()); + if (StringUtils.isBlank(item.getAlarmContent())) { + List<MdcAlarmInfo> mdcAlarmInfoList = mdcAlarmInfoService.list(new LambdaQueryWrapper<MdcAlarmInfo>().eq(MdcAlarmInfo::getAlarmCode, item.getAlarmNo()).eq(MdcAlarmInfo::getDriveType, item.getDriveType()).eq(MdcAlarmInfo::getIsUse, CommonConstant.STATUS_0)); + if (mdcAlarmInfoList != null && !mdcAlarmInfoList.isEmpty()) { + item.setAlarmContent(mdcAlarmInfoList.get(0).getAlarmContent()); + } } }); - return this.baseMapper.pageList(page, equipmentAlarmVo); + return pageList; } @Override @@ -136,6 +138,16 @@ // Step.2 AutoPoi 瀵煎嚭Excel ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); List<EquipmentAlarmDto> equipmentAlarmDtos = this.baseMapper.list(equipmentAlarmVo); + if (equipmentAlarmDtos != null && !equipmentAlarmDtos.isEmpty()) { + for (EquipmentAlarmDto equipmentAlarmDto : equipmentAlarmDtos) { + if (StringUtils.isBlank(equipmentAlarmDto.getAlarmContent())) { + List<MdcAlarmInfo> mdcAlarmInfoList = mdcAlarmInfoService.list(new LambdaQueryWrapper<MdcAlarmInfo>().eq(MdcAlarmInfo::getAlarmCode, equipmentAlarmDto.getAlarmNo()).eq(MdcAlarmInfo::getDriveType, equipmentAlarmDto.getDriveType()).eq(MdcAlarmInfo::getIsUse, CommonConstant.STATUS_0)); + if (mdcAlarmInfoList != null && !mdcAlarmInfoList.isEmpty()) { + equipmentAlarmDto.setAlarmContent(mdcAlarmInfoList.get(0).getAlarmContent()); + } + } + } + } // 瀵煎嚭鏂囦欢鍚嶇О mv.addObject(NormalExcelConstants.FILE_NAME, "璁惧鎶ヨ鍒楄〃"); mv.addObject(NormalExcelConstants.CLASS, EquipmentAlarmDto.class); diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentServiceImpl.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentServiceImpl.java index ad9d45f..fb64d0d 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentServiceImpl.java +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentServiceImpl.java @@ -438,16 +438,16 @@ } map.put("value", value); runData.add(map); - if ("spindlebeilv".equals(englishName)) { + if ("spindlebeilv".equals(englishName) || "Sfeed".equals(englishName)) { result.put("spindlebeilv", value); } - if ("feedbeilv".equals(englishName)) { + if ("feedbeilv".equals(englishName) || "Ffeed".equals(englishName)) { result.put("feedbeilv", value); } if ("spindleload".equals(englishName)) { result.put("spindleload", value); } - if ("rapidfeed".equals(englishName)) { + if ("rapidfeed".equals(englishName) || "Rapidfeed".equals(englishName)) { result.put("rapidfeed", value); } } diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcOeeInfoServiceImpl.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcOeeInfoServiceImpl.java index b611f47..8408f2a 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcOeeInfoServiceImpl.java +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcOeeInfoServiceImpl.java @@ -217,7 +217,7 @@ mdcOeeInfo.setOpenLong(mdcEquipmentStatisticalShiftInfo.getOpenLong()); mdcOeeInfo.setCloseLong(mdcEquipmentStatisticalShiftInfo.getCloseLong()); //鑾峰彇璁惧鐢熶骇璁″垝 - mdcProductDayschedule = productDayScheduleList.stream().filter(productDayschedule -> productDayschedule.getOrderId().substring(8, 10).equals(id)).findAny().orElse(null); + mdcProductDayschedule = productDayScheduleList.stream().filter(productDayschedule -> productDayschedule.getOrderId().substring(productDayschedule.getOrderId().length() - 5, productDayschedule.getOrderId().length() - 3).equals(id)).findAny().orElse(null); if (mdcProductDayschedule == null) { continue; } diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdcJc/service/impl/MdcProductDayScheduleServiceImpl.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdcJc/service/impl/MdcProductDayScheduleServiceImpl.java index 89ab5c2..23169ee 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdcJc/service/impl/MdcProductDayScheduleServiceImpl.java +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdcJc/service/impl/MdcProductDayScheduleServiceImpl.java @@ -1,6 +1,7 @@ package org.jeecg.modules.mdcJc.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.jeecg.modules.mdc.mapper.MdcEquipmentMapper; import org.jeecg.modules.mdc.util.DateUtils; import org.jeecg.modules.mdcJc.entity.MdcProductDayschedule; import org.jeecg.modules.mdcJc.entity.ProductDayschedule; @@ -14,8 +15,7 @@ import java.math.BigDecimal; import java.math.RoundingMode; import java.time.LocalDate; -import java.util.ArrayList; -import java.util.List; +import java.util.*; /** * @author Lius @@ -26,6 +26,9 @@ @Resource private IClassMonthlyScheduleService classMonthlyScheduleService; + + @Resource + private MdcEquipmentMapper mdcEquipmentMapper; @Override @@ -40,10 +43,28 @@ this.removeBatchByIds(mdcListIds); } List<MdcProductDayschedule> mesC = new ArrayList<>(); + Map<String, String> map = new HashMap<>(); + map.put("5899-8026", "1818119280110690306"); + map.put("5899-8027", "1818119094416269313"); + map.put("5899-8060", "1818118942234337281"); + map.put("5899-8061", "1818119019862515714"); for (ProductDayschedule c : list) { - MdcProductDayschedule mdc = new MdcProductDayschedule(); - BeanMapper.copy(c, mdc); - mesC.add(mdc); + if (map.containsKey(c.getEquipmentId())) { + List<String> productionIds = Arrays.asList(map.get(c.getEquipmentId()).split(",")); + List<String> equipmentList = mdcEquipmentMapper.queryIdsByProductions(productionIds); + if (equipmentList != null && !equipmentList.isEmpty()) { + for (String equipmentId : equipmentList) { + MdcProductDayschedule mdc = new MdcProductDayschedule(); + BeanMapper.copy(c, mdc); + mdc.setEquipmentId(equipmentId); + mesC.add(mdc); + } + } + } else { + MdcProductDayschedule mdc = new MdcProductDayschedule(); + BeanMapper.copy(c, mdc); + mesC.add(mdc); + } } boolean b = this.saveBatch(mesC); return b; diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/screen/service/impl/MdcLargeScreenServiceImpl.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/screen/service/impl/MdcLargeScreenServiceImpl.java index 9bb45c8..50c8bc1 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/screen/service/impl/MdcLargeScreenServiceImpl.java +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/screen/service/impl/MdcLargeScreenServiceImpl.java @@ -18,6 +18,7 @@ import java.time.LocalDate; import java.util.ArrayList; import java.util.List; +import java.util.stream.Collectors; /** * @author Lius @@ -61,7 +62,7 @@ BigDecimal processCount = mdcLargeScreenMapper.findYesterdayProcessCount(yesterday); BigDecimal utilizationRate = BigDecimal.ZERO; if (equipmentCount != null && processCount != null) { - utilizationRate = processCount.divide(new BigDecimal("86400").multiply(equipmentCount), 0, RoundingMode.HALF_UP).multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP); + utilizationRate = processCount.divide(new BigDecimal("86400").multiply(equipmentCount), 4, RoundingMode.HALF_UP).multiply(new BigDecimal("100")).setScale(0, RoundingMode.HALF_UP); } yesterdayOverviewDto.setUtilizationRate(utilizationRate); return yesterdayOverviewDto; @@ -93,7 +94,9 @@ if (mdcProductDayschedule.getCompletionCount() != 0) { todayProductionPassRateDto.setPassRate(new BigDecimal(mdcProductDayschedule.getQualifiedCount()).divide(new BigDecimal(mdcProductDayschedule.getCompletionCount()), 0, RoundingMode.HALF_UP).multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP)); } - result.add(todayProductionPassRateDto); + if (!(todayProductionPassRateDto.getPassRate().compareTo(BigDecimal.ZERO) == 0)) { + result.add(todayProductionPassRateDto); + } } } return result; @@ -106,7 +109,8 @@ */ @Override public List<ClazzCompletionCountDto> todayClazzCompletionCount() { - return mdcLargeScreenMapper.todayClazzCompletionCount(today); + List<ClazzCompletionCountDto> result = mdcLargeScreenMapper.todayClazzCompletionCount(today); + return result.stream().filter(clazzCompletionCountDto -> clazzCompletionCountDto.getCompletionCount() != 0).collect(Collectors.toList()); } /** -- Gitblit v1.9.3