|
|
@ -5,6 +5,7 @@ import java.util.List;
|
|
|
|
|
|
|
|
|
|
|
|
import com.aucma.base.domain.BaseOrderInfo;
|
|
|
|
import com.aucma.base.domain.BaseOrderInfo;
|
|
|
|
import com.aucma.base.service.IBaseOrderInfoService;
|
|
|
|
import com.aucma.base.service.IBaseOrderInfoService;
|
|
|
|
|
|
|
|
import com.aucma.base.utils.MaterialConstants;
|
|
|
|
import com.aucma.common.exception.ServiceException;
|
|
|
|
import com.aucma.common.exception.ServiceException;
|
|
|
|
import com.aucma.common.exception.base.BaseException;
|
|
|
|
import com.aucma.common.exception.base.BaseException;
|
|
|
|
import com.aucma.common.utils.DateUtils;
|
|
|
|
import com.aucma.common.utils.DateUtils;
|
|
|
@ -139,12 +140,8 @@ public class ProductPlanInfoServiceImpl implements IProductPlanInfoService
|
|
|
|
if (baseBomInfoList.size() == 0){
|
|
|
|
if (baseBomInfoList.size() == 0){
|
|
|
|
throw new BaseException("请先维护生产BOM信息!");
|
|
|
|
throw new BaseException("请先维护生产BOM信息!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//-- 若一个工单可下达多计划:则需要根据工单编号和物料编号去重
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//检查生产BOM是否满足下计划条件
|
|
|
|
|
|
|
|
baseBomInfoService.checkBomInfo(baseBomInfoList);
|
|
|
|
|
|
|
|
//维护生产计划
|
|
|
|
|
|
|
|
for (BaseBomInfo baseBomInfo : baseBomInfoList) {
|
|
|
|
for (BaseBomInfo baseBomInfo : baseBomInfoList) {
|
|
|
|
|
|
|
|
if (baseBomInfo.getMaterialType().equals(MaterialConstants.BOX_MATERIAL_TYPE)){
|
|
|
|
ProductPlanInfo planInfo = new ProductPlanInfo();
|
|
|
|
ProductPlanInfo planInfo = new ProductPlanInfo();
|
|
|
|
planInfo.setPlanCode(PlanCodeUtils.getPlanCode());
|
|
|
|
planInfo.setPlanCode(PlanCodeUtils.getPlanCode());
|
|
|
|
planInfo.setOrderCode(orderCode);
|
|
|
|
planInfo.setOrderCode(orderCode);
|
|
|
@ -152,10 +149,37 @@ public class ProductPlanInfoServiceImpl implements IProductPlanInfoService
|
|
|
|
planInfo.setSaleorderLinenumber(saleOrderLineNumber);
|
|
|
|
planInfo.setSaleorderLinenumber(saleOrderLineNumber);
|
|
|
|
planInfo.setMaterialCode(baseBomInfo.getMaterialCode());
|
|
|
|
planInfo.setMaterialCode(baseBomInfo.getMaterialCode());
|
|
|
|
planInfo.setMaterialName(baseBomInfo.getMaterialName());
|
|
|
|
planInfo.setMaterialName(baseBomInfo.getMaterialName());
|
|
|
|
planInfo.setProductLineCode(baseBomInfo.getProductLineCode());
|
|
|
|
planInfo.setProductLineCode("1002");
|
|
|
|
planInfo.setPlanAmount(baseBomInfo.getStandardAmount() * orderAmount.longValue());
|
|
|
|
planInfo.setPlanAmount(baseBomInfo.getStandardAmount().longValue() * orderAmount.longValue());
|
|
|
|
|
|
|
|
this.insertProductPlanInfo(planInfo);
|
|
|
|
|
|
|
|
planInfo.setPlanCode(PlanCodeUtils.getPlanCode());
|
|
|
|
|
|
|
|
planInfo.setProductLineCode("1005");
|
|
|
|
this.insertProductPlanInfo(planInfo);
|
|
|
|
this.insertProductPlanInfo(planInfo);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BaseBomInfo bomInfo1 = new BaseBomInfo();
|
|
|
|
|
|
|
|
bomInfo1.setParentId(baseBomInfo.getMaterialCode());
|
|
|
|
|
|
|
|
List<BaseBomInfo> baseBomInfos = baseBomInfoService.selectBaseBomInfoList(bomInfo1);
|
|
|
|
|
|
|
|
for (BaseBomInfo info : baseBomInfos) {
|
|
|
|
|
|
|
|
if (info.getMaterialType().equals(MaterialConstants.COAMING_MATERIAL_TYPE)){
|
|
|
|
|
|
|
|
planInfo.setPlanCode(PlanCodeUtils.getPlanCode());
|
|
|
|
|
|
|
|
planInfo.setOrderCode(orderCode);
|
|
|
|
|
|
|
|
planInfo.setSaleOrderCode(saleOrderCode);
|
|
|
|
|
|
|
|
planInfo.setSaleorderLinenumber(saleOrderLineNumber);
|
|
|
|
|
|
|
|
planInfo.setMaterialCode(info.getMaterialCode());
|
|
|
|
|
|
|
|
planInfo.setMaterialName(info.getMaterialName());
|
|
|
|
|
|
|
|
planInfo.setProductLineCode("1001");
|
|
|
|
|
|
|
|
planInfo.setPlanAmount(baseBomInfo.getStandardAmount().longValue() * orderAmount.longValue());
|
|
|
|
|
|
|
|
this.insertProductPlanInfo(planInfo);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//-- 若一个工单可下达多计划:则需要根据工单编号和物料编号去重
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//检查生产BOM是否满足下计划条件
|
|
|
|
|
|
|
|
// baseBomInfoService.checkBomInfo(baseBomInfoList);
|
|
|
|
|
|
|
|
|
|
|
|
baseOrderInfo.setIsRelease(0L);
|
|
|
|
baseOrderInfo.setIsRelease(0L);
|
|
|
|
baseOrderInfoService.updateBaseOrderInfo(baseOrderInfo);
|
|
|
|
baseOrderInfoService.updateBaseOrderInfo(baseOrderInfo);
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|