From d579248b431d2f24ed8d2238498afb699bd608ff Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Tue, 16 Jul 2024 18:20:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=BB=9E=E7=95=99=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/WarehouseRetentionScanEntity.java | 2 + .../WarehouseRetentionScanController.java | 15 +- .../dto/WarehouseRetentionScanDTO.java | 19 +++ .../excel/WarehouseRetentionScanExcel.java | 158 ++++++------------ .../mapper/WarehouseRetentionScanMapper.java | 10 +- .../mapper/WarehouseRetentionScanMapper.xml | 108 +++++++++++- .../WarehouseRetentionScanServiceImpl.java | 26 ++- 7 files changed, 220 insertions(+), 118 deletions(-) diff --git a/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseRetentionScanEntity.java b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseRetentionScanEntity.java index 76f26627b..1123f6022 100644 --- a/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseRetentionScanEntity.java +++ b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseRetentionScanEntity.java @@ -26,6 +26,7 @@ import com.baomidou.mybatisplus.annotation.TableId; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import org.springblade.core.tenant.mp.TenantEntity; +import org.springframework.format.annotation.DateTimeFormat; import java.io.Serializable; @@ -168,6 +169,7 @@ public class WarehouseRetentionScanEntity extends TenantEntity { * 滞留扫描时间 */ @ApiModelProperty(value = "滞留扫描时间") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date retentionScanTime; /** * 滞留方式 1-PDA、2-PC diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseRetentionScanController.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseRetentionScanController.java index 7a8fc93aa..e9c50d240 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseRetentionScanController.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseRetentionScanController.java @@ -16,6 +16,7 @@ */ package com.logpm.warehouse.controller; +import com.logpm.warehouse.dto.WarehouseRetentionScanDTO; import com.logpm.warehouse.entity.WarehouseRetentionScanEntity; import com.logpm.warehouse.excel.WarehouseRetentionScanExcel; import com.logpm.warehouse.service.IWarehouseRetentionScanService; @@ -89,7 +90,7 @@ public class WarehouseRetentionScanController extends BladeController { @GetMapping("/page") @ApiOperationSupport(order = 3) @ApiOperation(value = "分页", notes = "传入warehouseRetentionScan") - public R> page(WarehouseRetentionScanVO warehouseRetentionScan, Query query) { + public R> page(WarehouseRetentionScanDTO warehouseRetentionScan, Query query) { IPage pages = warehouseRetentionScanService.selectWarehouseRetentionRecordPage(Condition.getPage(query), warehouseRetentionScan); return R.data(pages); } @@ -141,14 +142,10 @@ public class WarehouseRetentionScanController extends BladeController { @GetMapping("/export-warehouseRetentionScan") @ApiOperationSupport(order = 9) @ApiOperation(value = "导出数据", notes = "传入warehouseRetentionScan") - public void exportWarehouseRetentionScan(@ApiIgnore @RequestParam Map warehouseRetentionScan, BladeUser bladeUser, HttpServletResponse response) { - QueryWrapper queryWrapper = Condition.getQueryWrapper(warehouseRetentionScan, WarehouseRetentionScanEntity.class); - //if (!AuthUtil.isAdministrator()) { - // queryWrapper.lambda().eq(WarehouseRetentionScan::getTenantId, bladeUser.getTenantId()); - //} - queryWrapper.lambda().eq(WarehouseRetentionScanEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED); - List list = warehouseRetentionScanService.exportWarehouseRetentionRecord(queryWrapper); - ExcelUtil.export(response, "滞留扫描记录数据" + DateUtil.time(), "滞留扫描记录数据表", list, WarehouseRetentionScanExcel.class); + public void exportWarehouseRetentionScan(WarehouseRetentionScanDTO warehouseRetentionScan,HttpServletResponse response) { + List warehouseRetentionScanExcelList = warehouseRetentionScanService.getExportWarehouseRetentionScanList(warehouseRetentionScan); + + ExcelUtil.export(response, "滞留扫描记录数据" + DateUtil.time(), "滞留扫描记录数据表", warehouseRetentionScanExcelList, WarehouseRetentionScanExcel.class); } } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/WarehouseRetentionScanDTO.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/WarehouseRetentionScanDTO.java index e3347140f..ebaf6ee88 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/WarehouseRetentionScanDTO.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/WarehouseRetentionScanDTO.java @@ -20,6 +20,8 @@ import com.logpm.warehouse.entity.WarehouseRetentionScanEntity; import lombok.Data; import lombok.EqualsAndHashCode; +import java.util.List; + /** * 滞留扫描记录 数据传输对象实体类 * @@ -31,4 +33,21 @@ import lombok.EqualsAndHashCode; public class WarehouseRetentionScanDTO extends WarehouseRetentionScanEntity { private static final long serialVersionUID = 1L; + /** + * 日期搜索 + */ + private String scanDate; + + /** + * 日期区间搜索 + */ + private String scanDateStart; + + /** + * 日期区间搜索 + */ + private String scanDateEnd; + + private List warehouseListId; + } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/excel/WarehouseRetentionScanExcel.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/excel/WarehouseRetentionScanExcel.java index 953bed997..03d7677e7 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/excel/WarehouseRetentionScanExcel.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/excel/WarehouseRetentionScanExcel.java @@ -41,161 +41,107 @@ public class WarehouseRetentionScanExcel 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; + /** * 配送车次号 */ @ColumnWidth(20) @ExcelProperty("配送车次号") private String trainNumber; + /** - * 订单ID - */ - @ColumnWidth(20) - @ExcelProperty("订单ID") - private Long orderId; - /** - * 库存品ID - */ - @ColumnWidth(20) - @ExcelProperty("库存品ID") - private Long inventoryId; - /** - * 滞留类型 1-包件、2-零担(这里会关联到具体的品类)、3-库存品 - */ - @ColumnWidth(20) - @ExcelProperty("滞留类型 1-包件、2-零担(这里会关联到具体的品类)、3-库存品") - private Integer conditions; - /** - * 物料编码(库存品) - */ - @ColumnWidth(20) - @ExcelProperty("物料编码(库存品)") - private String materialNumber; - /** - * 物料名称(库存品) + * 预约单号 */ @ColumnWidth(20) - @ExcelProperty("物料名称(库存品)") - private String materialName; + @ExcelProperty("预约单号") + private String reservationCode; + /** - * 预约客户ID + * 预约单号 */ @ColumnWidth(20) - @ExcelProperty("预约客户ID") - private Long reservationId; + @ExcelProperty("运单号") + private String waybillNumber; + /** * 订单自编号(库存品没有) */ @ColumnWidth(20) - @ExcelProperty("订单自编号(库存品没有)") + @ExcelProperty("订单自编号") private String orderCode; + /** - * 预约单号 - */ - @ColumnWidth(20) - @ExcelProperty("预约单号") - private String reservationCode; - /** - * 扫描类型:1-包件、2-订单、3-托盘、4... + * 包条码 */ @ColumnWidth(20) - @ExcelProperty("扫描类型:1-包件、2-订单、3-托盘、4...") - private Integer scanType; + @ExcelProperty("包条码") + private String orderPackageCode; + /** - * 包件ID + * 物料编码(库存品) */ @ColumnWidth(20) - @ExcelProperty("包件ID") - private Long orderPackageId; + @ExcelProperty("物料编码") + private String materialNumber; + + /** - * 包条码 + * 物料名称(库存品) */ @ColumnWidth(20) - @ExcelProperty("包条码") - private String orderPackageCode; + @ExcelProperty("物料名称") + private String materialName; + /** - * 滞留数量 + * 滞留扫描时间 */ @ColumnWidth(20) - @ExcelProperty("滞留数量") - private Integer retentionQuantity; + @ExcelProperty("滞留扫描时间") + private Date retentionScanTime; + /** * 滞留扫描操作人名称 */ @ColumnWidth(20) @ExcelProperty("滞留扫描操作人名称") private String retentionScanUsername; + /** - * 滞留扫描操作人Id + * 滞留数量 */ @ColumnWidth(20) - @ExcelProperty("滞留扫描操作人Id") - private String retentionScanUserId; + @ExcelProperty("滞留数量") + private Integer retentionQuantity; + + /** - * 滞留操作备注 + * 订单自编号(库存品没有) */ @ColumnWidth(20) - @ExcelProperty("滞留操作备注") - private String remarks; + @ExcelProperty("仓库") + private String warehouseName; + /** - * 滞留扫描时间 + * 滞留方式 1-PDA、2-PC */ @ColumnWidth(20) - @ExcelProperty("滞留扫描时间") - private Date retentionScanTime; + @ExcelProperty("滞留方式 1-PDA、2-PC") + private String retentionWay; + + /** - * 滞留方式 1-PDA、2-PC + * 滞留类型 */ @ColumnWidth(20) - @ExcelProperty("滞留方式 1-PDA、2-PC") - private Integer retentionWay; + @ExcelProperty("滞留货物类型") + private String conditions; + + /** - * 配送任务ID + * 滞留操作备注 */ @ColumnWidth(20) - @ExcelProperty("配送任务ID") - private Long deliveryListId; + @ExcelProperty("备注") + private String remarks; } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseRetentionScanMapper.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseRetentionScanMapper.java index b3334d03c..05bf92f2f 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseRetentionScanMapper.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseRetentionScanMapper.java @@ -16,6 +16,7 @@ */ package com.logpm.warehouse.mapper; +import com.logpm.warehouse.dto.WarehouseRetentionScanDTO; import com.logpm.warehouse.entity.WarehouseRetentionRecordEntity; import com.logpm.warehouse.entity.WarehouseRetentionScanEntity; import com.logpm.warehouse.excel.WarehouseRetentionScanExcel; @@ -43,7 +44,7 @@ public interface WarehouseRetentionScanMapper extends BaseMapper selectWarehouseRetentionRecordPage(IPage page, WarehouseRetentionScanVO warehouseRetentionScanVO); + List selectWarehouseRetentionRecordPage(IPage page,@Param("param") WarehouseRetentionScanDTO warehouseRetentionScanVO); /** @@ -54,4 +55,11 @@ public interface WarehouseRetentionScanMapper extends BaseMapper exportWarehouseRetentionRecord(@Param("ew") Wrapper queryWrapper); + /** + * 查询导出列表数据 + * @param warehouseRetentionScan + * @return + */ + List getExportWarehouseRetentionScanList(@Param("param") WarehouseRetentionScanDTO warehouseRetentionScan); + } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseRetentionScanMapper.xml b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseRetentionScanMapper.xml index 9cfeb6e64..87a07d2fb 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseRetentionScanMapper.xml +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseRetentionScanMapper.xml @@ -41,12 +41,118 @@ + diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionScanServiceImpl.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionScanServiceImpl.java index e46c64ae7..0e30509b9 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionScanServiceImpl.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionScanServiceImpl.java @@ -61,7 +61,7 @@ public class WarehouseRetentionScanServiceImpl extends BaseServiceImpl selectWarehouseRetentionRecordPage(IPage page, WarehouseRetentionScanVO warehouseRetentionScanVO) { + public IPage selectWarehouseRetentionRecordPage(IPage page, WarehouseRetentionScanDTO warehouseRetentionScanVO) { BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); List list = new ArrayList<>(); if (Func.isEmpty(myCurrentWarehouse)){ @@ -73,6 +73,10 @@ public class WarehouseRetentionScanServiceImpl extends BaseServiceImpl getExportWarehouseRetentionScanList(WarehouseRetentionScanDTO warehouseRetentionScan) { + BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); + List list = new ArrayList<>(); + if (Func.isEmpty(myCurrentWarehouse)){ + List warehouseList = warehouseClient.getMyWarehouseList(); + if (!warehouseList.isEmpty()){ + List warehouseIds = warehouseList.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList()); + list.addAll(warehouseIds); + } + }else { + list.add(myCurrentWarehouse.getId()); + } + if (list.isEmpty()) { + return null; + } + warehouseRetentionScan.setWarehouseListId(list); + return baseMapper.getExportWarehouseRetentionScanList(warehouseRetentionScan); + } + // @Override // public R saveRetentionList(WarehouseRetentionRecordDTO warehouseRetentionRecordDTO) { // BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();