diff --git a/op-modules/op-mes/src/main/java/com/op/mes/controller/MesLineAssistantQtyController.java b/op-modules/op-mes/src/main/java/com/op/mes/controller/MesLineAssistantQtyController.java index 7192afed..94707055 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/controller/MesLineAssistantQtyController.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/controller/MesLineAssistantQtyController.java @@ -212,8 +212,8 @@ public class MesLineAssistantQtyController extends BaseController { // workbook.dispose(); // } // } - ExcelUtil util = new ExcelUtil(MesDailyEfficiencyVo. class); - util.exportExcel(response, list, "生产日效率报表"); +// ExcelUtil util = new ExcelUtil(MesDailyEfficiencyVo. class); +// util.exportExcel(response, list, "生产日效率报表"); } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/domain/MesReportWork.java b/op-modules/op-mes/src/main/java/com/op/mes/domain/MesReportWork.java index 0c06acca..c606e6b3 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/domain/MesReportWork.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/domain/MesReportWork.java @@ -212,6 +212,15 @@ public class MesReportWork extends BaseEntity { private String version; private String sapCode; private String remark; + private String checkResult; + + public String getCheckResult() { + return checkResult; + } + + public void setCheckResult(String checkResult) { + this.checkResult = checkResult; + } public String getShiftName() { return shiftName; diff --git a/op-modules/op-mes/src/main/java/com/op/mes/domain/vo/MesDailyEfficiencyVo.java b/op-modules/op-mes/src/main/java/com/op/mes/domain/vo/MesDailyEfficiencyVo.java index 48e147bd..15bab0e8 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/domain/vo/MesDailyEfficiencyVo.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/domain/vo/MesDailyEfficiencyVo.java @@ -60,15 +60,15 @@ private static final long serialVersionUID=1L; @Excel(name = "产量达成率") private String completeRate; //一线 - @Excel(name = "标准工艺效率(PC/H)") + @Excel(name = "一线标准工艺效率(PC/H)") private String standEff; - @Excel(name = "标准用人") + @Excel(name = "一线标准用人") private String standMan; - @Excel(name = "实际用人") + @Excel(name = "一线实际用人") private String actMan; - @Excel(name = "产品标准工时") + @Excel(name = "一线产品标准工时") private String standHour; - @Excel(name = "产品实际工时") + @Excel(name = "一线产品实际工时") private String actHour; @Excel(name = "一线工时合计") private String oneHourSum; @@ -76,75 +76,75 @@ private static final long serialVersionUID=1L; private String oneStandEff; @Excel(name = "一线实际效率") private String oneActEff; - @Excel(name = "效率达成率") + @Excel(name = "一线效率达成率") private String effRate; //辅助 ////辅助用人数 @Excel(name = "辅助用人合计") private String assisManSum; - @Excel(name = "班长人数") + @Excel(name = "辅助班长人数") private String monitorQty; - @Excel(name = "组长人数") + @Excel(name = "辅助组长人数") private String groupleaderQty; - @Excel(name = "机操工人数") + @Excel(name = "辅助机操工人数") private String operateMachineQty; - @Excel(name = "物料员人数") + @Excel(name = "辅助物料员人数") private String materialQty; - @Excel(name = "配料员人数") + @Excel(name = "辅助配料员人数") private String materialDisQty; - @Excel(name = "配药员人数") + @Excel(name = "辅助配药员人数") private String pillDisQty; - @Excel(name = "药管员人数") + @Excel(name = "辅助药管员人数") private String pillMgrQty; - @Excel(name = "锅炉工人数") + @Excel(name = "辅助锅炉工人数") private String boilerQty; - @Excel(name = "石油气看管员人数") + @Excel(name = "辅助石油气看管员人数") private String oilQty; - @Excel(name = "库区管理员人数") + @Excel(name = "辅助库区管理员人数") private String wareMgrQty; - @Excel(name = "机修工人数") + @Excel(name = "辅助机修工人数") private String repairQty; - @Excel(name = "清洁工人数") + @Excel(name = "辅助清洁工人数") private String cleanerQty; ////辅助工时数 @Excel(name = "辅助工时合计") private String assisHourSum; - @Excel(name = "班长工时") + @Excel(name = "辅助班长工时") private String monitorHour; - @Excel(name = "组长工时") + @Excel(name = "辅助组长工时") private String groupleaderHour; - @Excel(name = "机操工工时") + @Excel(name = "辅助机操工工时") private String operateMachineHour; - @Excel(name = "物料员工时") + @Excel(name = "辅助物料员工时") private String materialHour; - @Excel(name = "配料员工时") + @Excel(name = "辅助配料员工时") private String materialDisHour; - @Excel(name = "配药员工时") + @Excel(name = "辅助配药员工时") private String pillDisHour; - @Excel(name = "药管员工时") + @Excel(name = "辅助药管员工时") private String pillMgrHour; - @Excel(name = "锅炉工工时") + @Excel(name = "辅助锅炉工工时") private String boilerHour; - @Excel(name = "石油气看管员工时") + @Excel(name = "辅助石油气看管员工时") private String oilHour; - @Excel(name = "库区管理员工时") + @Excel(name = "辅助库区管理员工时") private String wareMgrHour; - @Excel(name = "机修工工时") + @Excel(name = "辅助机修工工时") private String repairHour; - @Excel(name = "清洁工工时") + @Excel(name = "辅助清洁工工时") private String cleanerHour; //一线+辅助 - @Excel(name = "总工时") + @Excel(name = "一线+辅助总工时") private String hourSum; - @Excel(name = "效率提升基数") + @Excel(name = "一线+辅助效率提升基数") private String effUpBase; - @Excel(name = "提升目标") + @Excel(name = "一线+辅助提升目标") private String upGoal; - @Excel(name = "目标效率") + @Excel(name = "一线+辅助目标效率") private String goalRate; - @Excel(name = "实际效率") + @Excel(name = "一线+辅助实际效率") private String actRate; - @Excel(name = "效率提升率") + @Excel(name = "一线+辅助效率提升率") private String effUpRate; @Excel(name = "原因分析") private String reasonAnalysis; diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesLineAssistantQtyServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesLineAssistantQtyServiceImpl.java index 9994afd4..615fd4bb 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesLineAssistantQtyServiceImpl.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesLineAssistantQtyServiceImpl.java @@ -3,6 +3,7 @@ package com.op.mes.service.impl; import java.math.BigDecimal; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; import com.alibaba.nacos.common.utils.CollectionUtils; import com.baomidou.dynamic.datasource.annotation.DS; @@ -148,59 +149,67 @@ public class MesLineAssistantQtyServiceImpl implements IMesLineAssistantQtyServi hours = hours==null?BigDecimal.ZERO:hours; assistdto.setProductHour(hours.toString()); allProHours = allProHours.add(hours); + + } + for(MesLineAssistantQtyVo assistdto:dtos){ + //工时占比 + assistdto.setHourRatio(new BigDecimal(assistdto.getProductHour()) + .multiply(new BigDecimal("100.00")) + .divide(allProHours,2,BigDecimal.ROUND_HALF_UP) + .toString()+"%" + ); if(!assistMaps.isEmpty()){ MesLineAssistantQty manQty = assistMaps.get(mesLineAssistant.getProductDateStr()); if(manQty!=null){ - //班长用人=当日人数/线体数 + //班长用人=当日人数*工时占比 assistdto.setMonitorQty(new BigDecimal(manQty.getMonitorQty()) - .divide(new BigDecimal(dtos.size()),2,BigDecimal.ROUND_HALF_UP) + .multiply(new BigDecimal(assistdto.getHourRatio().replace("%",""))) .toString() ); - //班长工时=当日考勤小时数/线体数 + //班长工时=当日考勤小时数*工时占比 assistdto.setMonitorHour( - monitorHour.divide(new BigDecimal(dtos.size()),2,BigDecimal.ROUND_HALF_UP).toString()); - //组长用人=当日人数/线体数 + monitorHour.multiply( + new BigDecimal(assistdto.getHourRatio().replace("%",""))).toString()); + //组长用人=当日人数*工时占比 assistdto.setGroupleaderQty(new BigDecimal(manQty.getGroupleaderQty()) - .divide(new BigDecimal(dtos.size()),2,BigDecimal.ROUND_HALF_UP) + .multiply(new BigDecimal(assistdto.getHourRatio().replace("%",""))) .toString() ); - //组长工时=当日考勤小时数/线体数 + //组长工时=当日考勤小时数*工时占比 assistdto.setGroupLeaderHour( - groupleadeHour.divide(new BigDecimal(dtos.size()),2,BigDecimal.ROUND_HALF_UP).toString()); - //物料员用人=当日人数/线体数 + groupleadeHour.multiply( + new BigDecimal(assistdto.getHourRatio().replace("%",""))).toString()); + //物料员用人=当日人数*工时占比 assistdto.setMaterialQty(new BigDecimal(manQty.getMaterialQty()) - .divide(new BigDecimal(dtos.size()),2,BigDecimal.ROUND_HALF_UP) + .multiply(new BigDecimal(assistdto.getHourRatio().replace("%",""))) .toString() ); - //物料员工时=当日考勤小时数/线体数 + //物料员工时=当日考勤小时数*工时占比 assistdto.setMaterialHour( - materialHour.divide(new BigDecimal(dtos.size()),2,BigDecimal.ROUND_HALF_UP).toString()); - //药管员用人=当日人数/线体数 + materialHour.multiply( + new BigDecimal(assistdto.getHourRatio().replace("%",""))).toString()); + //药管员用人=当日人数*工时占比 assistdto.setPillMgrQty(new BigDecimal(manQty.getPillMgrQty()) - .divide(new BigDecimal(dtos.size()),2,BigDecimal.ROUND_HALF_UP) + .multiply(new BigDecimal(assistdto.getHourRatio().replace("%",""))) .toString() ); - //药管员工时=当日考勤小时数/线体数 + //药管员工时=当日考勤小时数*工时占比 assistdto.setPillMgrHour( - pillMgrHour.divide(new BigDecimal(dtos.size()),2,BigDecimal.ROUND_HALF_UP).toString()); - //配药员用人=当日人数/线体数 + pillMgrHour.multiply(new BigDecimal(assistdto.getHourRatio().replace("%",""))).toString()); + //配药员用人=当日人数*工时占比 assistdto.setPillDisQty(new BigDecimal(manQty.getPillDisQty()) - .divide(new BigDecimal(dtos.size()),2,BigDecimal.ROUND_HALF_UP) + .multiply(new BigDecimal(assistdto.getHourRatio().replace("%",""))) .toString() ); //配药员工时=当日考勤小时数/线体数 assistdto.setPillDisHour( - pillDisHour.divide(new BigDecimal(dtos.size()),2,BigDecimal.ROUND_HALF_UP).toString()); + pillDisHour.multiply( + new BigDecimal(assistdto.getHourRatio().replace("%",""))).toString()); } } } for(MesLineAssistantQtyVo assistdto:dtos){ - //工时占比 - assistdto.setHourRatio(new BigDecimal(assistdto.getProductHour()) - .multiply(new BigDecimal("100.00")) - .divide(allProHours,2,BigDecimal.ROUND_HALF_UP) - .toString()+"%" - ); + //辅助工时合计 assistdto.setMonitorHour(StringUtils.isEmpty(assistdto.getMonitorHour())?"0":assistdto.getMonitorHour()); assistdto.setGroupLeaderHour(StringUtils.isEmpty(assistdto.getGroupLeaderHour())?"0":assistdto.getGroupLeaderHour()); @@ -240,6 +249,14 @@ public class MesLineAssistantQtyServiceImpl implements IMesLineAssistantQtyServi assistdto0.setPillDisQty(manQty.getPillDisQty().toString()); assistdto0.setPillDisHour(pillDisHour.toString()); dtos.add(assistdto0); + if(StringUtils.isNotBlank(mesLineAssistant.getLineCode())){ + dtos = dtos.stream().filter(dto ->(dto.getLineCode().equals(mesLineAssistant.getLineCode()))) + .collect(Collectors.toList()); + } + if(StringUtils.isNotBlank(mesLineAssistant.getLineCode())){ + dtos = dtos.stream().filter(dto ->(dto.getLineCode().indexOf(mesLineAssistant.getProductName())>=0)) + .collect(Collectors.toList()); + } return dtos; } /**生产日效率报表**/ 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 5035d5f3..bbf40768 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 @@ -179,6 +179,7 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService { pTabs.setTitle("第"+i+"层工单信息"); mesReportWork.setParentOrder("0"); List liblist0 = mesReportWorkMapper.getReportList(mesReportWork); + pTabs.setLibList(liblist0); pTabs.setRemark(liblist0.get(0).getRemark()); tabs.add(pTabs); diff --git a/op-modules/op-mes/src/main/resources/mapper/mes/MesLineAssistantQtyMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/MesLineAssistantQtyMapper.xml index ce049510..488fe232 100644 --- a/op-modules/op-mes/src/main/resources/mapper/mes/MesLineAssistantQtyMapper.xml +++ b/op-modules/op-mes/src/main/resources/mapper/mes/MesLineAssistantQtyMapper.xml @@ -97,12 +97,13 @@ and be.department like concat('%',#{carCode},'%') + and pow.workorder_name is not null and pow.status in('w3','w4') + +