|
|
|
@ -184,19 +184,10 @@ public class InvWarehouseController extends BaseController {
|
|
|
|
|
filterInvSubWarehouseRequest.setAdvanceType(1);
|
|
|
|
|
}
|
|
|
|
|
List<InvWarehouseEntity> invWarehouseEntities = invWarehouseService.filterInvSubWarehouse(filterInvSubWarehouseRequest);
|
|
|
|
|
List<InvWarehouseEntity> invWarehouseEntities1 = new ArrayList<>();
|
|
|
|
|
for (InvWarehouseEntity invWarehouseEntity : invWarehouseEntities) {
|
|
|
|
|
if (!"".equals(invWarehouseEntity.getParentCode())) {
|
|
|
|
|
invWarehouseEntities1.add(invWarehouseEntity);
|
|
|
|
|
}
|
|
|
|
|
//领用仓库选择二级仓库的话,可以领用上一级中心库的产品
|
|
|
|
|
if (!filterInvWarehouseRequest.getLocInvCode().equals("1000000") && invWarehouseEntity.getCode().equals("1000000")) {
|
|
|
|
|
invWarehouseEntities1.add(invWarehouseEntity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<InvWarehouseEntity> results = new ArrayList<>();
|
|
|
|
|
if (CollUtil.isNotEmpty(invWarehouseEntities1)) {
|
|
|
|
|
invWarehouseEntities1.forEach(invWarehouseEntity -> {
|
|
|
|
|
if (CollUtil.isNotEmpty(invWarehouseEntities)) {
|
|
|
|
|
invWarehouseEntities.forEach(invWarehouseEntity -> {
|
|
|
|
|
if (!invWarehouseEntity.getCode().equals(filterInvWarehouseRequest.getLocInvCode())) {
|
|
|
|
|
results.add(invWarehouseEntity);
|
|
|
|
|
}
|
|
|
|
@ -205,6 +196,29 @@ public class InvWarehouseController extends BaseController {
|
|
|
|
|
return ResultVOUtils.success(results.stream().distinct().collect(Collectors.toList()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取上级仓库
|
|
|
|
|
*
|
|
|
|
|
* @param filterInvWarehouseRequest
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
|
@GetMapping("spms/inv/warehouse/findByUp")
|
|
|
|
|
public BaseResponse findByUp(FilterInvWarehouseRequest filterInvWarehouseRequest) {
|
|
|
|
|
if (StrUtil.isEmpty(filterInvWarehouseRequest.getLocInvCode())) {
|
|
|
|
|
return ResultVOUtils.error(500, "当前仓库不能为空!");
|
|
|
|
|
}
|
|
|
|
|
List<InvWarehouseEntity> invWarehouseEntities = new ArrayList<>();
|
|
|
|
|
InvWarehouseEntity invWarehouseEntity = invWarehouseService.findByInvSubByCode(filterInvWarehouseRequest.getLocInvCode());
|
|
|
|
|
if (invWarehouseEntity != null) {
|
|
|
|
|
InvWarehouseEntity invWarehouseEntity1 = invWarehouseService.findByInvSubByCode(invWarehouseEntity.getParentCode());
|
|
|
|
|
if (invWarehouseEntity1 != null)
|
|
|
|
|
invWarehouseEntities.add(invWarehouseEntity1);
|
|
|
|
|
}
|
|
|
|
|
return ResultVOUtils.success(invWarehouseEntities);
|
|
|
|
|
// return ResultVOUtils.error(500, "未找到!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
|
@GetMapping("spms/sub/inv/warehouse/filterSub")
|
|
|
|
|