功能修改-sjx

liweidong
sunjianxi 2 days ago
parent 4a11bcdefd
commit 3f66c2f3ae
  1. 71
      blade-service/blade-scheduling/src/main/java/org/springblade/scheduling/scheduling/service/impl/WorkOrderServiceImpl.java

@ -635,6 +635,9 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
Boolean isOccupied = false; Boolean isOccupied = false;
List<EquipResourceEntity> resourceList = entry1.getValue(); List<EquipResourceEntity> resourceList = entry1.getValue();
for (EquipResourceEntity equipResource : resourceList) { for (EquipResourceEntity equipResource : resourceList) {
if(equipResource.getStartTime().compareTo(prevProcessEnd) <0){
continue;
}
//烧结订单需判断零件类型 //烧结订单需判断零件类型
if(order.getYieldType() != YieldOrderEnum.YIELD_TYPE_1.getCode()){ if(order.getYieldType() != YieldOrderEnum.YIELD_TYPE_1.getCode()){
//玻璃饼订单查询玻璃饼直径,壳体查询最大外径 //玻璃饼订单查询玻璃饼直径,壳体查询最大外径
@ -664,11 +667,11 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
if(order.getYieldType() != YieldOrderEnum.YIELD_TYPE_1.getCode()){ if(order.getYieldType() != YieldOrderEnum.YIELD_TYPE_1.getCode()){
Double personHours = 0.0; Double personHours = 0.0;
if("箱式排腊玻化工序".equals(processMap.get(craft.getPpsId()))){ if("箱式排腊玻化工序".equals(processMap.get(craft.getPpsId()))){
personHours = calPersonHoursByXsplbh(order,part); personHours = calPersonHoursByXsplbh(capacity.intValue(),part);
}else if("真空炉灌胶".equals(processMap.get(craft.getPpsId()))){ }else if("真空炉灌胶".equals(processMap.get(craft.getPpsId()))){
personHours = calPersonHoursByZklgj(order,part); personHours = calPersonHoursByZklgj(capacity.intValue(),part);
}else{ }else{
personHours = calPersonHours(order,craft,part); personHours = calPersonHours(capacity.intValue(),craft,part);
} }
workPlan.setPlanEndTime(workPlan.getPlanEndTime().plusMinutes(personHours.longValue())); workPlan.setPlanEndTime(workPlan.getPlanEndTime().plusMinutes(personHours.longValue()));
} }
@ -783,21 +786,21 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
} }
}else{ }else{
if("玻璃封接组装".equals(processMap.get(craft.getPpsId()))){//玻璃封接组装单独计算 if("玻璃封接组装".equals(processMap.get(craft.getPpsId()))){//玻璃封接组装单独计算
totalTime = calPersonHoursByBlfjzz(order,part); totalTime = calPersonHoursByBlfjzz(order.getYpQty(),part);
}else if("箱式排腊玻化工序".equals(processMap.get(craft.getPpsId()))){ }else if("箱式排腊玻化工序".equals(processMap.get(craft.getPpsId()))){
totalTime = calPersonHoursByXsplbh(order,part); totalTime = calPersonHoursByXsplbh(order.getYpQty(),part);
}else if("玻璃封接卸模".equals(processMap.get(craft.getPpsId()))){ }else if("玻璃封接卸模".equals(processMap.get(craft.getPpsId()))){
totalTime = calPersonHoursByBlfjxm(order,part); totalTime = calPersonHoursByBlfjxm(order.getYpQty(),part);
}else if("玻璃封接灌胶".equals(processMap.get(craft.getPpsId()))){ }else if("玻璃封接灌胶".equals(processMap.get(craft.getPpsId()))){
totalTime = calPersonHoursByBlfjgj(order,part); totalTime = calPersonHoursByBlfjgj(order.getYpQty(),part);
}else if("真空炉灌胶".equals(processMap.get(craft.getPpsId()))){ }else if("真空炉灌胶".equals(processMap.get(craft.getPpsId()))){
totalTime = calPersonHoursByZklgj(order,part); totalTime = calPersonHoursByZklgj(order.getYpQty(),part);
}else if("单侧折针".equals(processMap.get(craft.getPpsId())) || "双侧折针".equals(processMap.get(craft.getPpsId()))){ }else if("单侧折针".equals(processMap.get(craft.getPpsId())) || "双侧折针".equals(processMap.get(craft.getPpsId()))){
totalTime = calPersonHoursByZz(order,part,processMap.get(craft.getPpsId())); totalTime = calPersonHoursByZz(order.getYpQty(),part,processMap.get(craft.getPpsId()));
}else if("玻璃封接电镀上挂".equals(processMap.get(craft.getPpsId()))){ }else if("玻璃封接电镀上挂".equals(processMap.get(craft.getPpsId()))){
totalTime = calPersonHoursByBlfjddsg(order,part); totalTime = calPersonHoursByBlfjddsg(order.getYpQty(),part);
}else{ }else{
totalTime = calPersonHours(order,craft,part); totalTime = calPersonHours(order.getYpQty(),craft,part);
} }
} }
@ -1766,11 +1769,11 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
} }
Double personHours = 0.0; Double personHours = 0.0;
if("箱式排腊玻化工序".equals(processMap.get(craft.getPpsId()))){ if("箱式排腊玻化工序".equals(processMap.get(craft.getPpsId()))){
personHours = calPersonHoursByXsplbh(order,part); personHours = calPersonHoursByXsplbh(order.getYpQty(),part);
}else if("真空炉灌胶".equals(processMap.get(craft.getPpsId()))){ }else if("真空炉灌胶".equals(processMap.get(craft.getPpsId()))){
personHours = calPersonHoursByZklgj(order,part); personHours = calPersonHoursByZklgj(order.getYpQty(),part);
}else{ }else{
personHours = calPersonHours(order,craft,part); personHours = calPersonHours(order.getYpQty(),craft,part);
} }
workPlan.setPlanEndTime(workPlan.getPlanEndTime().plusMinutes(personHours.longValue())); workPlan.setPlanEndTime(workPlan.getPlanEndTime().plusMinutes(personHours.longValue()));
workPlan.setWorkQty(0); workPlan.setWorkQty(0);
@ -1940,7 +1943,7 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
glassCakeOutClient.batchGeneratePreOutOrder(list); glassCakeOutClient.batchGeneratePreOutOrder(list);
} }
public Double calPersonHours(YieldOrderEntity order,YieldOrderCraftEntity craft,PartEntity part){ public Double calPersonHours(Integer qty,YieldOrderCraftEntity craft,PartEntity part){
Double personTime = 0.0; Double personTime = 0.0;
List<PersonAbilityEntity> personAbilityList = personAbilityService.list(Wrappers.<PersonAbilityEntity>lambdaQuery() List<PersonAbilityEntity> personAbilityList = personAbilityService.list(Wrappers.<PersonAbilityEntity>lambdaQuery()
.eq(PersonAbilityEntity::getWorkCenterId,craft.getWorkCenterId()) .eq(PersonAbilityEntity::getWorkCenterId,craft.getWorkCenterId())
@ -1953,7 +1956,7 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
List<PersonAbilityVO> voList = JsonUtil.readValue(personAbility.getStandardTime(), new TypeReference<List<PersonAbilityVO>>() {}); List<PersonAbilityVO> voList = JsonUtil.readValue(personAbility.getStandardTime(), new TypeReference<List<PersonAbilityVO>>() {});
for(PersonAbilityVO vo : voList){ for(PersonAbilityVO vo : voList){
if(part.getExternalDiameter() != null && part.getExternalDiameter() > vo.getStartNum() && part.getExternalDiameter() <= vo.getEndNum()){ if(part.getExternalDiameter() != null && part.getExternalDiameter() > vo.getStartNum() && part.getExternalDiameter() <= vo.getEndNum()){
personTime = Double.parseDouble(vo.getStandardTime()) * order.getYpQty() + personAbility.getPrepareTime().doubleValue(); personTime = Double.parseDouble(vo.getStandardTime()) * qty + personAbility.getPrepareTime().doubleValue();
break; break;
} }
} }
@ -1966,7 +1969,7 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
List<PersonAbilityVO> voList = JsonUtil.readValue(personAbility.getStandardTime(), new TypeReference<List<PersonAbilityVO>>() {}); List<PersonAbilityVO> voList = JsonUtil.readValue(personAbility.getStandardTime(), new TypeReference<List<PersonAbilityVO>>() {});
for(PersonAbilityVO vo : voList){ for(PersonAbilityVO vo : voList){
if(part.getBlbDiameter() != null && part.getBlbDiameter() >vo.getStartNum() && part.getBlbDiameter() <= vo.getEndNum()){ if(part.getBlbDiameter() != null && part.getBlbDiameter() >vo.getStartNum() && part.getBlbDiameter() <= vo.getEndNum()){
personTime = Double.parseDouble(vo.getStandardTime()) * order.getYpQty() + personAbility.getPrepareTime().doubleValue(); personTime = Double.parseDouble(vo.getStandardTime()) * qty + personAbility.getPrepareTime().doubleValue();
break; break;
} }
} }
@ -1990,7 +1993,7 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
List<PersonAbilityVO> voList = JsonUtil.readValue(personAbility.getStandardTime(), new TypeReference<List<PersonAbilityVO>>() {}); List<PersonAbilityVO> voList = JsonUtil.readValue(personAbility.getStandardTime(), new TypeReference<List<PersonAbilityVO>>() {});
for(PersonAbilityVO vo : voList){ for(PersonAbilityVO vo : voList){
if(quota > vo.getStartNum() && quota <= vo.getEndNum()){ if(quota > vo.getStartNum() && quota <= vo.getEndNum()){
personTime = Double.parseDouble(vo.getStandardTime()) * order.getYpQty() + personAbility.getPrepareTime().doubleValue(); personTime = Double.parseDouble(vo.getStandardTime()) * qty + personAbility.getPrepareTime().doubleValue();
break; break;
} }
} }
@ -2003,7 +2006,7 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
.eq(PersonAbilityEntity::getWorkCenterId,craft.getWorkCenterId()) .eq(PersonAbilityEntity::getWorkCenterId,craft.getWorkCenterId())
.eq(PersonAbilityEntity::getCraftId,craft.getCaId()) .eq(PersonAbilityEntity::getCraftId,craft.getCaId())
.eq(PersonAbilityEntity::getProcessId,craft.getPpsId())); .eq(PersonAbilityEntity::getProcessId,craft.getPpsId()));
personTime = Double.parseDouble(personAbility.getStandardTime()) * order.getYpQty() + personAbility.getPrepareTime().doubleValue(); personTime = Double.parseDouble(personAbility.getStandardTime()) * qty + personAbility.getPrepareTime().doubleValue();
} }
} }
return Math.ceil(personTime); return Math.ceil(personTime);
@ -2011,7 +2014,7 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
//玻璃封接组装 //玻璃封接组装
public Double calPersonHoursByBlfjzz(YieldOrderEntity order,PartEntity part){ public Double calPersonHoursByBlfjzz(Integer qty,PartEntity part){
Double result = 0.0; Double result = 0.0;
if (part != null && part.getId() != null) { if (part != null && part.getId() != null) {
List<PartRelationEntity> partRelationList = partRelationService.list(Wrappers.<PartRelationEntity>lambdaQuery().eq(PartRelationEntity::getPartId,part.getId())); List<PartRelationEntity> partRelationList = partRelationService.list(Wrappers.<PartRelationEntity>lambdaQuery().eq(PartRelationEntity::getPartId,part.getId()));
@ -2106,11 +2109,11 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
} }
} }
return Math.ceil(result * order.getYpQty()); return Math.ceil(result * qty);
} }
//箱式排腊玻化工序 //箱式排腊玻化工序
public Double calPersonHoursByXsplbh(YieldOrderEntity order,PartEntity part){ public Double calPersonHoursByXsplbh(Integer qty,PartEntity part){
Double result = 0.0; Double result = 0.0;
if (part != null && part.getId() != null && part.getBlbDiameter() != null) { if (part != null && part.getId() != null && part.getBlbDiameter() != null) {
Double n = part.getBlbDiameter(); Double n = part.getBlbDiameter();
@ -2135,11 +2138,11 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
} }
result = 0.6 + 0.6 * Math.pow(1.2, y); result = 0.6 + 0.6 * Math.pow(1.2, y);
} }
return Math.ceil(result * order.getYpQty() + 19); return Math.ceil(result * qty + 19);
} }
//玻璃封接卸模 //玻璃封接卸模
public Double calPersonHoursByBlfjxm(YieldOrderEntity order,PartEntity part){ public Double calPersonHoursByBlfjxm(Integer qty,PartEntity part){
Double result = 0.0; Double result = 0.0;
if (part != null && part.getId() != null) { if (part != null && part.getId() != null) {
List<PartRelationEntity> partRelationList = partRelationService.list(Wrappers.<PartRelationEntity>lambdaQuery().eq(PartRelationEntity::getPartId,part.getId())); List<PartRelationEntity> partRelationList = partRelationService.list(Wrappers.<PartRelationEntity>lambdaQuery().eq(PartRelationEntity::getPartId,part.getId()));
@ -2220,11 +2223,11 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
} }
} }
} }
return Math.ceil(result * order.getYpQty() + 3); return Math.ceil(result * qty + 3);
} }
//玻璃封接灌胶 //玻璃封接灌胶
public Double calPersonHoursByBlfjgj(YieldOrderEntity order,PartEntity part){ public Double calPersonHoursByBlfjgj(Integer qty,PartEntity part){
Double result = 0.0; Double result = 0.0;
if (part != null && part.getId() != null&&part.getExternalDiameter() != null) { if (part != null && part.getId() != null&&part.getExternalDiameter() != null) {
Double n = part.getExternalDiameter(); Double n = part.getExternalDiameter();
@ -2263,11 +2266,11 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
} }
} }
} }
return Math.ceil(result * order.getYpQty() + 4); return Math.ceil(result * qty + 4);
} }
//真空炉灌胶 //真空炉灌胶
public Double calPersonHoursByZklgj(YieldOrderEntity order,PartEntity part){ public Double calPersonHoursByZklgj(Integer qty,PartEntity part){
Double result = 0.0; Double result = 0.0;
if (part != null && part.getId() != null && part.getExternalDiameter() != null) { if (part != null && part.getId() != null && part.getExternalDiameter() != null) {
List<PartRelationEntity> partRelationList = partRelationService.list(Wrappers.<PartRelationEntity>lambdaQuery().eq(PartRelationEntity::getPartId,part.getId())); List<PartRelationEntity> partRelationList = partRelationService.list(Wrappers.<PartRelationEntity>lambdaQuery().eq(PartRelationEntity::getPartId,part.getId()));
@ -2297,7 +2300,7 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
if (n > 80) { if (n > 80) {
result = 15.6 + 1.5 * sumOfQuota; result = 15.6 + 1.5 * sumOfQuota;
} }
result = result * order.getYpQty() + 7; result = result * qty + 7;
} else { } else {
if (n <= 15) { if (n <= 15) {
result = 6.6 + 3.5 * sumOfQuota; result = 6.6 + 3.5 * sumOfQuota;
@ -2314,13 +2317,13 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
if (n > 80) { if (n > 80) {
result = 15.6 + 3.5 * sumOfQuota; result = 15.6 + 3.5 * sumOfQuota;
} }
result = result * order.getYpQty() + 10; result = result * qty + 10;
} }
} }
return Math.ceil(result); return Math.ceil(result);
} }
//单侧折针、双侧折针 //单侧折针、双侧折针
public Double calPersonHoursByZz(YieldOrderEntity order,PartEntity part,String processName){ public Double calPersonHoursByZz(Integer qty,PartEntity part,String processName){
Double result = 0.0; Double result = 0.0;
if (part != null && part.getId() != null) { if (part != null && part.getId() != null) {
List<PartRelationEntity> partRelationList = partRelationService.list(Wrappers.<PartRelationEntity>lambdaQuery().eq(PartRelationEntity::getPartId,part.getId())); List<PartRelationEntity> partRelationList = partRelationService.list(Wrappers.<PartRelationEntity>lambdaQuery().eq(PartRelationEntity::getPartId,part.getId()));
@ -2340,11 +2343,11 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
} }
} }
} }
return Math.ceil(result * order.getYpQty() + 2); return Math.ceil(result * qty + 2);
} }
//玻璃封接电镀上挂 //玻璃封接电镀上挂
public Double calPersonHoursByBlfjddsg(YieldOrderEntity order,PartEntity part){ public Double calPersonHoursByBlfjddsg(Integer qty,PartEntity part){
Double result = 0.0; Double result = 0.0;
if (part != null && part.getId() != null) { if (part != null && part.getId() != null) {
List<PartRelationEntity> partRelationList = partRelationService.list(Wrappers.<PartRelationEntity>lambdaQuery().eq(PartRelationEntity::getPartId,part.getId())); List<PartRelationEntity> partRelationList = partRelationService.list(Wrappers.<PartRelationEntity>lambdaQuery().eq(PartRelationEntity::getPartId,part.getId()));
@ -2357,7 +2360,7 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
result = (38 + 3 * sumOfQuota) / 60; result = (38 + 3 * sumOfQuota) / 60;
} }
} }
return Math.ceil(result * order.getYpQty() + 2); return Math.ceil(result * qty + 2);
} }
public static List<YieldOrderEntity> mergeYieldOrderList(List<YieldOrderEntity> originalList) { public static List<YieldOrderEntity> mergeYieldOrderList(List<YieldOrderEntity> originalList) {

Loading…
Cancel
Save