From 156ed0e831d30167cb625050ad535ba9cf11ac27 Mon Sep 17 00:00:00 2001 From: zhaoxiaolin Date: Wed, 26 Jun 2024 13:01:00 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E6=97=A5=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E4=BA=BA=E5=91=98=E8=B0=83=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/op/mes/domain/dto/QuantityDto.java | 15 ++++++++++++--- .../com/op/mes/domain/vo/MesDailyReportVo.java | 6 +++--- .../service/impl/MesReportWorkServiceImpl.java | 9 ++++----- .../mapper/mes/MesReportWorkMapper.xml | 3 ++- .../com/op/plan/service/IProOrderService.java | 4 +++- .../com/op/quality/domain/QcStaticTable.java | 18 ++++++++++++++++++ .../op/quality/mapper/QcStaticTableMapper.java | 2 ++ .../service/impl/QcStaticTableServiceImpl.java | 14 ++++++++++++++ .../quality/QcCheckTaskProduceMapper.xml | 4 ++-- .../quality/QcCheckUnqualifiedMapper.xml | 4 ++-- .../mapper/quality/QcStaticTableMapper.xml | 6 ++++++ 11 files changed, 68 insertions(+), 17 deletions(-) diff --git a/op-modules/op-mes/src/main/java/com/op/mes/domain/dto/QuantityDto.java b/op-modules/op-mes/src/main/java/com/op/mes/domain/dto/QuantityDto.java index ad1001ab..4a789e6f 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/domain/dto/QuantityDto.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/domain/dto/QuantityDto.java @@ -5,9 +5,18 @@ import java.math.BigDecimal; public class QuantityDto { private Long quantityFeedbackSum; private BigDecimal workTime; - private Long useMan; + private BigDecimal useMan; private String workorderCode; private String machineCode; + private BigDecimal totalWorkTime; + + public BigDecimal getTotalWorkTime() { + return totalWorkTime; + } + + public void setTotalWorkTime(BigDecimal totalWorkTime) { + this.totalWorkTime = totalWorkTime; + } public Long getQuantityFeedbackSum() { return quantityFeedbackSum; @@ -25,11 +34,11 @@ public class QuantityDto { this.workTime = workTime; } - public Long getUseMan() { + public BigDecimal getUseMan() { return useMan; } - public void setUseMan(Long useMan) { + public void setUseMan(BigDecimal useMan) { this.useMan = useMan; } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/domain/vo/MesDailyReportVo.java b/op-modules/op-mes/src/main/java/com/op/mes/domain/vo/MesDailyReportVo.java index a74d8c7f..dde99c19 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/domain/vo/MesDailyReportVo.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/domain/vo/MesDailyReportVo.java @@ -48,7 +48,7 @@ public class MesDailyReportVo extends BaseEntity { //计划产量 // 标准用人 @Excel(name = "标准用人") - private Long useMan; + private BigDecimal useMan; // 标准效率 @Excel(name = "产线标准效率") private BigDecimal efficiency; @@ -393,11 +393,11 @@ public class MesDailyReportVo extends BaseEntity { this.quantitySplit = quantitySplit; } - public Long getUseMan() { + public BigDecimal getUseMan() { return useMan; } - public void setUseMan(Long useMan) { + public void setUseMan(BigDecimal useMan) { this.useMan = useMan; } 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 56f97b5d..b61159c8 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 @@ -434,7 +434,7 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService { // 实际工时 BigDecimal workTime = BigDecimal.ZERO; // 实际用人 - Long useMan = 0L; + BigDecimal useMan = BigDecimal.ZERO; if (sonMesReport != null && sonMesReport != null) { sumQua = sonMesReport.getQuantityFeedbackSum(); realQua = parentMesReport.getQuantityFeedbackSum(); @@ -464,9 +464,8 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService { .divide(workTime,2,BigDecimal.ROUND_HALF_UP); dto.setProductivity(productivity.toString()+"%"); // 总工时 实际用人*实际工时 - BigDecimal totalWorkTime = new BigDecimal(useMan) - .multiply(workTime); - dto.setTotalWorkTime(totalWorkTime.toString()); + + dto.setTotalWorkTime(sonMesReport.getTotalWorkTime().toString()); // 标准人均效率 实际产量/标准用人/标准工时 BigDecimal manAvgStandard = new BigDecimal(realQua) .divide(new BigDecimal(dto.getManStandard()),4,BigDecimal.ROUND_HALF_UP) @@ -474,7 +473,7 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService { dto.setManAvgStandard(manAvgStandard.toString()); // 实际人均效率 实际产量/总工时 BigDecimal manAvgActual = new BigDecimal(realQua) - .divide(totalWorkTime,2,BigDecimal.ROUND_HALF_UP); + .divide(sonMesReport.getTotalWorkTime(),2,BigDecimal.ROUND_HALF_UP); dto.setManAvgActual(manAvgActual.toString()); // 人均效率达成率 实际人均效率/标准人均效率 BigDecimal manAvgDo = manAvgActual 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 48aaeabf..86d9c912 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,7 +715,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select sum(quantity_feedback) quantityFeedbackSum, sum(work_time) workTime, - max(use_man) useMan + ROUND(sum(work_time*use_man)/sum(work_time), 2) useMan, + sum(work_time*use_man) totalWorkTime from mes_report_work where parent_order = #{workorderCode} and del_flag = '0' and machine_code = #{machineCode} diff --git a/op-modules/op-plan/src/main/java/com/op/plan/service/IProOrderService.java b/op-modules/op-plan/src/main/java/com/op/plan/service/IProOrderService.java index c3914056..ee548b89 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/service/IProOrderService.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/service/IProOrderService.java @@ -146,5 +146,7 @@ public interface IProOrderService { String checkRepeatBatchCodes(SplitOrderDTO splitOrderDTO); - List getCanProductLine(); + ProOrder getCanProductLine(ProOrder proOrder); + + R autoSplitOrder(ProOrder proOrder); } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcStaticTable.java b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcStaticTable.java index 9a69cc94..af74ce19 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcStaticTable.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcStaticTable.java @@ -105,6 +105,24 @@ public class QcStaticTable extends BaseEntity { private List dxData; private List details; private String[] projectNoArray; + private BigDecimal upperDiff; + private BigDecimal downDiff; + + public BigDecimal getUpperDiff() { + return upperDiff; + } + + public void setUpperDiff(BigDecimal upperDiff) { + this.upperDiff = upperDiff; + } + + public BigDecimal getDownDiff() { + return downDiff; + } + + public void setDownDiff(BigDecimal downDiff) { + this.downDiff = downDiff; + } public String getShiftId() { return shiftId; diff --git a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcStaticTableMapper.java b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcStaticTableMapper.java index 36b64150..f696c237 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcStaticTableMapper.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcStaticTableMapper.java @@ -77,4 +77,6 @@ public interface QcStaticTableMapper { List getDLTableTitle(QcStaticTable qcStaticTable); List getProjectList(String checkType); + + QcStaticTable getUpAndDown(QcStaticTable qcStaticTable); } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcStaticTableServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcStaticTableServiceImpl.java index ae7e83ed..f5048b84 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcStaticTableServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcStaticTableServiceImpl.java @@ -541,6 +541,20 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService { dxData.add(result); } dto.setDxData(dxData); + + //给折线图取上下限制 + if(qcStaticTable.getProjectNoArray()!=null){ + qcStaticTable.setProjectNo(qcStaticTable.getProjectNoArray()[0]); + QcStaticTable upandown = qcStaticTableMapper.getUpAndDown(qcStaticTable); + if(upandown!=null){ + dto.setUpperDiff(upandown.getUpperDiff()); + dto.setDownDiff(upandown.getDownDiff()); + }else{ + dto.setUpperDiff(BigDecimal.ZERO); + dto.setDownDiff(BigDecimal.ZERO); + } + } + return dto; } diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskProduceMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskProduceMapper.xml index d565954d..e1e48ab3 100644 --- a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskProduceMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskProduceMapper.xml @@ -436,8 +436,8 @@ left join base_equipment be on be.equipment_code = pow.workorder_name and be.equipment_type_code = 'equ_type_bzx' where pow.del_flag = '0' and pow.status = #{status} and pow.parent_order = '0' - and (pow.product_date = CONVERT(varchar(10),GETDATE(), 120) - or pow.product_date = CONVERT(varchar(10),DATEADD(DAY, -1, GETDATE()), 120)) + + and pow.product_date >= CONVERT(varchar(10),DATEADD(DAY, -1, GETDATE()), 120) +