增加包装箱编码获取包装箱和箱内物料信息接口
This commit is contained in:
parent
21599dcc2d
commit
8c317215a2
|
|
@ -15,14 +15,14 @@ import com.nflg.wms.common.pojo.dto.InventoryInDTO;
|
||||||
import com.nflg.wms.common.pojo.dto.InventoryOutDTO;
|
import com.nflg.wms.common.pojo.dto.InventoryOutDTO;
|
||||||
import com.nflg.wms.common.pojo.dto.QrCodeMasterPrintDTO;
|
import com.nflg.wms.common.pojo.dto.QrCodeMasterPrintDTO;
|
||||||
import com.nflg.wms.common.pojo.qo.*;
|
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.QrCodeItemVO;
|
||||||
import com.nflg.wms.common.pojo.vo.QrCodeVO;
|
import com.nflg.wms.common.pojo.vo.QrCodeVO;
|
||||||
import com.nflg.wms.common.pojo.vo.StrappingVO;
|
import com.nflg.wms.common.pojo.vo.StrappingVO;
|
||||||
import com.nflg.wms.common.util.NumberUtil;
|
import com.nflg.wms.common.util.*;
|
||||||
import com.nflg.wms.common.util.StringUtil;
|
import com.nflg.wms.repository.entity.WmsPackageItem;
|
||||||
import com.nflg.wms.common.util.UserUtil;
|
|
||||||
import com.nflg.wms.common.util.VUtil;
|
|
||||||
import com.nflg.wms.repository.entity.WmsQrCodeMaster;
|
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.repository.service.IWmsQrCodeMasterService;
|
||||||
import com.nflg.wms.starter.annotation.ApiMark;
|
import com.nflg.wms.starter.annotation.ApiMark;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
|
|
@ -30,6 +30,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.core.io.ClassPathResource;
|
import org.springframework.core.io.ClassPathResource;
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
|
|
@ -52,6 +53,7 @@ import java.util.zip.ZipOutputStream;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 装箱管理
|
* 装箱管理
|
||||||
|
*
|
||||||
* @author: nflg
|
* @author: nflg
|
||||||
* @date: 2022/3/17
|
* @date: 2022/3/17
|
||||||
* @description:
|
* @description:
|
||||||
|
|
@ -63,6 +65,9 @@ public class QrCodeMasterController extends BaseController {
|
||||||
@Resource
|
@Resource
|
||||||
private IWmsQrCodeMasterService qrCodeMasterService;
|
private IWmsQrCodeMasterService qrCodeMasterService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IWmsPackageItemService wmsPackageItemService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取包装码信息
|
* 获取包装码信息
|
||||||
*/
|
*/
|
||||||
|
|
@ -91,7 +96,7 @@ public class QrCodeMasterController extends BaseController {
|
||||||
.eq(WmsQrCodeMaster::getBarcodeCode, request.getBarcodeCode())
|
.eq(WmsQrCodeMaster::getBarcodeCode, request.getBarcodeCode())
|
||||||
.one();
|
.one();
|
||||||
VUtil.trueThrowBusinessError(ObjectUtil.isNull(qrCodeMaster)).throwMessage("无效码");
|
VUtil.trueThrowBusinessError(ObjectUtil.isNull(qrCodeMaster)).throwMessage("无效码");
|
||||||
VUtil.trueThrowBusinessError(qrCodeMaster.getPackagingType()!=1).throwMessage("此码不属于箱码");
|
VUtil.trueThrowBusinessError(qrCodeMaster.getPackagingType() != 1).throwMessage("此码不属于箱码");
|
||||||
VUtil.trueThrowBusinessError(qrCodeMaster.getProcessStage() != BarCodeProcessStage.Unpackaged.getState())
|
VUtil.trueThrowBusinessError(qrCodeMaster.getProcessStage() != BarCodeProcessStage.Unpackaged.getState())
|
||||||
.throwMessage("此箱码已处于【" + BarCodeProcessStage.findByValue(qrCodeMaster.getProcessStage()).getDescription() + "】状态,不可以操作");
|
.throwMessage("此箱码已处于【" + BarCodeProcessStage.findByValue(qrCodeMaster.getProcessStage()).getDescription() + "】状态,不可以操作");
|
||||||
List<WmsQrCodeMaster> smallQrCodeMasters = qrCodeMasterService.lambdaQuery()
|
List<WmsQrCodeMaster> smallQrCodeMasters = qrCodeMasterService.lambdaQuery()
|
||||||
|
|
@ -118,6 +123,39 @@ public class QrCodeMasterController extends BaseController {
|
||||||
return ApiResult.success(vo);
|
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
|
* 箱码Validation
|
||||||
|
|
@ -244,6 +282,7 @@ public class QrCodeMasterController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 换箱
|
* 换箱
|
||||||
* 针对仓库内的物料箱合并,修改物料的箱属性和库存
|
* 针对仓库内的物料箱合并,修改物料的箱属性和库存
|
||||||
|
*
|
||||||
* @param request
|
* @param request
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -348,7 +387,7 @@ public class QrCodeMasterController extends BaseController {
|
||||||
* @param request
|
* @param request
|
||||||
* @return
|
* @return
|
||||||
* @author
|
* @author
|
||||||
* */
|
*/
|
||||||
@PostMapping("pda/scan")
|
@PostMapping("pda/scan")
|
||||||
@ApiMark(moduleName = "扫码", apiName = "扫码获取扫码信息")
|
@ApiMark(moduleName = "扫码", apiName = "扫码获取扫码信息")
|
||||||
public ApiResult<QrCodeVO> scan(@Valid @RequestBody QRCodeSearchQO request) {
|
public ApiResult<QrCodeVO> scan(@Valid @RequestBody QRCodeSearchQO request) {
|
||||||
|
|
@ -379,6 +418,7 @@ public class QrCodeMasterController extends BaseController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出标签图片为ZIP
|
* 导出标签图片为ZIP
|
||||||
|
*
|
||||||
* @param datas 二维码列表
|
* @param datas 二维码列表
|
||||||
*/
|
*/
|
||||||
@PostMapping(value = "exportToZip", produces = "application/zip")
|
@PostMapping(value = "exportToZip", produces = "application/zip")
|
||||||
|
|
@ -408,6 +448,7 @@ public class QrCodeMasterController extends BaseController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出标签图片为PDF
|
* 导出标签图片为PDF
|
||||||
|
*
|
||||||
* @param datas 二维码列表
|
* @param datas 二维码列表
|
||||||
*/
|
*/
|
||||||
@PostMapping("exportToPdf")
|
@PostMapping("exportToPdf")
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
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