Browse Source

1.可视化修改

training
0.0 2 years ago
parent
commit
7f54ab93b4
  1. 40
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/WarehouseShelfVO.java
  2. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSigndetailMapper.xml
  3. 24
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseGoodsAllocationController.java
  4. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseGoodsAllocationMapper.java
  5. 13
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseGoodsAllocationMapper.xml
  6. 1
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsMapper.java
  7. 5
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsMapper.xml
  8. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseGoodsAllocationService.java
  9. 1
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseUpdownGoodsService.java
  10. 113
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseGoodsAllocationServiceImpl.java
  11. 5
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownGoodsServiceImpl.java

40
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/WarehouseShelfVO.java

@ -0,0 +1,40 @@
package com.logpm.warehouse.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
public class WarehouseShelfVO {
/**
* 总货位
*/
@ApiModelProperty(value = "总货位")
private Integer cargoNub;
/**
* 使用货位
*/
@ApiModelProperty(value = "使用货位")
private Integer employNub;
/**
* 可用货位
*/
@ApiModelProperty(value = "可用货位")
private Integer unusedNub;
/**
* 禁用货位
*/
@ApiModelProperty(value = "禁用货位")
private Integer disableNub;
/**
* 总货数量
*/
@ApiModelProperty(value = "总货数量")
private Integer goodsNub;
/**
* 货位list
*/
@ApiModelProperty(value = "货位list")
private List<WarehouseGoodsAllocationVO> list;
}

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSigndetailMapper.xml

@ -124,7 +124,7 @@
ldsa.warehouse warehouse,
ldsa.brand brand,
ldsa.complete_set completeSet,
ldsa.warehouse_entry_time_end warehouseEntryTimeEnd,
ldsa.warehouse_entry_time warehouseEntryTime,
ldsa.store_time storeTime,
ldr.consignee consignee,
ldr.delivery_phone deliveryPhone,

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

@ -358,13 +358,13 @@ public class WarehouseGoodsAllocationController extends BladeController {
@GetMapping("/Visualization")
@ApiOperationSupport(order = 17)
@ApiOperation(value = "货位 可视化", notes = "传入warehouseGoodsAllocation")
public R<List<WarehouseGoodsAllocationVO>> Visualization(WarehouseGoodsAllocationVO warehouseGoodsAllocation) {
public R<WarehouseShelfVO> Visualization(WarehouseGoodsAllocationVO warehouseGoodsAllocation) {
//log.info("传入参数>>>>>>>>>>>>{}", warehouseGoodsAllocation);
if (null != bladeRedis.get(Url + "/" + warehouseGoodsAllocation.getGoodsShelfId())) {
log.info("缓存取值>>>>>>>>>>"+Url + "/" + warehouseGoodsAllocation.getGoodsShelfId());
return R.data(bladeRedis.get(Url + "/" + warehouseGoodsAllocation.getGoodsShelfId()));
}
List<WarehouseGoodsAllocationVO> pages = warehouseGoodsAllocationService.selectVisualization(warehouseGoodsAllocation);
WarehouseShelfVO pages = warehouseGoodsAllocationService.selectVisualization(warehouseGoodsAllocation);
bladeRedis.setEx(Url +"/"+ warehouseGoodsAllocation.getGoodsShelfId(), pages, 600L);
return R.data(pages);
}
@ -376,12 +376,12 @@ public class WarehouseGoodsAllocationController extends BladeController {
@ApiOperationSupport(order = 18)
@ApiOperation(value = "货位 统计所有库位数量")
public R locationsnub() {
if (null !=bladeRedis.get(Url+"/locationsnub)")){
log.info("缓存取值>>>>>>>>>>");
return R.data(bladeRedis.get(Url+"/locationsnub"));
}
// if (null !=bladeRedis.get(Url+"/locationsnub)")){
// log.info("缓存取值>>>>>>>>>>");
// return R.data(bladeRedis.get(Url+"/locationsnub"));
// }
locationsnubVO locationsnubVO = warehouseGoodsAllocationService.selectlocationsnub();
bladeRedis.setEx(Url+"/locationsnub",locationsnubVO,360L);
// bladeRedis.setEx(Url+"/locationsnub",locationsnubVO,360L);
return R.data(locationsnubVO);
}
@ -392,12 +392,12 @@ public class WarehouseGoodsAllocationController extends BladeController {
@ApiOperationSupport(order = 19)
@ApiOperation(value = "货位 统计每个货区数量")
public R cargoNub() {
if (null != bladeRedis.get(Url + "_cargoNub")) {
log.info("缓存取值>>>>>>>>>>");
return R.data(bladeRedis.get(Url + "_cargoNub"));
}
// if (null != bladeRedis.get(Url + "_cargoNub")) {
// log.info("缓存取值>>>>>>>>>>");
// return R.data(bladeRedis.get(Url + "_cargoNub"));
// }
List<WarehouseCargoSumVO> list = warehouseGoodsAllocationService.selectcargoNub();
bladeRedis.setEx(Url + "_cargoNub", list, 600L);
// bladeRedis.setEx(Url + "_cargoNub", list, 600L);
return R.data(list);
}

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseGoodsAllocationMapper.java

@ -161,7 +161,7 @@ public interface WarehouseGoodsAllocationMapper extends BaseMapper<WarehouseGood
*
* @return
*/
List<WarehouseCargoSumVO> selectCargoSumId();
List<Long> selectCargoSumId();
List<BasicdataWarehouseEntity> AllWarehouse();
}

13
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseGoodsAllocationMapper.xml

@ -306,18 +306,19 @@
</where>
</select>
<select id="selectCargoSumId" resultType="com.logpm.warehouse.vo.WarehouseCargoSumVO">
select id
from logpm_warehouse_goods_area
WHERE is_deleted = 0
and enable_status = '1'
</select>
<select id="AllWarehouse" resultType="com.logpm.basicdata.entity.BasicdataWarehouseEntity">
select lww.* from logpm_warehouse_warehouse lww
<where>
lww.is_deleted = 0
</where>
</select>
<select id="selectCargoSumId" resultType="java.lang.Long">
select id
from logpm_warehouse_goods_area
WHERE is_deleted = 0
and enable_status = '1'
</select>
</mapper>

1
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsMapper.java

@ -92,6 +92,7 @@ public interface WarehouseUpdownGoodsMapper extends BaseMapper<WarehouseUpdownGo
ParcelListVO findAllUpShelfDataByOrderCode(@Param("orderCode") String orderCode);
Integer selectCountNumByshelf(@Param("goodsAreaId") Long goodsAreaId,@Param("goodsShelfId") Long goodsShelfId);
// /**

5
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsMapper.xml

@ -257,7 +257,7 @@
and ldsa.warehouse_id = #{warehouseId}
</select>
<select id="getNumByZation" resultType="java.lang.Integer">
select COALESCE (lwug.num ,0) from logpm_warehouse_updown_goods lwug join logpm_distribution_stock_list ldsl on lwug.association_id =ldsl.material_id WHERE ldsl.market_id = lwug.market_id and ldsl.id =#{id}
select COALESCE (sum(lwug.num),0) from logpm_warehouse_updown_goods lwug join logpm_distribution_stock_list ldsl on lwug.association_id =ldsl.material_id WHERE ldsl.market_id = lwug.market_id and ldsl.id =#{id}
</select>
<select id="findAllUpShelfDataByOrderCode" resultType="com.logpm.warehouse.vo.ParcelListVO">
@ -271,6 +271,9 @@
and ldsa.order_code = #{orderCode}
and lwta.id is not null
</select>
<select id="selectCountNumByshelf" resultType="java.lang.Integer">
select COALESCE (sum(lwug.num) ,0) from logpm_warehouse_updown_goods lwug where lwug.area_id = #{goodsAreaId} and lwug.shelf_id = #{goodsShelfId} and lwug.is_deleted =0
</select>
</mapper>

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

@ -54,7 +54,7 @@ public interface IWarehouseGoodsAllocationService extends BaseService<WarehouseG
/**
* 上架 可视化查询
*/
List<WarehouseGoodsAllocationVO> selectVisualization(WarehouseGoodsAllocationVO warehouseGoodsAllocation);
WarehouseShelfVO selectVisualization(WarehouseGoodsAllocationVO warehouseGoodsAllocation);
/**
* 上架 可视化查询 查询仓库
*/

1
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseUpdownGoodsService.java

@ -127,4 +127,5 @@ public interface IWarehouseUpdownGoodsService extends BaseService<WarehouseUpdow
ParcelListVO findAllUpShelfDataByOrderCode(String orderCode);
Integer selectCountNumByshelf(Long goodsAreaId, Long goodsShelfId);
}

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

@ -85,19 +85,28 @@ public class WarehouseGoodsAllocationServiceImpl extends BaseServiceImpl<Warehou
}
@Override
public List<WarehouseGoodsAllocationVO> selectVisualization(WarehouseGoodsAllocationVO warehouseGoodsAllocation) {
public WarehouseShelfVO selectVisualization(WarehouseGoodsAllocationVO warehouseGoodsAllocation) {
//获取当前登录人仓库
//BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getMyCurrentWarehouse();
WarehouseShelfVO warehouseShelfVO = new WarehouseShelfVO();
Long goodsAreaId = warehouseGoodsAllocation.getGoodsAreaId();
Long goodsShelfId = warehouseGoodsAllocation.getGoodsShelfId();
//查询所有货位
List<WarehouseGoodsAllocationEntity> warehouseGoodsAllocationEntities = baseMapper.selectList(new QueryWrapper<WarehouseGoodsAllocationEntity>().lambda()
.eq(WarehouseGoodsAllocationEntity::getIsDeleted, 0)
//.eq(null != basicdataWarehouseEntity,WarehouseGoodsAllocationEntity::getWarehouseId,basicdataWarehouseEntity.getId())
.eq(WarehouseGoodsAllocationEntity::getGoodsAreaId, warehouseGoodsAllocation.getGoodsAreaId())
.eq(WarehouseGoodsAllocationEntity::getGoodsShelfId, warehouseGoodsAllocation.getGoodsShelfId())
.eq(WarehouseGoodsAllocationEntity::getGoodsAreaId, goodsAreaId)
.eq(WarehouseGoodsAllocationEntity::getGoodsShelfId,goodsShelfId)
.orderByAsc(WarehouseGoodsAllocationEntity::getLayerNum)
.orderByAsc(WarehouseGoodsAllocationEntity::getColumnNum)
);
//获取货架的所有货位
//查询该货区下的总货位
locationsnubVO num1 = this.getNum(goodsAreaId, goodsShelfId);
Func.copy(num1,warehouseShelfVO);
//查询所有包件数量
Integer num = warehouseUpdownGoodsService.selectCountNumByshelf(goodsAreaId,goodsShelfId);
warehouseShelfVO.setGoodsNub(null==num?0:num);
//使用HashMap进行二维List分割
ArrayList<WarehouseGoodsAllocationVO> warehouseGoodsAllocationVOS = new ArrayList<>();
//HashMap<Integer, List<WarehouseGoodsAllocationVO>> map = new HashMap<>();
@ -107,13 +116,14 @@ public class WarehouseGoodsAllocationServiceImpl extends BaseServiceImpl<Warehou
// map.put(layerNum, new ArrayList<>());
// }
WarehouseGoodsAllocationVO warehouseGoodsAllocationVO = this.convert(warehouseGoodsAllocationEntity);
log.info("List>>>>>>>>>>>>>>>>>{}",warehouseGoodsAllocationVO);
// map.get(layerNum).add(warehouseGoodsAllocationVO);
warehouseGoodsAllocationVOS.add(warehouseGoodsAllocationVO);
}
warehouseShelfVO.setList(warehouseGoodsAllocationVOS);
log.info("list>>>>>>>>>>>>>>>>>>>>{}",warehouseShelfVO);
// ArrayList<List<WarehouseGoodsAllocationVO>> arrayListTwo = new ArrayList<>(map.values());
//log.info("排序后>>>>>>>>>>>>>>{}",map);
return warehouseGoodsAllocationVOS;
return warehouseShelfVO;
}
@Override
@ -284,26 +294,54 @@ public class WarehouseGoodsAllocationServiceImpl extends BaseServiceImpl<Warehou
@Override
public locationsnubVO selectlocationsnub() {
locationsnubVO locationsnubVO = this.getNum(null,null);
return locationsnubVO;
}
@Override
public List<WarehouseCargoSumVO> selectcargoNub() {
//查询所有货区id
List<Long> ids =baseMapper.selectCargoSumId();
ArrayList<WarehouseCargoSumVO> list = new ArrayList<>();
for (Long id : ids) {
WarehouseCargoSumVO warehouseCargoSumVO = new WarehouseCargoSumVO();
locationsnubVO locationsnubVO = this.getNum(id, null);
Func.copy(locationsnubVO,warehouseCargoSumVO);
warehouseCargoSumVO.setId(id);
list.add(warehouseCargoSumVO);
}
return list;
}
public locationsnubVO getNum(Long areaId,Long shelfId){
locationsnubVO locationsnubVO = new locationsnubVO();
//查询所有货位
//查询该货区下的总货位
Integer cargoNub = baseMapper.selectCount(new QueryWrapper<WarehouseGoodsAllocationEntity>().lambda()
.eq(WarehouseGoodsAllocationEntity::getIsDeleted, 0)
.eq(null != areaId,WarehouseGoodsAllocationEntity::getGoodsAreaId, areaId)
.eq(null != shelfId,WarehouseGoodsAllocationEntity::getGoodsShelfId, shelfId)
).intValue();
//查询所有使用货位
Integer employNub = baseMapper.selectCount(new QueryWrapper<WarehouseGoodsAllocationEntity>().lambda()
.eq(WarehouseGoodsAllocationEntity::getIsDeleted, 0)
.eq(WarehouseGoodsAllocationEntity::getAllocationStatus, 2)
.eq(null != areaId,WarehouseGoodsAllocationEntity::getGoodsAreaId, areaId)
.eq(null != shelfId,WarehouseGoodsAllocationEntity::getGoodsShelfId, shelfId)
).intValue();
//查询所有禁用
Integer disableNub = baseMapper.selectCount(new QueryWrapper<WarehouseGoodsAllocationEntity>().lambda()
.eq(WarehouseGoodsAllocationEntity::getIsDeleted, 0)
.eq(WarehouseGoodsAllocationEntity::getEnableStatus, 2)
.eq(null != areaId,WarehouseGoodsAllocationEntity::getGoodsAreaId, areaId)
.eq(null != shelfId,WarehouseGoodsAllocationEntity::getGoodsShelfId, shelfId)
).intValue();
//查询可用货位
Integer unusedNub = baseMapper.selectCount(new QueryWrapper<WarehouseGoodsAllocationEntity>().lambda()
.eq(WarehouseGoodsAllocationEntity::getIsDeleted, 0)
.eq(WarehouseGoodsAllocationEntity::getEnableStatus, 1)
.eq(WarehouseGoodsAllocationEntity::getAllocationStatus,1)
.eq(null != areaId,WarehouseGoodsAllocationEntity::getGoodsAreaId, areaId)
.eq(null != shelfId,WarehouseGoodsAllocationEntity::getGoodsShelfId, shelfId)
).intValue();
locationsnubVO.setCargoNub(cargoNub);
locationsnubVO.setEmployNub(employNub);
@ -312,46 +350,6 @@ public class WarehouseGoodsAllocationServiceImpl extends BaseServiceImpl<Warehou
return locationsnubVO;
}
@Override
public List<WarehouseCargoSumVO> selectcargoNub() {
//查询所有货区id
List<WarehouseCargoSumVO> list =baseMapper.selectCargoSumId();
for (WarehouseCargoSumVO warehouseCargoSumVO : list) {
Long id = warehouseCargoSumVO.getId();
//查询该货区下的总货位
Integer cargoNub = baseMapper.selectCount(new QueryWrapper<WarehouseGoodsAllocationEntity>().lambda()
.eq(WarehouseGoodsAllocationEntity::getIsDeleted, 0)
.eq(WarehouseGoodsAllocationEntity::getGoodsAreaId,id)
).intValue();
//查询所有使用货位
Integer employNub = baseMapper.selectCount(new QueryWrapper<WarehouseGoodsAllocationEntity>().lambda()
.eq(WarehouseGoodsAllocationEntity::getIsDeleted, 0)
.eq(WarehouseGoodsAllocationEntity::getAllocationStatus, 2)
.eq(WarehouseGoodsAllocationEntity::getGoodsAreaId,id)
).intValue();
//查询所有禁用
Integer disableNub = baseMapper.selectCount(new QueryWrapper<WarehouseGoodsAllocationEntity>().lambda()
.eq(WarehouseGoodsAllocationEntity::getIsDeleted, 0)
.eq(WarehouseGoodsAllocationEntity::getEnableStatus, 2)
.eq(WarehouseGoodsAllocationEntity::getGoodsAreaId,id)
).intValue();
//查询可用货位
Integer unusedNub = baseMapper.selectCount(new QueryWrapper<WarehouseGoodsAllocationEntity>().lambda()
.eq(WarehouseGoodsAllocationEntity::getIsDeleted, 0)
.eq(WarehouseGoodsAllocationEntity::getEnableStatus, 1)
.eq(WarehouseGoodsAllocationEntity::getAllocationStatus,1)
.eq(WarehouseGoodsAllocationEntity::getGoodsAreaId,id)
).intValue();
warehouseCargoSumVO.setCargoNub(cargoNub);
warehouseCargoSumVO.setEmployNub(employNub);
warehouseCargoSumVO.setDisableNub(disableNub);
warehouseCargoSumVO.setUnusedNub(unusedNub);
}
return list;
}
@Override
public Boolean updateAllocationCache(String ids) {
//查询货位
@ -360,16 +358,27 @@ public class WarehouseGoodsAllocationServiceImpl extends BaseServiceImpl<Warehou
.in(WarehouseGoodsAllocationEntity::getId,ids)
);
for (WarehouseGoodsAllocationEntity warehouseGoodsAllocationEntity : warehouseGoodsAllocationEntities) {
Long goodsAreaId = warehouseGoodsAllocationEntity.getGoodsAreaId();
Long goodsShelfId = warehouseGoodsAllocationEntity.getGoodsShelfId();
if (null != bladeRedis.get(Url + "/" + warehouseGoodsAllocationEntity.getGoodsShelfId())) {
//查询所有包件数量
//转换当前货位的信息
WarehouseGoodsAllocationVO warehouseGoodsAllocationVO = this.convert(warehouseGoodsAllocationEntity);
List<WarehouseGoodsAllocationVO> warehouseGoodsAllocationVOList = bladeRedis.get(Url + "/" + warehouseGoodsAllocationEntity.getGoodsShelfId());
WarehouseShelfVO warehouseShelfVO = bladeRedis.get(Url + "/" + warehouseGoodsAllocationEntity.getGoodsShelfId());
List<WarehouseGoodsAllocationVO> warehouseGoodsAllocationVOList = warehouseShelfVO.getList();
//替换货位
warehouseGoodsAllocationVOList = warehouseGoodsAllocationVOList.stream()
.map(obj -> obj.getId().equals(warehouseGoodsAllocationVO.getId()) ? warehouseGoodsAllocationVO : obj)
.collect(Collectors.toList());
warehouseGoodsAllocationVOList = warehouseGoodsAllocationVOList.stream().map(obj -> obj.getId().equals(warehouseGoodsAllocationVO.getId()) ? warehouseGoodsAllocationVO : obj).collect(Collectors.toList());
//计算数量
//查询该货区下的总货位
locationsnubVO num1 = this.getNum(goodsAreaId, goodsShelfId);
Func.copy(num1,warehouseShelfVO);
Integer num = warehouseUpdownGoodsService.selectCountNumByshelf(goodsAreaId,goodsShelfId);
warehouseShelfVO.setGoodsNub(null==num?0:num);
warehouseShelfVO.setList(warehouseGoodsAllocationVOList);
//重新存入缓存
bladeRedis.setEx(Url +"/"+ warehouseGoodsAllocationEntity.getGoodsShelfId(), warehouseGoodsAllocationVOList, 600L);
bladeRedis.setEx(Url +"/"+ warehouseGoodsAllocationEntity.getGoodsShelfId(), warehouseShelfVO, 600L);
log.info("货位缓存更新成功");
}
}

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

@ -219,4 +219,9 @@ public class WarehouseUpdownGoodsServiceImpl extends BaseServiceImpl<WarehouseUp
return baseMapper.findAllUpShelfDataByOrderCode(orderCode);
}
@Override
public Integer selectCountNumByshelf(Long goodsAreaId, Long goodsShelfId) {
return baseMapper.selectCountNumByshelf(goodsAreaId,goodsShelfId);
}
}

Loading…
Cancel
Save