Browse Source

1.托盘库存品

training
0.0 1 year ago
parent
commit
c3a6399d4a
  1. 5
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseGoodsAllocationClient.java
  2. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTrayController.java
  3. 25
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataTrayMapper.xml
  4. 35
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseGoodsAllocationController.java
  5. 6
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseGoodsAllocationClient.java
  6. 5
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseGoodsAllocationService.java
  7. 66
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseGoodsAllocationServiceImpl.java

5
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseGoodsAllocationClient.java

@ -46,5 +46,10 @@ public interface IWarehouseGoodsAllocationClient {
*/
@GetMapping(TOP)
BladePage<WarehouseGoodsAllocationEntity> top(@RequestParam("current") Integer current, @RequestParam("size") Integer size);
/**
* 跟新货位缓存
*/
@GetMapping(TOP+ "/updateAllocationCache")
Boolean updateAllocationCache(@RequestParam("ids") String ids);
}

2
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTrayController.java

@ -108,7 +108,7 @@ public class BasicdataTrayController extends BladeController {
@ApiOperation(value = "库存品列表", notes = "传入BasicdataTray")
public R<IPage<WarehouseStockListVO>> inventoryList(BasicdataTrayDTO BasicdataTray, Query query) {
IPage<WarehouseStockListVO> list = trayService.getinventoryList(Condition.getPage(query), BasicdataTray);
return R.data(list);
return R.data(WarehouseStockListWrapper.build().pageVO(list));
}

25
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataTrayMapper.xml

@ -107,7 +107,9 @@
ldpl.order_package_reservation_status orderPackageReservationStatus,
ldpl.order_package_loading_status orderPackageLoadingStatus,
lwga.column_num columnNum,
lwga.layer_num layerNum
lwga.layer_num layerNum,
lwtg.create_time operateTime,
lwtg.create_user operateUser
FROM
logpm_warehouse_tray_goods lwtg
JOIN logpm_distribution_parcel_list ldpl ON lwtg.association_id = ldpl.id
@ -168,15 +170,18 @@
ldsl.cargo_number cargoNumber,
ldsl.cargo_unit cargoUnit,
ldsl.cargo_norms cargoNorms,
ldsl.shopping_mall shoppingMall,
ldsl.market_name marketName,
ldsl.warehouse_name warehouseName,
lwug.position_code positionCode,
lwga.column_num columnNum,
lwga.layer_num layerNum
lwga.layer_num layerNum,
lwtg.create_time operateTime,
lwtg.num num,
lwtg.create_user operateUser
FROM
logpm_warehouse_tray_goods lwtg
JOIN logpm_distribution_stock_list ldsl ON lwtg.association_id = ldsl.id
left join (logpm_warehouse_updown_goods lwug join logpm_warehouse_goods_allocation lwga on lwug.allocation_id =lwga.id) on lwug.association_id = ldsl.id
JOIN logpm_distribution_stock_list ldsl ON lwtg.association_id = ldsl.material_id
left join (logpm_warehouse_updown_goods lwug join logpm_warehouse_goods_allocation lwga on lwug.allocation_id =lwga.id) on lwug.association_id = ldsl.material_id
<where>
ldsl.is_deleted = 0 and lwtg.is_deleted = 0 and lwtg.association_type = 4 and lwtg.tray_id = #{param.id}
<if test="param.cargoNumber !=null and param.cargoNumber != ''">
@ -208,7 +213,9 @@
ldsa.consignee_address consigneeAddress,
lwug.position_code positionCode,
lwga.column_num columnNum,
lwga.layer_num layerNum
lwga.layer_num layerNum,
lwtg.create_time operateTime,
lwtg.create_user operateUser
FROM
logpm_warehouse_tray_goods lwtg
JOIN logpm_distribution_stock_article ldsa ON lwtg.association_id = ldsa.id
@ -309,7 +316,7 @@
ldsl.cargo_number cargoNumber,
ldsl.cargo_unit cargoUnit,
ldsl.cargo_norms cargoNorms,
ldsl.shopping_mall shoppingMall,
ldsl.market_name marketName,
ldsl.warehouse_name warehouseName,
lwug.position_code positionCode,
lwga.column_num columnNum,
@ -324,8 +331,8 @@
lwtgl.num num
FROM
logpm_warehouse_tray_goods_log lwtgl
JOIN logpm_distribution_stock_list ldsl ON lwtgl.association_id = ldsl.id
left join (logpm_warehouse_updown_goods lwug join logpm_warehouse_goods_allocation lwga on lwug.allocation_id =lwga.id) on lwug.association_id = ldsl.id
JOIN logpm_distribution_stock_list ldsl ON lwtgl.association_id = ldsl.material_id
left join (logpm_warehouse_updown_goods lwug join logpm_warehouse_goods_allocation lwga on lwug.allocation_id =lwga.id) on lwug.association_id = ldsl.material_id
<where>
ldsl.is_deleted = 0 and lwtgl.is_deleted = 0 and lwtgl.association_type = 4 and lwtgl.tray_id = #{param.id}
<if test="param.sku !=null and param.sku != ''">

35
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseGoodsAllocationController.java

@ -213,8 +213,7 @@ public class WarehouseGoodsAllocationController extends BladeController {
R r = warehouseUpdownTypeService.upShelfOrder(upShelfOrderList, allocationId,myCurrentWarehouse.getId());
if (r.getCode() == 200) {
String prefix = Url+"/*";
bladeRedis.del(bladeRedis.keys(prefix));
warehouseGoodsAllocationService.updateAllocationCache(allocationId.toString());
}
return r;
}
@ -247,8 +246,7 @@ public class WarehouseGoodsAllocationController extends BladeController {
}
R r = warehouseUpdownTypeService.upShelfOrder(upShelfOrderList, allocationId,myCurrentWarehouse.getId());
if (r.getCode() == 200) {
String prefix = Url+"/*";
bladeRedis.del(bladeRedis.keys(prefix));
warehouseGoodsAllocationService.updateAllocationCache(allocationId.toString());
}
return r;
}
@ -273,8 +271,7 @@ public class WarehouseGoodsAllocationController extends BladeController {
R r = warehouseUpdownTypeService.upShelfPackage(upShelfPackageList, allocationId,myCurrentWarehouse.getId());
if (r.getCode() == 200) {
String prefix = Url+"/*";
bladeRedis.del(bladeRedis.keys(prefix));
warehouseGoodsAllocationService.updateAllocationCache(allocationId.toString());
}
return r;
}
@ -298,8 +295,7 @@ public class WarehouseGoodsAllocationController extends BladeController {
//上架托盘
R r = warehouseUpdownTypeService.upShelfTray(trayCode, allocationId,myCurrentWarehouse.getId());
if (r.getCode() == 200) {
String prefix = Url+"/*";
bladeRedis.del(bladeRedis.keys(prefix));
warehouseGoodsAllocationService.updateAllocationCache(allocationId.toString());
}
return r;
}
@ -324,8 +320,7 @@ public class WarehouseGoodsAllocationController extends BladeController {
//查询该库位的货物信息
R r = warehouseUpdownTypeService.upShelfStockList(upShelfStockList, allocationId,myCurrentWarehouse.getId());
if (r.getCode() == 200) {
String prefix = Url+"/*";
bladeRedis.del(bladeRedis.keys(prefix));
warehouseGoodsAllocationService.updateAllocationCache(allocationId.toString());
}
return r;
@ -351,8 +346,7 @@ public class WarehouseGoodsAllocationController extends BladeController {
//查询该库位的货物信息
R r = warehouseUpdownTypeService.upShelfZeroOrder(upShelfZeroOrderList, allocationId,myCurrentWarehouse.getId());
if (r.getCode() == 200) {
String prefix = Url+"/*";
bladeRedis.del(bladeRedis.keys(prefix));
warehouseGoodsAllocationService.updateAllocationCache(allocationId.toString());
}
return r;
}
@ -370,7 +364,7 @@ public class WarehouseGoodsAllocationController extends BladeController {
return R.data(bladeRedis.get(Url + "/" + warehouseGoodsAllocation.getGoodsShelfId()));
}
List<WarehouseGoodsAllocationVO> pages = warehouseGoodsAllocationService.selectVisualization(warehouseGoodsAllocation);
bladeRedis.setEx(Url +"/"+ warehouseGoodsAllocation.getGoodsShelfId(), pages, 300L);
bladeRedis.setEx(Url +"/"+ warehouseGoodsAllocation.getGoodsShelfId(), pages, 600L);
return R.data(pages);
}
@ -402,7 +396,7 @@ public class WarehouseGoodsAllocationController extends BladeController {
return R.data(bladeRedis.get(Url + "_cargoNub"));
}
List<WarehouseCargoSumVO> list = warehouseGoodsAllocationService.selectcargoNub();
bladeRedis.setEx(Url + "_cargoNub", list, 360L);
bladeRedis.setEx(Url + "_cargoNub", list, 600L);
return R.data(list);
}
@ -637,6 +631,19 @@ public class WarehouseGoodsAllocationController extends BladeController {
}
/**
* 货位 更新货位缓存
*/
@GetMapping("/updateAllocationCache")
@ApiOperationSupport(order = 32)
@ApiOperation(value = "更新货位缓存", notes = "传入货位ids")
public R updateAllocationCache(String ids) {
log.info("更新货位缓存>>>>>>{}",ids);
Boolean b = warehouseGoodsAllocationService.updateAllocationCache(ids);
return R.status(b);
}
/**
* 导出数据
*/

6
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseGoodsAllocationClient.java

@ -50,4 +50,10 @@ public class WarehouseGoodsAllocationClient implements IWarehouseGoodsAllocation
return BladePage.of(page);
}
@Override
@GetMapping(TOP+ "/updateAllocationCache")
public Boolean updateAllocationCache(String ids) {
return warehouseGoodsAllocationService.updateAllocationCache(ids);
}
}

5
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseGoodsAllocationService.java

@ -23,6 +23,7 @@ import com.logpm.warehouse.entity.WarehouseGoodsAllocationEntity;
import com.logpm.warehouse.excel.WarehouseGoodsAllocationExcel;
import com.logpm.warehouse.vo.*;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.tool.api.R;
import java.util.List;
@ -110,4 +111,8 @@ public interface IWarehouseGoodsAllocationService extends BaseService<WarehouseG
* 货位 统计每个货区数量
*/
List<WarehouseCargoSumVO> selectcargoNub();
/**
* 更新货位 缓存
*/
Boolean updateAllocationCache(String ids);
}

66
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseGoodsAllocationServiceImpl.java

@ -38,6 +38,8 @@ import com.logpm.warehouse.vo.*;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.stereotype.Service;
@ -56,12 +58,16 @@ import java.util.stream.Collectors;
@AllArgsConstructor
public class WarehouseGoodsAllocationServiceImpl extends BaseServiceImpl<WarehouseGoodsAllocationMapper, WarehouseGoodsAllocationEntity> implements IWarehouseGoodsAllocationService {
private final IWarehouseUpdownGoodsService warehouseUpdownGoodsService;
private final IBasicdataWarehouseClient basicdataWarehouseClient;
private final IWarehouseTrayGoodsService warehouseTrayGoodsService;
private final BladeRedis bladeRedis;
private static String Url = "warehouseGoodsAllocation";
@Override
public IPage<WarehouseGoodsAllocationVO> selectWarehouseGoodsAllocationPage(IPage<WarehouseGoodsAllocationVO> page, WarehouseGoodsAllocationVO warehouseGoodsAllocation) {
@ -100,20 +106,7 @@ public class WarehouseGoodsAllocationServiceImpl extends BaseServiceImpl<Warehou
// if (!map.containsKey(layerNum)) {
// map.put(layerNum, new ArrayList<>());
// }
WarehouseGoodsAllocationVO warehouseGoodsAllocationVO = new WarehouseGoodsAllocationVO();
Func.copy(warehouseGoodsAllocationEntity,warehouseGoodsAllocationVO);
//查询数量
WarehouseGoodsAllocationVO warehouseGoodsAllocationVOData = baseMapper.selectnum(warehouseGoodsAllocationEntity.getId());
warehouseGoodsAllocationVO.setOrderNum(warehouseGoodsAllocationVOData.getOrderNum());
warehouseGoodsAllocationVO.setInventoryNum(warehouseGoodsAllocationVOData.getInventoryNum());
warehouseGoodsAllocationVO.setLessNum(warehouseGoodsAllocationVOData.getLessNum());
warehouseGoodsAllocationVO.setPackageNum(warehouseGoodsAllocationVOData.getPackageNum());
//查询包条信息
List<WarehouseVisualizationVO> list = baseMapper.selectServe(warehouseGoodsAllocationVO.getId());
warehouseGoodsAllocationVO.setServeNub(list);
//查询库存品
List<WarehouseMaterialEntity>listCopyVOS =baseMapper.selectStockList(warehouseGoodsAllocationVO.getId());
warehouseGoodsAllocationVO.setInventoryName(listCopyVOS);
WarehouseGoodsAllocationVO warehouseGoodsAllocationVO = this.convert(warehouseGoodsAllocationEntity);
// map.get(layerNum).add(warehouseGoodsAllocationVO);
warehouseGoodsAllocationVOS.add(warehouseGoodsAllocationVO);
}
@ -357,6 +350,31 @@ public class WarehouseGoodsAllocationServiceImpl extends BaseServiceImpl<Warehou
return list;
}
@Override
public Boolean updateAllocationCache(String ids) {
//查询货位
List<WarehouseGoodsAllocationEntity> warehouseGoodsAllocationEntities = baseMapper.selectList(new QueryWrapper<WarehouseGoodsAllocationEntity>().lambda()
.eq(WarehouseGoodsAllocationEntity::getIsDeleted,0)
.in(WarehouseGoodsAllocationEntity::getId,ids)
);
for (WarehouseGoodsAllocationEntity warehouseGoodsAllocationEntity : warehouseGoodsAllocationEntities) {
if (null != bladeRedis.get(Url + "/" + warehouseGoodsAllocationEntity.getGoodsShelfId())) {
//转换当前货位的信息
WarehouseGoodsAllocationVO warehouseGoodsAllocationVO = this.convert(warehouseGoodsAllocationEntity);
List<WarehouseGoodsAllocationVO> warehouseGoodsAllocationVOList = bladeRedis.get(Url + "/" + warehouseGoodsAllocationEntity.getGoodsShelfId());
//替换货位
warehouseGoodsAllocationVOList = warehouseGoodsAllocationVOList.stream()
.map(obj -> obj.getId().equals(warehouseGoodsAllocationVO.getId()) ? warehouseGoodsAllocationVO : obj)
.collect(Collectors.toList());
//重新存入缓存
bladeRedis.setEx(Url +"/"+ warehouseGoodsAllocationEntity.getGoodsShelfId(), warehouseGoodsAllocationVOList, 600L);
log.info("货位缓存更新成功");
}
}
return true;
}
public List<Long> getMyWatchWarehouseIds(){
//获取当前登录人仓库
List<BasicdataWarehouseEntity> myWatchWarehouse = basicdataWarehouseClient.getMyWatchWarehouse();
@ -366,4 +384,22 @@ public class WarehouseGoodsAllocationServiceImpl extends BaseServiceImpl<Warehou
return collect;
}
public WarehouseGoodsAllocationVO convert(WarehouseGoodsAllocationEntity warehouseGoodsAllocationEntity){
WarehouseGoodsAllocationVO warehouseGoodsAllocationVO = new WarehouseGoodsAllocationVO();
Func.copy(warehouseGoodsAllocationEntity,warehouseGoodsAllocationVO);
//查询数量
WarehouseGoodsAllocationVO warehouseGoodsAllocationVOData = baseMapper.selectnum(warehouseGoodsAllocationEntity.getId());
warehouseGoodsAllocationVO.setOrderNum(warehouseGoodsAllocationVOData.getOrderNum());
warehouseGoodsAllocationVO.setInventoryNum(warehouseGoodsAllocationVOData.getInventoryNum());
warehouseGoodsAllocationVO.setLessNum(warehouseGoodsAllocationVOData.getLessNum());
warehouseGoodsAllocationVO.setPackageNum(warehouseGoodsAllocationVOData.getPackageNum());
//查询包条信息
List<WarehouseVisualizationVO> list = baseMapper.selectServe(warehouseGoodsAllocationVO.getId());
warehouseGoodsAllocationVO.setServeNub(list);
//查询库存品
List<WarehouseMaterialEntity>listCopyVOS =baseMapper.selectStockList(warehouseGoodsAllocationVO.getId());
warehouseGoodsAllocationVO.setInventoryName(listCopyVOS);
return warehouseGoodsAllocationVO;
}
}

Loading…
Cancel
Save