生产日报表:实际人均效率计算错误修复

master
FCD 2 months ago
parent 7c8d5de4a3
commit 8fea737fb2

@ -488,10 +488,16 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService {
sumQua = sonMesReport.getQuantityFeedbackSum();
realQua = parentMesReport.getQuantityFeedbackSum();
workTime = sonMesReport.getWorkTime();
useMan = BigDecimal.ZERO;
if (parentMesReport.getUseMan() != null ){
useMan = sonMesReport.getUseMan().add(parentMesReport.getUseMan());
if(sonMesReport.getUseMan().compareTo(parentMesReport.getUseMan()) == 0){
useMan=sonMesReport.getUseMan();
}
if (sonMesReport.getUseMan() != null ){
useMan = sonMesReport.getUseMan().add(parentMesReport.getUseMan());
}
// if(sonMesReport.getUseMan().compareTo(parentMesReport.getUseMan()) == 0){
// useMan=sonMesReport.getUseMan();
// }
// 若 threeMesReport 不为空,则叠加其 useMan 值
if (threeMesReport != null && threeMesReport.getUseMan() != null) {
useMan = useMan.add(threeMesReport.getUseMan());
@ -527,7 +533,24 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService {
dto.setProductivity(productivity.toString()+"%");
// 总工时 实际用人*实际工时
dto.setTotalWorkTime(sonMesReport.getTotalWorkTime().toString());
BigDecimal totalWorkTime = BigDecimal.ZERO;
//人数*工时
if (parentMesReport.getTotalWorkTime() != null){
totalWorkTime = totalWorkTime.add(parentMesReport.getTotalWorkTime());
}
if (sonMesReport.getTotalWorkTime() != null){
totalWorkTime = totalWorkTime.add(sonMesReport.getTotalWorkTime());
}
if (threeMesReport != null && threeMesReport.getTotalWorkTime() != null ){
totalWorkTime = totalWorkTime.add(threeMesReport.getTotalWorkTime());
}
dto.setTotalWorkTime(totalWorkTime.toString());
// 标准人均效率 实际产量/标准用人/标准工时
BigDecimal manAvgStandard = null;
if(StringUtils.isNotBlank(dto.getManStandard())){
@ -541,7 +564,7 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService {
// 实际人均效率 实际产量/总工时
BigDecimal manAvgActual = new BigDecimal(realQua)
.divide(sonMesReport.getTotalWorkTime(),2,BigDecimal.ROUND_HALF_UP);
.divide(totalWorkTime,2,BigDecimal.ROUND_HALF_UP);
dto.setManAvgActual(manAvgActual.toString());
// 人均效率达成率 实际人均效率/标准人均效率
if(manAvgStandard!=null){

@ -860,9 +860,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getRealQuantity" resultType="com.op.mes.domain.dto.QuantityDto">
select sum(quantity_feedback) quantityFeedbackSum,
ROUND(sum(work_time*use_man)/sum(work_time), 2) useMan
ROUND(sum(work_time*use_man)/sum(work_time), 2) useMan,
-- sum(use_man) useMan,
SUM ( work_time * use_man ) totalWorkTime
from mes_report_work
where workorder_code = #{workorderCode} and del_flag = '0' and machine_code = #{machineCode}
<if test="board == null">

Loading…
Cancel
Save