生产工单修改
This commit is contained in:
parent
380bd86a8e
commit
be209592ce
@ -58,10 +58,11 @@ public class ProWorkorderController extends BaseController
|
|||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('mes:pro:workorder:list')")
|
@PreAuthorize("@ss.hasPermi('mes:pro:workorder:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public AjaxResult list(ProWorkorder proWorkorder)
|
public TableDataInfo list(ProWorkorder proWorkorder)
|
||||||
{
|
{
|
||||||
|
startPage();
|
||||||
List<ProWorkorder> list = proWorkorderService.selectProWorkorderList(proWorkorder);
|
List<ProWorkorder> list = proWorkorderService.selectProWorkorderList(proWorkorder);
|
||||||
return AjaxResult.success(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -208,22 +209,27 @@ public class ProWorkorderController extends BaseController
|
|||||||
) {
|
) {
|
||||||
MdProductBom theBom = new MdProductBom();
|
MdProductBom theBom = new MdProductBom();
|
||||||
theBom.setBomItemId(bom.getItemId());
|
theBom.setBomItemId(bom.getItemId());
|
||||||
result.addAll(getBoms(theBom,bom.getQuantity()));
|
result.addAll(getBoms(theBom,bom.getQuantity(),0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return getDataTable(result);
|
return getDataTable(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<MdProductBom> getBoms(MdProductBom item,BigDecimal quantity){
|
private List<MdProductBom> getBoms(MdProductBom item,BigDecimal quantity,int count){
|
||||||
MdProductBom param = new MdProductBom();
|
MdProductBom param = new MdProductBom();
|
||||||
List<MdProductBom> results = new ArrayList<MdProductBom>();
|
List<MdProductBom> results = new ArrayList<MdProductBom>();
|
||||||
|
if(count >20){
|
||||||
|
return results;
|
||||||
|
}
|
||||||
param.setItemId(item.getBomItemId());
|
param.setItemId(item.getBomItemId());
|
||||||
List<MdProductBom> boms = mdProductBomService.selectMdProductBomList(param);
|
List<MdProductBom> boms = mdProductBomService.selectMdProductBomList(param);
|
||||||
if(CollUtil.isNotEmpty(boms)){
|
if(CollUtil.isNotEmpty(boms)){
|
||||||
|
//最多20层依赖
|
||||||
|
count ++;
|
||||||
for (MdProductBom bomItem: boms
|
for (MdProductBom bomItem: boms
|
||||||
) {
|
) {
|
||||||
bomItem.setQuantity(quantity.multiply(bomItem.getQuantity()));
|
bomItem.setQuantity(quantity.multiply(bomItem.getQuantity()));
|
||||||
results.addAll(getBoms(bomItem,bomItem.getQuantity()));
|
results.addAll(getBoms(bomItem,bomItem.getQuantity(),count));
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
results.add(item);
|
results.add(item);
|
||||||
|
Loading…
Reference in New Issue
Block a user