Browse Source

货位可视化增加仓库字段,备货导出增加字段

single_db
汤建军 1 year ago
parent
commit
d2520d2453
  1. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockupController.java
  2. 33
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistributionCityExcel.java
  3. 11
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml
  4. 5
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseGoodsAllocationController.java
  5. 9
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseGoodsAllocationMapper.java
  6. 49
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseGoodsAllocationMapper.xml
  7. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseGoodsAllocationService.java
  8. 93
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseGoodsAllocationServiceImpl.java

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockupController.java

@ -187,7 +187,7 @@ public class DistributionStockupController extends BladeController {
ExcelUtil.export(response, "商配备货数据" + DateUtil.time(), "商配备货数据表", listMarket, DistributionMarketExcel.class);
break;
case "2":
List<DistributionCityExcel> listCity = distributionStockupService.exportCity(paramMap);
List<DistributionCityExcel> listCity = distributionStockupService.exportCity(paramMap);
ExcelUtil.export(response, "市配备货数据" + DateUtil.time(), "市配备货数据表", listCity, DistributionCityExcel.class);
break;
case "3":

33
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistributionCityExcel.java

@ -86,4 +86,37 @@ public class DistributionCityExcel implements Serializable {
private Date assignTime;
@ColumnWidth(20)
@ExcelProperty("库存品数量")
private Integer inventoryNum;
@ColumnWidth(20)
@ExcelProperty("包件数量")
private Integer packageNum;
@ColumnWidth(20)
@ExcelProperty("备货总数")
private Integer totalNum;
@ColumnWidth(20)
@ExcelProperty("预约单号")
private String reservationCodes;
@ColumnWidth(20)
@ExcelProperty("配送电话")
private String deliveryPhone;
@ColumnWidth(20)
@ExcelProperty("配送客户")
private String consignee;
@ColumnWidth(20)
@ExcelProperty("配送地址")
private String deliveryAddress;
@ColumnWidth(20)
@ExcelProperty("订单码")
private String orderCodes;
}

11
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml

@ -1078,10 +1078,19 @@
lds.type_service typeService,
lds.outbound_date outboundDate,
lds.stockup_code stockupCode,
ldr.reservation_stock_list_num AS inventoryNum,
ldr.reservation_num AS packageNum,
(ldr.reservation_num + ldr.reservation_stock_list_num) AS totalNum,
COALESCE(GROUP_CONCAT(DISTINCT lwug.position_code SEPARATOR ','), '') stockipAllocation,
COALESCE(GROUP_CONCAT(DISTINCT lwtg.tray_code SEPARATOR ','), '') pallet
COALESCE(GROUP_CONCAT(DISTINCT lwtg.tray_code SEPARATOR ','), '') pallet,
COALESCE ( group_concat( DISTINCT ldr.reservation_code SEPARATOR ',' ), '' ) AS reservationCodes,
COALESCE ( group_concat( DISTINCT ldr.delivery_phone SEPARATOR ',' ), '' ) AS deliveryPhone,
COALESCE ( group_concat( DISTINCT ldr.consignee SEPARATOR ',' ), '' ) AS consignee,
COALESCE ( group_concat( DISTINCT ldr.delivery_address SEPARATOR ',' ), '' ) AS deliveryAddress,
(SELECT GROUP_CONCAT(ldsa.order_code) FROM logpm_distribution_reservation_stockarticle AS ldrs LEFT JOIN logpm_distribution_stock_article AS ldsa ON ldrs.stock_article_id = ldsa.id WHERE ldrs.reservation_id = ldr.id GROUP BY ldrs.reservation_id) As orderCodes
from logpm_platform.logpm_distribution_stockup lds
LEFT JOIN logpm_platform.logpm_distribution_stockup_info ldsi on ldsi.stockup_id = lds.id
LEFT JOIN logpm_distribution_reservation AS ldr ON ldsi.reservation_id = ldr.id
LEFT JOIN logpm_platform.logpm_distribution_reservation_package ldrp on ldrp.reservation_id = ldsi.reservation_id
LEFT JOIN logpm_platform.logpm_warehouse_updown_goods lwug on lwug.association_id = ldrp.parce_list_id
LEFT JOIN logpm_platform.logpm_warehouse_tray_goods lwtg on lwtg.association_id = ldrp.parce_list_id

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

@ -450,12 +450,13 @@ public class WarehouseGoodsAllocationController extends BladeController {
@GetMapping("/locationsnub")
@ApiOperationSupport(order = 18)
@ApiOperation(value = "货位 统计所有库位数量")
public R locationsnub() {
public R locationsnub(@RequestParam Long warehouseId) {
// if (null !=bladeRedis.get(Url+"/locationsnub)")){
// log.info("缓存取值>>>>>>>>>>");
// return R.data(bladeRedis.get(Url+"/locationsnub"));
// }
locationsnubVO locationsnubVO = warehouseGoodsAllocationService.selectlocationsnub();
locationsnubVO locationsnubVO = warehouseGoodsAllocationService.selectlocationsnub(warehouseId);
// bladeRedis.setEx(Url+"/locationsnub",locationsnubVO,360L);
return R.data(locationsnubVO);
}

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

@ -176,4 +176,13 @@ public interface WarehouseGoodsAllocationMapper extends BaseMapper<WarehouseGood
* @return
*/
List<WarehouseGoodsAllocationEntity> selectAllocationInfo(@Param("ids") List<Long> ids);
/**
* 查询货位的分布情况
* @param warehouseId
* @param areaId
* @param shelfId
* @return
*/
locationsnubVO selectAllocationNumInfo(@Param("warehouseId") Long warehouseId,@Param("areaId") Long areaId,@Param("shelfId") Long shelfId);
}

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

@ -432,6 +432,55 @@
</foreach>
</where>
</select>
<select id="selectAllocationNumInfo" resultType="com.logpm.warehouse.vo.locationsnubVO">
SELECT
(SELECT count(*) FROM logpm_warehouse_goods_allocation
where
<if test="warehouseId != null and warehouseId != ''">
warehouse_id = #{warehouseId}
</if>
<if test="areaId != null and areaId != ''">
and goods_area_id = #{areaId}
</if>
<if test="shelfId != null and shelfId != ''">
and goods_shelf_id = #{shelfId}
</if>
) AS cargoNub ,
(SELECT count(*) FROM logpm_warehouse_goods_allocation WHERE enable_status = '2'
<if test="warehouseId != null and warehouseId != ''">
and warehouse_id = #{warehouseId}
</if>
<if test="areaId != null and areaId != ''">
and goods_area_id = #{areaId}
</if>
<if test="shelfId != null and shelfId != ''">
and goods_shelf_id = #{shelfId}
</if>
) AS disableNub,
(SELECT count(*) FROM logpm_warehouse_goods_allocation WHERE allocation_status = '2'
<if test="warehouseId != null and warehouseId != ''">
and warehouse_id = #{warehouseId}
</if>
<if test="areaId != null and areaId != ''">
and goods_area_id = #{areaId}
</if>
<if test="shelfId != null and shelfId != ''">
and goods_shelf_id = #{shelfId}
</if>
) AS employNub,
(SELECT count(*) FROM logpm_warehouse_goods_allocation WHERE allocation_status = '1'
<if test="warehouseId != null and warehouseId != ''">
and warehouse_id = #{warehouseId}
</if>
<if test="areaId != null and areaId != ''">
and goods_area_id = #{areaId}
</if>
<if test="shelfId != null and shelfId != ''">
and goods_shelf_id = #{shelfId}
</if>
) AS unusedNub
;
</select>
</mapper>

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

@ -105,7 +105,7 @@ public interface IWarehouseGoodsAllocationService extends BaseService<WarehouseG
/**
* 货位 统计库位数量
*/
locationsnubVO selectlocationsnub();
locationsnubVO selectlocationsnub(Long warehouseId);
/**
* 货位 统计每个货区数量
*/

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

@ -99,7 +99,7 @@ public class WarehouseGoodsAllocationServiceImpl extends BaseServiceImpl<Warehou
);
//获取货架的所有货位
//查询该货区下的总货位
locationsnubVO num1 = this.getNum(goodsAreaId, goodsShelfId);
locationsnubVO num1 = this.getNum(null,goodsAreaId, goodsShelfId);
Func.copy(num1,warehouseShelfVO);
//查询所有包件数量
Integer num = warehouseUpdownGoodsService.selectCountNumByshelf(goodsAreaId,goodsShelfId);
@ -295,8 +295,9 @@ public class WarehouseGoodsAllocationServiceImpl extends BaseServiceImpl<Warehou
}
@Override
public locationsnubVO selectlocationsnub() {
locationsnubVO locationsnubVO = this.getNum(null,null);
public locationsnubVO selectlocationsnub(Long warehouseId) {
// locationsnubVO locationsnubVO = this.getNum(null,null);
locationsnubVO locationsnubVO = this.getNum(warehouseId,null,null);
return locationsnubVO;
}
@ -307,7 +308,7 @@ public class WarehouseGoodsAllocationServiceImpl extends BaseServiceImpl<Warehou
ArrayList<WarehouseCargoSumVO> list = new ArrayList<>();
for (Long id : ids) {
WarehouseCargoSumVO warehouseCargoSumVO = new WarehouseCargoSumVO();
locationsnubVO locationsnubVO = this.getNum(id, null);
locationsnubVO locationsnubVO = this.getNum(null,id, null);
Func.copy(locationsnubVO,warehouseCargoSumVO);
warehouseCargoSumVO.setId(id);
list.add(warehouseCargoSumVO);
@ -315,41 +316,53 @@ public class WarehouseGoodsAllocationServiceImpl extends BaseServiceImpl<Warehou
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);
locationsnubVO.setDisableNub(disableNub);
locationsnubVO.setUnusedNub(unusedNub);
return locationsnubVO;
public locationsnubVO getNum(Long warehouseId,Long areaId,Long shelfId){
if (null == warehouseId){
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);
locationsnubVO.setDisableNub(disableNub);
locationsnubVO.setUnusedNub(unusedNub);
return locationsnubVO;
}else {
locationsnubVO locationsnubVO = baseMapper.selectAllocationNumInfo(warehouseId, areaId, shelfId);
return locationsnubVO;
}
}
@Override
@ -372,7 +385,7 @@ public class WarehouseGoodsAllocationServiceImpl extends BaseServiceImpl<Warehou
warehouseGoodsAllocationVOList = warehouseGoodsAllocationVOList.stream().map(obj -> obj.getId().equals(warehouseGoodsAllocationVO.getId()) ? warehouseGoodsAllocationVO : obj).collect(Collectors.toList());
//计算数量
//查询该货区下的总货位
locationsnubVO num1 = this.getNum(goodsAreaId, goodsShelfId);
locationsnubVO num1 = this.getNum(null,goodsAreaId, goodsShelfId);
Func.copy(num1,warehouseShelfVO);
Integer num = warehouseUpdownGoodsService.selectCountNumByshelf(goodsAreaId,goodsShelfId);
warehouseShelfVO.setGoodsNub(null==num?0:num);

Loading…
Cancel
Save