This commit is contained in:
luoliming 2024-03-04 21:25:18 +08:00
parent 0a756abf84
commit 548ecba0a4
3 changed files with 17 additions and 9 deletions

View File

@ -212,11 +212,11 @@ public class PBomApi extends BaseApi {
}
@PostMapping("saveAllocationFactoryNew")
@ApiOperation("分工厂-保存")
@ApiOperation("分工厂-批量保存保存")
@LogRecord(success = "PBom-分工厂-保存。操作结果:{{#_ret}}", bizNo = "",type = "PBom-分工厂-保存")
public ResultVO<Boolean> saveAllocationFactory(@Valid @RequestBody AllocationFactoryParam params){
return ResultVO.success(bomNewPbomParentService.saveAllocationFactory(params));
return ResultVO.success(bomNewPbomParentService.saveAllocationFactoryNew(params));
}
@PostMapping("allocationFactoryForRel")

View File

@ -15,6 +15,9 @@ public class SaveAllocationFactoryDTO {
@NotNull(message = "bom明细行ID不能为空")
private Long rowId;
@ApiModelProperty("bom版本行ID")
private Long bomRowId;
@ApiModelProperty("生产工厂")
@NotNull(message = "生产工厂不能为空")
private String productionFactoryCode;

View File

@ -620,15 +620,20 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
return saveAllocationFactory(params.getData());
}else {
params.getData().forEach(k->{
try {
List<BomNewPbomParentVO> allBom = this.getAllBomTree(k.getBomRowId());
List<Long> rowIds = allBom.stream().map(u -> u.getRowId()).collect(Collectors.toList());
if(CollUtil.isNotEmpty(rowIds)) {
pbomChildService.getBaseMapper().setProductionFactoryCode(k.getProductionFactoryCode(), rowIds);
}
} catch (ExecutionException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
});
}
// Map<String, List<SaveAllocationFactoryDTO>> stringListMap = ListCommonUtil.listGroupMap(params.equals(), SaveAllocationFactoryDTO::getProductionFactoryCode);
// for (Map.Entry<String, List<SaveAllocationFactoryDTO>> entry : stringListMap.entrySet()) {
// List<SaveAllocationFactoryDTO> saveList = entry.getValue();
// List<Long> rowIds = saveList.stream().map(u -> u.getRowId()).collect(Collectors.toList());
// pbomChildService.getBaseMapper().setProductionFactoryCode(entry.getKey(), rowIds);
// }
return true;
}