From fe1bbd9b475ff32c708ac6370d844209a59b9fa0 Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Fri, 8 Mar 2024 11:50:11 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E8=87=AA=E6=8F=90=E5=8D=95=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ReportBillLoadingController.java | 35 +++++++++++++++++++ .../report/excel/BillLoadingReportExcel.java | 2 +- .../mapper/ReportBillLoadingMapper.java | 20 +++++++++++ .../report/mapper/ReportBillLoadingMapper.xml | 22 ++++++++++++ .../IReportBillLoadingAsyncService.java | 11 ++++++ .../impl/ReportBillLoadingAsyncService.java | 29 ++++++++++++--- .../com/logpm/report/util/MyExcelUtil.java | 4 +++ 7 files changed, 117 insertions(+), 6 deletions(-) create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportBillLoadingMapper.java create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportBillLoadingMapper.xml create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/util/MyExcelUtil.java diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/controller/ReportBillLoadingController.java b/blade-service/logpm-report/src/main/java/com/logpm/report/controller/ReportBillLoadingController.java index e1461c172..ea6634521 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/controller/ReportBillLoadingController.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/controller/ReportBillLoadingController.java @@ -1,9 +1,25 @@ package com.logpm.report.controller; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.logpm.report.excel.BillLoadingReportExcel; +import com.logpm.report.service.IReportBillLoadingAsyncService; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; +import org.springblade.core.excel.util.ExcelUtil; +import org.springblade.core.secure.BladeUser; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.DateUtil; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; +import springfox.documentation.annotations.ApiIgnore; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; /** * 自提单包条控制器 @@ -14,6 +30,25 @@ import org.springframework.web.bind.annotation.RestController; @Api(value = "自提单报表", tags = "自提单报表接口") public class ReportBillLoadingController { + private IReportBillLoadingAsyncService reportBillLoadingAsyncService; + + + + + + /** + * 导出数据 + */ + @GetMapping("/export-billLoading") + @ApiOperationSupport(order = 9) + @ApiOperation(value = "导出数据", notes = "传入distributionDeliveryList") + public R exportBillLoading(@ApiIgnore @RequestParam Map param, HttpServletResponse response) { + List list = reportBillLoadingAsyncService.exportBillLoading(param); + ExcelUtil.export(response, "配送管理数据" + DateUtil.time(), "配送管理数据表", list, BillLoadingReportExcel.class); + + return R.status(true); + } + diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/excel/BillLoadingReportExcel.java b/blade-service/logpm-report/src/main/java/com/logpm/report/excel/BillLoadingReportExcel.java index a7a8b56af..f4b53a687 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/excel/BillLoadingReportExcel.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/excel/BillLoadingReportExcel.java @@ -21,7 +21,7 @@ public class BillLoadingReportExcel implements Serializable { @ColumnWidth(20) @ExcelProperty("提货件数") - private String stockupCode; + private String BillLoadingNum; @ColumnWidth(20) @ExcelProperty("到付运费") diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportBillLoadingMapper.java b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportBillLoadingMapper.java new file mode 100644 index 000000000..d2b9a5170 --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportBillLoadingMapper.java @@ -0,0 +1,20 @@ +package com.logpm.report.mapper; + +import com.logpm.report.excel.BillLoadingReportExcel; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +@Mapper +public interface ReportBillLoadingMapper { + + + /** + * 导出自提单 + * @param param + * @return + */ + List exportBillLoading(@Param("param") Map param); +} diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportBillLoadingMapper.xml b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportBillLoadingMapper.xml new file mode 100644 index 000000000..61317a135 --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportBillLoadingMapper.xml @@ -0,0 +1,22 @@ + + + + + + + diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/IReportBillLoadingAsyncService.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/IReportBillLoadingAsyncService.java index 38b1a6572..1df41dd8b 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/service/IReportBillLoadingAsyncService.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/IReportBillLoadingAsyncService.java @@ -1,7 +1,18 @@ package com.logpm.report.service; +import com.logpm.report.excel.BillLoadingReportExcel; + +import java.util.List; +import java.util.Map; + public interface IReportBillLoadingAsyncService { + /** + * 导出自提单报表 + * @param param + * @return + */ + List exportBillLoading(Map param); } diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportBillLoadingAsyncService.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportBillLoadingAsyncService.java index d104136c7..903605b38 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportBillLoadingAsyncService.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportBillLoadingAsyncService.java @@ -1,19 +1,38 @@ package com.logpm.report.service.impl; +import com.logpm.report.excel.BillLoadingReportExcel; +import com.logpm.report.mapper.ReportBillLoadingMapper; import com.logpm.report.service.IReportBillLoadingAsyncService; import lombok.AllArgsConstructor; import lombok.extern.log4j.Log4j2; +import org.springblade.core.excel.util.ExcelUtil; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.DateUtil; +import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + @Log4j2 @Service @AllArgsConstructor public class ReportBillLoadingAsyncService implements IReportBillLoadingAsyncService { - - - - - + private ReportBillLoadingMapper reportBillLoadingMapper; + + /** + * @param param + * @return + */ + @Override + @Async + public List exportBillLoading(Map param) { + List list = reportBillLoadingMapper.exportBillLoading(param); + log.info("导出数据条数:{}",list.size()); + list.stream().forEach(l->l.setAmountToFee(l.getForkliftFee()+l.getAddValueFee()+l.getStorageFee()+l.getCollectPaymentFee()+l.getTransportFee())); + return list; + } } diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/util/MyExcelUtil.java b/blade-service/logpm-report/src/main/java/com/logpm/report/util/MyExcelUtil.java new file mode 100644 index 000000000..c640a0d8a --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/util/MyExcelUtil.java @@ -0,0 +1,4 @@ +package com.logpm.report.util; + +public class MyExcelUtil { +} From 159d1f76db76aa617f202ccb2451922e31495209 Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Fri, 8 Mar 2024 12:00:50 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=BE=85=E7=AD=BE=E6=94=B6=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=95=B0=E9=87=8F=E7=BB=B4=E6=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/DistributionSignforServiceImpl.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java index 65932a4ce..616b29bc2 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java @@ -240,12 +240,12 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl0){ - zhuangchejianshu += list.stream().filter(f -> f.getStockLockingStatus().equals(InventoryLoadingStatusConstant.yizhuangche.getValue())).mapToInt(DisStockListDetailEntity::getNum).sum(); - weizhuangchejianshu += list.stream().filter(f -> f.getStockLockingStatus().equals(InventoryLoadingStatusConstant.weizhuangche.getValue())).mapToInt(DisStockListDetailEntity::getNum).sum(); - qianshoujianshu += list.stream().filter(f -> f.getStockSignfoStatus().equals(InventorySigningStatusConstant.yiqianshou.getValue())).mapToInt(DisStockListDetailEntity::getNum).sum(); - weiqianshoujianshu += list.stream().filter(f -> f.getStockSignfoStatus().equals(InventorySigningStatusConstant.weiqianshou.getValue())).mapToInt(DisStockListDetailEntity::getNum).sum(); - } +// if (Func.isNotEmpty(list) && list.size()>0){ +// zhuangchejianshu += list.stream().filter(f -> f.getStockLockingStatus().equals(InventoryLoadingStatusConstant.yizhuangche.getValue())).mapToInt(DisStockListDetailEntity::getNum).sum(); +// weizhuangchejianshu += list.stream().filter(f -> f.getStockLockingStatus().equals(InventoryLoadingStatusConstant.weizhuangche.getValue())).mapToInt(DisStockListDetailEntity::getNum).sum(); +// qianshoujianshu += list.stream().filter(f -> f.getStockSignfoStatus().equals(InventorySigningStatusConstant.yiqianshou.getValue())).mapToInt(DisStockListDetailEntity::getNum).sum(); +// weiqianshoujianshu += list.stream().filter(f -> f.getStockSignfoStatus().equals(InventorySigningStatusConstant.weiqianshou.getValue())).mapToInt(DisStockListDetailEntity::getNum).sum(); +// } if (Func.isNotEmpty(distributionParcelListEntities)) { weizhuangchejianshu += distributionParcelListEntities.stream().filter(f -> f.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())).mapToInt(DistributionParcelListEntity::getQuantity).sum(); zhuangchejianshu += distributionParcelListEntities.stream().filter(f -> f.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue())).mapToInt(DistributionParcelListEntity::getQuantity).sum(); From 69f2a67d45a40616bf02de33d0cfae265d44630c Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Fri, 8 Mar 2024 14:18:29 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=A4=87=E8=B4=A7=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/DistributionStockupServiceImpl.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java index e406c8d9e..3fa5793c1 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java @@ -2349,6 +2349,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl getRoleList() { //获取当前登录用户 BladeUser user = AuthUtil.getUser(); + log.info(">>>>>>>>>>>>>>>user:{}",user); String tenantId = user.getTenantId(); // String deptId = user.getDeptId(); //查询备货岗位 @@ -2366,6 +2367,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl> listR = userSearchClient.listByRole(roleIds); //查询角色下的所有人员数据 + log.info(">>>>>>>>>>>>>>>>>>>>>listR,:{}",listR); BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse(); //有没有选择仓库信息 if (ObjectUtils.isNotNull(myCurrentWarehouse)) {