新增包装箱编码获取包装箱和箱内物料信息
This commit is contained in:
parent
443cbfd194
commit
5bae050ad6
|
|
@ -15,6 +15,7 @@ import com.nflg.wms.common.pojo.dto.InventoryInDTO;
|
|||
import com.nflg.wms.common.pojo.dto.InventoryOutDTO;
|
||||
import com.nflg.wms.common.pojo.dto.QrCodeMasterPrintDTO;
|
||||
import com.nflg.wms.common.pojo.qo.*;
|
||||
import com.nflg.wms.common.pojo.vo.PackageInfoVO;
|
||||
import com.nflg.wms.common.pojo.vo.QrCodeItemVO;
|
||||
import com.nflg.wms.common.pojo.vo.QrCodeVO;
|
||||
import com.nflg.wms.common.pojo.vo.StrappingVO;
|
||||
|
|
@ -22,7 +23,9 @@ import com.nflg.wms.common.util.NumberUtil;
|
|||
import com.nflg.wms.common.util.StringUtil;
|
||||
import com.nflg.wms.common.util.UserUtil;
|
||||
import com.nflg.wms.common.util.VUtil;
|
||||
import com.nflg.wms.repository.entity.WmsPackageItem;
|
||||
import com.nflg.wms.repository.entity.WmsQrCodeMaster;
|
||||
import com.nflg.wms.repository.service.IWmsPackageItemService;
|
||||
import com.nflg.wms.repository.service.IWmsQrCodeMasterService;
|
||||
import com.nflg.wms.starter.annotation.ApiMark;
|
||||
import jakarta.annotation.Resource;
|
||||
|
|
@ -63,6 +66,9 @@ public class QrCodeMasterController extends BaseController {
|
|||
@Resource
|
||||
private IWmsQrCodeMasterService qrCodeMasterService;
|
||||
|
||||
@Resource
|
||||
private IWmsPackageItemService wmsPackageItemService;
|
||||
|
||||
/**
|
||||
* 获取包装码信息
|
||||
*/
|
||||
|
|
@ -118,6 +124,38 @@ public class QrCodeMasterController extends BaseController {
|
|||
return ApiResult.success(vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 包装箱编码获取包装箱和箱内物料信息
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("getContent")
|
||||
@ApiMark(moduleName = "包装箱编码获取获取包装箱信息", apiName = "包装箱编码获取获取包装箱信息")
|
||||
public ApiResult<List<PackageInfoVO>> getPackageInfos(@Valid @RequestBody PackageQO request) {
|
||||
List<WmsPackageItem> wmsPackageItems = wmsPackageItemService.lambdaQuery()
|
||||
.eq(WmsPackageItem::getPackageId,request.getPackageId())
|
||||
.list();
|
||||
List<String> barcodeCodes = wmsPackageItems.stream()
|
||||
.map(WmsPackageItem::getBarcodeCode)
|
||||
.filter(Objects::nonNull)
|
||||
.toList();
|
||||
List<WmsQrCodeMaster> qrCodeMasterList = qrCodeMasterService.lambdaQuery()
|
||||
.in(WmsQrCodeMaster::getBarcodeCode, barcodeCodes)
|
||||
.list();
|
||||
List<PackageInfoVO> packageInfoVOS = Convert.toList(PackageInfoVO.class,qrCodeMasterList);
|
||||
packageInfoVOS.forEach(vo -> {
|
||||
WmsPackageItem item = wmsPackageItems.stream()
|
||||
.filter(p -> StrUtil.equals(p.getBarcodeCode(), vo.getBarcodeCode()))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
if (item != null) {
|
||||
vo.setDeliveryNo(item.getDeliveryNo());
|
||||
vo.setDeliveryLineNo(item.getDeliveryLineNo());
|
||||
}
|
||||
});
|
||||
return ApiResult.success(packageInfoVOS);
|
||||
}
|
||||
|
||||
/**
|
||||
* 箱码Validation
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
package com.nflg.wms.common.pojo.qo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PackageQO {
|
||||
/**
|
||||
* 包装编号Id
|
||||
*/
|
||||
private Long packageId;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
package com.nflg.wms.common.pojo.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PackageInfoVO {
|
||||
/**
|
||||
* 条码号
|
||||
*/
|
||||
private String barcodeCode;
|
||||
/**
|
||||
* 物料编号
|
||||
*/
|
||||
private String materialCode;
|
||||
/**
|
||||
* 物料描述
|
||||
*/
|
||||
private String materialDescription;
|
||||
/**
|
||||
* 条码类型
|
||||
*/
|
||||
private Short packagingType;
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private BigDecimal quantity;
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
private String batchNo;
|
||||
/**
|
||||
* 序列号
|
||||
*/
|
||||
private String serialNo;
|
||||
/**
|
||||
* 供应商编号
|
||||
*/
|
||||
private String supplierCode;
|
||||
/**
|
||||
* 供应商名称
|
||||
*/
|
||||
private String supplierName;
|
||||
/**
|
||||
* 所属工厂
|
||||
*/
|
||||
private String factoryCode;
|
||||
/**
|
||||
* 仓库
|
||||
*/
|
||||
private String storageLocation;
|
||||
/**
|
||||
* 储位
|
||||
*/
|
||||
private String binLocation;
|
||||
|
||||
/**
|
||||
* 送货单单号
|
||||
*/
|
||||
private String deliveryNo;
|
||||
/**
|
||||
* 送货单行号
|
||||
*/
|
||||
private String deliveryLineNo;
|
||||
}
|
||||
Loading…
Reference in New Issue