change - 改下达生产计划

master
yinq 10 months ago
parent a25e66aaaf
commit 64726cd810

@ -58,17 +58,29 @@ public class ProductPlanInfo extends BaseEntity {
@Excel(name = "物料名称")
private String materialName;
/**
* 线
*/
@Excel(name = "产线编号")
private String productLineCode;
/**
* 线
*/
@Excel(name = "产线名称")
private String productLineName;
/**
*
*/
@Excel(name = "计划工位编号")
private String productLineCode;
private String stationCode;
/**
*
*/
@Excel(name = "计划工位名称")
private String productLineName;
private String stationName;
/**
*
@ -128,6 +140,23 @@ public class ProductPlanInfo extends BaseEntity {
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date updatedTime;
public String getStationCode() {
return stationCode;
}
public void setStationCode(String stationCode) {
this.stationCode = stationCode;
}
public String getStationName() {
return stationName;
}
public void setStationName(String stationName) {
this.stationName = stationName;
}
public String getProductLineName() {
return productLineName;
}

@ -130,36 +130,60 @@ public class ProductPlanInfoServiceImpl implements IProductPlanInfoService {
if (baseBomInfoList.size() == 0) {
throw new ServiceException("生产BOM信息不完整请先维护生产BOM信息");
}
bomInfo.setIsPlanToStation(null);
List<BaseBomInfo> baseBomInfos = baseBomInfoService.selectBaseBomInfoList(bomInfo);
BaseBomInfo bom = new BaseBomInfo();
bom.setAncestors(baseOrderInfo.getMaterialCode());
List<BaseBomInfo> baseBomInfos = baseBomInfoService.selectBaseBomInfoList(bom);
try {
for (BaseBomInfo baseBomInfo : baseBomInfos) {
if (baseBomInfo.getMaterialType().equals(MaterialConstants.BOX_MATERIAL_TYPE)) {
ProductPlanInfo planInfo = new ProductPlanInfo();
planInfo.setPlanCode(PlanCodeUtils.getPlanCode());
planInfo.setOrderCode(orderCode);
planInfo.setSaleOrderCode(saleOrderCode);
planInfo.setSaleorderLinenumber(saleOrderLineNumber);
planInfo.setMaterialCode(baseBomInfo.getMaterialCode());
planInfo.setMaterialName(baseBomInfo.getMaterialName());
planInfo.setProductLineCode("1002");
planInfo.setPlanAmount(baseBomInfo.getStandardAmount().longValue() * orderAmount.longValue());
this.insertProductPlanInfo(planInfo);
planInfo.setPlanCode(PlanCodeUtils.getPlanCode());
planInfo.setProductLineCode("1005");
this.insertProductPlanInfo(planInfo);
//一线
if (StringUtils.isNotEmpty(baseOrderInfo.getWorkCenterCode()) && baseOrderInfo.getWorkCenterCode().equals("3101")) {
for (BaseBomInfo baseBomInfo : baseBomInfos) {
if (baseBomInfo.getMaterialType().equals(MaterialConstants.BOX_MATERIAL_TYPE)) {
ProductPlanInfo planInfo = new ProductPlanInfo();
planInfo.setPlanCode(PlanCodeUtils.getPlanCode());
planInfo.setOrderCode(orderCode);
planInfo.setSaleOrderCode(saleOrderCode);
planInfo.setSaleorderLinenumber(saleOrderLineNumber);
planInfo.setMaterialCode(baseBomInfo.getMaterialCode());
planInfo.setMaterialName(baseBomInfo.getMaterialName());
planInfo.setProductLineCode("1105");//箱体发泡
planInfo.setPlanAmount(baseBomInfo.getStandardAmount().longValue() * orderAmount.longValue());
this.insertProductPlanInfo(planInfo);
planInfo.setPlanCode(PlanCodeUtils.getPlanCode());
planInfo.setProductLineCode("1109");//成品下线扫描
this.insertProductPlanInfo(planInfo);
}
}
if (baseBomInfo.getMaterialType().equals(MaterialConstants.COAMING_MATERIAL_TYPE)) {
ProductPlanInfo plan = new ProductPlanInfo();
plan.setPlanCode(PlanCodeUtils.getPlanCode());
plan.setProductLineCode("1001");
plan.setOrderCode(orderCode);
plan.setSaleOrderCode(saleOrderCode);
plan.setSaleorderLinenumber(saleOrderLineNumber);
plan.setMaterialCode(baseBomInfo.getMaterialCode());
plan.setMaterialName(baseBomInfo.getMaterialName());
plan.setPlanAmount(baseBomInfo.getStandardAmount().longValue() * orderAmount.longValue());
this.insertProductPlanInfo(plan);
}
if (StringUtils.isNotEmpty(baseOrderInfo.getWorkCenterCode()) && baseOrderInfo.getWorkCenterCode().equals("3103")) {
for (BaseBomInfo baseBomInfo : baseBomInfos) {
if (baseBomInfo.getMaterialType().equals(MaterialConstants.COAMING_MATERIAL_TYPE)) {
ProductPlanInfo plan = new ProductPlanInfo();
plan.setPlanCode(PlanCodeUtils.getPlanCode());
plan.setProductLineCode("1001");// 前/后板自动成型
plan.setOrderCode(orderCode);
plan.setSaleOrderCode(saleOrderCode);
plan.setSaleorderLinenumber(saleOrderLineNumber);
plan.setMaterialCode(baseBomInfo.getMaterialCode());
plan.setMaterialName(baseBomInfo.getMaterialName());
plan.setPlanAmount(baseBomInfo.getStandardAmount().longValue() * orderAmount.longValue());
this.insertProductPlanInfo(plan);
}
if (baseBomInfo.getMaterialType().equals(MaterialConstants.BOX_MATERIAL_TYPE)) {
ProductPlanInfo planInfo = new ProductPlanInfo();
planInfo.setPlanCode(PlanCodeUtils.getPlanCode());
planInfo.setOrderCode(orderCode);
planInfo.setSaleOrderCode(saleOrderCode);
planInfo.setSaleorderLinenumber(saleOrderLineNumber);
planInfo.setMaterialCode(baseBomInfo.getMaterialCode());
planInfo.setMaterialName(baseBomInfo.getMaterialName());
planInfo.setProductLineCode("1005");// 箱体发泡
planInfo.setPlanAmount(baseBomInfo.getStandardAmount().longValue() * orderAmount.longValue());
this.insertProductPlanInfo(planInfo);
planInfo.setPlanCode(PlanCodeUtils.getPlanCode());
planInfo.setProductLineCode("1006");// 泡后库
this.insertProductPlanInfo(planInfo);
}
}
}
baseOrderInfo.setIsRelease(0L);

@ -12,7 +12,9 @@
<result property="saleorderLinenumber" column="saleorder_linenumber"/>
<result property="materialCode" column="material_code"/>
<result property="materialName" column="material_name"/>
<result property="productLineCode" column="productline_code"/>
<result property="stationCode" column="stationCode"/>
<result property="stationName" column="stationName"/>
<result property="productLineCode" column="productLineCode"/>
<result property="productLineName" column="productLineName"/>
<result property="planAmount" column="plan_amount"/>
<result property="completeAmount" column="complete_amount"/>
@ -33,8 +35,10 @@
pp.saleorder_linenumber,
pp.material_code,
pp.material_name,
pp.productline_code,
pl.PRODUCT_LINE_CODE productLineCode,
pl.PRODUCT_LINE_NAME productLineName,
st.PRODUCT_LINE_CODE stationCode,
st.PRODUCT_LINE_NAME stationName,
pp.plan_amount,
pp.complete_amount,
pp.begin_time,
@ -45,7 +49,8 @@
pp.updated_by,
pp.updated_time
from product_planinfo pp
left join BASE_PRODUCTLINE pl on pl.PRODUCT_LINE_CODE = pp.productline_code
left join BASE_PRODUCTLINE st on st.PRODUCT_LINE_CODE = pp.productline_code
left join BASE_PRODUCTLINE pl on pl.PRODUCT_LINE_CODE = st.PARENT_ID
</sql>
<select id="selectProductPlanInfoList" parameterType="ProductPlanInfo" resultMap="ProductPlanInfoResult">

Loading…
Cancel
Save