Commit e5e8cbd4 by wuwenlong

生产计划排产

parent 37e3a63a
......@@ -40,6 +40,15 @@ public enum ComputeTypeEnum {
return block;
}
public static ComputeTypeEnum getEnumByCode(Integer code){
for (ComputeTypeEnum en : ComputeTypeEnum.values()){
if(code.compareTo(en.code)==0){
return en;
}
}
return null;
}
public Integer getCode() {
return code;
}
......
package com.baosight.hggp.hg.sc.tools;
import com.baosight.hggp.common.ComputeTypeEnum;
import com.baosight.hggp.common.ProductTypeEnum;
import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils;
......@@ -393,14 +394,20 @@ public class HGSCTools {
if(StringUtils.equals(product.getInventCode(),planInfo.getProductCode())){
//额定工时
BigDecimal timing = sj.getStandardJob().multiply(sj.getStandardDays()).divide(sj.getStandardNum());
if(StringUtils.equals(sj.getUnit(),"米")) {
workHour.set(product.getLength().multiply(new BigDecimal(planInfo.getQuantity())).multiply(unitConver).multiply(composingCoeff)
.divide(timing)
.multiply(baseWorkHour).add(finalRemainder));
}else{
workHour.set(new BigDecimal(planInfo.getQuantity()).multiply(composingCoeff)
.divide(timing)
.multiply(baseWorkHour).add(finalRemainder));
ComputeTypeEnum computeType = ComputeTypeEnum.getEnumByCode(sj.getComputeType());
switch (computeType){
case CD:
workHour.set(product.getLength().multiply(new BigDecimal(planInfo.getQuantity())).multiply(unitConver).multiply(composingCoeff)
.divide(timing)
.multiply(baseWorkHour).add(finalRemainder));
break;
case SL:
workHour.set(new BigDecimal(planInfo.getQuantity()).multiply(composingCoeff)
.divide(timing)
.multiply(baseWorkHour).add(finalRemainder));
break;
default:
break;
}
}
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment