diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DisStockListVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DisStockListVO.java index 8dc348f5e..7d45f66c2 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DisStockListVO.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DisStockListVO.java @@ -15,7 +15,7 @@ public class DisStockListVO { private String cargoUnit; //单位 private String stockPackageCode; //包条码 private String brandName; //品牌 - private String stockListId; //库存品ID - private String reservationId; //预约ID + private Long stockListId; //库存品ID + private Long reservationId; //预约ID } 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 edd6f66c0..1db20107c 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 @@ -23,6 +23,8 @@ public class PackageStockupVO implements Serializable { private String scaned;//备货 private String materialName;//物料名称 + private String trayCode;//托盘名称 + private String allocationTitle;//货位名称 private Long scanId;//扫码记录id 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(); diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataWarehouseServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataWarehouseServiceImpl.java index f3cae2b32..b1e26c018 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataWarehouseServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataWarehouseServiceImpl.java @@ -45,9 +45,7 @@ import org.springblade.system.feign.IDeptClient; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; +import java.util.*; /** * 仓库 服务实现类 @@ -164,28 +162,31 @@ public class BasicdataWarehouseServiceImpl extends BaseServiceImpl getMyWarehouseList() { - + Set deptIds = new HashSet<>(); // 获取当前登陆人 BladeUser user = AuthUtil.getUser(); //查询出部门表 String deptId = user.getDeptId(); - List userDeptNode = deptClient.getUserDeptNode(Long.parseLong(deptId)); + String[] split = deptId.split(","); + for (String s : split) { + List userDeptNode = deptClient.getUserDeptNode(Long.parseLong(s)); + if (Func.isEmpty(userDeptNode)) { + continue; + } else { + userDeptNode.forEach(u -> { + deptIds.add(u.getId()); + }); + } + } + + - List deptIds = new ArrayList<>(); - if (Func.isEmpty(userDeptNode)) { - log.error("userDeptNode用户部门信息有误+{" + userDeptNode + "}"); - return null; - } else { - userDeptNode.forEach(u -> { - deptIds.add(u.getId()); - }); - } List warehouseEntityList = baseMapper.selectList(Wrappers.query().lambda().in(BasicdataWarehouseEntity::getDepartment, deptIds)); // String json = redis.get(CacheNames.tenantKeyObj(user.getTenantId(), CacheNames.USER_WAREHOUSE_KEY, user.getUserId())); - if (warehouseEntityList.size() <= 1) { - redis.setEx(CacheNames.tenantKeyObj(user.getTenantId(), CacheNames.USER_WAREHOUSE_KEY, user.getUserId()), warehouseEntityList.get(0), 30 * 24 * 60 * 60L); - } +// if (warehouseEntityList.size() <= 1) { +// redis.setEx(CacheNames.tenantKeyObj(user.getTenantId(), CacheNames.USER_WAREHOUSE_KEY, user.getUserId()), warehouseEntityList.get(0), 30 * 24 * 60 * 60L); +// } return warehouseEntityList; } @@ -193,18 +194,31 @@ public class BasicdataWarehouseServiceImpl extends BaseServiceImpl userDeptNode = deptClient.getUserDeptNode(Long.parseLong(deptId)); +// List userDeptNode = deptClient.getUserDeptNode(Long.parseLong(deptId)); + + Set deptIds = new HashSet<>(); +// String deptId = user.getDeptId(); + String[] split = deptId.split(","); + for (String s : split) { + List userDeptNode = deptClient.getUserDeptNode(Long.parseLong(s)); + if (Func.isEmpty(userDeptNode)) { + continue; + } else { + userDeptNode.forEach(u -> { + deptIds.add(u.getId()); + }); + } + } - List deptIds = new ArrayList<>(); - if (Func.isEmpty(userDeptNode)) { - log.error("userDeptNode用户部门信息有误+{" + userDeptNode + "}"); - return null; - } else { - userDeptNode.forEach(u -> { - deptIds.add(u.getId()); - }); - } +// if (Func.isEmpty(userDeptNode)) { +// log.error("userDeptNode用户部门信息有误+{" + userDeptNode + "}"); +// return null; +// } else { +// userDeptNode.forEach(u -> { +// deptIds.add(u.getId()); +// }); +// } BasicdataWarehouseEntity warehouseEntity = null; List warehouseEntityList = baseMapper.selectList(Wrappers.query().lambda().in(BasicdataWarehouseEntity::getDepartment, deptIds)); // String json = redis.get(CacheNames.tenantKeyObj(user.getTenantId(), CacheNames.USER_WAREHOUSE_KEY, user.getUserId())); diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/wrapper/WarehouseGoodsAreaWrapper.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/wrapper/WarehouseGoodsAreaWrapper.java index 9008a8d73..db9869fb2 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/wrapper/WarehouseGoodsAreaWrapper.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/wrapper/WarehouseGoodsAreaWrapper.java @@ -17,6 +17,7 @@ package com.logpm.basicdata.wrapper; import com.logpm.basicdata.vo.BasicdataGoodsAreaVO; +import lombok.extern.slf4j.Slf4j; import org.springblade.common.constant.DictBizConstant; import org.springblade.core.mp.support.BaseEntityWrapper; import org.springblade.core.tool.utils.BeanUtil; @@ -33,6 +34,7 @@ import java.util.Objects; * @since 2023-08-08 */ +@Slf4j public class WarehouseGoodsAreaWrapper extends BaseEntityWrapper { IUserClient userCliient = SpringUtil.getBean(IUserClient.class); public static WarehouseGoodsAreaWrapper build() { @@ -42,7 +44,10 @@ public class WarehouseGoodsAreaWrapper extends BaseEntityWrapper - select ldpl.order_code orderCode,ldpl.order_package_code packageBarCode, 1 goodsType,ldrp.parce_list_id parceListId,ldpl.material_name materialName + select ldpl.order_code orderCode,ldpl.order_package_code packageBarCode, 1 goodsType,ldrp.parce_list_id parceListId,ldpl.material_name materialName, + lwug.allocation_title allocationTitle,lwtg.tray_code trayCode 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' + LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id =ldrp.parce_list_id and lwug.association_type = '3' ldrp.reservation_id = #{reservationId} and ldrp.stock_article_id = #{stockArticleId} and ldrp.packet_bar_status in (1,3) and lwtg.tray_id = #{trayId} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml index b5dd88acc..bc771d774 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml @@ -85,7 +85,7 @@