领用获取上级仓库

test
anthonywj 1 year ago
parent 4631e2dfcc
commit 70323f2e5f

@ -59,7 +59,7 @@ public class MasterDataSourceConfig {
sessionFactory.setConfiguration(configuration);
globalConfig.setSqlInjector(new CustomerSqlInjector());
sessionFactory.setGlobalConfig(globalConfig);
sessionFactory.setPlugins(mybatisPlusInterceptor());
// sessionFactory.setPlugins(mybatisPlusInterceptor());
sessionFactory.setMapperLocations(new PathMatchingResourcePatternResolver()
.getResources(MasterDataSourceConfig.MAPPER_LOCATION));
return sessionFactory.getObject();

@ -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")

@ -166,8 +166,7 @@ public class PurOrderReceiveController extends BaseController {
}
List<ReceiveResponse> data = receiveService.filterList(filterReceiveRequest);
PageInfo<ReceiveResponse> pageInfo;
pageInfo = new PageInfo<>(data);
PageInfo<ReceiveResponse> pageInfo = new PageInfo<>(data);
PageSimpleResponse<ReceiveResponse> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(data);

Loading…
Cancel
Save