change - add生产BOM

main
yinq 6 months ago
parent d1d5a76f14
commit 1bad8a04aa

@ -45,6 +45,12 @@ public class ProdBomInfo extends BaseEntity {
@Excel(name = "物料类别") @Excel(name = "物料类别")
private String materialType; private String materialType;
/**
*
*/
@Excel(name = "计量单位")
private String materialUnit;
/** /**
* *
*/ */
@ -111,6 +117,14 @@ public class ProdBomInfo extends BaseEntity {
@Excel(name = "是否标识") @Excel(name = "是否标识")
private String isFlag; private String isFlag;
public String getMaterialUnit() {
return materialUnit;
}
public void setMaterialUnit(String materialUnit) {
this.materialUnit = materialUnit;
}
public String getParentCode() { public String getParentCode() {
return parentCode; return parentCode;
} }

@ -1,5 +1,6 @@
package com.os.mes.prod.service.impl; package com.os.mes.prod.service.impl;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.os.common.exception.base.BaseException; import com.os.common.exception.base.BaseException;
@ -51,16 +52,18 @@ public class ProdBomInfoServiceImpl implements IProdBomInfoService {
*/ */
@Override @Override
public List<ProdBomInfo> selectProductionBomTreeList(ProdBomInfo prodBomInfo) { public List<ProdBomInfo> selectProductionBomTreeList(ProdBomInfo prodBomInfo) {
List<ProdBomInfo> prodBomInfos = prodBomInfoMapper.selectProdBomInfoList(prodBomInfo); List<ProdBomInfo> prodBomInfoList = new ArrayList<>();
ProdBomInfo info = prodBomInfoMapper.selectProdBomInfoByObjId(prodBomInfo.getObjId());
prodBomInfoList.add(info);
try { try {
ProdBomInfo bomInfo = new ProdBomInfo(); ProdBomInfo bomInfo = new ProdBomInfo();
bomInfo.setAncestors(prodBomInfos.get(0).getObjId().toString()); bomInfo.setAncestors(info.getObjId().toString());
List<ProdBomInfo> infos = prodBomInfoMapper.selectProdBomInfoList(bomInfo); List<ProdBomInfo> infos = prodBomInfoMapper.selectProdBomInfoList(bomInfo);
prodBomInfos.addAll(infos); prodBomInfoList.addAll(infos);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
return prodBomInfos; return prodBomInfoList;
} }
/** /**

@ -37,7 +37,7 @@
bmi.material_unit, bmi.material_unit,
bmi.unit_price, bmi.unit_price,
bmi.material_specifications, bmi.material_specifications,
bmi.factory_code, pbl.plant_code factory_code,
bmi.product_line_code, bmi.product_line_code,
pbl.product_line_name, pbl.product_line_name,
bmi.is_flag, bmi.is_flag,

@ -10,6 +10,7 @@
<result property="materialCode" column="material_code"/> <result property="materialCode" column="material_code"/>
<result property="materialName" column="material_name"/> <result property="materialName" column="material_name"/>
<result property="materialType" column="material_type"/> <result property="materialType" column="material_type"/>
<result property="materialUnit" column="material_unit"/>
<result property="standardAmount" column="standard_amount"/> <result property="standardAmount" column="standard_amount"/>
<result property="parentId" column="parent_id"/> <result property="parentId" column="parent_id"/>
<result property="parentCode" column="parent_code"/> <result property="parentCode" column="parent_code"/>
@ -33,10 +34,9 @@
pbi.material_code, pbi.material_code,
bmi.material_name, bmi.material_name,
pbi.material_type, pbi.material_type,
bmi.material_unit,
pbi.standard_amount, pbi.standard_amount,
pbi.parent_id, pbi.parent_id,
pbi2.material_code parent_code,
pbi2.material_name parent_name,
bf.factory_code, bf.factory_code,
bf.factory_name, bf.factory_name,
pbi.sort, pbi.sort,
@ -50,7 +50,6 @@
pbi.update_time pbi.update_time
from prod_bom_info pbi from prod_bom_info pbi
left join base_material_info bmi on bmi.material_code = pbi.material_code left join base_material_info bmi on bmi.material_code = pbi.material_code
left join prod_bom_info pbi2 on pbi.obj_id = pbi2.parent_id
left join base_product_line bpl on bpl.product_line_code = bmi.product_line_code left join base_product_line bpl on bpl.product_line_code = bmi.product_line_code
left join base_factory bf on bf.factory_code = bpl.plant_code left join base_factory bf on bf.factory_code = bpl.plant_code
</sql> </sql>

Loading…
Cancel
Save