diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdatavisualizationSheetThree.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdatavisualizationSheetThree.java new file mode 100644 index 000000000..f78edac3c --- /dev/null +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdatavisualizationSheetThree.java @@ -0,0 +1,122 @@ +package com.logpm.basicdata.excel; + +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 lombok.Data; + +import java.io.Serializable; + +/** + * 车辆照片信息表 Excel实体类 + * + * @author lmy + * @since 2023-09-11 + */ +@Data +@ColumnWidth(25) +@HeadRowHeight(20) +@ContentRowHeight(18) +public class BasicdatavisualizationSheetThree implements Serializable { + /** + * 订单自编号 + */ + @ColumnWidth(30) + @ExcelProperty("订单自编号") + private String orderCode; + /** + * 包条码 + */ + @ColumnWidth(40) + @ExcelProperty("包条码") + private String orderPackageCode; + + /** + * 物料编码 + */ + @ColumnWidth(30) + @ExcelProperty("物料编码") + private String materialCode; + + /** + * 物料名称 + */ + @ColumnWidth(30) + @ExcelProperty("物料名称") + private String materialName; + + /** + * 托盘码 + */ + @ColumnWidth(30) + @ExcelProperty("托盘码") + private String trayCode; + + /** + * 库位号 + */ + @ColumnWidth(40) + @ExcelProperty("库位号") + private String positionInfo; + + + /** + * 一级品类 + */ + @ColumnWidth(40) + @ExcelProperty("一级品类") + private String firsts; + + /** + * 一级品类编码 + */ + @ColumnWidth(40) + @ExcelProperty("一级品类编码") + private String firstsCode; + + + /** + * 二级品类 + */ + @ColumnWidth(40) + @ExcelProperty("二级品类") + private String second; + + /** + * 二级品类编码 + */ + @ColumnWidth(40) + @ExcelProperty("二级品类编码") + private String secondCode; + + + /** + * 三级品类 + */ + @ColumnWidth(30) + @ExcelProperty("三级品类") + private String thirdProduct; + + /** + * 三级品类编码 + */ + @ColumnWidth(30) + @ExcelProperty("三级品类编码") + private String thirdCode; + + /** + * 上架时间 + */ + @ColumnWidth(20) + @ExcelProperty("上架时间") + private String createTime; + + /** + * 上架人 + */ + @ColumnWidth(20) + @ExcelProperty("上架人") + private String createUser; + +} diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdatavisualizationSheetTwo.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdatavisualizationSheetTwo.java new file mode 100644 index 000000000..e0b5193e6 --- /dev/null +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdatavisualizationSheetTwo.java @@ -0,0 +1,69 @@ +package com.logpm.basicdata.excel; + +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 lombok.Data; + +import java.io.Serializable; + +/** + * 车辆照片信息表 Excel实体类 + * + * @author lmy + * @since 2023-09-11 + */ +@Data +@ColumnWidth(25) +@HeadRowHeight(20) +@ContentRowHeight(18) +public class BasicdatavisualizationSheetTwo implements Serializable { + + /** + * 库位号 + */ + @ColumnWidth(40) + @ExcelProperty("库位号") + private String positionInfo; + /** + * 一级品类 + */ + @ColumnWidth(40) + @ExcelProperty("一级品类") + private String firsts; + /** + * 二级品类 + */ + @ColumnWidth(40) + @ExcelProperty("二级品类") + private String second; + + /** + * 三级品类 + */ + @ColumnWidth(30) + @ExcelProperty("三级品类") + private String thirdProduct; + + /** + * 订单自编号 + */ + @ColumnWidth(30) + @ExcelProperty("订单自编号") + private String orderCode; + + /** + * 物料名称 + */ + @ColumnWidth(30) + @ExcelProperty("物料名称") + private String materialName; + + /** + * 数量 + */ + @ColumnWidth(20) + @ExcelProperty("数量") + private String num; +} diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAreaMapper.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAreaMapper.java index f2512d337..be86b708a 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAreaMapper.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAreaMapper.java @@ -21,6 +21,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.logpm.basicdata.entity.BasicdataGoodsAreaEntity; import com.logpm.basicdata.excel.BasicdataGoodsAreaexportExcel; import com.logpm.basicdata.excel.BasicdatavisualizationSheetOne; +import com.logpm.basicdata.excel.BasicdatavisualizationSheetThree; +import com.logpm.basicdata.excel.BasicdatavisualizationSheetTwo; import com.logpm.basicdata.vo.BasicdataGoodsAreaVO; import com.logpm.basicdata.vo.BasicdataNodeVO; import org.apache.ibatis.annotations.Param; @@ -74,4 +76,8 @@ public interface BasicdataGoodsAreaMapper extends BaseMapper exportWarehouseByorderId(@Param("areaId") Long areaId); void sqlMode(); + + List exportWarehouseByallocation(@Param("areaId") Long areaId); + + List exportWarehouseByStrip(@Param("areaId") Long areaId); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAreaMapper.xml b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAreaMapper.xml index 38be11393..4843b1bd8 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAreaMapper.xml +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAreaMapper.xml @@ -174,25 +174,86 @@ + + diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsAreaServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsAreaServiceImpl.java index 67ae193ea..434628e24 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsAreaServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsAreaServiceImpl.java @@ -29,10 +29,7 @@ import com.logpm.basicdata.entity.BasicdataGoodsAllocationEntity; import com.logpm.basicdata.entity.BasicdataGoodsAreaEntity; import com.logpm.basicdata.entity.BasicdataGoodsShelfEntity; import com.logpm.basicdata.entity.BasicdataWarehouseEntity; -import com.logpm.basicdata.excel.BasicdataGoodsAreaExcel; -import com.logpm.basicdata.excel.BasicdataGoodsAreaexportExcel; -import com.logpm.basicdata.excel.BasicdatavisualizationSheetOne; -import com.logpm.basicdata.excel.GoodsAreaSheetInfoBean; +import com.logpm.basicdata.excel.*; import com.logpm.basicdata.feign.IBasicdataWarehouseClient; import com.logpm.basicdata.mapper.BasicdataGoodsAllocationMapper; import com.logpm.basicdata.mapper.BasicdataGoodsAreaMapper; @@ -52,6 +49,8 @@ import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.DateUtil; import org.springblade.core.tool.utils.Func; +import org.springblade.core.tool.utils.SpringUtil; +import org.springblade.system.feign.IUserClient; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -91,6 +90,8 @@ public class BasicdataGoodsAreaServiceImpl extends BaseServiceImpl selectWarehouseGoodsAreaPage(IPage page, BasicdataGoodsAreaVO basicdataGoodsAreaVO) { @@ -324,10 +325,15 @@ public class BasicdataGoodsAreaServiceImpl extends BaseServiceImpl basicdatavisualizationSheetOnes = baseMapper.exportWarehouseByorderId(areaId); - log.info("warehouseGoodsAreaList>>>>>>>>>>>{}",basicdatavisualizationSheetOnes); - //warehouseGoodsAreaList.forEach(warehouseGoodsArea -> { - // warehouseGoodsArea.setTypeName(DictCache.getValue(DictEnum.YES_NO, WarehouseGoodsArea.getType())); - //}); + //sheetTwo + List basicdatavisualizationSheetTwos = baseMapper.exportWarehouseByallocation(areaId); + //sheetThree + List basicdatavisualizationSheetThrees = baseMapper.exportWarehouseByStrip(areaId); + //转换上架人 + for (BasicdatavisualizationSheetThree basicdatavisualizationSheetThree : basicdatavisualizationSheetThrees) { + basicdatavisualizationSheetThree.setCreateUser(userClient.userInfoById(Long.valueOf(basicdatavisualizationSheetThree.getCreateUser())).getData().getName()); + } + try { String fileName = "仓库数据" + DateUtil.time(); response.setContentType("application/vnd.ms-excel"); @@ -337,7 +343,8 @@ public class BasicdataGoodsAreaServiceImpl extends BaseServiceImpl goodsAreaSheetInfoBeans = new LinkedList<>(); goodsAreaSheetInfoBeans.add(new GoodsAreaSheetInfoBean("订单自编号维度",BasicdatavisualizationSheetOne.class,basicdatavisualizationSheetOnes)); - //goodsAreaSheetInfoBeans.add(new GoodsAreaSheetInfoBean("货区数据表sheet2",BasicdataGoodsAreaexportExcel.class,warehouseGoodsAreaList)); + goodsAreaSheetInfoBeans.add(new GoodsAreaSheetInfoBean("货位维度",BasicdatavisualizationSheetTwo.class,basicdatavisualizationSheetTwos)); + goodsAreaSheetInfoBeans.add(new GoodsAreaSheetInfoBean("包条维度",BasicdatavisualizationSheetThree.class,basicdatavisualizationSheetThrees)); // EasyExcel.write(response.getOutputStream(), BasicdataGoodsAreaexportExcel.class).sheet("货区数据表").doWrite(warehouseGoodsAreaList); ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream()).build();