zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/LocDetl.java
@@ -9,6 +9,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.zy.asrs.common.utils.Synchro; import com.zy.asrs.framework.common.DateUtils; import com.zy.asrs.wms.asrs.entity.dto.MatnrDetlDto; import com.zy.asrs.wms.asrs.service.LocService; import com.zy.asrs.wms.asrs.service.MatFieldService; import com.zy.asrs.wms.asrs.service.MatService; @@ -147,10 +148,10 @@ @ApiModelProperty(value= "库存冻结 1: 冻结 0: 正常") private Integer freeze; // @ApiModelProperty("物料信息") // @TableField(exist = false) // @Delegate // private Mat mats; @ApiModelProperty("物料信息") @TableField(exist = false) private MatnrDetlDto mats; public LocDetl() {} zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/dto/MatnrDetlDto.java
New file @@ -0,0 +1,25 @@ package com.zy.asrs.wms.asrs.entity.dto; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.experimental.Accessors; @Data @Accessors(chain = true) @ApiModel(value = "MatnrDetlDto", description = "物料详情") public class MatnrDetlDto { //产品编码 @ApiModelProperty("物料编码") private String matnrNo; //产品名称 @ApiModelProperty("产品名称") private String matnrName; //产品型号 @ApiModelProperty("型号") private String type; //产品规格 @ApiModelProperty("规格") private String tspec; } zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/LocDetlServiceImpl.java
@@ -213,18 +213,18 @@ } @Override @Transactional(rollbackFor = Exception.class) public void removeLocDetl(Long locId) { List<LocDetl> locDetls = this.list(new LambdaQueryWrapper<LocDetl>().eq(LocDetl::getLocId, locId)); for (LocDetl locDetl : locDetls) { boolean remove = locDetlFieldService.remove(new LambdaQueryWrapper<LocDetlField>().eq(LocDetlField::getDetlId, locDetl.getId())); if (!remove) { throw new CoolException("扩展字段删除失败"); } // if (!remove) { // throw new CoolException("扩展字段删除失败"); // } boolean result = this.removeById(locDetl.getId()); if (!result) { throw new CoolException("明细删除失败"); } // if (!result) { // throw new CoolException("明细删除失败"); // } } } zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/MobileServiceImpl.java
@@ -10,6 +10,7 @@ import com.zy.asrs.wms.apis.wcs.entity.response.CommonReponse; import com.zy.asrs.wms.apis.wcs.utils.HttpEssUtils; import com.zy.asrs.wms.asrs.entity.*; import com.zy.asrs.wms.asrs.entity.dto.MatnrDetlDto; import com.zy.asrs.wms.asrs.entity.dto.PickSheetDetlDto; import com.zy.asrs.wms.asrs.entity.dto.ShippingOrderDetlDto; import com.zy.asrs.wms.asrs.entity.enums.*; @@ -680,7 +681,13 @@ List<LocDetl> detls = locDetlService.list(new LambdaQueryWrapper<LocDetl>() .eq(LocDetl::getLocNo, barcode)); for (int i = 0; i < detls.size(); i++) { // detls.get(i).setMats(matService.getOne(new LambdaQueryWrapper<Mat>().eq(Mat::getMatnr, detls.get(i).getMatnr()))); Mat mat = matService.getOne(new LambdaQueryWrapper<Mat>().eq(Mat::getId, detls.get(i).getMatId())); MatnrDetlDto detlDto = new MatnrDetlDto(); detlDto.setTspec(mat.getSpecs()) .setType(mat.getModel()) .setMatnrName(mat.getMaktx()) .setMatnrNo(mat.getMatnr()); detls.get(i).setMats(detlDto); } return detls; } @@ -697,7 +704,7 @@ .eq(Loc::getLocStsId, LocStsType.F.val()) .eq(Loc::getLocNo, param.get("barcode"))); if (Objects.isNull(barcode)) { throw new CoolException("源库位明细不存在!!"); throw new CoolException(param.get("barcode") + "库位状态不可执行此操作!!"); } Loc tarCode = locService.getOne(new LambdaQueryWrapper<Loc>() .eq(Loc::getLocStsId, LocStsType.O.val()) @@ -711,7 +718,7 @@ List<LocArea> locAreas = locAreaService.list(new LambdaQueryWrapper<LocArea>() .in(LocArea::getLocId, ids) .eq(LocArea::getTypeId, LocAreaTypeSts.LOC_AREA_TYPE_FLAT.id)); if (!locAreas.isEmpty() && locAreas.size() == ids.size()) { if (!locAreas.isEmpty() && locAreas.size() != ids.size()) { throw new CoolException("非平库不可执行此操作!!"); } @@ -720,6 +727,19 @@ return R.error("库位明细不存在!!"); } if (!locService.update(new LambdaUpdateWrapper<Loc>() .eq(Loc::getLocNo, barcode.getLocNo()) .set(Loc::getBarcode, null) .set(Loc::getLocStsId, LocStsType.O.val()))) { throw new CoolException("源库位状态修改失败!!"); } if (!locService.update(new LambdaUpdateWrapper<Loc>().eq(Loc::getLocNo, tarCode.getLocNo()) .set(Loc::getBarcode, barcode.getBarcode()) .set(Loc::getLocStsId, LocStsType.F.val()))) { throw new CoolException("目标库位修改失败!!"); } if (!locDetlService.update(new LambdaUpdateWrapper<LocDetl>() .eq(LocDetl::getLocId, barcode.getId()) .set(LocDetl::getLocId, tarCode.getId())