|
|
@ -165,46 +165,44 @@ public class BasicdataWarehouseClient implements IBasicdataWarehouseClient { |
|
|
|
return warehouseWarehouseService.clearWarehouseCache(); |
|
|
|
return warehouseWarehouseService.clearWarehouseCache(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
@GetMapping(WAREHOUSEBYDEPARTMENT) |
|
|
|
|
|
|
|
public BasicdataWarehouseEntity getWarehouseByDepartment(String deptId) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String key =RedisKeyConstant.BASIC_DATA_WAREHOUSE_LIST_KEY + deptId; |
|
|
|
|
|
|
|
BasicdataWarehouseEntity o = bladeRedis.get(key); |
|
|
|
|
|
|
|
log.info(">>> 获取的仓库的信息 o ={}",o); |
|
|
|
|
|
|
|
if(ObjectUtils.isNull(o)){ |
|
|
|
|
|
|
|
QueryWrapper<BasicdataWarehouseEntity> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
|
|
|
queryWrapper.eq("department",deptId) |
|
|
|
|
|
|
|
.eq("is_deleted",0) |
|
|
|
|
|
|
|
.eq("enable_status",2); |
|
|
|
|
|
|
|
List<BasicdataWarehouseEntity> list = warehouseWarehouseService.list(queryWrapper); |
|
|
|
|
|
|
|
if(!Objects.isNull(list) && !list.isEmpty()){ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 寻找中心仓
|
|
|
|
|
|
|
|
for (BasicdataWarehouseEntity basicdataWarehouseEntity : list) { |
|
|
|
|
|
|
|
if("2".equals(basicdataWarehouseEntity.getFunctionType())){ |
|
|
|
|
|
|
|
o = basicdataWarehouseEntity; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// 找不到 就去第一个
|
|
|
|
|
|
|
|
if(ObjectUtils.isNull(o)){ |
|
|
|
|
|
|
|
o= list.get(0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 设定缓存时间 1小时的缓存时间
|
|
|
|
|
|
|
|
bladeRedis.setEx(key,o, 60 * 60L); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return o; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// @Override
|
|
|
|
|
|
|
|
// @GetMapping(WAREHOUSEBYDEPARTMENT)
|
|
|
|
|
|
|
|
// public BasicdataWarehouseEntity getWarehouseByDepartment(String deptId) {
|
|
|
|
} |
|
|
|
// String key =RedisKeyConstant.BASIC_DATA_WAREHOUSE_LIST_KEY + deptId;
|
|
|
|
|
|
|
|
// BasicdataWarehouseEntity o = bladeRedis.get(key);
|
|
|
|
|
|
|
|
// log.info(">>> 获取的仓库的信息 o ={}",o);
|
|
|
|
|
|
|
|
// if(ObjectUtils.isNull(o)){
|
|
|
|
|
|
|
|
// QueryWrapper<BasicdataWarehouseEntity> queryWrapper = new QueryWrapper<>();
|
|
|
|
|
|
|
|
// queryWrapper.eq("department",deptId)
|
|
|
|
|
|
|
|
// .eq("is_deleted",0)
|
|
|
|
|
|
|
|
// .eq("enable_status",2);
|
|
|
|
|
|
|
|
// List<BasicdataWarehouseEntity> list = warehouseWarehouseService.list(queryWrapper);
|
|
|
|
|
|
|
|
// if(!Objects.isNull(list) && !list.isEmpty()){
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// // 寻找中心仓
|
|
|
|
|
|
|
|
// for (BasicdataWarehouseEntity basicdataWarehouseEntity : list) {
|
|
|
|
|
|
|
|
// if("2".equals(basicdataWarehouseEntity.getFunctionType())){
|
|
|
|
|
|
|
|
// o = basicdataWarehouseEntity;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// // 找不到 就去第一个
|
|
|
|
|
|
|
|
// if(ObjectUtils.isNull(o)){
|
|
|
|
|
|
|
|
// o= list.get(0);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// // 设定缓存时间 1小时的缓存时间
|
|
|
|
|
|
|
|
// bladeRedis.setEx(key,o, 60 * 60L);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// return o;
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public BasicdataWarehouseEntity getEntityWarehouseId(Long warehouseId) { |
|
|
|
public BasicdataWarehouseEntity getEntityWarehouseId(Long warehouseId) { |
|
|
|