|
|
|
@ -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;
|
|
|
|
|
}
|
|
|
|
|
/**生产日效率报表**/
|
|
|
|
|