Browse Source

备货库位包件扫描接口、包件上架数据保存接口

chenglong
汤建军 9 months ago
parent
commit
1697b3079a
  1. 7
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDisStockListDetailClient.java
  2. 30
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/UpDownStockupAreaVO.java
  3. 91
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseUpdownStockupAreaEntity.java
  4. 98
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseUpdownStockupAreaLogEntity.java
  5. 12
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DisStockListDetailClient.java
  6. 11
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DisStockListDetailMapper.java
  7. 19
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DisStockListDetailMapper.xml
  8. 9
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDisStockListDetailService.java
  9. 12
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DisStockListDetailServiceImpl.java
  10. 128
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseUpdownStockupAreaApiController.java
  11. 54
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/UpStockupAreaPackageDTO.java
  12. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/UpdownTypeDTO.java
  13. 31
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownStockupAreaLogMapper.java
  14. 67
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownStockupAreaLogMapper.xml
  15. 41
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownStockupAreaMapper.java
  16. 67
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownStockupAreaMapper.xml
  17. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseTaryAllocationService.java
  18. 33
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseUpdownStockupAreaLogService.java
  19. 60
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseUpdownStockupAreaService.java
  20. 67
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownStockupAreaLogServiceImpl.java
  21. 227
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownStockupAreaServiceImpl.java

7
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDisStockListDetailClient.java

@ -17,6 +17,8 @@
package com.logpm.distribution.feign;
import com.logpm.distribution.entity.DisStockListDetailEntity;
import com.logpm.distribution.vo.UpDownStockupAreaVO;
import org.springblade.common.constant.ModuleNameConstant;
import org.springblade.core.mp.support.BladePage;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
@ -29,7 +31,7 @@ import org.springframework.web.bind.annotation.RequestParam;
* @since 2023-09-04
*/
@FeignClient(
value = "disStockOrdercodeReco"
value = ModuleNameConstant.APPLICATION_DISTRIBUTION_NAME
)
public interface IDisStockListDetailClient {
@ -46,4 +48,7 @@ public interface IDisStockListDetailClient {
@GetMapping(TOP)
BladePage<DisStockListDetailEntity> topDisStockListDetail(@RequestParam("current") Integer current, @RequestParam("size") Integer size);
@GetMapping(TOP+"/findByPacketBarCodeAndWarehouseId")
UpDownStockupAreaVO findByPacketBarCodeAndWarehouseId(@RequestParam("warehouseId")Long warehouseId, @RequestParam("orderPackageCode") String orderPackageCode);
}

30
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/UpDownStockupAreaVO.java

@ -0,0 +1,30 @@
package com.logpm.distribution.vo;
import lombok.Data;
/**
* 上架备货库位货物VO
*/
@Data
public class UpDownStockupAreaVO {
private Long marketId;
private Long warehouseId;
private String marketName;
private String associationType;
private String associationValue;
private Long associationId;
private String incomingBatch;
private String goodsType;
}

91
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseUpdownStockupAreaEntity.java

@ -0,0 +1,91 @@
package com.logpm.warehouse.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
@Data
@TableName("logpm_warehouse_updown_goods")
@ApiModel(value = "UpdownGoods对象", description = "货位货物绑定表")
@EqualsAndHashCode(callSuper = true)
public class WarehouseUpdownStockupAreaEntity extends TenantEntity {
/** 预留1 */
@ApiModelProperty(name = "预留1",notes = "")
private String reserve1 ;
/** 预留2 */
@ApiModelProperty(name = "预留2",notes = "")
private String reserve2 ;
/** 预留3 */
@ApiModelProperty(name = "预留3",notes = "")
private String reserve3 ;
/** 预留4 */
@ApiModelProperty(name = "预留4",notes = "")
private String reserve4 ;
/** 预留5 */
@ApiModelProperty(name = "预留5",notes = "")
private String reserve5 ;
/** 上架方式id */
@ApiModelProperty(name = "上架方式id",notes = "")
private String updownType ;
/** 货区id */
@ApiModelProperty(name = "货区id",notes = "")
private Long areaId ;
/** 货区名称 */
@ApiModelProperty(name = "货区名称",notes = "")
private String areaTitle ;
/** 货架id */
@ApiModelProperty(name = "货架id",notes = "")
private Long shelfId ;
/** 货架名称 */
@ApiModelProperty(name = "货架名称",notes = "")
private String shelfTitle ;
/** 货位id */
@ApiModelProperty(name = "货位id",notes = "")
private Long allocationId ;
/** 货位名称 */
@ApiModelProperty(name = "货位名称",notes = "")
private String allocationTitle ;
/** 完整货位 */
@ApiModelProperty(name = "完整货位",notes = "")
private String positionCode ;
/** 货物类型;1有数据 2无数据 */
@ApiModelProperty(name = "货物类型",notes = "1有数据 2无数据")
private String goodsType ;
/** 关联id */
@ApiModelProperty(name = "关联id",notes = "")
private Long associationId ;
/** 关联值 */
@ApiModelProperty(name = "关联值",notes = "")
private String associationValue ;
/** 关联类型;1.订单号 2运单号 3包件码 */
@ApiModelProperty(name = "关联类型",notes = "1.订单号 2运单号 3包件码 4库存品")
private String associationType ;
/** 货物名称 */
@ApiModelProperty(name = "货物名称",notes = "")
private String goodsName ;
/** 数量 */
@ApiModelProperty(name = "数量",notes = "")
private Integer num ;
/** 商场id */
@ApiModelProperty(name = "商场id",notes = "")
private Long marketId ;
/** 商场名称 */
@ApiModelProperty(name = "商场名称",notes = "")
private String marketName ;
/** 批次号 */
@ApiModelProperty(name = "批次号",notes = "")
private String incomingBatch ;
/** 物料编码 */
@ApiModelProperty(name = "物料编码",notes = "")
private String materielCode ;
/** 物料名称 */
@ApiModelProperty(name = "物料名称",notes = "")
private String materielName ;
/** 仓库id */
@ApiModelProperty(name = "仓库id",notes = "")
private Long warehouseId;
}

98
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseUpdownStockupAreaLogEntity.java

@ -0,0 +1,98 @@
package com.logpm.warehouse.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
@Data
@TableName("logpm_warehouse_updown_goods_log")
@ApiModel(value = "UpdownGoodsLog对象", description = "上下架记录表")
@EqualsAndHashCode(callSuper = true)
public class WarehouseUpdownStockupAreaLogEntity extends TenantEntity {
/** 预留1 */
@ApiModelProperty(name = "预留1",notes = "")
private String reserve1 ;
/** 预留2 */
@ApiModelProperty(name = "预留2",notes = "")
private String reserve2 ;
/** 预留3 */
@ApiModelProperty(name = "预留3",notes = "")
private String reserve3 ;
/** 预留4 */
@ApiModelProperty(name = "预留4",notes = "")
private String reserve4 ;
/** 预留5 */
@ApiModelProperty(name = "预留5",notes = "")
private String reserve5 ;
/** 上架方式id */
@ApiModelProperty(name = "上架方式id",notes = "")
private Long updownTypeId ;
/** 货区id */
@ApiModelProperty(name = "货区id",notes = "")
private Long areaId ;
/** 货区名称 */
@ApiModelProperty(name = "货区名称",notes = "")
private String areaTitle ;
/** 货架id */
@ApiModelProperty(name = "货架id",notes = "")
private Long shelfId ;
/** 货架名称 */
@ApiModelProperty(name = "货架名称",notes = "")
private String shelfTitle ;
/** 货位id */
@ApiModelProperty(name = "货位id",notes = "")
private Long allocationId ;
/** 货位名称 */
@ApiModelProperty(name = "货位名称",notes = "")
private String allocationTitle ;
/** 完整货位 */
@ApiModelProperty(name = "完整货位",notes = "")
private String positionCode ;
/** 上架类型;1=上架,2=下架 */
@ApiModelProperty(name = "上架类型",notes = "1=上架,2=下架")
private Integer bindingType ;
/** 是否整托;0不是 1是 */
@ApiModelProperty(name = "是否整托",notes = "0不是 1是")
private Integer isAlltrays ;
/** 货物类型;有数据 无数据 */
@ApiModelProperty(name = "货物类型",notes = "有数据 无数据")
private String goodsType ;
/** 关联类型 */
@ApiModelProperty(name = "关联类型",notes = "")
private String associationType ;
/** 关联值 */
@ApiModelProperty(name = "关联值",notes = "")
private String associationValue ;
/** 关联id */
@ApiModelProperty(name = "关联id",notes = "")
private Long associationId ;
/** 上下架数量 */
@ApiModelProperty(name = "上下架数量",notes = "")
private Integer num ;
/** 备注 */
@ApiModelProperty(name = "备注",notes = "")
private String remark ;
/** 商场id */
@ApiModelProperty(name = "商场id",notes = "")
private Long marketId ;
/** 商场名称 */
@ApiModelProperty(name = "商场名称",notes = "")
private String marketName ;
/** 批次号 */
@ApiModelProperty(name = "批次号",notes = "")
private String incomingBatch ;
/** 物料编码 */
@ApiModelProperty(name = "物料编码",notes = "")
private String materielCode ;
/** 物料名称 */
@ApiModelProperty(name = "物料名称",notes = "")
private String materielName ;
/** 仓库Id */
@ApiModelProperty(name = "仓库Id",notes = "")
private Long warehouseId ;
}

12
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DisStockListDetailClient.java

@ -19,6 +19,7 @@ package com.logpm.distribution.feign;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.distribution.entity.DisStockListDetailEntity;
import com.logpm.distribution.service.IDisStockListDetailService;
import com.logpm.distribution.vo.UpDownStockupAreaVO;
import lombok.AllArgsConstructor;
import org.springblade.core.mp.support.BladePage;
import org.springblade.core.mp.support.Condition;
@ -50,4 +51,15 @@ public class DisStockListDetailClient implements IDisStockListDetailClient {
return BladePage.of(page);
}
/**
* @param warehouseId
* @param orderPackageCode
* @return
*/
@GetMapping(TOP+"/findByPacketBarCodeAndWarehouseId")
@Override
public UpDownStockupAreaVO findByPacketBarCodeAndWarehouseId(Long warehouseId, String orderPackageCode) {
return disStockListDetailService.findByPacketBarCodeAndWarehouseId(warehouseId,orderPackageCode);
}
}

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

@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.distribution.entity.DisStockListDetailEntity;
import com.logpm.distribution.excel.DisStockListDetailExcel;
import com.logpm.distribution.vo.DisStockListDetailVO;
import com.logpm.distribution.vo.UpDownStockupAreaVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -63,4 +64,14 @@ public interface DisStockListDetailMapper extends BaseMapper<DisStockListDetailE
* @param id
*/
void deleteInventoryByReservationId(@Param("reservationId")Long id);
/**
* 查询已备货的库存品包件信息
* @param warehouseId
* @param orderPackageCode
* @return
*/
UpDownStockupAreaVO findByPacketBarCodeAndWarehouseId(Long warehouseId, String orderPackageCode);
}

19
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DisStockListDetailMapper.xml

@ -47,5 +47,24 @@
<select id="exportDisStockListDetail" resultType="com.logpm.distribution.excel.DisStockListDetailExcel">
SELECT * FROM logpm_dis_stock_list_detail ${ew.customSqlSegment}
</select>
<select id="findByPacketBarCodeAndWarehouseId" resultType="com.logpm.distribution.vo.UpDownStockupAreaVO">
SELECT
ldsld.id AS associationId,
ldsld.num AS num,
ldsld.stock_package_code AS associationValue,
'3' AS associationType,
'2' AS goodsType,
ldsl.cargo_number AS materielCode,
ldsl.description_goods AS materielName,
ldsl.market_id AS marketId,
ldsl.market_name AS marketName,
ldsl.incoming_batch AS incomingBatch,
#{warehouseId} AS warehouseId,
FROM
logpm_dis_stock_list_detail AS ldsld
LEFT JOIN logpm_distribution_stock_list AS ldsl ON ldsld.stock_list_id = ldsl.id
WHERE
ldsld.stock_package_code = #{orderPackageCode} AND ldsld.warehouse_id = #{warehouseId}
</select>
</mapper>

9
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDisStockListDetailService.java

@ -23,6 +23,7 @@ import com.logpm.distribution.excel.DisStockListDetailExcel;
import com.logpm.distribution.vo.DisStockListDetailVO;
import com.logpm.distribution.vo.DisStockListVO;
import com.logpm.distribution.vo.OrderPackgeCodeDataVO;
import com.logpm.distribution.vo.UpDownStockupAreaVO;
import org.springblade.core.mp.base.BaseService;
import java.util.List;
@ -74,4 +75,12 @@ public interface IDisStockListDetailService extends BaseService<DisStockListDeta
* @param billLadingId
*/
void cancelInventoryPackageByReservationIdAnStockListId(Long stockListId, Long billLadingId);
/**
* 查询库存品包件信息
* @param warehouseId
* @param orderPackageCode
* @return
*/
UpDownStockupAreaVO findByPacketBarCodeAndWarehouseId(Long warehouseId, String orderPackageCode);
}

12
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DisStockListDetailServiceImpl.java

@ -36,6 +36,7 @@ import com.logpm.distribution.service.*;
import com.logpm.distribution.vo.DisStockListDetailVO;
import com.logpm.distribution.vo.DisStockListVO;
import com.logpm.distribution.vo.OrderPackgeCodeDataVO;
import com.logpm.distribution.vo.UpDownStockupAreaVO;
import lombok.AllArgsConstructor;
import org.jetbrains.annotations.NotNull;
import org.springblade.common.constant.DistributionTypeConstant;
@ -258,6 +259,17 @@ public class DisStockListDetailServiceImpl extends BaseServiceImpl<DisStockListD
this.update(updateWrapper);
}
/**
* @param warehouseId
* @param orderPackageCode
* @return
*/
@Override
public UpDownStockupAreaVO findByPacketBarCodeAndWarehouseId(Long warehouseId, String orderPackageCode) {
return baseMapper.findByPacketBarCodeAndWarehouseId(warehouseId,orderPackageCode);
}
/**
* 赋值模板转换
* @param id

128
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseUpdownStockupAreaApiController.java

@ -0,0 +1,128 @@
package com.logpm.warehouse.api;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.distribution.vo.UpDownStockupAreaVO;
import com.logpm.warehouse.bean.Resp;
import com.logpm.warehouse.dto.UpShelfPackageDTO;
import com.logpm.warehouse.dto.UpStockupAreaPackageDTO;
import com.logpm.warehouse.dto.UpdownTypeDTO;
import com.logpm.warehouse.entity.WarehouseUpdownStockupAreaEntity;
import com.logpm.warehouse.service.IWarehouseUpdownStockupAreaService;
import com.logpm.warehouse.service.IWarehouseUpdownTypeService;
import com.logpm.warehouse.vo.UpShelfAllocationVO;
import com.logpm.warehouse.vo.UpShelfDataVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Objects;
@Log4j2
@RestController
@AllArgsConstructor
@RequestMapping("/api/warehouseUpdownStockupArea")
@Api(value = "货物备货区绑定控制器", tags = "备货库位上架接口")
public class WarehouseUpdownStockupAreaApiController {
private final IBasicdataWarehouseClient warehouseClient;
private final IWarehouseUpdownStockupAreaService warehouseUpdownStockupAreaService;
@ResponseBody
@PostMapping("/upShelfPackage")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "上架包件维度", notes = "传入trayTypeDTO")
public R upShelfPackage(@RequestBody UpdownTypeDTO updownTypeDTO ) {
String method = "###########upShelfPackage: ";
log.info(method + "上架包件维度 updownTypeDTO={}", updownTypeDTO);
List<UpStockupAreaPackageDTO> upStockupAreaPackageDTOS = updownTypeDTO.getUpStockupAreaPackageDTOS();
Long allocationId = updownTypeDTO.getAllocationId();//库位码
try{
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息不能为空");
return R.fail(403,"仓库信息不能为空");
}
int size = upStockupAreaPackageDTOS.size();
if(size == 0 ){
log.warn(method+"没有处理的数据");
return R.fail(403,"无处理数据");
}
if(Objects.isNull(allocationId)){
log.warn(method+"库位信息不能为空 allocationId={}",allocationId);
return R.fail(403,"库位信息不能为空");
}
//查询该库位的货物信息
return warehouseUpdownStockupAreaService.upStockupAreaPackage(upStockupAreaPackageDTOS,allocationId,myCurrentWarehouse.getId());
}catch (CustomerException e){
log.warn(e.message);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常,联系管理员",e);
return R.fail(500,"系统异常,联系管理员");
}
}
@ResponseBody
@PostMapping("/upShelfScanPackage")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "备货库位上架包条级别扫描接口", notes = "传入trayTypeDTO")
public R upShelfScanPackage(@RequestBody UpdownTypeDTO updownTypeDTO ) {
String method = "###########upShelfScanPackage: ";
log.info(method + "上架扫描备货库位 updownTypeDTO={}", updownTypeDTO);
try{
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息不能为空");
return R.fail(403,"仓库信息不能为空");
}
//查询该库位的货物信息
UpDownStockupAreaVO upDownStockupAreaVO = warehouseUpdownStockupAreaService.upShelfScanPackage(myCurrentWarehouse.getId(), updownTypeDTO.getOrderPackageCode());
//此包件是否已经完成上架了
if (Func.isNotEmpty(upDownStockupAreaVO)){
//查询是否上架
WarehouseUpdownStockupAreaEntity updownStockupAreaEntity = warehouseUpdownStockupAreaService.getOne(Wrappers.<WarehouseUpdownStockupAreaEntity>query().lambda()
.eq(WarehouseUpdownStockupAreaEntity::getWarehouseId, myCurrentWarehouse.getId())
.eq(WarehouseUpdownStockupAreaEntity::getAssociationValue, upDownStockupAreaVO.getAssociationValue())
.eq(WarehouseUpdownStockupAreaEntity::getAllocationId, upDownStockupAreaVO.getAssociationId())
.eq(WarehouseUpdownStockupAreaEntity::getGoodsType, upDownStockupAreaVO.getGoodsType())
);
if (Func.isNotEmpty(updownStockupAreaEntity)){
//已经在备货库位进行上架了
return Resp.scanFail("该包件已上架","该包件已上架");
}
return R.data(updownStockupAreaEntity);
}else {
return Resp.scanFail("该包件不存在","该包件不存在");
}
}catch (CustomerException e){
log.warn(e.message);
return Resp.scanFail(e.code,e.message,e.message);
}catch (Exception e){
log.error(method+"系统异常,联系管理员",e);
return R.fail(500,"系统异常,联系管理员");
}
}
}

54
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/UpStockupAreaPackageDTO.java

@ -0,0 +1,54 @@
package com.logpm.warehouse.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
@ApiModel(value = "UpShelfPackageDTO对象", description = "包件DTO")
public class UpStockupAreaPackageDTO implements Serializable {
/**
* 商城ID
*/
private Long marketId;
/**
* 商场名称
*/
private String marketName;
/**
* 仓库ID
*/
private Long warehouseId;
/**
* 绑定类型 1-订单 2-订制品 3-库存品 4-托盘
*/
private String associationType;
/**
* 绑定值 与上方对应
*/
private String associationValue;
/**
* 绑定ID 与上方对应
*/
private String associationId;
/**
* 批次号 库存品专属
*/
private String incomingBatch;
/**
* 有无数据 1- 2-
*/
private String goodsType;
}

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

@ -31,6 +31,8 @@ public class UpdownTypeDTO implements Serializable {
private List<UpShelfOrderDTO> upShelfOrderList = new ArrayList<>();
@ApiModelProperty(name = "包件列表",notes = "包件列表")
private List<UpShelfPackageDTO> upShelfPackageList = new ArrayList<>();
@ApiModelProperty(name = "备货库位上架数据传输",notes = "备货库位上架数据传输")
private List<UpStockupAreaPackageDTO> upStockupAreaPackageDTOS = new ArrayList<>();
@ApiModelProperty(name = "零担列表",notes = "零担列表")
private List<UpShelfZeroOrderDTO> upShelfZeroOrderList = new ArrayList<>();
@ApiModelProperty(name = "库存品列表",notes = "库存品列表")

31
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownStockupAreaLogMapper.java

@ -0,0 +1,31 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.warehouse.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.warehouse.entity.WarehouseUpdownStockupAreaEntity;
import com.logpm.warehouse.entity.WarehouseUpdownStockupAreaLogEntity;
/**
* 货位与货物绑定表 Mapper 接口
*
* @author lmy
* @since 2023-08-14
*/
public interface WarehouseUpdownStockupAreaLogMapper extends BaseMapper<WarehouseUpdownStockupAreaLogEntity> {
}

67
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownStockupAreaLogMapper.xml

@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.logpm.warehouse.mapper.WarehouseUpdownStockupAreaLogMapper">
<!-- 通用查询映射结果 -->
<resultMap id="warehouseUpdownGoodsResultMap" type="com.logpm.warehouse.entity.WarehouseUpdownGoodsEntity">
<result column="tenant_id" property="tenantId"/>
<result column="create_user" property="createUser"/>
<result column="create_time" property="createTime"/>
<result column="update_user" property="updateUser"/>
<result column="update_time" property="updateTime"/>
<result column="status" property="status"/>
<result column="is_deleted" property="isDeleted"/>
<result column="create_dept" property="createDept"/>
<result column="id" property="id"/>
<result column="reserve1" property="reserve1"/>
<result column="reserve2" property="reserve2"/>
<result column="reserve3" property="reserve3"/>
<result column="reserve4" property="reserve4"/>
<result column="reserve5" property="reserve5"/>
<result column="updown_type_id" property="updownTypeId"/>
<result column="area_id" property="areaId"/>
<result column="area_title" property="areaTitle"/>
<result column="shelf_id" property="shelfId"/>
<result column="shelf_title" property="shelfTitle"/>
<result column="allocation_id" property="allocationId"/>
<result column="allocation_title" property="allocationTitle"/>
<result column="position_code" property="positionCode"/>
<result column="goods_type" property="goodsType"/>
<result column="association_id" property="associationId"/>
<result column="association_value" property="associationValue"/>
<result column="association_type" property="associationType"/>
<result column="goods_name" property="goodsName"/>
<result column="num" property="num"/>
<result column="tenant_id" property="tenantId"/>
<result column="create_user" property="createUser"/>
<result column="create_time" property="createTime"/>
<result column="update_user" property="updateUser"/>
<result column="update_time" property="updateTime"/>
<result column="status" property="status"/>
<result column="is_deleted" property="isDeleted"/>
<result column="create_dept" property="createDept"/>
<result column="id" property="id"/>
<result column="reserve1" property="reserve1"/>
<result column="reserve2" property="reserve2"/>
<result column="reserve3" property="reserve3"/>
<result column="reserve4" property="reserve4"/>
<result column="reserve5" property="reserve5"/>
<result column="updown_type_id" property="updownTypeId"/>
<result column="area_id" property="areaId"/>
<result column="area_title" property="areaTitle"/>
<result column="shelf_id" property="shelfId"/>
<result column="shelf_title" property="shelfTitle"/>
<result column="allocation_id" property="allocationId"/>
<result column="allocation_title" property="allocationTitle"/>
<result column="position_code" property="positionCode"/>
<result column="goods_type" property="goodsType"/>
<result column="association_id" property="associationId"/>
<result column="association_value" property="associationValue"/>
<result column="association_type" property="associationType"/>
<result column="goods_name" property="goodsName"/>
<result column="num" property="num"/>
</resultMap>
</mapper>

41
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownStockupAreaMapper.java

@ -0,0 +1,41 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.warehouse.mapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.warehouse.dto.TaskSearchDTO;
import com.logpm.warehouse.entity.QuestDetailEntity;
import com.logpm.warehouse.entity.WarehouseUpdownGoodsEntity;
import com.logpm.warehouse.entity.WarehouseUpdownStockupAreaEntity;
import com.logpm.warehouse.excel.WarehouseUpdownGoodsExcel;
import com.logpm.warehouse.vo.*;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* 货位与货物绑定表 Mapper 接口
*
* @author lmy
* @since 2023-08-14
*/
public interface WarehouseUpdownStockupAreaMapper extends BaseMapper<WarehouseUpdownStockupAreaEntity> {
}

67
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownStockupAreaMapper.xml

@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.logpm.warehouse.mapper.WarehouseUpdownStockupAreaMapper">
<!-- 通用查询映射结果 -->
<resultMap id="warehouseUpdownGoodsResultMap" type="com.logpm.warehouse.entity.WarehouseUpdownGoodsEntity">
<result column="tenant_id" property="tenantId"/>
<result column="create_user" property="createUser"/>
<result column="create_time" property="createTime"/>
<result column="update_user" property="updateUser"/>
<result column="update_time" property="updateTime"/>
<result column="status" property="status"/>
<result column="is_deleted" property="isDeleted"/>
<result column="create_dept" property="createDept"/>
<result column="id" property="id"/>
<result column="reserve1" property="reserve1"/>
<result column="reserve2" property="reserve2"/>
<result column="reserve3" property="reserve3"/>
<result column="reserve4" property="reserve4"/>
<result column="reserve5" property="reserve5"/>
<result column="updown_type_id" property="updownTypeId"/>
<result column="area_id" property="areaId"/>
<result column="area_title" property="areaTitle"/>
<result column="shelf_id" property="shelfId"/>
<result column="shelf_title" property="shelfTitle"/>
<result column="allocation_id" property="allocationId"/>
<result column="allocation_title" property="allocationTitle"/>
<result column="position_code" property="positionCode"/>
<result column="goods_type" property="goodsType"/>
<result column="association_id" property="associationId"/>
<result column="association_value" property="associationValue"/>
<result column="association_type" property="associationType"/>
<result column="goods_name" property="goodsName"/>
<result column="num" property="num"/>
<result column="tenant_id" property="tenantId"/>
<result column="create_user" property="createUser"/>
<result column="create_time" property="createTime"/>
<result column="update_user" property="updateUser"/>
<result column="update_time" property="updateTime"/>
<result column="status" property="status"/>
<result column="is_deleted" property="isDeleted"/>
<result column="create_dept" property="createDept"/>
<result column="id" property="id"/>
<result column="reserve1" property="reserve1"/>
<result column="reserve2" property="reserve2"/>
<result column="reserve3" property="reserve3"/>
<result column="reserve4" property="reserve4"/>
<result column="reserve5" property="reserve5"/>
<result column="updown_type_id" property="updownTypeId"/>
<result column="area_id" property="areaId"/>
<result column="area_title" property="areaTitle"/>
<result column="shelf_id" property="shelfId"/>
<result column="shelf_title" property="shelfTitle"/>
<result column="allocation_id" property="allocationId"/>
<result column="allocation_title" property="allocationTitle"/>
<result column="position_code" property="positionCode"/>
<result column="goods_type" property="goodsType"/>
<result column="association_id" property="associationId"/>
<result column="association_value" property="associationValue"/>
<result column="association_type" property="associationType"/>
<result column="goods_name" property="goodsName"/>
<result column="num" property="num"/>
</resultMap>
</mapper>

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

@ -4,6 +4,8 @@ import com.logpm.basicdata.entity.BasicdataTrayEntity;
import com.logpm.warehouse.entity.WarehouseTaryAllocationEntity;
import org.springblade.core.mp.base.BaseService;
import java.util.List;
public interface IWarehouseTaryAllocationService extends BaseService<WarehouseTaryAllocationEntity> {
BasicdataTrayEntity getTrayByAllocation(String targetAllocation);

33
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseUpdownStockupAreaLogService.java

@ -0,0 +1,33 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.warehouse.service;
import com.logpm.warehouse.entity.WarehouseUpdownStockupAreaLogEntity;
import org.springblade.core.mp.base.BaseService;
import java.util.List;
/**
* 货位与货物绑定表 服务类
*
* @author lmy
* @since 2023-08-14
*/
public interface IWarehouseUpdownStockupAreaLogService extends BaseService<WarehouseUpdownStockupAreaLogEntity> {
}

60
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseUpdownStockupAreaService.java

@ -0,0 +1,60 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.warehouse.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.vo.UpDownStockupAreaVO;
import com.logpm.warehouse.dto.UpShelfPackageDTO;
import com.logpm.warehouse.dto.UpStockupAreaPackageDTO;
import com.logpm.warehouse.entity.WarehouseUpdownGoodsEntity;
import com.logpm.warehouse.entity.WarehouseUpdownStockupAreaEntity;
import com.logpm.warehouse.entity.WarehouseUpdownTypeEntity;
import com.logpm.warehouse.excel.WarehouseUpdownGoodsExcel;
import com.logpm.warehouse.vo.*;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.tool.api.R;
import java.util.List;
import java.util.Map;
/**
* 货位与货物绑定表 服务类
*
* @author lmy
* @since 2023-08-14
*/
public interface IWarehouseUpdownStockupAreaService extends BaseService<WarehouseUpdownStockupAreaEntity> {
/**
* 上架备货库位扫描接口
* @param warehouseId
* @param orderPackageCode
* @return
*/
UpDownStockupAreaVO upShelfScanPackage(Long warehouseId, String orderPackageCode);
/**
* 备货库位上架数据保存
* @param upStockupAreaPackageDTOS
* @param allocationId
* @param id
* @return
*/
R upStockupAreaPackage(List<UpStockupAreaPackageDTO> upStockupAreaPackageDTOS, Long allocationId, Long id);
}

67
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownStockupAreaLogServiceImpl.java

@ -0,0 +1,67 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.warehouse.service.impl;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.basicdata.entity.BasicdataGoodsAllocationEntity;
import com.logpm.basicdata.entity.BasicdataGoodsAreaEntity;
import com.logpm.basicdata.entity.BasicdataGoodsShelfEntity;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataGoodsAllocationClient;
import com.logpm.basicdata.feign.IBasicdataGoodsAreaClient;
import com.logpm.basicdata.feign.IBasicdataGoodsShelfClient;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.feign.IDisStockListDetailClient;
import com.logpm.distribution.feign.IDistributionParcelListClient;
import com.logpm.distribution.vo.UpDownStockupAreaVO;
import com.logpm.warehouse.dto.UpShelfPackageDTO;
import com.logpm.warehouse.dto.UpStockupAreaPackageDTO;
import com.logpm.warehouse.entity.WarehouseUpdownGoodsEntity;
import com.logpm.warehouse.entity.WarehouseUpdownStockupAreaEntity;
import com.logpm.warehouse.entity.WarehouseUpdownStockupAreaLogEntity;
import com.logpm.warehouse.mapper.WarehouseUpdownStockupAreaLogMapper;
import com.logpm.warehouse.mapper.WarehouseUpdownStockupAreaMapper;
import com.logpm.warehouse.service.*;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.Func;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
* 货位与货物绑定表 服务实现类
*
* @author lmy
* @since 2023-08-14
*/
@AllArgsConstructor
@Service
@Log4j2
public class WarehouseUpdownStockupAreaLogServiceImpl extends BaseServiceImpl<WarehouseUpdownStockupAreaLogMapper, WarehouseUpdownStockupAreaLogEntity> implements IWarehouseUpdownStockupAreaLogService {
}

227
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownStockupAreaServiceImpl.java

@ -0,0 +1,227 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.warehouse.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.BeanUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.basicdata.entity.BasicdataGoodsAllocationEntity;
import com.logpm.basicdata.entity.BasicdataGoodsAreaEntity;
import com.logpm.basicdata.entity.BasicdataGoodsShelfEntity;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataGoodsAllocationClient;
import com.logpm.basicdata.feign.IBasicdataGoodsAreaClient;
import com.logpm.basicdata.feign.IBasicdataGoodsShelfClient;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.feign.IDisStockListDetailClient;
import com.logpm.distribution.feign.IDistributionParcelListClient;
import com.logpm.distribution.vo.UpDownStockupAreaVO;
import com.logpm.warehouse.dto.UpShelfPackageDTO;
import com.logpm.warehouse.dto.UpStockupAreaPackageDTO;
import com.logpm.warehouse.entity.*;
import com.logpm.warehouse.mapper.WarehouseUpdownStockupAreaMapper;
import com.logpm.warehouse.service.*;
import com.logpm.warehouse.vo.UpShelfAllocationVO;
import com.logpm.warehouse.vo.UpShelfDataVO;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.Func;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
* 货位与货物绑定表 服务实现类
*
* @author lmy
* @since 2023-08-14
*/
@AllArgsConstructor
@Service
@Log4j2
public class WarehouseUpdownStockupAreaServiceImpl extends BaseServiceImpl<WarehouseUpdownStockupAreaMapper, WarehouseUpdownStockupAreaEntity> implements IWarehouseUpdownStockupAreaService {
private final IBasicdataWarehouseClient basicdataWarehouseClient;
private final IBasicdataGoodsAreaClient basicdataGoodsAreaClient;
private final IBasicdataGoodsShelfClient basicdataGoodsShelfClient;
private final IBasicdataGoodsAllocationClient basicdataGoodsAllocationClient;
private final IWarehouseUpdownTypeService warehouseUpdownTypeService;
private final IWarehouseUpdownGoodsService warehouseUpdownGoodsService;
private final IWarehouseTrayGoodsService warehouseTrayGoodsService;
private final IWarehouseTrayTypeService warehouseTrayTypeService;
private final IDistributionParcelListClient parcelListClient;
private final IDisStockListDetailClient disStockListDetailClient;
private final IWarehouseUpdownStockupAreaLogService warehouseUpdownStockupAreaLogService;
/**
* @param warehouseId
* @param orderPackageCode
* @return
*/
@Override
public UpDownStockupAreaVO upShelfScanPackage(Long warehouseId, String orderPackageCode) {
String method = "###############WarehouseUpdownStockupAreaServiceImpl.upShelfScanPackage,";
//这里有可能会查询出订制品包件和有数据的库存品包件
DistributionParcelListEntity parcelListEntity = parcelListClient.findByPacketBarCodeAndWarehouseId( orderPackageCode,warehouseId);
if (Func.isNotEmpty(parcelListEntity)){
UpDownStockupAreaVO stockupAreaVo = Func.copy(parcelListEntity, UpDownStockupAreaVO.class);
if (Func.isNotEmpty(parcelListEntity.getMallId())){
stockupAreaVo.setMarketId(parcelListEntity.getMallId());
}
if (Func.isNotEmpty(parcelListEntity.getMallName())){
stockupAreaVo.setMarketName(parcelListEntity.getMallName());
}
stockupAreaVo.setGoodsType("1");
stockupAreaVo.setAssociationId(parcelListEntity.getId());
stockupAreaVo.setAssociationValue(parcelListEntity.getOrderPackageCode());
if (1==parcelListEntity.getConditions()){
stockupAreaVo.setAssociationType("2");
}else {
stockupAreaVo.setAssociationType("3");
}
return stockupAreaVo;
}
if (Func.isEmpty(parcelListEntity)){
//查询无数据已备货库存品包件
UpDownStockupAreaVO stockupAreaVo =disStockListDetailClient.findByPacketBarCodeAndWarehouseId(warehouseId,orderPackageCode);
if (Func.isNotEmpty(stockupAreaVo)){
return stockupAreaVo;
}
}
log.warn(method+"未查询到数据");
return null;
}
/**
* @param upStockupAreaPackageDTOS
* @param allocationId
* @param id
* @return
*/
@Override
@Transactional
public R upStockupAreaPackage(List<UpStockupAreaPackageDTO> upStockupAreaPackageDTOS, Long allocationId, Long warehouseId) {
String method = "###############WarehouseUpdownStockupAreaServiceImpl.upStockupAreaPackage,";
BasicdataGoodsAllocationEntity goodsAllocationEntity = basicdataGoodsAllocationClient.getEntityByAllocationId(allocationId);
if(Objects.isNull(goodsAllocationEntity)){
log.warn("##############upShelfPackage: 库位不存在 allocationId={}",allocationId);
return R.fail(403,"库位不存在");
}
String enableStatus = goodsAllocationEntity.getEnableStatus();
Long goodsShelfId = goodsAllocationEntity.getGoodsShelfId();
if("2".equals(enableStatus)){
log.warn("##############upShelfPackage: 库位已被禁用 allocationId={}",allocationId);
return R.fail(403,"库位已被禁用");
}
BasicdataGoodsShelfEntity goodsShelfEntity = basicdataGoodsShelfClient.getEntityByGoodsShelfId(goodsShelfId);
if(Objects.isNull(goodsShelfEntity)){
log.warn("##############upShelfPackage: 货架不存在 goodsShelfId={}",goodsShelfId);
return R.fail(403,"货架不存在");
}
Long goodsAreaId = goodsShelfEntity.getGoodsAreaId();
BasicdataGoodsAreaEntity goodsAreaEntity = basicdataGoodsAreaClient.getEntityByGoodsAreaId(goodsAreaId);
if(Objects.isNull(goodsAreaEntity)){
log.warn("##############upShelfPackage: 货区不存在 goodsAreaId={}",goodsAreaId);
return R.fail(403,"货区不存在");
}
String areaType = goodsAreaEntity.getAreaType();
if(!"1".equals(areaType)){
log.warn("#################upShelfPackage: 备货区不能上下架 goodsAreaId={}",goodsAreaId);
throw new CustomerException(403,"请扫描备货库位");
}
Long wid = goodsAreaEntity.getWarehouseId();
BasicdataWarehouseEntity warehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(wid);
if(Objects.isNull(warehouseEntity)){
log.warn("##############upShelfPackage: 仓库不存在 warehouseId={}",wid);
return R.fail(403,"仓库不存在");
}
if(!wid.equals(warehouseId)){
log.warn("##############upShelfPackage: 库位不属于本仓库 wid={}",wid);
return R.fail(403,"库位不属于本仓库");
}
List<UpShelfPackageDTO> waitUpShelfPackageDTO = new ArrayList<>();
List<WarehouseUpdownStockupAreaEntity> waitSaveWarehouseUpdownStockupAreaEntity = new ArrayList<>();
List<WarehouseUpdownStockupAreaLogEntity> waitSaveWarehouseUpdownStockupAreaLogEntity = new ArrayList<>();
for (UpStockupAreaPackageDTO upStockupAreaPackageDTO : upStockupAreaPackageDTOS) {
if ("1".equals(upStockupAreaPackageDTO.getGoodsType())){
//有数据的包件
WarehouseUpdownGoodsEntity updownGoodsEntity = warehouseUpdownGoodsService.getOne(Wrappers.<WarehouseUpdownGoodsEntity>query().lambda()
.eq(WarehouseUpdownGoodsEntity::getWarehouseId, warehouseId)
.eq(WarehouseUpdownGoodsEntity::getAssociationValue, warehouseId)
.eq(WarehouseUpdownGoodsEntity::getAssociationType, "3")
);
if (!Objects.isNull(updownGoodsEntity)){
//进行下架解托操作
UpShelfPackageDTO upShelfPackageDTO = new UpShelfPackageDTO();
upShelfPackageDTO.setOrderPackageCode(updownGoodsEntity.getAssociationValue());
waitUpShelfPackageDTO.add(upShelfPackageDTO);
}
}
WarehouseUpdownStockupAreaEntity updownStockupAreaEntity = BeanUtil.copy(upStockupAreaPackageDTO, WarehouseUpdownStockupAreaEntity.class);
updownStockupAreaEntity.setAreaTitle(goodsAreaEntity.getHeadline());
updownStockupAreaEntity.setAreaId(goodsAreaEntity.getId());
updownStockupAreaEntity.setShelfId(goodsShelfEntity.getId());
updownStockupAreaEntity.setShelfTitle(goodsShelfEntity.getGoodsShelfName());
updownStockupAreaEntity.setAllocationId(goodsAllocationEntity.getId());
updownStockupAreaEntity.setAllocationTitle(goodsAllocationEntity.getGoodsAllocationName());
updownStockupAreaEntity.setPositionCode(goodsAllocationEntity.getQrCode());
updownStockupAreaEntity.setUpdownType("包条");
waitSaveWarehouseUpdownStockupAreaEntity.add(updownStockupAreaEntity);
WarehouseUpdownStockupAreaLogEntity warehouseUpdownStockupAreaLogEntity = BeanUtil.copy(updownStockupAreaEntity, WarehouseUpdownStockupAreaLogEntity.class);
warehouseUpdownStockupAreaLogEntity.setRemark("扫描上架:包条上架");
warehouseUpdownStockupAreaLogEntity.setBindingType(1);
waitSaveWarehouseUpdownStockupAreaLogEntity.add(warehouseUpdownStockupAreaLogEntity);
//查询是否进行了上架,如果进行了上架需要进行对原库位进行下架,
}
if (Func.isNotEmpty(waitUpShelfPackageDTO)){
//存在需要进行下架操作的包件
R r = warehouseUpdownTypeService.downPackageOrDelTray(waitUpShelfPackageDTO, warehouseId);
if (200 !=r.getCode()){
//进行异常保证事务回滚
log.warn(method+"执行下架失败");
throw new RuntimeException("执行下架失败");
}
}
warehouseUpdownStockupAreaLogService.saveBatch(waitSaveWarehouseUpdownStockupAreaLogEntity);
return R.status(this.saveBatch(waitSaveWarehouseUpdownStockupAreaEntity));
}
}
Loading…
Cancel
Save