diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/PackageStockupVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/PackageStockupVO.java index 6be965c56..edd6f66c0 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/PackageStockupVO.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/PackageStockupVO.java @@ -22,6 +22,7 @@ public class PackageStockupVO implements Serializable { private String isScanStr;//是否备货 private String scaned;//备货 + private String materialName;//物料名称 private Long scanId;//扫码记录id diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/dto/BasicdataStorageServicesDTO.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/dto/BasicdataStorageServicesDTO.java index 112618a77..c0651c27c 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/dto/BasicdataStorageServicesDTO.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/dto/BasicdataStorageServicesDTO.java @@ -33,6 +33,6 @@ import java.util.List; public class BasicdataStorageServicesDTO extends BasicdataStorageServicesEntity { private static final long serialVersionUID = 1L; - private List sendWarehouseIds; + private List sendWarehouseIds; //发站仓 } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataStorageServicesServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataStorageServicesServiceImpl.java index 9af8f7b8d..2493c7467 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataStorageServicesServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataStorageServicesServiceImpl.java @@ -30,9 +30,11 @@ import com.logpm.basicdata.excel.BasicdataStorageServicesExcel; import com.logpm.basicdata.mapper.BasicdataStorageServicesMapper; import com.logpm.basicdata.service.IBasicdataStorageServicesService; import lombok.AllArgsConstructor; +import org.springblade.core.log.exception.ServiceException; import org.springblade.core.secure.BladeUser; import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.ObjectUtil; import org.springblade.system.entity.Dept; import org.springblade.system.entity.User; import org.springblade.system.feign.IDeptClient; @@ -96,73 +98,57 @@ public class BasicdataStorageServicesServiceImpl extends BaseServiceImpl sendWarehouseIds = new ArrayList<>(); if(ObjectUtils.isNull( basicdataStorageServices.getSendWarehouseIds()) || basicdataStorageServices.getSendWarehouseIds().size() == 0 ){ - BladeUser user = AuthUtil.getUser(); - // R userR = userClient.userInfoByIdOwn(user.getUserId()); - QueryWrapper queryWrapper = new QueryWrapper(); - queryWrapper.eq("tenant_id",user.getTenantId()); - /*if(userR.getData().getRoleName().equals("管理员")){ - //查询全部 - queryWrapper.eq("tenant_id",user.getTenantId()); - }else{ - queryWrapper.eq("department",user.getDeptId()); - }*/ - //查询全部仓库 - List list1 = basicdataWarehouseService.list(queryWrapper); - //查询有没有过服务舱 List list = this.list(Wrappers.query().lambda() .eq(BasicdataStorageServicesEntity::getServeWarehouseId, basicdataStorageServices.getServeWarehouseId()) .eq(BasicdataStorageServicesEntity::getClientId, basicdataStorageServices.getClientId()) ); - if(list.size() > 0){ - // 有 - list.removeIf(q -> { - boolean b = list1.stream().anyMatch(i -> i.getId().equals(q.getSendWarehouseId())); - if (b) { - return list1.removeIf(i -> i.getId().equals(q.getSendWarehouseId())); - } - return false; - }); -// list1.removeIf(person1 -> list.stream().anyMatch(person2 -> person2.getSendWarehouseId().equals(person1.getId()))); - List collect = list1.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList()); - sendWarehouseIds = collect.stream().map(String::valueOf).collect(Collectors.toList()); + boolean b = list.stream().anyMatch(i -> ObjectUtil.isEmpty(i.getSendWarehouseId())); + if(b){ + throw new ServiceException("当前添加已存在!"); }else{ - //没有 - List collect = list1.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList()); - sendWarehouseIds = collect.stream().map(String::valueOf).collect(Collectors.toList()); - } - }else{ - sendWarehouseIds = basicdataStorageServices.getSendWarehouseIds(); - } - List servicesEntities = new ArrayList<>(); - sendWarehouseIds.forEach( i ->{ - - List list = this.list(Wrappers.query().lambda() - .eq(BasicdataStorageServicesEntity::getServeWarehouseId, basicdataStorageServices.getServeWarehouseId()) - .eq(BasicdataStorageServicesEntity::getSendWarehouseId, i) - .eq(BasicdataStorageServicesEntity::getClientId, basicdataStorageServices.getClientId()) - - ); - if(list.size() < 1){ - BasicdataStorageServicesEntity basicdataStorageServicesEntity = new BasicdataStorageServicesEntity(); - BeanUtils.copyProperties(basicdataStorageServices,basicdataStorageServicesEntity); - // 获取仓库名称 - BasicdataWarehouseEntity sendBasicdataWarehouseEntity = basicdataWarehouseService.getById(i); - basicdataStorageServicesEntity.setSendWarehouseName(sendBasicdataWarehouseEntity.getName()); - BasicdataWarehouseEntity serveBasicdataWarehouseEntity = basicdataWarehouseService.getById(basicdataStorageServices.getServeWarehouseId()); - basicdataStorageServicesEntity.setServeWarehouseName(serveBasicdataWarehouseEntity.getName()); - basicdataStorageServicesEntity.setSendWarehouseId(i); - servicesEntities.add(basicdataStorageServicesEntity); } + } + List sendWarehouseIds = basicdataStorageServices.getSendWarehouseIds(); + List servicesEntities = new ArrayList<>(); + if(ObjectUtil.isEmpty(sendWarehouseIds) || sendWarehouseIds.size() < 1){ + BasicdataStorageServicesEntity basicdataStorageServicesEntity = new BasicdataStorageServicesEntity(); + BeanUtils.copyProperties(basicdataStorageServices,basicdataStorageServicesEntity); + // 获取仓库名称 + BasicdataWarehouseEntity serveBasicdataWarehouseEntity = basicdataWarehouseService.getById(basicdataStorageServices.getServeWarehouseId()); + basicdataStorageServicesEntity.setServeWarehouseName(serveBasicdataWarehouseEntity.getName()); + servicesEntities.add(basicdataStorageServicesEntity); + }else{ + sendWarehouseIds.forEach( i ->{ + + List list = this.list(Wrappers.query().lambda() + .eq(BasicdataStorageServicesEntity::getServeWarehouseId, basicdataStorageServices.getServeWarehouseId()) + .eq(BasicdataStorageServicesEntity::getSendWarehouseId, i) + .eq(BasicdataStorageServicesEntity::getClientId, basicdataStorageServices.getClientId()) + + ); + if(list.size() < 1){ + BasicdataStorageServicesEntity basicdataStorageServicesEntity = new BasicdataStorageServicesEntity(); + BeanUtils.copyProperties(basicdataStorageServices,basicdataStorageServicesEntity); + // 获取仓库名称 + BasicdataWarehouseEntity sendBasicdataWarehouseEntity = basicdataWarehouseService.getById(i); + basicdataStorageServicesEntity.setSendWarehouseName(sendBasicdataWarehouseEntity.getName()); + BasicdataWarehouseEntity serveBasicdataWarehouseEntity = basicdataWarehouseService.getById(basicdataStorageServices.getServeWarehouseId()); + basicdataStorageServicesEntity.setServeWarehouseName(serveBasicdataWarehouseEntity.getName()); + basicdataStorageServicesEntity.setSendWarehouseId(i); + servicesEntities.add(basicdataStorageServicesEntity); + } + + + }); + } - }); if(servicesEntities.size() > 0){ this.saveBatch(servicesEntities); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml index 9b6b57c66..ab1acf6bd 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml @@ -99,7 +99,7 @@ and CONCAT(ldpl.cargo_title,'-',ldpl.shelf_title,'-',ldpl.goods_allocation) = #{allocation} and ldpl.pallet = #{pallet} and ldr.is_deleted = 0 --> - select ldpl.order_code orderCode,ldpl.order_package_code packageBarCode, 1 goodsType,ldrp.parce_list_id parceListId + select ldpl.order_code orderCode,ldpl.order_package_code packageBarCode, 1 goodsType,ldrp.parce_list_id parceListId,ldpl.material_name materialName from logpm_distribution_reservation_package ldrp LEFT JOIN logpm_distribution_parcel_list ldpl on ldrp.parce_list_id = ldpl.id LEFT JOIN logpm_warehouse_tray_goods lwtg on lwtg.association_id =ldrp.parce_list_id and lwtg.association_type = '3'