diff --git a/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesReportWorkMapper.java b/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesReportWorkMapper.java index d11ffc30..2dc221e2 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesReportWorkMapper.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesReportWorkMapper.java @@ -180,7 +180,7 @@ public interface MesReportWorkMapper { QuantityDto getRealQuantity(QuantityDto quantityDto); - List getSumQuantity(QuantityDto quantityDto); + QuantityDto getSumQuantity(QuantityDto quantityDto); List getmonthProductionSut(MesMonthReportVo mesMonthReportVo); } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkServiceImpl.java index 60b10a77..56f97b5d 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkServiceImpl.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkServiceImpl.java @@ -425,8 +425,7 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService { quantityDto.setWorkorderCode(workorderCode); quantityDto.setMachineCode(machineCode); QuantityDto parentMesReport = mesReportWorkMapper.getRealQuantity(quantityDto); - List sonMesReportList = mesReportWorkMapper.getSumQuantity(quantityDto); - QuantityDto sonMesReport = sonMesReportList.stream().max(Comparator.comparingLong(QuantityDto::getUseMan)).orElse(null); + QuantityDto sonMesReport = mesReportWorkMapper.getSumQuantity(quantityDto); // 产量 Long sumQua = 0L; diff --git a/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml index 1f46a3f5..48aaeabf 100644 --- a/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml +++ b/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml @@ -715,10 +715,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select sum(quantity_feedback) quantityFeedbackSum, sum(work_time) workTime, - use_man useMan + max(use_man) useMan from mes_report_work where parent_order = #{workorderCode} and del_flag = '0' and machine_code = #{machineCode} - group by use_man