From 2ca45f3d94c8c7ccd591758913f9bf7e5dd5f123 Mon Sep 17 00:00:00 2001 From: "0.0" <1092404103.qq.com> Date: Mon, 14 Aug 2023 17:09:42 +0800 Subject: [PATCH] =?UTF-8?q?1.=E8=B4=A7=E4=BD=8D=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BasicdataGoodsAllocationEntity.java | 4 + .../entity/WarehouseParcelListEntity.java | 229 +++++++++++++ .../feign/IWarehouseUpdownGoodsClient.java | 53 +++ .../warehouse/vo/WarehouseParcelListVO.java | 64 ++++ .../logpm/basicdata/BasicDataApplication.java | 1 + .../BasicdataGoodsShelfController.java | 10 + .../service/IBasicdataGoodsShelfService.java | 5 +- .../impl/BasicdataGoodsShelfServiceImpl.java | 324 +++++++++++++++++- .../DistrilbutionCallDeliveryServiceImpl.java | 2 +- .../WarehouseUpdownGoodsController.java | 151 ++++++++ .../dto/WarehouseUpdownGoodsDTO.java | 34 ++ .../excel/WarehouseUpdownGoodsExcel.java | 172 ++++++++++ .../feign/WarehouseUpdownGoodsClient.java | 36 ++ .../mapper/WarehouseUpdownGoodsMapper.java | 60 ++++ .../mapper/WarehouseUpdownGoodsMapper.xml | 78 +++++ .../service/IWarehouseUpdownGoodsService.java | 65 ++++ .../impl/WarehouseUpdownGoodsServiceImpl.java | 68 ++++ .../wrapper/WarehouseTrayTypeWrapper.java | 4 +- .../wrapper/WarehouseUpdownGoodsWrapper.java | 50 +++ 19 files changed, 1400 insertions(+), 10 deletions(-) create mode 100644 blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseParcelListEntity.java create mode 100644 blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseUpdownGoodsClient.java create mode 100644 blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/WarehouseParcelListVO.java create mode 100644 blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseUpdownGoodsController.java create mode 100644 blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/WarehouseUpdownGoodsDTO.java create mode 100644 blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/excel/WarehouseUpdownGoodsExcel.java create mode 100644 blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseUpdownGoodsClient.java create mode 100644 blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsMapper.java create mode 100644 blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsMapper.xml create mode 100644 blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseUpdownGoodsService.java create mode 100644 blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownGoodsServiceImpl.java create mode 100644 blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/wrapper/WarehouseUpdownGoodsWrapper.java diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataGoodsAllocationEntity.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataGoodsAllocationEntity.java index 6fff90181..3e3d12682 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataGoodsAllocationEntity.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataGoodsAllocationEntity.java @@ -23,6 +23,8 @@ import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.core.tenant.mp.TenantEntity; +import java.util.List; + /** * 货位 实体类 * @@ -130,4 +132,6 @@ public class BasicdataGoodsAllocationEntity extends TenantEntity { @ApiModelProperty(value = "旧库位码") private String oldQrCode; + + } diff --git a/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseParcelListEntity.java b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseParcelListEntity.java new file mode 100644 index 000000000..ce9f82638 --- /dev/null +++ b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseParcelListEntity.java @@ -0,0 +1,229 @@ +///* +// * 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.entity; +// +//import com.baomidou.mybatisplus.annotation.TableField; +//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; +// +//import java.util.Date; +// +///** +// * 在库订单包件清单 实体类 +// * +// * @author cyz +// * @since 2023-06-13 +// */ +//@Data +//@TableName("logpm_distribution_parcel_list") +//@ApiModel(value = "DistributionParcelList对象", description = "在库订单包件清单") +//@EqualsAndHashCode(callSuper = true) +//public class WarehouseParcelListEntity extends TenantEntity { +// +// /** +// * 预留1 +// */ +// @ApiModelProperty(value = "预留1") +// private String reserve1; +// /** +// * 预留2 +// */ +// @ApiModelProperty(value = "预留2") +// private String reserve2; +// /** +// * 预留3 +// */ +// @ApiModelProperty(value = "预留3") +// private String reserve3; +// /** +// * 预留4 +// */ +// @ApiModelProperty(value = "预留4") +// private String reserve4; +// /** +// * 预留5 +// */ +// @ApiModelProperty(value = "预留5") +// private String reserve5; +// /** +// * 订单自编号 +// */ +// @ApiModelProperty(value = "订单自编号") +// private String orderCode; +// /** +// * 仓库 +// */ +// @ApiModelProperty(value = "仓库") +// private String warehouse; +// +// @ApiModelProperty(value = "仓库ID") +// private Long warehouseId; +// /** +// * 状态 +// */ +// @ApiModelProperty(value = "状态") +// private Integer conditions; +// /** +// * 包条码 +// */ +// @ApiModelProperty(value = "包条码") +// @TableField("order_package_code") +// private String orderPackageCode; +// +// @ApiModelProperty(value = "货区信息") +// private String cargoTitle; +// +// @ApiModelProperty(value = "货架信息") +// private String shelfTitle; +// /** +// * 货位信息 +// */ +// @ApiModelProperty(value = "货位信息") +// private String goodsAllocation; +// /** +// * 所在托盘 +// */ +// @ApiModelProperty(value = "所在托盘") +// private String pallet; +// /** +// * 一级品 +// */ +// @ApiModelProperty(value = "一级品") +// private String firsts; +// /** +// * 二级品 +// */ +// @ApiModelProperty(value = "二级品") +// private String second; +// /** +// * 三级品 +// */ +// @ApiModelProperty(value = "三级品") +// private String thirdProduct; +// /** +// * 入库时间 +// */ +// @ApiModelProperty(value = "入库时间") +// private Date warehouseEntryTimeEnd; +// /** +// * 运单号 +// */ +// @ApiModelProperty(value = "运单号") +// private String waybillNumber; +// /** +// * 运单ID +// */ +// @ApiModelProperty(value = "运单ID") +// private String waybillId; +// /** +// * 客户id +// */ +// @ApiModelProperty(value = "客户id") +// @TableField(exist = false) +// private String marketId; +// /** +// * 物料Id +// */ +// @ApiModelProperty(value = "物料ID") +// private Long materialId; +// +// /** +// * 物料名称 +// */ +// @ApiModelProperty(value = "物料名称") +// private String materialName; +// /** +// * 物料编号 +// */ +// @ApiModelProperty(value = "物料编号") +// private String materialCode; +// /** +// * 物料单位 +// */ +// @ApiModelProperty(value = "物料单位") +// private String materialUnit; +// /** +// * 数量 +// */ +// @ApiModelProperty(value = "数量") +// private Integer quantity; +// /** +// * 车次号 +// */ +// @ApiModelProperty(value = "车次号") +// private String trainNumber; +// /** +// * 在库订单ID +// */ +// @ApiModelProperty(value = "在库订单ID") +// private Long stockArticleId; +// +// /** +// * 服务号 +// */ +// @ApiModelProperty(value = "服务号") +// private String serviceNumber; +// /** +// * 品牌ID +// */ +// @ApiModelProperty(value = "品牌ID") +// private Long brandId; +// /** +// * 品牌名称 +// */ +// @ApiModelProperty(value = "品牌名称") +// private String brandName; +//// /** +//// * 配送状态 +//// */ +//// @ApiModelProperty(value = "配送状态") +//// private String deliveryState; +// /** +// * 包件状态 +// */ +// @ApiModelProperty(value = "包件状态") +// private String orderPackageStatus; +// +// @ApiModelProperty(value = "包件冻结状态") +// private String orderPackageFreezeStatus; +// +// @ApiModelProperty(value = "包件冻结状态") +// private String orderPackageReservationStatus; +// +// +// +// @ApiModelProperty(value = "备货状态") +// private String orderPackageStockupStatus; +// +// @ApiModelProperty(value = "上架状态") +// private String orderPackageGroundingStatus; +// +// +// +// +// +//// /** +//// * 配送状态 +//// */ +//// @ApiModelProperty(value = "配送状态") +//// private String orderPackageStatus; +// +//} diff --git a/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseUpdownGoodsClient.java b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseUpdownGoodsClient.java new file mode 100644 index 000000000..d9bc79727 --- /dev/null +++ b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseUpdownGoodsClient.java @@ -0,0 +1,53 @@ +/* + * 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.feign; + + +import org.springblade.common.constant.ModuleNameConstant; + +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; + +import org.springframework.web.bind.annotation.RequestParam; + +import java.util.List; + +/** + * 货位与货物绑定 Feign接口类 + * + * @author lmy + * @since 2023-08-14 + */ +@FeignClient( + value = ModuleNameConstant.APPLICATION_WAREHOUSE_NAME +) +public interface IWarehouseUpdownGoodsClient { + + String API_PREFIX = "updownGoods/client"; + String TOP = API_PREFIX + "/top"; + +// /** +// *查询包条 +// */ +// @GetMapping(TOP + "/selectListByAllo") +// List selectListByAllo(@RequestParam Long alloId); + /** + *改货位有无物品 + */ + @GetMapping(TOP + "/selectCountByAllo") + Integer selectCountByAllo(@RequestParam Long alloId); +} diff --git a/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/WarehouseParcelListVO.java b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/WarehouseParcelListVO.java new file mode 100644 index 000000000..4517e5dea --- /dev/null +++ b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/WarehouseParcelListVO.java @@ -0,0 +1,64 @@ +///* +// * 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.vo; +// +//import com.logpm.distribution.entity.DistributionParcelListEntity; +//import com.logpm.warehouse.entity.WarehouseParcelListEntity; +//import lombok.Data; +//import lombok.EqualsAndHashCode; +// +//import java.util.Date; +// +///** +// * 在库订单包件清单 视图实体类 +// * +// * @author cyz +// * @since 2023-06-13 +// */ +//@Data +//@EqualsAndHashCode(callSuper = true) +//public class WarehouseParcelListVO extends WarehouseParcelListEntity { +// private static final long serialVersionUID = 1L; +// +// private String stockupStatus; +// private Date stockupDate; +// private String stockupArea; +// private String goodsAllocation; +// /** +// * 包件状态名称 +// */ +// private String orderPackageStatusName; +// /** +// * 包件冻结状态 +// */ +// private String orderPackageFreezeStatusName; +// /** +// * 包件上架状态 +// */ +// private String orderPackageGroundingStatusName; +// /** +// * 包件备货状态 +// */ +// private String orderPackageStockupStatusName; +// +// /** +// * 包件预约状态 +// */ +// private String orderPackageReservationStatusName; +// +// +//} diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/BasicDataApplication.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/BasicDataApplication.java index c98b3bd15..f6ca4cad2 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/BasicDataApplication.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/BasicDataApplication.java @@ -2,6 +2,7 @@ package com.logpm.basicdata; import org.springblade.common.constant.ModuleNameConstant; +import org.springblade.common.constant.TenantNum; import org.springblade.core.cloud.client.BladeCloudApplication; import org.springblade.core.launch.BladeApplication; diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataGoodsShelfController.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataGoodsShelfController.java index 24be4043e..0abafa9bb 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataGoodsShelfController.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataGoodsShelfController.java @@ -104,6 +104,16 @@ public class BasicdataGoodsShelfController extends BladeController { return R.status(basicdataGoodsShelfService.insertGoodsshelf(basicdataGoodsShelfDTO)); } + /** + * 货架 编辑货位 + */ + @PostMapping("/allocation") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入BasicdataGoodsShelf") + public R allocation(@Valid @RequestBody BasicdataGoodsShelfDTO basicdataGoodsShelfDTO) { + return basicdataGoodsShelfService.insertallocation(basicdataGoodsShelfDTO); + } + /** * 货架 修改 */ diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataGoodsShelfService.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataGoodsShelfService.java index 05554aafe..c570ce88c 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataGoodsShelfService.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataGoodsShelfService.java @@ -117,5 +117,8 @@ public interface IBasicdataGoodsShelfService extends BaseService getShowTemplate(Map params, HttpServletResponse response); - + /** + * 货架 编辑货位 + */ + R insertallocation(BasicdataGoodsShelfDTO basicdataGoodsShelfDTO); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsShelfServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsShelfServiceImpl.java index fcb5343df..090821e2a 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsShelfServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsShelfServiceImpl.java @@ -19,6 +19,7 @@ package com.logpm.basicdata.service.impl; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.toolkit.SqlHelper; import com.logpm.basic.entity.BasicPrintTemplateEntity; @@ -28,10 +29,13 @@ import com.logpm.basicdata.dto.BasicdataGoodsShelfDTO; import com.logpm.basicdata.entity.BasicdataGoodsAllocationEntity; import com.logpm.basicdata.entity.BasicdataGoodsShelfEntity; import com.logpm.basicdata.excel.BasicdataGoodsShelfExcel; +import com.logpm.basicdata.mapper.BasicdataGoodsAllocationMapper; import com.logpm.basicdata.mapper.BasicdataGoodsShelfMapper; import com.logpm.basicdata.service.IBasicdataGoodsAllocationService; import com.logpm.basicdata.service.IBasicdataGoodsShelfService; import com.logpm.basicdata.vo.BasicdataGoodsShelfVO; +import com.logpm.warehouse.feign.IWarehouseTrayGoodsClient; +import com.logpm.warehouse.feign.IWarehouseUpdownGoodsClient; import lombok.AllArgsConstructor; import lombok.extern.log4j.Log4j; import lombok.extern.log4j.Log4j2; @@ -57,6 +61,7 @@ import java.io.IOException; import java.util.*; import java.util.concurrent.ScheduledThreadPoolExecutor; import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; /** * 货架 服务实现类 @@ -77,6 +82,11 @@ public class BasicdataGoodsShelfServiceImpl extends BaseServiceImpl selectBasicdataGoodsShelfPage(IPage page, BasicdataGoodsShelfVO basicdataGoodsShelfVO) { @@ -150,6 +160,7 @@ public class BasicdataGoodsShelfServiceImpl extends BaseServiceImpl arrayList = new ArrayList<>(); // for (Integer i = 0; i < rowNum; i++) { // for (Integer j = 0; j < storeyNum; j++) { // BasicdataGoodsAllocationEntity basicdataGoodsAllocationEntity = new BasicdataGoodsAllocationEntity(); @@ -159,16 +170,17 @@ public class BasicdataGoodsShelfServiceImpl extends BaseServiceImpl>>>>>>>>>{}",rowNum); + Integer storeyNum = basicdataGoodsShelfDTO.getStoreyNum();//行 + log.info("行>>>>>>>>>>{}",storeyNum); + //查询租户对应的库位码前缀规则 + // String allocationCode = basicTenantCodeClient.shelfCode(user.getTenantId(),"5"); + //判断新增货位 + List basicdataGoodsAllocationEntities = basicdataGoodsAllocationMapper.selectList(new QueryWrapper().lambda() + .eq(BasicdataGoodsAllocationEntity::getIsDeleted, 0) + .eq(BasicdataGoodsAllocationEntity::getGoodsShelfId, basicdataGoodsShelfDTO.getId()) + ); + if (basicdataGoodsAllocationEntities.size()<=0){ + ArrayList arrayList = new ArrayList<>(); + for (Integer i = 0; i < rowNum; i++) { + for (Integer j = 0; j < storeyNum; j++) { + BasicdataGoodsAllocationEntity basicdataGoodsAllocationEntity = new BasicdataGoodsAllocationEntity(); + //设置所在列 + basicdataGoodsAllocationEntity.setColumnNum(i + 1); + //设置所在层 + basicdataGoodsAllocationEntity.setLayerNum(j + 1); + int row = i + 1; + int layer = j + 1; + // basicdataGoodsAllocationEntity.setQrCode(allocationCode + "-" + row + "-" + layer); + // basicdataGoodsAllocationEntity.setWarehouseId(basicdataGoodsShelfEntity.getWarehouseId()); + basicdataGoodsAllocationEntity.setGoodsAreaId(basicdataGoodsShelfDTO.getGoodsAreaId()); + basicdataGoodsAllocationEntity.setGoodsShelfId(basicdataGoodsShelfDTO.getId()); + basicdataGoodsAllocationEntity.setGoodsAllocationName( layer+ "-" + row); +// basicdataGoodsAllocationEntity.setAllocationStatuc("1"); +// basicdataGoodsAllocationEntity.setEnableStatus("1"); + arrayList.add(basicdataGoodsAllocationEntity); + } + } + basicdataGoodsAllocationService.saveBatch(arrayList); + //更新数量 + this.updateById(basicdataGoodsShelfDTO); + return R.success("新增成功"); + }else { + //查询原有的行 + List layerSort = basicdataGoodsAllocationEntities.stream().collect(Collectors.toMap(BasicdataGoodsAllocationEntity::getColumnNum, a -> a, (s1, s2) -> s1)).values().stream().sorted(Comparator.comparingInt(BasicdataGoodsAllocationEntity::getLayerNum).thenComparing(BasicdataGoodsAllocationEntity::getColumnNum)).collect(Collectors.toList()); + //查询原有的列 + List columnSort = basicdataGoodsAllocationEntities.stream().collect(Collectors.toMap(BasicdataGoodsAllocationEntity::getLayerNum, a -> a, (s1, s2) -> s1)).values().stream().sorted(Comparator.comparingInt(BasicdataGoodsAllocationEntity::getColumnNum).thenComparing(BasicdataGoodsAllocationEntity::getLayerNum)).collect(Collectors.toList()); + log.info("layerSort排序后>>>>>>>>>>>>>{}",layerSort); + log.info("columnSort排序后>>>>>>>>>>>>>{}",columnSort); + if (layerSort.get(layerSort.size()-1).getColumnNum()>>>>>>行不变列加>>>>>>>>>>>"); + //TODO 都增加 + //TODO 行不变列加 +// //增加列数 +// int i = rowNum - layerSort.get(layerSort.size() - 1).getColumnNum(); +// //增加行数 +// int j =storeyNum- columnSort.get(columnSort.size()-1).getLayerNum(); + + ArrayList arrayList = new ArrayList<>(); +// for (Integer k = layerSort.get(layerSort.size()-1).getColumnNum()+1; k <= rowNum; k++) { +// for (Integer z = columnSort.get(columnSort.size()-1).getLayerNum()+1; z <= storeyNum; z++) { +// BasicdataGoodsAllocationEntity basicdataGoodsAllocationEntity = new BasicdataGoodsAllocationEntity(); +// //设置所在列 +// basicdataGoodsAllocationEntity.setColumnNum(k); +// //设置所在层 +// basicdataGoodsAllocationEntity.setLayerNum(z); +// basicdataGoodsAllocationEntity.setGoodsAreaId(basicdataGoodsShelfDTO.getGoodsAreaId()); +// basicdataGoodsAllocationEntity.setGoodsShelfId(basicdataGoodsShelfDTO.getId()); +// basicdataGoodsAllocationEntity.setGoodsAllocationName(k + "-" + z); +// arrayList.add(basicdataGoodsAllocationEntity); +// } +// } + //原有列 + for (Integer k = 1; k <= layerSort.get(layerSort.size()-1).getColumnNum(); k++) { + for (Integer z = columnSort.get(columnSort.size()-1).getLayerNum()+1; z <= storeyNum; z++) { + BasicdataGoodsAllocationEntity basicdataGoodsAllocationEntity = new BasicdataGoodsAllocationEntity(); + //设置所在列 + basicdataGoodsAllocationEntity.setColumnNum(k); + //设置所在层 + basicdataGoodsAllocationEntity.setLayerNum(z); + basicdataGoodsAllocationEntity.setGoodsAreaId(basicdataGoodsShelfDTO.getGoodsAreaId()); + basicdataGoodsAllocationEntity.setGoodsShelfId(basicdataGoodsShelfDTO.getId()); + basicdataGoodsAllocationEntity.setGoodsAllocationName(z + "-" + k); + arrayList.add(basicdataGoodsAllocationEntity); + } + } + //新加列 + for (Integer k = layerSort.get(layerSort.size()-1).getColumnNum()+1; k <= rowNum; k++) { + for (Integer z = 1; z <= storeyNum; z++) { + BasicdataGoodsAllocationEntity basicdataGoodsAllocationEntity = new BasicdataGoodsAllocationEntity(); + //设置所在列 + basicdataGoodsAllocationEntity.setColumnNum(k); + //设置所在层 + basicdataGoodsAllocationEntity.setLayerNum(z); + basicdataGoodsAllocationEntity.setGoodsAreaId(basicdataGoodsShelfDTO.getGoodsAreaId()); + basicdataGoodsAllocationEntity.setGoodsShelfId(basicdataGoodsShelfDTO.getId()); + basicdataGoodsAllocationEntity.setGoodsAllocationName(z + "-" + k); + arrayList.add(basicdataGoodsAllocationEntity); + } + } + + basicdataGoodsAllocationService.saveBatch(arrayList); + //更新数量 + this.updateById(basicdataGoodsShelfDTO); + return R.success("更新成功"); + }else if (columnSort.get(columnSort.size()-1).getLayerNum()>storeyNum){ + log.info("行减列加>>>>>>>>>>>>>>>>>>"); + //TODO 行减列加 + //行减 + for (Integer z = layerSort.get(layerSort.size()-1).getColumnNum(); z > storeyNum; z--) { + List basicdataGoodsAllocationEntitiesDate = basicdataGoodsAllocationMapper.selectList(new QueryWrapper().lambda() + .eq(BasicdataGoodsAllocationEntity::getLayerNum, z) + .eq(BasicdataGoodsAllocationEntity::getGoodsAreaId, basicdataGoodsShelfDTO.getGoodsAreaId()) + .eq(BasicdataGoodsAllocationEntity::getGoodsShelfId, basicdataGoodsShelfDTO.getId()) + ); + ArrayList longs = new ArrayList<>(); + for (BasicdataGoodsAllocationEntity basicdataGoodsAllocationEntity : basicdataGoodsAllocationEntitiesDate) { + Long id = basicdataGoodsAllocationEntity.getId(); + //查询有无绑定货物 + Integer integer = warehouseUpdownGoodsClient.selectCountByAllo(id); + if (integer>0)return R.fail(basicdataGoodsAllocationEntity.getGoodsAllocationName()+"有货物存在"); + longs.add(id); + } + basicdataGoodsAllocationService.deleteLogic(longs); + } + //列加 + ArrayList arrayList = new ArrayList<>(); + for (int i = 1; i <=storeyNum ; i++) { + for (Integer k = layerSort.get(layerSort.size()-1).getColumnNum()+1; k <= rowNum; k++) { + BasicdataGoodsAllocationEntity basicdataGoodsAllocationEntity = new BasicdataGoodsAllocationEntity(); + //设置所在列 + basicdataGoodsAllocationEntity.setColumnNum(k); + //设置所在层 + basicdataGoodsAllocationEntity.setLayerNum(i); + basicdataGoodsAllocationEntity.setGoodsAreaId(basicdataGoodsShelfDTO.getGoodsAreaId()); + basicdataGoodsAllocationEntity.setGoodsShelfId(basicdataGoodsShelfDTO.getId()); + basicdataGoodsAllocationEntity.setGoodsAllocationName(i + "-" + k); + arrayList.add(basicdataGoodsAllocationEntity); + } + } + + basicdataGoodsAllocationService.saveBatch(arrayList); + //更新数量 + this.updateById(basicdataGoodsShelfDTO); + return R.success("更新成功"); + }else { + log.info("行不变列加>>>>>>>>>>>>>>>>>>"); + //TODO 行不变列加 合并 + + } + }else if (layerSort.get(layerSort.size()-1).getColumnNum()>rowNum){ + if (columnSort.get(columnSort.size()-1).getLayerNum()>>>>>>>>>>>>>>>>>"); + //TODO 行加列减 + //列减 + for (Integer k = layerSort.get(layerSort.size()-1).getColumnNum(); k > rowNum; k--) { + List basicdataGoodsAllocationEntitiesDate = basicdataGoodsAllocationMapper.selectList(new QueryWrapper().lambda() + .eq(BasicdataGoodsAllocationEntity::getColumnNum, k) + .eq(BasicdataGoodsAllocationEntity::getGoodsAreaId, basicdataGoodsShelfDTO.getGoodsAreaId()) + .eq(BasicdataGoodsAllocationEntity::getGoodsShelfId, basicdataGoodsShelfDTO.getId()) + ); + ArrayList longs = new ArrayList<>(); + for (BasicdataGoodsAllocationEntity basicdataGoodsAllocationEntity : basicdataGoodsAllocationEntitiesDate) { + Long id = basicdataGoodsAllocationEntity.getId(); + //查询有无绑定货物 + Integer integer = warehouseUpdownGoodsClient.selectCountByAllo(id); + if (integer>0)return R.fail(basicdataGoodsAllocationEntity.getGoodsAllocationName()+"有货物存在"); + longs.add(id); + } + basicdataGoodsAllocationService.deleteLogic(longs); + } + //行加 + ArrayList arrayList = new ArrayList<>(); + for (int i = 1; i <=rowNum ; i++) { + for (Integer z = columnSort.get(columnSort.size()-1).getLayerNum()+1; z <= storeyNum; z++) { + BasicdataGoodsAllocationEntity basicdataGoodsAllocationEntity = new BasicdataGoodsAllocationEntity(); + //设置所在列 + basicdataGoodsAllocationEntity.setColumnNum(i); + //设置所在层 + basicdataGoodsAllocationEntity.setLayerNum(z); + basicdataGoodsAllocationEntity.setGoodsAreaId(basicdataGoodsShelfDTO.getGoodsAreaId()); + basicdataGoodsAllocationEntity.setGoodsShelfId(basicdataGoodsShelfDTO.getId()); + basicdataGoodsAllocationEntity.setGoodsAllocationName(z + "-" + i); + arrayList.add(basicdataGoodsAllocationEntity); + } + } + basicdataGoodsAllocationService.saveBatch(arrayList); + //更新数量 + this.updateById(basicdataGoodsShelfDTO); + return R.success("更新成功"); + }else if (columnSort.get(columnSort.size()-1).getLayerNum()>=storeyNum){ + log.info("都减少>>>>>行不变列减>>>>>>>>>>>>>>"); + //TODO 都减少 行不变列减 + //列减 + for (Integer k = layerSort.get(layerSort.size()-1).getColumnNum(); k > rowNum; k--) { + List basicdataGoodsAllocationEntitiesDate = basicdataGoodsAllocationMapper.selectList(new QueryWrapper().lambda() + .eq(BasicdataGoodsAllocationEntity::getColumnNum, k) + .eq(BasicdataGoodsAllocationEntity::getGoodsAreaId, basicdataGoodsShelfDTO.getGoodsAreaId()) + .eq(BasicdataGoodsAllocationEntity::getGoodsShelfId, basicdataGoodsShelfDTO.getId()) + ); + ArrayList longs = new ArrayList<>(); + for (BasicdataGoodsAllocationEntity basicdataGoodsAllocationEntity : basicdataGoodsAllocationEntitiesDate) { + Long id = basicdataGoodsAllocationEntity.getId(); + //查询有无绑定货物 + Integer integer = warehouseUpdownGoodsClient.selectCountByAllo(id); + if (integer>0)return R.fail(basicdataGoodsAllocationEntity.getGoodsAllocationName()+"有货物存在"); + longs.add(id); + } + basicdataGoodsAllocationService.deleteLogic(longs); + } + //行减 + for (Integer z = layerSort.get(layerSort.size()-1).getColumnNum(); z > storeyNum; z--) { + List basicdataGoodsAllocationEntitiesDate = basicdataGoodsAllocationMapper.selectList(new QueryWrapper().lambda() + .eq(BasicdataGoodsAllocationEntity::getLayerNum, z) + .eq(BasicdataGoodsAllocationEntity::getGoodsAreaId, basicdataGoodsShelfDTO.getGoodsAreaId()) + .eq(BasicdataGoodsAllocationEntity::getGoodsShelfId, basicdataGoodsShelfDTO.getId()) + ); + ArrayList longs = new ArrayList<>(); + for (BasicdataGoodsAllocationEntity basicdataGoodsAllocationEntity : basicdataGoodsAllocationEntitiesDate) { + Long id = basicdataGoodsAllocationEntity.getId(); + //查询有无绑定货物 + Integer integer = warehouseUpdownGoodsClient.selectCountByAllo(id); + if (integer>0)return R.fail(basicdataGoodsAllocationEntity.getGoodsAllocationName()+"有货物存在"); + longs.add(id); + } + basicdataGoodsAllocationService.deleteLogic(longs); + } + //更新数量 + this.updateById(basicdataGoodsShelfDTO); + return R.success("更新成功"); + }else { + log.info("行不变列减>>>>>>>>>>>>>>>>>>"); + //TODO 行不变列减 合并 + + } + }else { + if (columnSort.get(columnSort.size()-1).getLayerNum()>storeyNum){ + log.info("行减列不变>>>>>>>>>>>>>>>>>>"); + //TODO 行减列不变 + //行减 + for (Integer z = layerSort.get(layerSort.size()-1).getColumnNum(); z > storeyNum; z--) { + List basicdataGoodsAllocationEntitiesDate = basicdataGoodsAllocationMapper.selectList(new QueryWrapper().lambda() + .eq(BasicdataGoodsAllocationEntity::getLayerNum, z) + .eq(BasicdataGoodsAllocationEntity::getGoodsAreaId, basicdataGoodsShelfDTO.getGoodsAreaId()) + .eq(BasicdataGoodsAllocationEntity::getGoodsShelfId, basicdataGoodsShelfDTO.getId()) + ); + ArrayList longs = new ArrayList<>(); + for (BasicdataGoodsAllocationEntity basicdataGoodsAllocationEntity : basicdataGoodsAllocationEntitiesDate) { + Long id = basicdataGoodsAllocationEntity.getId(); + //查询有无绑定货物 + Integer integer = warehouseUpdownGoodsClient.selectCountByAllo(id); + if (integer>0)return R.fail(basicdataGoodsAllocationEntity.getGoodsAllocationName()+"有货物存在"); + longs.add(id); + } + basicdataGoodsAllocationService.deleteLogic(longs); + } + //更新数量 + this.updateById(basicdataGoodsShelfDTO); + return R.success("更新成功"); + + }else if (columnSort.get(columnSort.size()-1).getLayerNum()>>>>>>>>>>>>>>>>>"); + //TODO 行加列不变 + //行加 + ArrayList arrayList = new ArrayList<>(); + for (int i = 1; i <=rowNum ; i++) { + for (Integer z = columnSort.get(columnSort.size()-1).getLayerNum()+1; z <= storeyNum; z++) { + BasicdataGoodsAllocationEntity basicdataGoodsAllocationEntity = new BasicdataGoodsAllocationEntity(); + //设置所在列 + basicdataGoodsAllocationEntity.setColumnNum(i); + //设置所在层 + basicdataGoodsAllocationEntity.setLayerNum(z); + basicdataGoodsAllocationEntity.setGoodsAreaId(basicdataGoodsShelfDTO.getGoodsAreaId()); + basicdataGoodsAllocationEntity.setGoodsShelfId(basicdataGoodsShelfDTO.getId()); + basicdataGoodsAllocationEntity.setGoodsAllocationName(z + "-" + i); + arrayList.add(basicdataGoodsAllocationEntity); + } + } + basicdataGoodsAllocationService.saveBatch(arrayList); + //更新数量 + this.updateById(basicdataGoodsShelfDTO); + return R.success("更新成功"); + }else { + log.info("无变化>>>>>>>>>>>>>>>>>>"); + return R.success("无变化"); + } + } + } + return R.fail("无法新增"); + + } + + static Integer getLayerNum(List products, String ColumnNum) { + return products.stream() + .filter(e -> e.getColumnNum().equals(ColumnNum)) + .mapToInt(BasicdataGoodsAllocationEntity::getLayerNum) + .findFirst() + .orElse(0); + } + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionCallDeliveryServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionCallDeliveryServiceImpl.java index f44b1165a..c059ba4f0 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionCallDeliveryServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionCallDeliveryServiceImpl.java @@ -85,7 +85,7 @@ public class DistrilbutionCallDeliveryServiceImpl extends BaseServiceImpl detail(WarehouseUpdownGoodsEntity warehouseUpdownGoods) { + WarehouseUpdownGoodsEntity detail = warehouseUpdownGoodsService.getOne(Condition.getQueryWrapper(warehouseUpdownGoods)); + return R.data(WarehouseUpdownGoodsWrapper.build().entityVO(detail)); + } + /** + * 货位与货物绑定表 分页 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入warehouseUpdownGoods") + public R> list(@ApiIgnore @RequestParam Map warehouseUpdownGoods, Query query) { + IPage pages = warehouseUpdownGoodsService.page(Condition.getPage(query), Condition.getQueryWrapper(warehouseUpdownGoods, WarehouseUpdownGoodsEntity.class)); + return R.data(WarehouseUpdownGoodsWrapper.build().pageVO(pages)); + } + + /** + * 货位与货物绑定表 自定义分页 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入warehouseUpdownGoods") + public R> page(WarehouseUpdownGoodsVO warehouseUpdownGoods, Query query) { + IPage pages = warehouseUpdownGoodsService.selectWarehouseUpdownGoodsPage(Condition.getPage(query), warehouseUpdownGoods); + return R.data(pages); + } + + /** + * 货位与货物绑定表 新增 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入warehouseUpdownGoods") + public R save(@Valid @RequestBody WarehouseUpdownGoodsEntity warehouseUpdownGoods) { + return R.status(warehouseUpdownGoodsService.save(warehouseUpdownGoods)); + } + + /** + * 货位与货物绑定表 修改 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入warehouseUpdownGoods") + public R update(@Valid @RequestBody WarehouseUpdownGoodsEntity warehouseUpdownGoods) { + return R.status(warehouseUpdownGoodsService.updateById(warehouseUpdownGoods)); + } + + /** + * 货位与货物绑定表 新增或修改 + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "新增或修改", notes = "传入warehouseUpdownGoods") + public R submit(@Valid @RequestBody WarehouseUpdownGoodsEntity warehouseUpdownGoods) { + return R.status(warehouseUpdownGoodsService.saveOrUpdate(warehouseUpdownGoods)); + } + + /** + * 货位与货物绑定表 删除 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 7) + @ApiOperation(value = "逻辑删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(warehouseUpdownGoodsService.deleteLogic(Func.toLongList(ids))); + } + + + /** + * 导出数据 + */ + @GetMapping("/export-warehouseUpdownGoods") + @ApiOperationSupport(order = 9) + @ApiOperation(value = "导出数据", notes = "传入warehouseUpdownGoods") + public void exportWarehouseUpdownGoods(@ApiIgnore @RequestParam Map warehouseUpdownGoods, BladeUser bladeUser, HttpServletResponse response) { + QueryWrapper queryWrapper = Condition.getQueryWrapper(warehouseUpdownGoods, WarehouseUpdownGoodsEntity.class); + //if (!AuthUtil.isAdministrator()) { + // queryWrapper.lambda().eq(WarehouseUpdownGoods::getTenantId, bladeUser.getTenantId()); + //} + queryWrapper.lambda().eq(WarehouseUpdownGoodsEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED); + List list = warehouseUpdownGoodsService.exportWarehouseUpdownGoods(queryWrapper); + ExcelUtil.export(response, "货位与货物绑定表数据" + DateUtil.time(), "货位与货物绑定表数据表", list, WarehouseUpdownGoodsExcel.class); + } + +} diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/WarehouseUpdownGoodsDTO.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/WarehouseUpdownGoodsDTO.java new file mode 100644 index 000000000..18d689b45 --- /dev/null +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/WarehouseUpdownGoodsDTO.java @@ -0,0 +1,34 @@ +/* + * 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.dto; + +import com.logpm.warehouse.entity.WarehouseUpdownGoodsEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 货位与货物绑定表 数据传输对象实体类 + * + * @author lmy + * @since 2023-08-14 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class WarehouseUpdownGoodsDTO extends WarehouseUpdownGoodsEntity { + private static final long serialVersionUID = 1L; + +} diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/excel/WarehouseUpdownGoodsExcel.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/excel/WarehouseUpdownGoodsExcel.java new file mode 100644 index 000000000..1dbb968ba --- /dev/null +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/excel/WarehouseUpdownGoodsExcel.java @@ -0,0 +1,172 @@ +/* + * 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.excel; + + +import lombok.Data; + +import java.util.Date; +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import com.alibaba.excel.annotation.write.style.ContentRowHeight; +import com.alibaba.excel.annotation.write.style.HeadRowHeight; +import java.io.Serializable; + + +/** + * 货位与货物绑定表 Excel实体类 + * + * @author lmy + * @since 2023-08-14 + */ +@Data +@ColumnWidth(25) +@HeadRowHeight(20) +@ContentRowHeight(18) +public class WarehouseUpdownGoodsExcel implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 租户号 + */ + @ColumnWidth(20) + @ExcelProperty("租户号") + private String tenantId; + /** + * 是否已删除 + */ + @ColumnWidth(20) + @ExcelProperty("是否已删除") + private Integer isDeleted; + /** + * 预留1 + */ + @ColumnWidth(20) + @ExcelProperty("预留1") + private String reserve1; + /** + * 预留2 + */ + @ColumnWidth(20) + @ExcelProperty("预留2") + private String reserve2; + /** + * 预留3 + */ + @ColumnWidth(20) + @ExcelProperty("预留3") + private String reserve3; + /** + * 预留4 + */ + @ColumnWidth(20) + @ExcelProperty("预留4") + private String reserve4; + /** + * 预留5 + */ + @ColumnWidth(20) + @ExcelProperty("预留5") + private String reserve5; + /** + * 上架方式id + */ + @ColumnWidth(20) + @ExcelProperty("上架方式id") + private Long updownTypeId; + /** + * 货区id + */ + @ColumnWidth(20) + @ExcelProperty("货区id") + private Long areaId; + /** + * 货区名称 + */ + @ColumnWidth(20) + @ExcelProperty("货区名称") + private String areaTitle; + /** + * 货架id + */ + @ColumnWidth(20) + @ExcelProperty("货架id") + private Long shelfId; + /** + * 货架名称 + */ + @ColumnWidth(20) + @ExcelProperty("货架名称") + private String shelfTitle; + /** + * 货位id + */ + @ColumnWidth(20) + @ExcelProperty("货位id") + private Long allocationId; + /** + * 货位名称 + */ + @ColumnWidth(20) + @ExcelProperty("货位名称") + private String allocationTitle; + /** + * 完整货位 + */ + @ColumnWidth(20) + @ExcelProperty("完整货位") + private String positionCode; + /** + * 货物类型;1有数据 2无数据 + */ + @ColumnWidth(20) + @ExcelProperty("货物类型;1有数据 2无数据") + private String goodsType; + /** + * 关联id + */ + @ColumnWidth(20) + @ExcelProperty("关联id") + private Long associationId; + /** + * 关联值 + */ + @ColumnWidth(20) + @ExcelProperty("关联值") + private String associationValue; + /** + * 关联类型;1.订单号 2运单号 3包件码 4库存品 + */ + @ColumnWidth(20) + @ExcelProperty("关联类型;1.订单号 2运单号 3包件码 4库存品") + private String associationType; + /** + * 货物名称 + */ + @ColumnWidth(20) + @ExcelProperty("货物名称") + private String goodsName; + /** + * 数量 + */ + @ColumnWidth(20) + @ExcelProperty("数量") + private String num; + + +} diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseUpdownGoodsClient.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseUpdownGoodsClient.java new file mode 100644 index 000000000..b0ef0f6de --- /dev/null +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseUpdownGoodsClient.java @@ -0,0 +1,36 @@ +package com.logpm.warehouse.feign; + + +import com.logpm.warehouse.service.IWarehouseUpdownGoodsService; + +import lombok.AllArgsConstructor; + +import org.springblade.core.tenant.annotation.NonDS; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; +import springfox.documentation.annotations.ApiIgnore; + +import java.util.List; + +@NonDS +@ApiIgnore +@RestController +@AllArgsConstructor +public class WarehouseUpdownGoodsClient implements IWarehouseUpdownGoodsClient { + + private final IWarehouseUpdownGoodsService warehouseUpdownGoodsService; + + +// @Override +// @GetMapping(TOP + "/selectListByAllo") +// public List selectListByAllo(Long alloId) { +// return warehouseUpdownGoodsService.selectListByAllo(alloId); +// } + + @Override + @GetMapping(TOP + "/selectCountByAllo") + public Integer selectCountByAllo(Long alloId) { + return warehouseUpdownGoodsService.selectCountByAllo(alloId); + } +} diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsMapper.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsMapper.java new file mode 100644 index 000000000..2dcb8fa96 --- /dev/null +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsMapper.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.mapper; + +import com.logpm.warehouse.entity.WarehouseUpdownGoodsEntity; +import com.logpm.warehouse.vo.WarehouseUpdownGoodsVO; +import com.logpm.warehouse.excel.WarehouseUpdownGoodsExcel; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.apache.ibatis.annotations.Param; +import java.util.List; + +/** + * 货位与货物绑定表 Mapper 接口 + * + * @author lmy + * @since 2023-08-14 + */ +public interface WarehouseUpdownGoodsMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param warehouseUpdownGoods + * @return + */ + List selectWarehouseUpdownGoodsPage(IPage page, WarehouseUpdownGoodsVO warehouseUpdownGoods); + + + /** + * 获取导出数据 + * + * @param queryWrapper + * @return + */ + List exportWarehouseUpdownGoods(@Param("ew") Wrapper queryWrapper); +// /** +// * 根据货位查询货物 +// * +// * @param alloId +// * @return +// */ +// List selectListByAllo(@Param("alloId") Long alloId); +} diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsMapper.xml b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsMapper.xml new file mode 100644 index 000000000..924e8c465 --- /dev/null +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsMapper.xml @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseUpdownGoodsService.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseUpdownGoodsService.java new file mode 100644 index 000000000..641e2d080 --- /dev/null +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseUpdownGoodsService.java @@ -0,0 +1,65 @@ +/* + * 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.logpm.warehouse.entity.WarehouseUpdownGoodsEntity; +import com.logpm.warehouse.vo.WarehouseUpdownGoodsVO; +import com.logpm.warehouse.excel.WarehouseUpdownGoodsExcel; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.mp.base.BaseService; +import java.util.List; + +/** + * 货位与货物绑定表 服务类 + * + * @author lmy + * @since 2023-08-14 + */ +public interface IWarehouseUpdownGoodsService extends BaseService { + /** + * 自定义分页 + * + * @param page + * @param warehouseUpdownGoods + * @return + */ + IPage selectWarehouseUpdownGoodsPage(IPage page, WarehouseUpdownGoodsVO warehouseUpdownGoods); + + + /** + * 导出数据 + * + * @param queryWrapper + * @return + */ + List exportWarehouseUpdownGoods(Wrapper queryWrapper); +// /** +// * 关联查询货物 +// * +// * @param alloId +// * @return +// */ +// List selectListByAllo(Long alloId); + /** + * 关联查询货位有无货物 + * + * @param alloId + * @return + */ + Integer selectCountByAllo(Long alloId); +} diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownGoodsServiceImpl.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownGoodsServiceImpl.java new file mode 100644 index 000000000..197648578 --- /dev/null +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownGoodsServiceImpl.java @@ -0,0 +1,68 @@ +/* + * 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.logpm.warehouse.entity.WarehouseUpdownGoodsEntity; +import com.logpm.warehouse.vo.WarehouseUpdownGoodsVO; +import com.logpm.warehouse.excel.WarehouseUpdownGoodsExcel; +import com.logpm.warehouse.mapper.WarehouseUpdownGoodsMapper; +import com.logpm.warehouse.service.IWarehouseUpdownGoodsService; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.mp.base.BaseServiceImpl; +import java.util.List; + +/** + * 货位与货物绑定表 服务实现类 + * + * @author lmy + * @since 2023-08-14 + */ +@Service +public class WarehouseUpdownGoodsServiceImpl extends BaseServiceImpl implements IWarehouseUpdownGoodsService { + + @Override + public IPage selectWarehouseUpdownGoodsPage(IPage page, WarehouseUpdownGoodsVO warehouseUpdownGoods) { + return page.setRecords(baseMapper.selectWarehouseUpdownGoodsPage(page, warehouseUpdownGoods)); + } + + + @Override + public List exportWarehouseUpdownGoods(Wrapper queryWrapper) { + List warehouseUpdownGoodsList = baseMapper.exportWarehouseUpdownGoods(queryWrapper); + //warehouseUpdownGoodsList.forEach(warehouseUpdownGoods -> { + // warehouseUpdownGoods.setTypeName(DictCache.getValue(DictEnum.YES_NO, WarehouseUpdownGoods.getType())); + //}); + return warehouseUpdownGoodsList; + } +// +// @Override +// public List selectListByAllo(Long alloId) { +// return baseMapper.selectListByAllo(alloId); +// } + + @Override + public Integer selectCountByAllo(Long alloId) { + return baseMapper.selectCount(new QueryWrapper().lambda() + .eq(WarehouseUpdownGoodsEntity::getIsDeleted,0) + .eq(WarehouseUpdownGoodsEntity::getAllocationId,alloId) + ).intValue(); + } + +} diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/wrapper/WarehouseTrayTypeWrapper.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/wrapper/WarehouseTrayTypeWrapper.java index 79ad70466..565bde681 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/wrapper/WarehouseTrayTypeWrapper.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/wrapper/WarehouseTrayTypeWrapper.java @@ -40,8 +40,8 @@ public class WarehouseTrayTypeWrapper extends BaseEntityWrapper { + + public static WarehouseUpdownGoodsWrapper build() { + return new WarehouseUpdownGoodsWrapper(); + } + + @Override + public WarehouseUpdownGoodsVO entityVO(WarehouseUpdownGoodsEntity warehouseUpdownGoods) { + WarehouseUpdownGoodsVO warehouseUpdownGoodsVO = Objects.requireNonNull(BeanUtil.copy(warehouseUpdownGoods, WarehouseUpdownGoodsVO.class)); + + //User createUser = UserCache.getUser(warehouseUpdownGoods.getCreateUser()); + //User updateUser = UserCache.getUser(warehouseUpdownGoods.getUpdateUser()); + //warehouseUpdownGoodsVO.setCreateUserName(createUser.getName()); + //warehouseUpdownGoodsVO.setUpdateUserName(updateUser.getName()); + + return warehouseUpdownGoodsVO; + } + + +}