From a26532b27269675c7d40d9dbe4cab118442205ba Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Wed, 12 Mar 2025 15:45:26 +0800 Subject: [PATCH 1/2] =?UTF-8?q?1.=E4=BF=AE=E5=A4=8D=E5=B9=B2=E7=BA=BFbug?= =?UTF-8?q?=202.=E6=8A=A5=E8=A1=A8=E6=98=8E=E7=BB=86=E5=AE=8C=E6=88=90=203?= =?UTF-8?q?.=E6=89=B9=E9=87=8F=E7=94=9F=E6=88=90=E6=89=98=E7=9B=98?= =?UTF-8?q?=E7=A0=81=E9=87=8D=E5=A4=8D=E9=97=AE=E9=A2=98=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=204.=E4=BF=AE=E5=A4=8D=E4=BB=93=E5=BA=93=E6=89=93=E6=89=98bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basicdata/feign/IBasicdataCodeClient.java | 3 + .../entity/TrunklineBillladingEntity.java | 2 +- .../basicdata/feign/BasicdataCodeClient.java | 5 + .../service/IBasicdataCodeService.java | 2 + .../impl/BasicdataCodeServiceImpl.java | 44 + .../impl/BasicdataTrayServiceImpl.java | 28 +- .../controller/ReportIncomingController.java | 39 + .../controller/ReportQualityController.java | 9 +- .../controller/ReportTimeController.java | 242 ++++- .../report/dto/AllTrunklineTimeDetailDTO.java | 54 ++ .../report/dto/ReportCheckTimeDetailDTO.java | 6 + .../report/dto/ReportIncomingDetailDTO.java | 100 +++ .../report/dto/ReportStartTimeDetailDTO.java | 53 ++ .../com/logpm/report/dto/ReportTimeDTO.java | 1 + .../report/mapper/ReportIncomingMapper.java | 16 +- .../report/mapper/ReportIncomingMapper.xml | 846 +++++++++++++++++- .../report/mapper/ReportQuallityMapper.xml | 36 +- .../logpm/report/mapper/ReportTimeMapper.java | 14 + .../logpm/report/mapper/ReportTimeMapper.xml | 738 ++++++++++++--- .../service/IReportIncomingService.java | 9 + .../report/service/IReportTimeService.java | 14 + .../impl/ReportIncomingServiceImpl.java | 269 +++++- .../service/impl/ReportTimeServiceImpl.java | 153 ++++ .../logpm/report/vo/ReportDeptIncomingVO.java | 3 + .../vo/ReportIncomingDetailExportVO.java | 224 +++++ .../report/vo/ReportIncomingDetailVO.java | 116 +++ .../ReportPackgeAllTrunklineTimeDetailVO.java | 98 ++ .../vo/ReportPackgeAllTrunklineTimeVO.java | 5 + .../vo/ReportPackgeStartTimeDetailVO.java | 102 +++ .../report/vo/ReportPackgeStartTimeVO.java | 5 + .../report/vo/ReportPackgeTransferTimeVO.java | 7 + .../service/IOpenOrderAsyncService.java | 1 + .../impl/OpenOrderAsyncServiceImpl.java | 50 +- ...TrunklineBillladingWaybillServiceImpl.java | 5 + .../impl/TrunklineCarsLoadServiceImpl.java | 53 +- .../TrunklineWaybillPackageServiceImpl.java | 3 + .../TrunklineWaybillTrackServiceImpl.java | 4 +- .../impl/WarehouseTrayTypeServiceImpl.java | 14 +- 38 files changed, 3193 insertions(+), 180 deletions(-) create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/dto/AllTrunklineTimeDetailDTO.java create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/dto/ReportIncomingDetailDTO.java create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/dto/ReportStartTimeDetailDTO.java create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportIncomingDetailExportVO.java create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportIncomingDetailVO.java create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportPackgeAllTrunklineTimeDetailVO.java create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportPackgeStartTimeDetailVO.java diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataCodeClient.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataCodeClient.java index 9648f2bb6..0971467a8 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataCodeClient.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataCodeClient.java @@ -21,4 +21,7 @@ public interface IBasicdataCodeClient { @GetMapping(API_PREFIX+"/getBatchPackageCodeByType") List getBatchPackageCodeByType(@RequestParam String warehouseCode, @RequestParam String orderCode,@RequestParam Integer num); + @GetMapping(API_PREFIX+"/getBatchTrayCode") + List getBatchTrayCode(@RequestParam String warehouseCode, @RequestParam String orderCode,@RequestParam Integer num); + } diff --git a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineBillladingEntity.java b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineBillladingEntity.java index 421e87d85..46d94e92c 100644 --- a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineBillladingEntity.java +++ b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineBillladingEntity.java @@ -75,7 +75,7 @@ public class TrunklineBillladingEntity extends TenantEntity { private BigDecimal planVolume ; /** 实际件数 */ @ApiModelProperty(name = "实际件数",notes = "") - private int realNum ; + private Integer realNum ; /** 实际重量 */ @ApiModelProperty(name = "实际重量",notes = "") private BigDecimal realWeight ; diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataCodeClient.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataCodeClient.java index 4d1f5ab0e..32af262ee 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataCodeClient.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataCodeClient.java @@ -24,4 +24,9 @@ public class BasicdataCodeClient implements IBasicdataCodeClient { return basicdataCodeService.getBatchPackageCodeByType(warehouseCode,orderCode,num); } + @Override + public List getBatchTrayCode(String warehouseCode, String orderCode, Integer num) { + return basicdataCodeService.getBatchTrayCode(warehouseCode,orderCode,num); + } + } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataCodeService.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataCodeService.java index b7534a05d..9e41bd849 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataCodeService.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataCodeService.java @@ -7,4 +7,6 @@ public interface IBasicdataCodeService { String getCodeByType(Integer type,String warehouseCode,String orderCode); List getBatchPackageCodeByType(String warehouseCode, String orderCode, Integer num) ; + + List getBatchTrayCode(String warehouseCode, String orderCode, Integer num); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataCodeServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataCodeServiceImpl.java index bbaf61501..9cfb11e81 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataCodeServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataCodeServiceImpl.java @@ -161,6 +161,50 @@ public class BasicdataCodeServiceImpl implements IBasicdataCodeService { return packageCodes; } + @Override + public List getBatchTrayCode(String warehouseCode, String orderCode, Integer num) { + BasicTenantCodeEntity basicTenantCode = tenantCodeClient.findBasicTenantCodeByCodeAndShowType(BasicCodeTypeConstant.TRAY_CODE.getValue(), BasicCodeShowConstant.QR_CODE.getValue()); + if (Objects.isNull(basicTenantCode)) { + log.warn("############generateTraysCode: 租户信息不存在basicTenantCode={}", basicTenantCode); + return null; + } + String desName = basicTenantCode.getDesName(); + String code = basicTenantCode.getCode(); + + if (!StringUtil.hasLength(warehouseCode)) { + log.warn("############generateTraysCode: 仓库编码为空warehouseCode={}", warehouseCode); + return null; + } + + //托盘 HT+仓库拼音+ 年月 +【当前仓库总数+1(五位数 不足补零)】 + BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseService.getWarehouseEntityByWarehouseCode(warehouseCode); + if (Objects.isNull(basicdataWarehouseEntity)) { + log.warn("############getWayBillNo: 仓库信息不存在 warehouseCode={}", warehouseCode); + return null; + } + + String abbreviation = basicdataWarehouseEntity.getAbbreviation(); + + + BasicdataCodeRecordEntity basicdataCodeRecordEntity = getBasicdataCodeRecordEntity(CodeNumConstant.TRAYS, basicdataWarehouseEntity); + + Integer inrc = basicdataCodeRecordEntity.getNum(); + + List trayCodes = new ArrayList<>(); + + for (int i = 0; i < num; i++) { + inrc = inrc + 1; + String trayCode = code + warehouseCode + (Integer.parseInt(basicdataCodeRecordEntity.getYear()) % 100) + inrc; + String trayName = desName + abbreviation + inrc; + trayCodes.add(trayCode + "&&" + trayName); + } + + basicdataCodeRecordEntity.setNum(inrc); + basicdataCodeRecordService.updateById(basicdataCodeRecordEntity); + + return trayCodes; + } + private String generateTrunklineLoadSignCode(Integer type, String warehouseCode, String orderCode) { if (!StringUtil.hasLength(warehouseCode)) { diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTrayServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTrayServiceImpl.java index f156dfbdb..344a3eee0 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTrayServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTrayServiceImpl.java @@ -41,7 +41,6 @@ import com.logpm.basicdata.feign.IBasicdataCodeClient; import com.logpm.basicdata.mapper.BasicdataTrayMapper; import com.logpm.basicdata.mapper.BasicdataWarehouseMapper; import com.logpm.basicdata.service.IBasicdataTrayService; -import com.logpm.basicdata.service.IBasicdataWarehouseService; import com.logpm.basicdata.vo.*; import com.logpm.warehouse.feign.IWarehouseTrayGoodsClient; import com.logpm.warehouse.vo.WarehouseTrayQRCode; @@ -49,7 +48,6 @@ import com.logpm.warehouse.vo.WarehouseTraybarCode; import lombok.AllArgsConstructor; import lombok.extern.log4j.Log4j2; import org.apache.commons.io.IOUtils; -import org.springblade.common.constant.CodeNumConstant; import org.springblade.common.utils.QRCodeUtil; import org.springblade.common.utils.TemplateUtil; import org.springblade.core.log.exception.ServiceException; @@ -59,7 +57,6 @@ import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.Func; import org.springblade.system.entity.User; -import org.springblade.system.feign.ISysClient; import org.springblade.system.feign.IUserClient; import org.springframework.beans.BeanUtils; import org.springframework.data.repository.init.ResourceReader; @@ -121,7 +118,6 @@ public class BasicdataTrayServiceImpl extends BaseServiceImpl basicdataTrayEntities = new ArrayList<>(); - for (Integer i = 0; i < number; i++) { - basicdataTrayEntity = new BasicdataTrayEntity(); + + List trayCodes = basicdataCodeClient.getBatchTrayCode(basicdataWarehouseEntity.getWarehouseCode(), "465897", number); + + trayCodes.forEach(trayCode -> { + BasicdataTrayEntity basicdataTrayEntity = new BasicdataTrayEntity(); BeanUtils.copyProperties(basicdataTrayDTO, basicdataTrayEntity); - //String trayCode = tenantCodeClient.shelfCode(AuthUtil.getTenantId(), "6"); - String trayInfo = basicdataCodeClient.getCodeByType(CodeNumConstant.TRAYS, basicdataWarehouseEntity.getWarehouseCode(), "465897"); - // basicdataTrayEntity.setTrayStatus("1"); - //String uuid = "1" + Func.random(18, RandomType.INT).trim(); - //long id = Long.parseLong(uuid); -// BladeUser user = AuthUtil.getUser(); -// basicdataTrayEntity.setCreateUser(user.getUserId()); -// basicdataTrayEntity.setCreateTime(new Date()); -// basicdataTrayEntity.setCreateDept(Long.valueOf(user.getDeptId())); -// basicdataTrayEntity.setTenantId(user.getTenantId()); -// basicdataTrayEntity.setIsDeleted(0); -// basicdataTrayEntity.setStatus(1); - // basicdataTrayEntity.setId(id); - String[] split = trayInfo.split("&&"); + String[] split = trayCode.split("&&"); basicdataTrayEntity.setPalletCode(split[0]); basicdataTrayEntity.setPalletName(split[1]); basicdataTrayEntities.add(basicdataTrayEntity); - } + }); result = this.saveBatch(basicdataTrayEntities); } return result; diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/controller/ReportIncomingController.java b/blade-service/logpm-report/src/main/java/com/logpm/report/controller/ReportIncomingController.java index 8aa69a7c0..6d80c6204 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/controller/ReportIncomingController.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/controller/ReportIncomingController.java @@ -2,16 +2,19 @@ package com.logpm.report.controller; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.logpm.report.dto.ReportIncomingDTO; +import com.logpm.report.dto.ReportIncomingDetailDTO; import com.logpm.report.service.IReportIncomingService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.tool.api.R; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; +@Slf4j @RestController @AllArgsConstructor @RequestMapping("/reportIncoming") @@ -50,4 +53,40 @@ public class ReportIncomingController extends BladeController { } + @PostMapping("/incomingDetailPage") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "收入明细报表", notes = "收入明细报表") + public R incomingDetailPage(@RequestBody ReportIncomingDetailDTO reportIncomingDetailDTO) { + String method = "##############incomingDetailPage: "; + try{ + return reportIncomingService.incomingDetailPage(reportIncomingDetailDTO); + }catch (Exception e){ + log.error(method+"系统异常",e); + return R.fail(500,"系统异常"); + } + + } + + @PostMapping("/incomingDetailExport") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "收入明细报表导出", notes = "收入明细报表导出") + public void incomingDetailExport(@RequestBody ReportIncomingDetailDTO reportIncomingDetailDTO, HttpServletResponse response) { + reportIncomingService.incomingDetailExport(reportIncomingDetailDTO,response); + } + + + @PostMapping("/deptIncomingPageNew") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "营业部收入报表-新", notes = "营业部收入报表-新") + public R deptIncomingPageNew(@RequestBody ReportIncomingDTO reportIncomingDTO) { + return reportIncomingService.deptIncomingPageNew(reportIncomingDTO); + } + + @PostMapping("/deptIncomingExportNew") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "营业部收入报表导出-新", notes = "营业部收入报表导出-新") + public void deptIncomingExportNew(@RequestBody ReportIncomingDTO reportIncomingDTO, HttpServletResponse response) { + reportIncomingService.deptIncomingExportNew(reportIncomingDTO,response); + } + } diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/controller/ReportQualityController.java b/blade-service/logpm-report/src/main/java/com/logpm/report/controller/ReportQualityController.java index b428ada7a..ebd431b3d 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/controller/ReportQualityController.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/controller/ReportQualityController.java @@ -73,7 +73,14 @@ public class ReportQualityController { return R.fail(405,"目的仓id不能为空"); } - return reportQualityService.updateWaybillQualityDetailPage(reportQualityDTO); + try{ + return reportQualityService.updateWaybillQualityDetailPage(reportQualityDTO); + }catch (Exception e){ + log.error(method+"系统异常",e); + return R.fail(500,"系统异常"); + } + + } diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/controller/ReportTimeController.java b/blade-service/logpm-report/src/main/java/com/logpm/report/controller/ReportTimeController.java index fd2540fc9..28b672479 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/controller/ReportTimeController.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/controller/ReportTimeController.java @@ -1,7 +1,9 @@ package com.logpm.report.controller; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.logpm.report.dto.AllTrunklineTimeDetailDTO; import com.logpm.report.dto.ReportCheckTimeDetailDTO; +import com.logpm.report.dto.ReportStartTimeDetailDTO; import com.logpm.report.dto.ReportTimeDTO; import com.logpm.report.service.IReportTimeService; import io.swagger.annotations.Api; @@ -67,7 +69,12 @@ public class ReportTimeController extends BladeController { log.warn(method+"仓库id不能为空 {}",warehouseId); return R.fail(405,"仓库id不能为空"); } - return reportTimeService.openTimeDetailPage(reportTimeDTO); + try{ + return reportTimeService.openTimeDetailPage(reportTimeDTO); + }catch (Exception e){ + log.error(method+"系统异常",e); + return R.fail(500,"系统异常"); + } } @PostMapping("/openTimeDetailExport") @@ -142,7 +149,13 @@ public class ReportTimeController extends BladeController { return R.fail(405,"目的仓id不能为空"); } - return reportTimeService.checkWaybillTimeDetailPage(reportCheckTimeDetailDTO); + try{ + return reportTimeService.checkWaybillTimeDetailPage(reportCheckTimeDetailDTO); + }catch (Exception e){ + log.error(method+"系统异常",e); + return R.fail(500,"系统异常"); + } + } @PostMapping("/checkWaybillTimeDetailExport") @@ -194,6 +207,80 @@ public class ReportTimeController extends BladeController { reportTimeService.packageStartTimeExport(reportTimeDTO,response); } + @PostMapping("/packageStartTimeDetailPage") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "订制品发运时效明细报表", notes = "订制品发运时效明细报表") + public R packageStartTimeDetailPage(@RequestBody ReportStartTimeDetailDTO reportStartTimeDetailDTO) { + String method = "###########packageStartTimeDetailPage: "; + String brand = reportStartTimeDetailDTO.getBrand(); + String businessLine = reportStartTimeDetailDTO.getBusinessLine(); + Long departureWarehouseId = reportStartTimeDetailDTO.getDepartureWarehouseId(); + Long destinationWarehouseId = reportStartTimeDetailDTO.getDestinationWarehouseId(); + + if(StringUtil.isBlank(brand)){ + log.warn(method+"品牌不能为空 {}",brand); + return R.fail(405,"品牌不能为空"); + } + + if(StringUtil.isBlank(businessLine)){ + log.warn(method+"事业线不能为空 {}",businessLine); + return R.fail(405,"事业线不能为空"); + } + + if(Objects.isNull(departureWarehouseId)){ + log.warn(method+"始发仓id不能为空 {}",departureWarehouseId); + return R.fail(405,"始发仓id不能为空"); + } + + if(Objects.isNull(destinationWarehouseId)){ + log.warn(method+"目的仓id不能为空 {}",destinationWarehouseId); + return R.fail(405,"目的仓id不能为空"); + } + + try{ + return reportTimeService.packageStartTimeDetailPage(reportStartTimeDetailDTO); + }catch (Exception e){ + log.error(method+"系统异常",e); + return R.fail(500,"系统异常"); + } + } + + @PostMapping("/packageStartTimeDetailExport") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "订制品发运时效明细报表导出", notes = "订制品发运时效明细报表导出") + public void packageStartTimeDetailExport(@RequestBody ReportStartTimeDetailDTO reportStartTimeDetailDTO, HttpServletResponse response) { + String method = "###########packageStartTimeDetailExport: "; + String brand = reportStartTimeDetailDTO.getBrand(); + String businessLine = reportStartTimeDetailDTO.getBusinessLine(); + Long departureWarehouseId = reportStartTimeDetailDTO.getDepartureWarehouseId(); + Long destinationWarehouseId = reportStartTimeDetailDTO.getDestinationWarehouseId(); + + if(StringUtil.isBlank(brand)){ + log.warn(method+"品牌不能为空 {}",brand); + throw new CustomerException(405,"品牌不能为空"); + } + + if(StringUtil.isBlank(businessLine)){ + log.warn(method+"事业线不能为空 {}",businessLine); + throw new CustomerException(405,"事业线不能为空"); + } + + if(Objects.isNull(departureWarehouseId)){ + log.warn(method+"始发仓id不能为空 {}",departureWarehouseId); + throw new CustomerException(405,"始发仓id不能为空"); + } + + if(Objects.isNull(destinationWarehouseId)){ + log.warn(method+"目的仓id不能为空 {}",destinationWarehouseId); + throw new CustomerException(405,"目的仓id不能为空"); + } + + reportTimeService.packageStartTimeDetailExport(reportStartTimeDetailDTO,response); + } + + + + //-----------------------零担发运时效------------------------ @PostMapping("/zeroStartTimePage") @@ -226,6 +313,85 @@ public class ReportTimeController extends BladeController { reportTimeService.packageTransferTimeExport(reportTimeDTO,response); } + + @PostMapping("/packageTransferTimeDetailPage") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "订制品中转时效明细报表", notes = "订制品中转时效明细报表") + public R packageTransferTimeDetailPage(@RequestBody ReportStartTimeDetailDTO reportStartTimeDetailDTO) { + String method = "###########packageTransferTimeDetailPage: "; + String brand = reportStartTimeDetailDTO.getBrand(); + String businessLine = reportStartTimeDetailDTO.getBusinessLine(); + Long warehouseId = reportStartTimeDetailDTO.getWarehouseId(); + Long departureWarehouseId = reportStartTimeDetailDTO.getDepartureWarehouseId(); + Long destinationWarehouseId = reportStartTimeDetailDTO.getDestinationWarehouseId(); + + if(StringUtil.isBlank(brand)){ + log.warn(method+"品牌不能为空 {}",brand); + return R.fail(405,"品牌不能为空"); + } + + if(StringUtil.isBlank(businessLine)){ + log.warn(method+"事业线不能为空 {}",businessLine); + return R.fail(405,"事业线不能为空"); + } + + if(Objects.isNull(warehouseId)){ + log.warn(method+"中转仓id不能为空 {}",warehouseId); + return R.fail(405,"中转仓id不能为空"); + } + + if(Objects.isNull(departureWarehouseId)){ + log.warn(method+"始发仓id不能为空 {}",departureWarehouseId); + return R.fail(405,"始发仓id不能为空"); + } + + if(Objects.isNull(destinationWarehouseId)){ + log.warn(method+"目的仓id不能为空 {}",destinationWarehouseId); + return R.fail(405,"目的仓id不能为空"); + } + + return reportTimeService.packageTransferTimeDetailPage(reportStartTimeDetailDTO); + } + + @PostMapping("/packageTransferTimeDetailExport") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "订制品中转时效明细报表导出", notes = "订制品中转时效明细报表导出") + public void packageTransferTimeDetailExport(@RequestBody ReportStartTimeDetailDTO reportStartTimeDetailDTO, HttpServletResponse response) { + String method = "###########packageTransferTimeDetailExport: "; + String brand = reportStartTimeDetailDTO.getBrand(); + String businessLine = reportStartTimeDetailDTO.getBusinessLine(); + Long warehouseId = reportStartTimeDetailDTO.getWarehouseId(); + Long departureWarehouseId = reportStartTimeDetailDTO.getDepartureWarehouseId(); + Long destinationWarehouseId = reportStartTimeDetailDTO.getDestinationWarehouseId(); + + if(StringUtil.isBlank(brand)){ + log.warn(method+"品牌不能为空 {}",brand); + throw new CustomerException(405,"品牌不能为空"); + } + + if(StringUtil.isBlank(businessLine)){ + log.warn(method+"事业线不能为空 {}",businessLine); + throw new CustomerException(405,"事业线不能为空"); + } + + if(Objects.isNull(warehouseId)){ + log.warn(method+"中转仓id不能为空 {}",warehouseId); + throw new CustomerException(405,"中转仓id不能为空"); + } + + if(Objects.isNull(departureWarehouseId)){ + log.warn(method+"始发仓id不能为空 {}",departureWarehouseId); + throw new CustomerException(405,"始发仓id不能为空"); + } + + if(Objects.isNull(destinationWarehouseId)){ + log.warn(method+"目的仓id不能为空 {}",destinationWarehouseId); + throw new CustomerException(405,"目的仓id不能为空"); + } + reportTimeService.packageTransferTimeDetailExport(reportStartTimeDetailDTO,response); + } + + //-----------------------零担中转时效------------------------ @PostMapping("/zeroTransferTimePage") @@ -258,6 +424,78 @@ public class ReportTimeController extends BladeController { reportTimeService.packageAllTrunklineTimeExport(reportTimeDTO,response); } + @PostMapping("/packageAllTrunklineTimeDetailPage") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "订制品干线时效明细报表", notes = "订制品干线时效明细报表") + public R packageAllTrunklineTimeDetailPage(@RequestBody AllTrunklineTimeDetailDTO allTrunklineTimeDetailDTO) { + String method = "#####################packageAllTrunklineTimeDetailPage: "; + String brand = allTrunklineTimeDetailDTO.getBrand(); + Long departureWarehouseId = allTrunklineTimeDetailDTO.getDepartureWarehouseId(); + Long destinationWarehouseId = allTrunklineTimeDetailDTO.getDestinationWarehouseId(); + String businessLine = allTrunklineTimeDetailDTO.getBusinessLine(); + if(StringUtil.isBlank(brand)){ + log.warn(method+"品牌不能为空 {}",brand); + return R.fail(405,"品牌不能为空"); + } + + if(StringUtil.isBlank(businessLine)){ + log.warn(method+"事业线不能为空 {}",businessLine); + return R.fail(405,"事业线不能为空"); + } + + if(Objects.isNull(departureWarehouseId)){ + log.warn(method+"始发仓id不能为空 {}",departureWarehouseId); + return R.fail(405,"始发仓id不能为空"); + } + + if(Objects.isNull(destinationWarehouseId)){ + log.warn(method+"目的仓id不能为空 {}",destinationWarehouseId); + return R.fail(405,"目的仓id不能为空"); + } + + try{ + return reportTimeService.packageAllTrunklineTimeDetailPage(allTrunklineTimeDetailDTO); + }catch (Exception e){ + log.error(method+"系统异常",e); + return R.fail(500,"系统异常"); + } + + } + + @PostMapping("/packageAllTrunklineTimeDetailExport") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "订制品干线时效明细报表导出", notes = "订制品干线时效明细报表导出") + public void packageAllTrunklineTimeDetailExport(@RequestBody AllTrunklineTimeDetailDTO allTrunklineTimeDetailDTO, HttpServletResponse response) { + String method = "#####################packageAllTrunklineTimeDetailExport: "; + String brand = allTrunklineTimeDetailDTO.getBrand(); + Long departureWarehouseId = allTrunklineTimeDetailDTO.getDepartureWarehouseId(); + Long destinationWarehouseId = allTrunklineTimeDetailDTO.getDestinationWarehouseId(); + String businessLine = allTrunklineTimeDetailDTO.getBusinessLine(); + if(StringUtil.isBlank(brand)){ + log.warn(method+"品牌不能为空 {}",brand); + throw new CustomerException(405,"品牌不能为空"); + } + + if(StringUtil.isBlank(businessLine)){ + log.warn(method+"事业线不能为空 {}",businessLine); + throw new CustomerException(405,"事业线不能为空"); + } + + if(Objects.isNull(departureWarehouseId)){ + log.warn(method+"始发仓id不能为空 {}",departureWarehouseId); + throw new CustomerException(405,"始发仓id不能为空"); + } + + if(Objects.isNull(destinationWarehouseId)){ + log.warn(method+"目的仓id不能为空 {}",destinationWarehouseId); + throw new CustomerException(405,"目的仓id不能为空"); + } + + reportTimeService.packageAllTrunklineTimeDetailExport(allTrunklineTimeDetailDTO,response); + } + + + //-----------------------零担干线整体时效------------------------ @PostMapping("/zeroAllTrunklineTimePage") diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/dto/AllTrunklineTimeDetailDTO.java b/blade-service/logpm-report/src/main/java/com/logpm/report/dto/AllTrunklineTimeDetailDTO.java new file mode 100644 index 000000000..6cafeaa2e --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/dto/AllTrunklineTimeDetailDTO.java @@ -0,0 +1,54 @@ +package com.logpm.report.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +@Data +public class AllTrunklineTimeDetailDTO implements Serializable { + + private Integer pageNum; + private Integer pageSize; + + private String brand; + private String businessLine; + private Long warehouseId; + private Long departureWarehouseId; + private Long destinationWarehouseId; + + private Integer hoursTime; + + private String startTimeStr; + private String endTimeStr; + + private Date startTime; + private Date endTime; + + + // 开单件数 1 + // 目的仓到仓件数 2 + // 目的仓未到仓件数 3 + // 准时到仓件数 4 + private Integer allTrunklineTimeDetailType; + + private String createTimeStartStr; + private String createTimeEndStr; + + private Date createTimeStartTime; + private Date createTimeEndTime; + + + private String orderCode; + private String waybillNo; + private String departureWarehouseName; + private String destinationWarehouseName; + private String orderPackageCode; + private String serviceNum; + private String trainNumber; + + private Integer isDesIncomging; + private Integer isOverTime; // 未超时 0 超时1 + + +} diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/dto/ReportCheckTimeDetailDTO.java b/blade-service/logpm-report/src/main/java/com/logpm/report/dto/ReportCheckTimeDetailDTO.java index c6db3e339..1afb0be4d 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/dto/ReportCheckTimeDetailDTO.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/dto/ReportCheckTimeDetailDTO.java @@ -27,6 +27,12 @@ public class ReportCheckTimeDetailDTO implements Serializable { private List waybillNoList; + private String startTimeStr; + private String endTimeStr; + + private Date startTime; + private Date endTime; + private String documentMakingTimeStartStr; private String documentMakingTimeEndStr; diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/dto/ReportIncomingDetailDTO.java b/blade-service/logpm-report/src/main/java/com/logpm/report/dto/ReportIncomingDetailDTO.java new file mode 100644 index 000000000..1e1f43682 --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/dto/ReportIncomingDetailDTO.java @@ -0,0 +1,100 @@ +package com.logpm.report.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +@Data +public class ReportIncomingDetailDTO implements Serializable { + + private Integer pageNum; + private Integer pageSize; + + + private String startTimeStr; + private String endTimeStr; + + private Date startTime; + private Date endTime; + + private String year; + private String month; + + private String businessLine; + private Long departureWarehouseId; + private Long destinationWarehouseId; + private String brand; + private Long consigneeId; + + + private String documentMakingTimeStartStr; + private String documentMakingTimeEndStr; + + private Date documentMakingTimeStartDate; + private Date documentMakingTimeEndDate; + + private String createTimeStartStr; + private String createTimeEndStr; + + private Date createTimeStartDate; + private Date createTimeEndDate; + + private String abolishTimeStartStr; + private String abolishTimeEndStr; + private Date abolishTimeStartDate; + private Date abolishTimeEndDate; + + private String freezeTimeStartStr; + private String freezeTimeEndStr; + private Date freezeTimeStartDate; + private Date freezeTimeEndDate; + + + private String checkTimeStartStr; + private String checkTimeEndStr; + private Date checkTimeStartDate; + private Date checkTimeEndDate; + + private List waybillNos; + private List waybillNoList; + private List destinationWarehouseIds; + private String waybillNo; + private String orderNo; + private String destinationWarehouseName; + private String departureWarehouseName; + private String customerTrain; + private String shipper; + private String shipperName; + private String shipperMobile; + private String consignee; + private String consigneeName; + private String consigneeMobile; + private String destination; + private String completeDestination; + private String departure; + private String completeDeparture; + private Integer payType; + private Integer payWay; + private Integer deliveryWay; + private Integer urgency; + private Integer serviceType; + private Integer transportType; + private Integer waybillStatus; + private Integer checkStatus; + private Integer pickupCompleteOrNot; + private Integer trunklineCompleteOrNot; + private String agent; + private String goodsName; + private Integer freezeStatus; + private Integer abolishStatus; + private String remark; + private String consigneeAddress; + private Integer payStatus; + private String signUserName; + private Integer settlementStatus; + + + +} diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/dto/ReportStartTimeDetailDTO.java b/blade-service/logpm-report/src/main/java/com/logpm/report/dto/ReportStartTimeDetailDTO.java new file mode 100644 index 000000000..dc5da508a --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/dto/ReportStartTimeDetailDTO.java @@ -0,0 +1,53 @@ +package com.logpm.report.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +@Data +public class ReportStartTimeDetailDTO implements Serializable { + + private Integer pageNum; + private Integer pageSize; + + private String createStartTimeStr; + private String createEndTimeStr; + + private Date createStartTime; + private Date createEndTime; + + private String startTimeStr; + private String endTimeStr; + + private Date startTime; + private Date endTime; + + private String businessLine; + private Long departureWarehouseId; + private Long warehouseId; + private Long destinationWarehouseId; + private String brand; + + private Integer hoursTime; + + + private String orderCode; + private String waybillNo; + private String departureWarehouseName; + private String nowWarehouseName; + private String destinationWarehouseName; + private String orderPackageCode; + private String serviceNum; + private String trainNumber; + + private Integer isDesIncomging; + private Integer isOverTime; // 未超时 0 超时1 + + //开单件数 1 + //发运件数 2 + //为发运件数 3 + //未发运超时件数 4 + private Integer startDetailType; + +} diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/dto/ReportTimeDTO.java b/blade-service/logpm-report/src/main/java/com/logpm/report/dto/ReportTimeDTO.java index 45e6343d4..9f920fd29 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/dto/ReportTimeDTO.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/dto/ReportTimeDTO.java @@ -30,6 +30,7 @@ public class ReportTimeDTO implements Serializable { private String orderCode; private String waybillCode; + private String waybillNo; private String brand; private String businessLine; diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportIncomingMapper.java b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportIncomingMapper.java index eb493a8dc..fcddcc511 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportIncomingMapper.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportIncomingMapper.java @@ -2,10 +2,8 @@ package com.logpm.report.mapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.logpm.report.dto.ReportIncomingDTO; -import com.logpm.report.vo.ReportConsigneeIncomingExportVO; -import com.logpm.report.vo.ReportDeptIncomingExportVO; -import com.logpm.report.vo.ReportDeptIncomingNumVO; -import com.logpm.report.vo.ReportDeptIncomingVO; +import com.logpm.report.dto.ReportIncomingDetailDTO; +import com.logpm.report.vo.*; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -26,4 +24,14 @@ public interface ReportIncomingMapper { List findIncomingNumByConsiginee(@Param("param") ReportIncomingDTO reportIncomingDTO); List consigneeIncomingExport(@Param("param") ReportIncomingDTO reportIncomingDTO); + + IPage incomingDetailPage(IPage page, @Param("param") ReportIncomingDetailDTO reportIncomingDetailDTO); + + List incomingDetailExport(@Param("param") ReportIncomingDetailDTO reportIncomingDetailDTO); + + IPage deptIncomingPageNew(IPage page, @Param("param") ReportIncomingDTO reportIncomingDTO); + + List findIncomingNumNew(@Param("param") ReportIncomingDTO reportIncomingDTO); + + List deptIncomingExportNew(@Param("param") ReportIncomingDTO reportIncomingDTO); } diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportIncomingMapper.xml b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportIncomingMapper.xml index 600a82655..6e9016d7c 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportIncomingMapper.xml +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportIncomingMapper.xml @@ -5,8 +5,10 @@ + + + + + + + @@ -180,10 +371,109 @@ MONTH(lww.document_making_time) + + @@ -368,4 +658,544 @@ MONTH(lww.document_making_time) + + + + + diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportQuallityMapper.xml b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportQuallityMapper.xml index 4ba0ab7e0..9dce52b9a 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportQuallityMapper.xml +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportQuallityMapper.xml @@ -151,29 +151,33 @@ left join logpm_trunkline_waybill_track ltwt on ltwt.waybill_id = lww.id and ltwt.track_type = '888' where 1=1 and lww.create_time > '2024-10-22 00:00:00' + and ltwt.id is not null and waw.business_line is not null and waw.business_line = #{param.businessLine} and lww.departure_warehouse_id = #{param.departureWarehouseId} and lww.destination_warehouse_id = #{param.destinationWarehouseId} and lww.brand = #{param.brand} - + and ltwt.refer = '发车前修改' - + and ltwt.refer = '人为操作错误' - + and ltwt.refer = '财务修改' - + and ltwt.refer = '商家要求' - + and ltwt.refer = '业务调整' - - group by lww.id - + + group by lww.id + + + + @@ -199,28 +203,32 @@ where 1=1 and lww.create_time > '2024-10-22 00:00:00' and waw.business_line is not null + and ltwt.id is not null and waw.business_line = #{param.businessLine} and lww.departure_warehouse_id = #{param.departureWarehouseId} and lww.destination_warehouse_id = #{param.destinationWarehouseId} and lww.brand = #{param.brand} - + and ltwt.refer = '发车前修改' - + and ltwt.refer = '人为操作错误' - + and ltwt.refer = '财务修改' - + and ltwt.refer = '商家要求' - + and ltwt.refer = '业务调整' - + group by lww.id + + + diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.java b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.java index 0b6d40411..7e50fe9c1 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.java @@ -1,7 +1,9 @@ package com.logpm.report.mapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.logpm.report.dto.AllTrunklineTimeDetailDTO; import com.logpm.report.dto.ReportCheckTimeDetailDTO; +import com.logpm.report.dto.ReportStartTimeDetailDTO; import com.logpm.report.dto.ReportTimeDTO; import com.logpm.report.vo.*; import org.apache.ibatis.annotations.Mapper; @@ -56,4 +58,16 @@ public interface ReportTimeMapper { IPage checkWaybillTimeDetailPage(IPage page, @Param("param") ReportCheckTimeDetailDTO reportCheckTimeDetailDTO); List checkWaybillTimeDetailExport(@Param("param") ReportCheckTimeDetailDTO reportCheckTimeDetailDTO); + + IPage packageAllTrunklineTimeDetailPage(IPage page, @Param("param") AllTrunklineTimeDetailDTO allTrunklineTimeDetailDTO); + + List packageAllTrunklineTimeDetailExport(@Param("param") AllTrunklineTimeDetailDTO allTrunklineTimeDetailDTO); + + IPage packageStartTimeDetailPage(IPage page, @Param("param") ReportStartTimeDetailDTO reportStartTimeDetailDTO); + + List packageStartTimeDetailExport(@Param("param") ReportStartTimeDetailDTO reportStartTimeDetailDTO); + + IPage packageTransferTimeDetailPage(IPage page, @Param("param") ReportStartTimeDetailDTO reportStartTimeDetailDTO); + + List packageTransferTimeDetailExport(@Param("param") ReportStartTimeDetailDTO reportStartTimeDetailDTO); } diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.xml b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.xml index 19afa334a..af2e2f0db 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.xml +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.xml @@ -224,7 +224,9 @@ @@ -333,7 +337,9 @@ and lta.create_time <= #{param.endTime} group by waw.business_line, + lww.departure_warehouse_id, lww.departure_warehouse_name, + lww.destination_warehouse_id, lww.destination_warehouse_name, lta.brand @@ -553,8 +559,11 @@ @@ -677,8 +689,11 @@ and ldpl.create_time <= #{param.endTime} group by waw.business_line, + ldpl.send_warehouse_id, ldpl.send_warehouse_name, + ldpl.accept_warehouse_id, ldpl.accept_warehouse_name, + ldpl.warehouse_id, ldpl.warehouse, ldpl.brand_name @@ -813,7 +828,9 @@ @@ -1615,20 +1634,14 @@ lta.order_type orderType, lta.system_type systemType, lta.service_num serviceNum, - case when lta.freeze_status = '0' then '否' - when lta.freeze_status = '1' then '是' - else '未知' - end freezeStatus, + lta.freeze_status, + lta.waybill_status, lta.create_time createTime, lww.document_making_time documentMakingTime, - case when lta.waybill_status = '0' then '未开单' - when lta.waybill_status = '1' then '已开单' - else '未知' - end waybillStatus, round(TIMESTAMPDIFF(SECOND, lta.create_time, lww.create_time)/3600,1) openHours, #{param.hoursTime} hoursTime, - case when round(TIMESTAMPDIFF(SECOND, lta.create_time, lww.create_time)/3600,1) <= #{param.hoursTime} then '未超时' - when round(TIMESTAMPDIFF(SECOND, lta.create_time, lww.create_time)/3600,1) > #{param.hoursTime} then '超时' + case when round(TIMESTAMPDIFF(SECOND, lta.create_time, lww.create_time)/3600,1) <= #{param.hoursTime} then '0' + when round(TIMESTAMPDIFF(SECOND, lta.create_time, lww.create_time)/3600,1) > #{param.hoursTime} then '1' else '未知' end isOverTime from logpm_trunkline_advance lta @@ -1663,8 +1676,8 @@ and lta.create_time <= #{param.endTime} - - and lta.waybill_no like concat('%',#{param.waybillCode},'%') + + and lta.waybill_no like concat('%',#{param.waybillNo},'%') and lta.order_code like concat('%',#{param.orderCode},'%') @@ -1720,10 +1733,10 @@ and lta.create_time <= #{param.openTimeEnd} - + and round(TIMESTAMPDIFF(SECOND, lta.create_time, lww.create_time)/3600,1) <= #{param.hoursTime} - + and round(TIMESTAMPDIFF(SECOND, lta.create_time, lww.create_time)/3600,1) > #{param.hoursTime} @@ -1757,6 +1770,7 @@ and lta.waybill_status='1' and lww.create_time > DATE_ADD( lta.create_time, INTERVAL #{param.hoursTime} HOUR ) + group by lta.id @@ -1955,52 +1970,20 @@ lww.complete_departure completeDeparture, lww.departure_warehouse_name departureWarehouseName, lww.destination_warehouse_name destinationWarehouseName, - case when lww.delivery_way='1' then '自提' - when lww.delivery_way='2' then '送货' - when lww.delivery_way='3' then '送货上门' - when lww.delivery_way='4' then '送货上门(有电梯)' - when lww.delivery_way='5' then '送货上门(无电梯)' - when lww.delivery_way='6' then '送货卸货' - when lww.delivery_way='7' then '送货安装' - ELSE '未知' END deliveryWay, + lww.delivery_way deliveryWay, lww.customer_train customerTrain, - CASE WHEN IFNULL(lww.return_status,0)=0 THEN '未回单' - WHEN IFNULL(lww.return_status,0)=1 THEN '已回单' - ELSE '未知' END returnStatus, + IFNULL(lww.return_status,0) returnStatus, lww.remark remark, - case when lbc.clean_obj_type='1' THEN '工厂' - when lbc.clean_obj_type='2' THEN '商场' - when lbc.clean_obj_type='3' THEN '个人' - else '未知' end cleanObjType, - case when lww.pay_type='1' then '现金' - when lww.pay_type='2' then '银行卡' - when lww.pay_type='3' then '微信' - when lww.pay_type='4' then '支付宝' - when lww.pay_type='5' then '支票' - when lww.pay_type='6' then '账本' - else '未知' end payType, - case when lww.pay_way='1' then '现付' - when lww.pay_way='2' then '到付' - when lww.pay_way='3' then '月结' - when lww.pay_way='4' then '回付' - when lww.pay_way='5' then '内部结算' - when lww.pay_way='6' then '多笔付' - else '未知' end payWay, + lbc.clean_obj_type cleanObjType, + lww.pay_type payType, + lww.pay_way payWay, lww.x_pay nowPay, lww.d_pay arrivePay, lww.h_pay backPay, lww.y_pay monthPay, - case when lbc.type_service='1' then '商配' - when lbc.type_service='2' then '市配' - when lbc.type_service='3' then '自提' - when lbc.type_service='4' then '三方中转' - else '未知' end serviceType, - CASE WHEN IFNULL(lww.update_status,0)=0 THEN '未改单' - WHEN IFNULL(lww.update_status,0)=1 THEN '已改单' - ELSE '未知' END updateStatus, - CASE WHEN IFNULL(lww.check_status,0)=0 THEN '未审核' - WHEN IFNULL(lww.check_status,0)=1 THEN '已审核' - ELSE '未知' END checkStatus, + lbc.type_service serviceType, + IFNULL(lww.update_status,0) updateStatus, + IFNULL(lww.check_status,0) checkStatus, lww.check_reson checkReson, lww.check_remark checkRemark, lww.check_user_name checkUserName, @@ -2008,17 +1991,7 @@ lww.cancle_check_remark cancleCheckRemark, lww.cancle_check_user_name cancleCheckUserName, lww.cancle_check_time cancleCheckTime, - case when lww.waybill_status='10' then '部分入库' - when lww.waybill_status='20' then '入库' - when lww.waybill_status='30' then '部分中转' - when lww.waybill_status='40' then '中转' - when lww.waybill_status='50' then '目的仓部分到达' - when lww.waybill_status='60' then '目的仓到达' - when lww.waybill_status='70' then '配送部分装车' - when lww.waybill_status='80' then '配送装车' - when lww.waybill_status='90' then '部分签收' - when lww.waybill_status='100' then '已签收' - else '未知' end waybillStatus, + lww.waybill_status waybillStatus, lww.document_making_time openTime, lww.goods_name goodsName, lww.total_count totalCount, @@ -2047,14 +2020,8 @@ lww.claiming_value claimingValue, lww.third_operation_fee thirdOperationFee, lww.rebate rebate, - CASE WHEN lww.pay_status='10' THEN '未付款' - WHEN lww.pay_status='20' THEN '部分付款' - WHEN lww.pay_status='30' THEN '已付款' - ELSE '未知' END payStatus, - CASE WHEN lww.settlement_status='10' THEN '未结算' - WHEN lww.settlement_status='20' THEN '部分结算' - WHEN lww.settlement_status='30' THEN '已结算' - ELSE '未知' END settlementStatus, + lww.pay_status payStatus, + lww.settlement_status settlementStatus, lww.sign_num signNum, lww.sign_time signTime, lww.delivery_time deliveryTime, @@ -2068,8 +2035,8 @@ count(lwwd.id) goodsTypeCount, round(TIMESTAMPDIFF(SECOND, lww.create_time, lww.check_time)/3600,1) checkHours, #{param.hoursTime} hoursTime, - case when round(TIMESTAMPDIFF(SECOND, lww.create_time, lww.check_time)/3600,1) <= #{param.hoursTime} then '未超时' - when round(TIMESTAMPDIFF(SECOND, lww.create_time, lww.check_time)/3600,1) > #{param.hoursTime} then '超时' + case when round(TIMESTAMPDIFF(SECOND, lww.create_time, lww.check_time)/3600,1) <= #{param.hoursTime} then '0' + when round(TIMESTAMPDIFF(SECOND, lww.create_time, lww.check_time)/3600,1) > #{param.hoursTime} then '1' else '未知' end isOverTime from logpm_warehouse_waybill lww @@ -2109,9 +2076,6 @@ and Locate(#{param.customerTrain},lww.customer_train) > 0 - - and Locate(#{param.brand},lww.brand) > 0 - and Locate(#{param.shipper},lww.shipper) > 0 @@ -2179,11 +2143,11 @@ and lww.document_making_time <= #{param.documentMakingTimeEndDate} - - and lww.create_time >= #{param.createTimeStartDate} + + and lww.create_time >= #{param.startTime} - - and lww.create_time <= #{param.createTimeEndDate} + + and lww.create_time <= #{param.endTime} and lww.check_time >= #{param.checkTimeStartDate} @@ -2209,15 +2173,6 @@ and Locate(#{param.consigneeAddress},lww.consignee_address) > 0 - - and lww.total_count = #{param.totalCount} - - - and lww.total_weight = #{param.totalWeight} - - - and lww.total_volume = #{param.totalVolume} - and lww.abolish_time >= #{param.abolishTimeStartDate} @@ -2245,7 +2200,7 @@ and lww.check_status=1 - + and lww.check_status=0 @@ -2430,9 +2385,6 @@ and Locate(#{param.customerTrain},lww.customer_train) > 0 - - and Locate(#{param.brand},lww.brand) > 0 - and Locate(#{param.shipper},lww.shipper) > 0 @@ -2500,11 +2452,11 @@ and lww.document_making_time <= #{param.documentMakingTimeEndDate} - - and lww.create_time >= #{param.createTimeStartDate} + + and lww.create_time >= #{param.startTime} - - and lww.create_time <= #{param.createTimeEndDate} + + and lww.create_time <= #{param.endTime} and lww.check_time >= #{param.checkTimeStartDate} @@ -2530,15 +2482,6 @@ and Locate(#{param.consigneeAddress},lww.consignee_address) > 0 - - and lww.total_count = #{param.totalCount} - - - and lww.total_weight = #{param.totalWeight} - - - and lww.total_volume = #{param.totalVolume} - and lww.abolish_time >= #{param.abolishTimeStartDate} @@ -2566,7 +2509,7 @@ and lww.check_status=1 - + and lww.check_status=0 @@ -2577,6 +2520,579 @@ order by lww.create_time desc + + + + + + + + + + + + + diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/IReportIncomingService.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/IReportIncomingService.java index 8cda9a1f9..a24168da5 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/service/IReportIncomingService.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/IReportIncomingService.java @@ -1,6 +1,7 @@ package com.logpm.report.service; import com.logpm.report.dto.ReportIncomingDTO; +import com.logpm.report.dto.ReportIncomingDetailDTO; import org.springblade.core.tool.api.R; import javax.servlet.http.HttpServletResponse; @@ -15,4 +16,12 @@ public interface IReportIncomingService { R consigineeIncomingPage(ReportIncomingDTO reportIncomingDTO); void consigineeIncomingExport(ReportIncomingDTO reportIncomingDTO, HttpServletResponse response); + + R incomingDetailPage(ReportIncomingDetailDTO reportIncomingDetailDTO); + + void incomingDetailExport(ReportIncomingDetailDTO reportIncomingDetailDTO, HttpServletResponse response); + + R deptIncomingPageNew(ReportIncomingDTO reportIncomingDTO); + + void deptIncomingExportNew(ReportIncomingDTO reportIncomingDTO, HttpServletResponse response); } diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/IReportTimeService.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/IReportTimeService.java index 0d036ad1d..088f14b28 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/service/IReportTimeService.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/IReportTimeService.java @@ -1,6 +1,8 @@ package com.logpm.report.service; +import com.logpm.report.dto.AllTrunklineTimeDetailDTO; import com.logpm.report.dto.ReportCheckTimeDetailDTO; +import com.logpm.report.dto.ReportStartTimeDetailDTO; import com.logpm.report.dto.ReportTimeDTO; import org.springblade.core.tool.api.R; @@ -52,4 +54,16 @@ public interface IReportTimeService { R checkWaybillTimeDetailPage(ReportCheckTimeDetailDTO reportCheckTimeDetailDTO); void checkWaybillTimeDetailExport(ReportCheckTimeDetailDTO reportCheckTimeDetailDTO, HttpServletResponse response); + + R packageAllTrunklineTimeDetailPage(AllTrunklineTimeDetailDTO allTrunklineTimeDetailDTO); + + void packageAllTrunklineTimeDetailExport(AllTrunklineTimeDetailDTO allTrunklineTimeDetailDTO, HttpServletResponse response); + + R packageStartTimeDetailPage(ReportStartTimeDetailDTO reportStartTimeDetailDTO); + + void packageStartTimeDetailExport(ReportStartTimeDetailDTO reportStartTimeDetailDTO, HttpServletResponse response); + + R packageTransferTimeDetailPage(ReportStartTimeDetailDTO reportStartTimeDetailDTO); + + void packageTransferTimeDetailExport(ReportStartTimeDetailDTO reportStartTimeDetailDTO, HttpServletResponse response); } diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportIncomingServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportIncomingServiceImpl.java index a31eb1af7..6d85588f0 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportIncomingServiceImpl.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportIncomingServiceImpl.java @@ -3,12 +3,10 @@ package com.logpm.report.service.impl; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.logpm.report.dto.ReportIncomingDTO; +import com.logpm.report.dto.ReportIncomingDetailDTO; import com.logpm.report.mapper.ReportIncomingMapper; import com.logpm.report.service.IReportIncomingService; -import com.logpm.report.vo.ReportConsigneeIncomingExportVO; -import com.logpm.report.vo.ReportDeptIncomingExportVO; -import com.logpm.report.vo.ReportDeptIncomingNumVO; -import com.logpm.report.vo.ReportDeptIncomingVO; +import com.logpm.report.vo.*; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.common.exception.CustomerException; @@ -461,4 +459,267 @@ public class ReportIncomingServiceImpl implements IReportIncomingService { //导出ls ExcelUtil.export(response, "收货单位收入报表导出", "收货单位收入报表导出", list, ReportConsigneeIncomingExportVO.class); } + + @Override + public R incomingDetailPage(ReportIncomingDetailDTO reportIncomingDetailDTO) { + IPage page = new Page<>(); + page.setCurrent(reportIncomingDetailDTO.getPageNum()); + page.setSize(reportIncomingDetailDTO.getPageSize()); + + String startTimeStr = reportIncomingDetailDTO.getStartTimeStr(); + String endTimeStr = reportIncomingDetailDTO.getEndTimeStr(); + reportIncomingDetailDTO.setStartTime(CommonUtil.getStartByDateStr(startTimeStr)); + reportIncomingDetailDTO.setEndTime(CommonUtil.getEndByDateStr(endTimeStr)); + + reportIncomingDetailDTO.setDocumentMakingTimeStartDate(CommonUtil.getStartByDateStr(reportIncomingDetailDTO.getDocumentMakingTimeStartStr())); + reportIncomingDetailDTO.setDocumentMakingTimeEndDate(CommonUtil.getEndByDateStr(reportIncomingDetailDTO.getDocumentMakingTimeEndStr())); + reportIncomingDetailDTO.setCreateTimeStartDate(CommonUtil.getStartByDateStr(reportIncomingDetailDTO.getCreateTimeStartStr())); + reportIncomingDetailDTO.setCreateTimeEndDate(CommonUtil.getEndByDateStr(reportIncomingDetailDTO.getCreateTimeEndStr())); + reportIncomingDetailDTO.setAbolishTimeStartDate(CommonUtil.getStartByDateStr(reportIncomingDetailDTO.getAbolishTimeStartStr())); + reportIncomingDetailDTO.setAbolishTimeEndDate(CommonUtil.getEndByDateStr(reportIncomingDetailDTO.getAbolishTimeEndStr())); + reportIncomingDetailDTO.setFreezeTimeStartDate(CommonUtil.getStartByDateStr(reportIncomingDetailDTO.getFreezeTimeStartStr())); + reportIncomingDetailDTO.setFreezeTimeEndDate(CommonUtil.getEndByDateStr(reportIncomingDetailDTO.getFreezeTimeEndStr())); + + reportIncomingDetailDTO.setCheckTimeStartDate(CommonUtil.getStartByDateStr(reportIncomingDetailDTO.getCheckTimeStartStr())); + reportIncomingDetailDTO.setCheckTimeEndDate(CommonUtil.getEndByDateStr(reportIncomingDetailDTO.getCheckTimeEndStr())); + + IPage iPage = reportIncomingMapper.incomingDetailPage(page,reportIncomingDetailDTO); + + + return R.data(iPage); + } + + @Override + public void incomingDetailExport(ReportIncomingDetailDTO reportIncomingDetailDTO, HttpServletResponse response) { + reportIncomingDetailDTO.setDocumentMakingTimeStartDate(CommonUtil.getStartByDateStr(reportIncomingDetailDTO.getDocumentMakingTimeStartStr())); + reportIncomingDetailDTO.setDocumentMakingTimeEndDate(CommonUtil.getEndByDateStr(reportIncomingDetailDTO.getDocumentMakingTimeEndStr())); + reportIncomingDetailDTO.setCreateTimeStartDate(CommonUtil.getStartByDateStr(reportIncomingDetailDTO.getCreateTimeStartStr())); + reportIncomingDetailDTO.setCreateTimeEndDate(CommonUtil.getEndByDateStr(reportIncomingDetailDTO.getCreateTimeEndStr())); + reportIncomingDetailDTO.setAbolishTimeStartDate(CommonUtil.getStartByDateStr(reportIncomingDetailDTO.getAbolishTimeStartStr())); + reportIncomingDetailDTO.setAbolishTimeEndDate(CommonUtil.getEndByDateStr(reportIncomingDetailDTO.getAbolishTimeEndStr())); + reportIncomingDetailDTO.setFreezeTimeStartDate(CommonUtil.getStartByDateStr(reportIncomingDetailDTO.getFreezeTimeStartStr())); + reportIncomingDetailDTO.setFreezeTimeEndDate(CommonUtil.getEndByDateStr(reportIncomingDetailDTO.getFreezeTimeEndStr())); + + reportIncomingDetailDTO.setCheckTimeStartDate(CommonUtil.getStartByDateStr(reportIncomingDetailDTO.getCheckTimeStartStr())); + reportIncomingDetailDTO.setCheckTimeEndDate(CommonUtil.getEndByDateStr(reportIncomingDetailDTO.getCheckTimeEndStr())); + + List list = reportIncomingMapper.incomingDetailExport(reportIncomingDetailDTO); + + ExcelUtil.export(response, "收入明细报表导出", "收入明细报表导出", list, ReportIncomingDetailExportVO.class); + + } + + @Override + public R deptIncomingPageNew(ReportIncomingDTO reportIncomingDTO) { + IPage page = new Page<>(); + page.setCurrent(reportIncomingDTO.getPageNum()); + page.setSize(reportIncomingDTO.getPageSize()); + + String year = reportIncomingDTO.getYear(); + String month = reportIncomingDTO.getMonth(); + String startTimeStr = reportIncomingDTO.getStartTimeStr(); + String endTimeStr = reportIncomingDTO.getEndTimeStr(); + String timeStr = null; + if(StringUtil.isNotBlank(startTimeStr) && StringUtil.isNotBlank(endTimeStr)){ + reportIncomingDTO.setStartTime(CommonUtil.getStartByDateStr(startTimeStr)); + reportIncomingDTO.setEndTime(CommonUtil.getEndByDateStr(endTimeStr)); + timeStr=startTimeStr+"至"+endTimeStr; + }else{ + if(StringUtil.isNotBlank(month)){ + Calendar instance = Calendar.getInstance(); + if(StringUtil.isBlank(year)){ + log.info("############deptIncomingPage:请选择年份"); + return R.fail(405,"请选择年份"); + } + try{ + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM"); + SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + final Date parse = sdf.parse(year+"-"+month); + reportIncomingDTO.setStartTime(CommonUtil.StringToDate(sdf1.format(parse))); + final Calendar cal = Calendar.getInstance(); + cal.setTime(parse); + final int last = cal.getActualMaximum(Calendar.DAY_OF_MONTH); + cal.set(Calendar.DAY_OF_MONTH, last); + cal.add(Calendar.DATE, +1); + cal.add(Calendar.SECOND, -1); + reportIncomingDTO.setEndTime(cal.getTime()); + + timeStr = year+"年"+month+"月"; + + }catch (Exception e){ + log.info("############deptIncomingPage:"); + return R.fail(405,"请选择年份"); + } + }else{ + if(StringUtil.isNotBlank(year)){ + Calendar instance = Calendar.getInstance(); + instance.set(Calendar.YEAR,Integer.parseInt(year)); + instance.set(Calendar.MONTH,Calendar.JANUARY); + instance.set(Calendar.DAY_OF_MONTH,1); + instance.set(Calendar.HOUR_OF_DAY, 0); + instance.set(Calendar.MINUTE, 0); + instance.set(Calendar.SECOND, 0); + instance.set(Calendar.MILLISECOND, 0); + reportIncomingDTO.setStartTime(instance.getTime()); + + instance.set(Calendar.MONTH,Calendar.DECEMBER); + instance.set(Calendar.DAY_OF_MONTH,31); + instance.set(Calendar.HOUR_OF_DAY, 23); + instance.set(Calendar.MINUTE, 59); + instance.set(Calendar.SECOND, 59); + instance.set(Calendar.MILLISECOND, 999); + reportIncomingDTO.setEndTime(instance.getTime()); + timeStr = year+"年"; + }else{ + Calendar instance = Calendar.getInstance(); + instance.set(Calendar.HOUR_OF_DAY, 23); + instance.set(Calendar.MINUTE, 59); + instance.set(Calendar.SECOND, 59); + instance.set(Calendar.MILLISECOND, 999); + reportIncomingDTO.setEndTime(instance.getTime()); + instance.add(Calendar.DATE, -7); + instance.set(Calendar.HOUR_OF_DAY, 0); + instance.set(Calendar.MINUTE, 0); + instance.set(Calendar.SECOND, 0); + instance.set(Calendar.MILLISECOND, 0); + reportIncomingDTO.setStartTime(instance.getTime()); + timeStr=CommonUtil.dateToStringGeneral(reportIncomingDTO.getStartTime())+"至"+CommonUtil.dateToStringGeneral(reportIncomingDTO.getEndTime()); + } + } + } + + IPage iPage = reportIncomingMapper.deptIncomingPageNew(page,reportIncomingDTO); + + //查询数据对应的在库数和签收数 + List ls = reportIncomingMapper.findIncomingNumNew(reportIncomingDTO); + //把ls转化为以businessLine,brand,departureWarehouseName,destinationWarehouseName为key的map + Map map = ls.stream() + .collect(Collectors.toMap(t-> t.getBusinessLine()+"&&"+t.getBrand()+"&&"+t.getDepartureWarehouseName()+"&&"+t.getDestinationWarehouseName()+"&&"+t.getNian()+"&&"+t.getYue(), reportDeptIncomingNumVO -> reportDeptIncomingNumVO)); + + List records = iPage.getRecords(); + String finalTimeStr = timeStr; + records.forEach(reportDeptIncomingVO -> { + String businessLine = reportDeptIncomingVO.getBusinessLine(); + String brand = reportDeptIncomingVO.getBrand(); + String departureWarehouseName = reportDeptIncomingVO.getDepartureWarehouseName(); + String destinationWarehouseName = reportDeptIncomingVO.getDestinationWarehouseName(); + String nian = reportDeptIncomingVO.getNian(); + String yue = reportDeptIncomingVO.getYue(); + reportDeptIncomingVO.setTimeStr(finalTimeStr); + ReportDeptIncomingNumVO reportDeptIncomingNumVO = map.get(businessLine + "&&" + brand + "&&" + departureWarehouseName + "&&" + destinationWarehouseName+"&&"+nian+"&&"+yue); + if(!Objects.isNull(reportDeptIncomingNumVO)){ + reportDeptIncomingVO.setStockNum(reportDeptIncomingNumVO.getStockNum()); + reportDeptIncomingVO.setSignNum(reportDeptIncomingNumVO.getSignNum()); + } + }); + iPage.setRecords(records); + + return R.data(iPage); + } + + @Override + public void deptIncomingExportNew(ReportIncomingDTO reportIncomingDTO, HttpServletResponse response) { + String year = reportIncomingDTO.getYear(); + String month = reportIncomingDTO.getMonth(); + String startTimeStr = reportIncomingDTO.getStartTimeStr(); + String endTimeStr = reportIncomingDTO.getEndTimeStr(); + String timeStr = null; + if(StringUtil.isNotBlank(startTimeStr) && StringUtil.isNotBlank(endTimeStr)){ + reportIncomingDTO.setStartTime(CommonUtil.getStartByDateStr(startTimeStr)); + reportIncomingDTO.setEndTime(CommonUtil.getEndByDateStr(endTimeStr)); + timeStr=startTimeStr+"至"+endTimeStr; + }else{ + if(StringUtil.isNotBlank(month)){ + Calendar instance = Calendar.getInstance(); + if(StringUtil.isBlank(year)){ + log.info("############deptIncomingPage:请选择年份"); + throw new CustomerException(405,"请选择年份"); + } + try{ + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM"); + SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + final Date parse = sdf.parse(year+"-"+month); + reportIncomingDTO.setStartTime(CommonUtil.StringToDate(sdf1.format(parse))); + final Calendar cal = Calendar.getInstance(); + cal.setTime(parse); + final int last = cal.getActualMaximum(Calendar.DAY_OF_MONTH); + cal.set(Calendar.DAY_OF_MONTH, last); + cal.add(Calendar.DATE, +1); + cal.add(Calendar.SECOND, -1); + reportIncomingDTO.setEndTime(cal.getTime()); + + timeStr = year+"年"+month+"月"; + + }catch (Exception e){ + log.info("############deptIncomingPage:请选择年份11111"); + throw new CustomerException(405,"请选择年份"); + } + }else{ + if(StringUtil.isNotBlank(year)){ + Calendar instance = Calendar.getInstance(); + instance.set(Calendar.YEAR,Integer.parseInt(year)); + instance.set(Calendar.MONTH,Calendar.JANUARY); + instance.set(Calendar.DAY_OF_MONTH,1); + instance.set(Calendar.HOUR_OF_DAY, 0); + instance.set(Calendar.MINUTE, 0); + instance.set(Calendar.SECOND, 0); + instance.set(Calendar.MILLISECOND, 0); + reportIncomingDTO.setStartTime(instance.getTime()); + + instance.set(Calendar.MONTH,Calendar.DECEMBER); + instance.set(Calendar.DAY_OF_MONTH,31); + instance.set(Calendar.HOUR_OF_DAY, 23); + instance.set(Calendar.MINUTE, 59); + instance.set(Calendar.SECOND, 59); + instance.set(Calendar.MILLISECOND, 999); + reportIncomingDTO.setEndTime(instance.getTime()); + timeStr = year+"年"; + }else{ + Calendar instance = Calendar.getInstance(); + instance.set(Calendar.HOUR_OF_DAY, 23); + instance.set(Calendar.MINUTE, 59); + instance.set(Calendar.SECOND, 59); + instance.set(Calendar.MILLISECOND, 999); + reportIncomingDTO.setEndTime(instance.getTime()); + instance.add(Calendar.DATE, -7); + instance.set(Calendar.HOUR_OF_DAY, 0); + instance.set(Calendar.MINUTE, 0); + instance.set(Calendar.SECOND, 0); + instance.set(Calendar.MILLISECOND, 0); + reportIncomingDTO.setStartTime(instance.getTime()); + timeStr=CommonUtil.dateToStringGeneral(reportIncomingDTO.getStartTime())+"至"+CommonUtil.dateToStringGeneral(reportIncomingDTO.getEndTime()); + } + } + } + + List list = reportIncomingMapper.deptIncomingExportNew(reportIncomingDTO); + + //查询数据对应的在库数和签收数 + List ls = reportIncomingMapper.findIncomingNumNew(reportIncomingDTO); + //把ls转化为以businessLine,brand,departureWarehouseName,destinationWarehouseName为key的map + Map map = ls.stream() + .collect(Collectors.toMap(t-> t.getBusinessLine()+"&&"+t.getBrand()+"&&"+t.getDepartureWarehouseName()+"&&"+t.getDestinationWarehouseName()+"&&"+t.getNian()+"&&"+t.getYue(), reportDeptIncomingNumVO -> reportDeptIncomingNumVO)); + + String finalTimeStr = timeStr; + list.forEach(reportDeptIncomingVO -> { + String businessLine = reportDeptIncomingVO.getBusinessLine(); + String brand = reportDeptIncomingVO.getBrand(); + String departureWarehouseName = reportDeptIncomingVO.getDepartureWarehouseName(); + String destinationWarehouseName = reportDeptIncomingVO.getDestinationWarehouseName(); + String nian = reportDeptIncomingVO.getNian(); + String yue = reportDeptIncomingVO.getYue(); + reportDeptIncomingVO.setTimeStr(finalTimeStr); + + ReportDeptIncomingNumVO reportDeptIncomingNumVO = map.get(businessLine + "&&" + brand + "&&" + departureWarehouseName + "&&" + destinationWarehouseName+"&&"+nian+"&&"+yue); + if(!Objects.isNull(reportDeptIncomingNumVO)){ + reportDeptIncomingVO.setStockNum(reportDeptIncomingNumVO.getStockNum()); + reportDeptIncomingVO.setSignNum(reportDeptIncomingNumVO.getSignNum()); + } + }); + + //导出ls + ExcelUtil.export(response, "营业部收入报表导出-新", "营业部收入报表导出-新", list, ReportDeptIncomingExportVO.class); + } } diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportTimeServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportTimeServiceImpl.java index 5dfdce205..58aca1a5a 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportTimeServiceImpl.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportTimeServiceImpl.java @@ -3,7 +3,9 @@ package com.logpm.report.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.logpm.report.dto.AllTrunklineTimeDetailDTO; import com.logpm.report.dto.ReportCheckTimeDetailDTO; +import com.logpm.report.dto.ReportStartTimeDetailDTO; import com.logpm.report.dto.ReportTimeDTO; import com.logpm.report.entity.*; import com.logpm.report.mapper.ReportTimeMapper; @@ -545,6 +547,8 @@ public class ReportTimeServiceImpl implements IReportTimeService { page.setCurrent(reportCheckTimeDetailDTO.getPageNum()); page.setSize(reportCheckTimeDetailDTO.getPageSize()); + reportCheckTimeDetailDTO.setStartTime(CommonUtil.getStartByDateStr(reportCheckTimeDetailDTO.getStartTimeStr())); + reportCheckTimeDetailDTO.setEndTime(CommonUtil.getEndByDateStr(reportCheckTimeDetailDTO.getEndTimeStr())); reportCheckTimeDetailDTO.setDocumentMakingTimeStartDate(CommonUtil.getStartByDateStr(reportCheckTimeDetailDTO.getDocumentMakingTimeStartStr())); reportCheckTimeDetailDTO.setDocumentMakingTimeEndDate(CommonUtil.getEndByDateStr(reportCheckTimeDetailDTO.getDocumentMakingTimeEndStr())); reportCheckTimeDetailDTO.setCreateTimeStartDate(CommonUtil.getStartByDateStr(reportCheckTimeDetailDTO.getCreateTimeStartStr())); @@ -576,6 +580,8 @@ public class ReportTimeServiceImpl implements IReportTimeService { @Override public void checkWaybillTimeDetailExport(ReportCheckTimeDetailDTO reportCheckTimeDetailDTO, HttpServletResponse response) { + reportCheckTimeDetailDTO.setStartTime(CommonUtil.getStartByDateStr(reportCheckTimeDetailDTO.getStartTimeStr())); + reportCheckTimeDetailDTO.setEndTime(CommonUtil.getEndByDateStr(reportCheckTimeDetailDTO.getEndTimeStr())); reportCheckTimeDetailDTO.setDocumentMakingTimeStartDate(CommonUtil.getStartByDateStr(reportCheckTimeDetailDTO.getDocumentMakingTimeStartStr())); reportCheckTimeDetailDTO.setDocumentMakingTimeEndDate(CommonUtil.getEndByDateStr(reportCheckTimeDetailDTO.getDocumentMakingTimeEndStr())); reportCheckTimeDetailDTO.setCreateTimeStartDate(CommonUtil.getStartByDateStr(reportCheckTimeDetailDTO.getCreateTimeStartStr())); @@ -605,4 +611,151 @@ public class ReportTimeServiceImpl implements IReportTimeService { //导出ls ExcelUtil.export(response, "审单及时率明细报表导出", "审单及时率明细报表导出", list, ReportCheckWaybillTimeDetailVO.class); } + + @Override + public R packageAllTrunklineTimeDetailPage(AllTrunklineTimeDetailDTO allTrunklineTimeDetailDTO) { + IPage page = new Page<>(); + page.setCurrent(allTrunklineTimeDetailDTO.getPageNum()); + page.setSize(allTrunklineTimeDetailDTO.getPageSize()); + + allTrunklineTimeDetailDTO.setStartTime(CommonUtil.getStartByDateStr(allTrunklineTimeDetailDTO.getStartTimeStr())); + allTrunklineTimeDetailDTO.setEndTime(CommonUtil.getEndByDateStr(allTrunklineTimeDetailDTO.getEndTimeStr())); + + allTrunklineTimeDetailDTO.setHoursTime(0); + + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("departure_warehouse_name","全部") + .eq("destination_warehouse_name","全部") + .eq("is_deleted",0); + ReportConfigAllTrunklineEntity allTrunklineEntity = allTrunklineService.getOne(queryWrapper); + if(!Objects.isNull(allTrunklineEntity)){ + allTrunklineTimeDetailDTO.setHoursTime(allTrunklineEntity.getHoursTime()); + } + + IPage iPage = reportTimeMapper.packageAllTrunklineTimeDetailPage(page,allTrunklineTimeDetailDTO); + + + return R.data(iPage); + } + + @Override + public void packageAllTrunklineTimeDetailExport(AllTrunklineTimeDetailDTO allTrunklineTimeDetailDTO, HttpServletResponse response) { + allTrunklineTimeDetailDTO.setStartTime(CommonUtil.getStartByDateStr(allTrunklineTimeDetailDTO.getStartTimeStr())); + allTrunklineTimeDetailDTO.setEndTime(CommonUtil.getEndByDateStr(allTrunklineTimeDetailDTO.getEndTimeStr())); + + allTrunklineTimeDetailDTO.setHoursTime(0); + + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("departure_warehouse_name","全部") + .eq("destination_warehouse_name","全部") + .eq("is_deleted",0); + ReportConfigAllTrunklineEntity allTrunklineEntity = allTrunklineService.getOne(queryWrapper); + if(!Objects.isNull(allTrunklineEntity)){ + allTrunklineTimeDetailDTO.setHoursTime(allTrunklineEntity.getHoursTime()); + } + + List list = reportTimeMapper.packageAllTrunklineTimeDetailExport(allTrunklineTimeDetailDTO); + + //导出ls + ExcelUtil.export(response, "干线整体时效明细报表导出", "干线整体时效明细报表导出", list, ReportPackgeAllTrunklineTimeDetailVO.class); + + } + + @Override + public R packageStartTimeDetailPage(ReportStartTimeDetailDTO reportStartTimeDetailDTO) { + IPage page = new Page<>(); + page.setCurrent(reportStartTimeDetailDTO.getPageNum()); + page.setSize(reportStartTimeDetailDTO.getPageSize()); + + reportStartTimeDetailDTO.setStartTime(CommonUtil.getStartByDateStr(reportStartTimeDetailDTO.getStartTimeStr())); + reportStartTimeDetailDTO.setEndTime(CommonUtil.getEndByDateStr(reportStartTimeDetailDTO.getEndTimeStr())); + + reportStartTimeDetailDTO.setHoursTime(72); + + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("departure_warehouse_name","全部") + .eq("destination_warehouse_name","全部") + .eq("brand","全部") + .eq("is_deleted",0); + ReportConfigDespatchEntity despatchEntity = despatchService.getOne(queryWrapper); + if(!Objects.isNull(despatchEntity)){ + reportStartTimeDetailDTO.setHoursTime(despatchEntity.getHoursTime()); + } + + IPage iPage = reportTimeMapper.packageStartTimeDetailPage(page,reportStartTimeDetailDTO); + + return R.data(iPage); + } + + @Override + public void packageStartTimeDetailExport(ReportStartTimeDetailDTO reportStartTimeDetailDTO, HttpServletResponse response) { + reportStartTimeDetailDTO.setStartTime(CommonUtil.getStartByDateStr(reportStartTimeDetailDTO.getStartTimeStr())); + reportStartTimeDetailDTO.setEndTime(CommonUtil.getEndByDateStr(reportStartTimeDetailDTO.getEndTimeStr())); + + reportStartTimeDetailDTO.setHoursTime(72); + + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("departure_warehouse_name","全部") + .eq("destination_warehouse_name","全部") + .eq("brand","全部") + .eq("is_deleted",0); + ReportConfigDespatchEntity despatchEntity = despatchService.getOne(queryWrapper); + if(!Objects.isNull(despatchEntity)){ + reportStartTimeDetailDTO.setHoursTime(despatchEntity.getHoursTime()); + } + + List list = reportTimeMapper.packageStartTimeDetailExport(reportStartTimeDetailDTO); + + //导出ls + ExcelUtil.export(response, "干线发运时效明细报表导出", "干线发运时效明细报表导出", list, ReportPackgeStartTimeDetailVO.class); + } + + @Override + public R packageTransferTimeDetailPage(ReportStartTimeDetailDTO reportStartTimeDetailDTO) { + IPage page = new Page<>(); + page.setCurrent(reportStartTimeDetailDTO.getPageNum()); + page.setSize(reportStartTimeDetailDTO.getPageSize()); + + reportStartTimeDetailDTO.setStartTime(CommonUtil.getStartByDateStr(reportStartTimeDetailDTO.getStartTimeStr())); + reportStartTimeDetailDTO.setEndTime(CommonUtil.getEndByDateStr(reportStartTimeDetailDTO.getEndTimeStr())); + + reportStartTimeDetailDTO.setHoursTime(72); + + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("departure_warehouse_name","全部") + .eq("destination_warehouse_name","全部") + .eq("brand","全部") + .eq("is_deleted",0); + ReportConfigDespatchEntity despatchEntity = despatchService.getOne(queryWrapper); + if(!Objects.isNull(despatchEntity)){ + reportStartTimeDetailDTO.setHoursTime(despatchEntity.getHoursTime()); + } + + IPage iPage = reportTimeMapper.packageTransferTimeDetailPage(page,reportStartTimeDetailDTO); + + return R.data(iPage); + } + + @Override + public void packageTransferTimeDetailExport(ReportStartTimeDetailDTO reportStartTimeDetailDTO, HttpServletResponse response) { + reportStartTimeDetailDTO.setStartTime(CommonUtil.getStartByDateStr(reportStartTimeDetailDTO.getStartTimeStr())); + reportStartTimeDetailDTO.setEndTime(CommonUtil.getEndByDateStr(reportStartTimeDetailDTO.getEndTimeStr())); + + reportStartTimeDetailDTO.setHoursTime(72); + + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("departure_warehouse_name","全部") + .eq("destination_warehouse_name","全部") + .eq("brand","全部") + .eq("is_deleted",0); + ReportConfigDespatchEntity despatchEntity = despatchService.getOne(queryWrapper); + if(!Objects.isNull(despatchEntity)){ + reportStartTimeDetailDTO.setHoursTime(despatchEntity.getHoursTime()); + } + + List list = reportTimeMapper.packageTransferTimeDetailExport(reportStartTimeDetailDTO); + + //导出ls + ExcelUtil.export(response, "干线中转时效明细报表导出", "干线中转时效明细报表导出", list, ReportPackgeStartTimeDetailVO.class); + } } diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportDeptIncomingVO.java b/blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportDeptIncomingVO.java index c4e904bff..6900b8f82 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportDeptIncomingVO.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportDeptIncomingVO.java @@ -10,9 +10,12 @@ public class ReportDeptIncomingVO implements Serializable { private String businessLine;//事业线 + private Long departureWarehouseId;//始发仓id private String departureWarehouseName;//始发仓 + private Long destinationWarehouseId;//目的仓id private String destinationWarehouseName;//目的仓 private String brand;//品牌 + private Long consigneeId;//收货单位id private String consignee;//收货单位 private String nian;//年 private String yue;//月 diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportIncomingDetailExportVO.java b/blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportIncomingDetailExportVO.java new file mode 100644 index 000000000..f1ef6dc68 --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportIncomingDetailExportVO.java @@ -0,0 +1,224 @@ +package com.logpm.report.vo; + +import com.alibaba.excel.annotation.ExcelIgnore; +import com.alibaba.excel.annotation.ExcelProperty; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +@Data +public class ReportIncomingDetailExportVO implements Serializable { + + @ExcelIgnore + private Long waybillId; + + @ExcelProperty(value = "品牌") + private String brand; + + @ExcelProperty(value = "运单号") + private String waybillNo; + + @ExcelProperty(value = "订单号") + private String orderNo; + + + @ExcelProperty(value = "收货单位") + private String consignee; + + @ExcelProperty(value = "收货人") + private String consigneeName; + + @ExcelProperty(value = "收货人电话") + private String consigneeMobile; + + + @ExcelProperty(value = "收货人地址") + private String consigneeAddress; + + @ExcelProperty(value = "发货单位") + private String shipper; + + @ExcelProperty(value = "发货人") + private String shipperName; + + + @ExcelProperty(value = "发货人电话") + private String shipperMobile; + + @ExcelProperty(value = "发货地址") + private String shipperAddress; + + @ExcelProperty(value = "到站") + private String destination; + @ExcelProperty(value = "完整到站") + private String completeDestination; + @ExcelProperty(value = "发站") + private String departure; + @ExcelProperty(value = "完整发站") + private String completeDeparture; + @ExcelProperty(value = "发站仓") + private String departureWarehouseName; + @ExcelProperty(value = "目的仓") + private String destinationWarehouseName; + + @ExcelProperty(value = "目的仓") + private String deliveryWay; + + @ExcelProperty(value = "车次号") + private String customerTrain; + + @ExcelProperty(value = "备注") + private String remark; + + @ExcelProperty(value = "结算方") + private String cleanObjType; + + @ExcelProperty(value = "支付方式") + private String payType; + + @ExcelProperty(value = "付款方式") + private String payWay; + + @ExcelProperty(value = "现付") + private BigDecimal nowPay; + + @ExcelProperty(value = "到付") + private BigDecimal arrivePay; + + @ExcelProperty(value = "回付") + private BigDecimal backPay; + + @ExcelProperty(value = "月结") + private BigDecimal monthPay; + + @ExcelProperty(value = "服务类型") + private String serviceType; + + @ExcelProperty(value = "是否改单") + private String updateStatus; + + @ExcelProperty(value = "是否审单") + private String checkStatus; + + @ExcelProperty(value = "审核原因") + private String checkReson; + + @ExcelProperty(value = "审核备注") + private String checkRemark; + + @ExcelProperty(value = "审核人") + private String checkUserName; + + @ExcelProperty(value = "审核时间") + private Date checkTime; + + @ExcelProperty(value = "取消审核备注") + private String cancleCheckRemark; + + @ExcelProperty(value = "取消审核人") + private String cancleCheckUserName; + + @ExcelProperty(value = "取消审核时间") + private Date cancleCheckTime; + + @ExcelProperty(value = "运单状态") + private String waybillStatus; + + @ExcelProperty(value = "开单时间") + private Date openTime; + + @ExcelProperty(value = "货物品类") + private String goodsName; + + @ExcelProperty(value = "总数量") + private Integer totalCount; + + @ExcelProperty(value = "总重量") + private BigDecimal totalWeight; + + @ExcelProperty(value = "总体积") + private BigDecimal totalVolume; + + @ExcelProperty(value = "总费用") + private BigDecimal totalFee; + + @ExcelProperty(value = "开单费用") + private BigDecimal systemTotalFee; + + @ExcelProperty(value = "提货费") + private BigDecimal pickupFee; + + @ExcelProperty(value = "运费") + private BigDecimal freightFee; + @ExcelProperty(value = "仓库服务费合计") + private BigDecimal warehouseServiceFee; + @ExcelProperty(value = "仓储费") + private BigDecimal warehouseFee; + @ExcelProperty(value = "仓储管理费") + private BigDecimal warehouseManagementFee; + @ExcelProperty(value = "仓储分拣费") + private BigDecimal warehouseSortingFee; + @ExcelProperty(value = "仓储操作费") + private BigDecimal warehouseOprationFee; + @ExcelProperty(value = "配送服务费合计") + private BigDecimal deliveryServiceFee; + @ExcelProperty(value = "配送费") + private BigDecimal deliveryFee; + @ExcelProperty(value = "配送装卸费") + private BigDecimal deliveryHandlingFee; + @ExcelProperty(value = "配送分货费") + private BigDecimal deliverySortingFee; + @ExcelProperty(value = "配送上楼费") + private BigDecimal deliveryUpfloorFee; + @ExcelProperty(value = "配送平移费") + private BigDecimal deliveryMoveFee; + @ExcelProperty(value = "配送公里数") + private BigDecimal deliveryLine; + @ExcelProperty(value = "超区公里费") + private BigDecimal deliveryLineFee; + @ExcelProperty(value = "其他费用") + private BigDecimal otherFee; + @ExcelProperty(value = "安装费") + private BigDecimal installFee; + @ExcelProperty(value = "保价费") + private BigDecimal insuranceFee; + @ExcelProperty(value = "申明价值") + private BigDecimal claimingValue; + @ExcelProperty(value = "三方操作费") + private BigDecimal thirdOperationFee; + @ExcelProperty(value = "回扣") + private BigDecimal rebate; + @ExcelProperty(value = "收款状态") + private String payStatus; + @ExcelProperty(value = "结算状态") + private String settlementStatus; + @ExcelProperty(value = "签收数量") + private Integer signNum; + @ExcelProperty(value = "签收时间") + @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + private Date signTime; + @ExcelProperty(value = "配送时间") + @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + private Date deliveryTime; + @ExcelProperty(value = "签收人") + private String signUserName; + @ExcelProperty(value = "配送司机") + private String deliveryDriverName; + @ExcelProperty(value = "品类数量") + private String goodsTypeNum; + @ExcelProperty(value = "品类开单运费") + private String goodsTypePrice; + @ExcelProperty(value = "品类系统配送单价") + private String goodsTypeDeliveryPrice; + @ExcelProperty(value = "品类系统提货单价") + private String goodsTypePickupPrice; + @ExcelProperty(value = "品类系统运费单价") + private String goodsTypeFreightPrice; + @ExcelProperty(value = "品类数") + private Integer goodsTypeCount; + + +} diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportIncomingDetailVO.java b/blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportIncomingDetailVO.java new file mode 100644 index 000000000..fbe309efa --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportIncomingDetailVO.java @@ -0,0 +1,116 @@ +package com.logpm.report.vo; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +@Data +public class ReportIncomingDetailVO implements Serializable { + + private Long id; + private String brand; + private String waybillNo; + private String orderNo; + private String consignee; + private String consigneeName; + private String consigneeMobile; + private String consigneeAddress; + private String shipper; + private String shipperName; + private String shipperMobile; + private String shipperAddress; + private String destination; + private String completeDestination; + private String departure; + private String completeDeparture; + private String departureWarehouseName; + private String destinationWarehouseName; + private String deliveryWay; + private String customerTrain; + private Integer returnStatus; + private String remark; + private String cleanObjType; + private String payType; + private String payWay; + private BigDecimal xPay; + private BigDecimal dPay; + private BigDecimal hPay; + private BigDecimal yPay; + private String serviceType; + private Integer updateStatus; + private Integer checkStatus; + private String checkReson; + private String checkRemark; + private String checkUserName; + private Date checkTime; + private String cancleCheckRemark; + private String cancleCheckUserName; + private Date cancleCheckTime; + private String waybillStatus; + private String waybillType; + private Date openTime; + private String goodsName; + private Integer totalCount; + private BigDecimal totalWeight; + private BigDecimal totalVolume; + private BigDecimal totalFee; + private BigDecimal systemTotalFee; + private BigDecimal pickupFee; + private BigDecimal freightFee; + private BigDecimal warehouseServiceFee; + private BigDecimal warehouseFee; + private BigDecimal warehouseManagementFee; + private BigDecimal warehouseSortingFee; + private BigDecimal warehouseOprationFee; + private BigDecimal deliveryServiceFee; + private BigDecimal deliveryFee; + private BigDecimal deliveryHandlingFee; + private BigDecimal deliverySortingFee; + private BigDecimal deliveryUpfloorFee; + private BigDecimal deliveryMoveFee; + private BigDecimal deliveryLine; + private BigDecimal deliveryLineFee; + private BigDecimal otherFee; + private BigDecimal installFee; + private BigDecimal insuranceFee; + private BigDecimal claimingValue; + private BigDecimal thirdOperationFee; + private BigDecimal rebate; + private String goodsTypeNum; + private String goodsTypePrice; + private String goodsTypeDeliveryPrice; + private String goodsTypePickupPrice; + private String goodsTypeFreightPrice; + private Integer goodsTypeCount; + private String payStatus; + private String settlementStatus; + + /** + * 签收件数 + */ + private Integer signCount; + + /** + * 签收人 + */ + private String signUserName; + + /** + * 签收时间 + */ + private Date signTime; + + /** + * 配送时间 + */ + private Date deliveryTime; + + /** + * 配送司机 + */ + private String deliveryDriverName; + + +} diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportPackgeAllTrunklineTimeDetailVO.java b/blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportPackgeAllTrunklineTimeDetailVO.java new file mode 100644 index 000000000..735b9693a --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportPackgeAllTrunklineTimeDetailVO.java @@ -0,0 +1,98 @@ +package com.logpm.report.vo; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +@Data +public class ReportPackgeAllTrunklineTimeDetailVO implements Serializable { + + @ExcelProperty(value = "运单号") + private String waybillNo; + + @ExcelProperty(value = "订单自编号") + private String orderCode; + + @ExcelProperty(value = "当前所在仓") + private String nowWarehouseName; + + @ExcelProperty(value = "始发仓") + private String departureWarehouseName; + + @ExcelProperty(value = "目的仓") + private String destinationWarehouseName; + + @ExcelProperty(value = "客户车次号") + private String trainNumber; + + @ExcelProperty(value = "干仓配") + private String isGcp; + + @ExcelProperty(value = "一级品类") + private String firstPackName; + + @ExcelProperty(value = "二级品类") + private String secondPackName; + + @ExcelProperty(value = "三级品类") + private String thirdPackName; + + @ExcelProperty(value = "物料编码") + private String materialCode; + + @ExcelProperty(value = "物料名称") + private String materialName; + + @ExcelProperty(value = "包条码") + private String orderPackageCode; + + @ExcelProperty(value = "订单来源") + private String systemType; + + @ExcelProperty(value = "服务号") + private String serviceNum; + + @ExcelProperty(value = "发货数量") + private Integer senderNum; + + @ExcelProperty(value = "体积") + private BigDecimal volume; + + @ExcelProperty(value = "重量") + private BigDecimal weight; + + @ExcelProperty(value = "基地发货日期") + @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + private Date deliveryDate; + + @ExcelProperty(value = "导入仓库") + private String warehouseName; + + @ExcelProperty(value = "订单创建人") + private String createUserName; + + @ExcelProperty(value = "订单创建时间") + @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @ExcelProperty(value = "是否目的仓入库") + private String isDesIncoming; + + @ExcelProperty(value = "目的仓入库时间") + @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + private Date desIncomgingTime; + + @ExcelProperty(value = "实际入库时效") + private String incomingHours; + + @ExcelProperty(value = "标准入库时效") + private String hoursTime; + + @ExcelProperty(value = "是否超时") + private String isOverTime; + +} diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportPackgeAllTrunklineTimeVO.java b/blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportPackgeAllTrunklineTimeVO.java index 8e1472167..7846ac425 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportPackgeAllTrunklineTimeVO.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportPackgeAllTrunklineTimeVO.java @@ -1,5 +1,6 @@ package com.logpm.report.vo; +import com.alibaba.excel.annotation.ExcelIgnore; import com.alibaba.excel.annotation.ExcelProperty; import lombok.Data; @@ -10,8 +11,12 @@ public class ReportPackgeAllTrunklineTimeVO implements Serializable { @ExcelProperty(value = "事业线") private String businessLine; + @ExcelIgnore + private Long departureWarehouseId; @ExcelProperty(value = "始发仓") private String departureWarehouseName; + @ExcelIgnore + private Long destinationWarehouseId; @ExcelProperty(value = "目的仓") private String destinationWarehouseName; @ExcelProperty(value = "品牌") diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportPackgeStartTimeDetailVO.java b/blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportPackgeStartTimeDetailVO.java new file mode 100644 index 000000000..bf4f1b85d --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportPackgeStartTimeDetailVO.java @@ -0,0 +1,102 @@ +package com.logpm.report.vo; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +@Data +public class ReportPackgeStartTimeDetailVO implements Serializable { + + @ExcelProperty(value = "运单号") + private String waybillNo; + + @ExcelProperty(value = "订单自编号") + private String orderCode; + + @ExcelProperty(value = "当前所在仓") + private String nowWarehouseName; + + @ExcelProperty(value = "始发仓") + private String departureWarehouseName; + + @ExcelProperty(value = "目的仓") + private String destinationWarehouseName; + + @ExcelProperty(value = "客户车次号") + private String trainNumber; + + @ExcelProperty(value = "干仓配") + private String isGcp; + + @ExcelProperty(value = "一级品类") + private String firstPackName; + + @ExcelProperty(value = "二级品类") + private String secondPackName; + + @ExcelProperty(value = "三级品类") + private String thirdPackName; + + @ExcelProperty(value = "物料编码") + private String materialCode; + + @ExcelProperty(value = "物料名称") + private String materialName; + + @ExcelProperty(value = "包条码") + private String orderPackageCode; + + @ExcelProperty(value = "订单来源") + private String systemType; + + @ExcelProperty(value = "服务号") + private String serviceNum; + + @ExcelProperty(value = "发货数量") + private Integer senderNum; + + @ExcelProperty(value = "体积") + private BigDecimal volume; + + @ExcelProperty(value = "重量") + private BigDecimal weight; + + @ExcelProperty(value = "基地发货日期") + @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + private Date deliveryDate; + + @ExcelProperty(value = "导入仓库") + private String warehouseName; + + @ExcelProperty(value = "订单创建人") + private String createUserName; + + @ExcelProperty(value = "订单创建时间") + @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @ExcelProperty(value = "入库时间") + @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + private Date incomgingTime; + + @ExcelProperty(value = "是否发运") + private String isStarting; + + @ExcelProperty(value = "发运时间") + @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + private Date startTime; + + @ExcelProperty(value = "实际发运时效") + private String startHours; + + @ExcelProperty(value = "标准发运时效") + private String hoursTime; + + @ExcelProperty(value = "是否超时") + private String isOverTime; + +} diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportPackgeStartTimeVO.java b/blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportPackgeStartTimeVO.java index a60fd419f..0d712624e 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportPackgeStartTimeVO.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportPackgeStartTimeVO.java @@ -1,5 +1,6 @@ package com.logpm.report.vo; +import com.alibaba.excel.annotation.ExcelIgnore; import com.alibaba.excel.annotation.ExcelProperty; import lombok.Data; @@ -10,8 +11,12 @@ public class ReportPackgeStartTimeVO implements Serializable { @ExcelProperty(value = "事业线") private String businessLine; + @ExcelIgnore + private Long departureWarehouseId; @ExcelProperty(value = "始发仓") private String departureWarehouseName; + @ExcelIgnore + private Long destinationWarehouseId; @ExcelProperty(value = "目的仓") private String destinationWarehouseName; @ExcelProperty(value = "品牌") diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportPackgeTransferTimeVO.java b/blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportPackgeTransferTimeVO.java index fca9beb88..2d7322a73 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportPackgeTransferTimeVO.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportPackgeTransferTimeVO.java @@ -1,5 +1,6 @@ package com.logpm.report.vo; +import com.alibaba.excel.annotation.ExcelIgnore; import com.alibaba.excel.annotation.ExcelProperty; import lombok.Data; @@ -10,10 +11,16 @@ public class ReportPackgeTransferTimeVO implements Serializable { @ExcelProperty(value = "事业线") private String businessLine; + @ExcelIgnore + private Long departureWarehouseId; @ExcelProperty(value = "始发仓") private String departureWarehouseName; + @ExcelIgnore + private Long destinationWarehouseId; @ExcelProperty(value = "目的仓") private String destinationWarehouseName; + @ExcelIgnore + private Long warehouseId; @ExcelProperty(value = "中转仓") private String warehouseName; @ExcelProperty(value = "品牌") diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IOpenOrderAsyncService.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IOpenOrderAsyncService.java index 1b6e4e903..17e45d8bc 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IOpenOrderAsyncService.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IOpenOrderAsyncService.java @@ -9,6 +9,7 @@ import java.util.List; public interface IOpenOrderAsyncService { void saveLog(Long waybillId, String waybillNo, String trackType, String refer, String operationRemark, String nickName,Long userId,Long warehouseId,String warehouseName); + void saveAbnormalLog(Long waybillId, String waybillNo, String trackType, String refer, String operationRemark, String nickName,Long userId,Long warehouseId,String warehouseName); void saveStartCarLog(TrunklineCarsLoadLineEntity carsLoadLineEntity,String nickName,Long userId); void saveTripartiteStartCarLog(TrunklineCarsLoadLineEntity carsLoadLineEntity,String nickName,Long userId); diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderAsyncServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderAsyncServiceImpl.java index 7c30bf0e2..84732d7af 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderAsyncServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderAsyncServiceImpl.java @@ -127,6 +127,49 @@ public class OpenOrderAsyncServiceImpl implements IOpenOrderAsyncService { // DynamicDataSourceContextHolder.clear(); } + @Override + public void saveAbnormalLog(Long waybillId, String waybillNo, String trackType, String refer, String operationRemark, String nickName, Long userId, Long warehouseId, String warehouseName) { + if(Objects.isNull(waybillId)){ + log.warn("##########saveAbnormalLog: 运单信息为空 {}",waybillId); + return ; + } + + if("61".equals(trackType)){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("warehouse_id",warehouseId) + .eq("waybill_id",waybillId) + .eq("track_type",trackType); + TrunklineWaybillTrackEntity waybillTrackEntity = trunklineWaybillTrackService.getOne(queryWrapper); + if(Objects.isNull(waybillTrackEntity)){ + waybillTrackEntity = new TrunklineWaybillTrackEntity(); + waybillTrackEntity.setWarehouseId(warehouseId); + waybillTrackEntity.setWarehouseName(warehouseName); + waybillTrackEntity.setWaybillId(waybillId); + waybillTrackEntity.setWaybillNo(waybillNo); + waybillTrackEntity.setTrackType(trackType); + waybillTrackEntity.setRefer(refer); + waybillTrackEntity.setOperationRemark(operationRemark); + waybillTrackEntity.setCreateUserName(nickName); + waybillTrackEntity.setCheckStatus(1); + waybillTrackEntity.setCheckTime(new Date()); + trunklineWaybillTrackService.save(waybillTrackEntity); + } + }else{ + TrunklineWaybillTrackEntity waybillTrackEntity = new TrunklineWaybillTrackEntity(); + waybillTrackEntity.setWarehouseId(warehouseId); + waybillTrackEntity.setWarehouseName(warehouseName); + waybillTrackEntity.setWaybillId(waybillId); + waybillTrackEntity.setWaybillNo(waybillNo); + waybillTrackEntity.setTrackType(trackType); + waybillTrackEntity.setRefer(refer); + waybillTrackEntity.setOperationRemark(operationRemark); + waybillTrackEntity.setCreateUserName(nickName); + waybillTrackEntity.setCheckStatus(1); + waybillTrackEntity.setCheckTime(new Date()); + trunklineWaybillTrackService.save(waybillTrackEntity); + } + } + @LogpmAsync("asyncExecutor") @Override public void saveStartCarLog(TrunklineCarsLoadLineEntity carsLoadLineEntity,String nickName,Long userId) { @@ -950,6 +993,7 @@ public class OpenOrderAsyncServiceImpl implements IOpenOrderAsyncService { //把billladingWaybillEntities转化成以billladingId为key的Map Map billladingNoWaybillMap = billladingNoWaybillEntities.stream().collect(Collectors.toMap(TrunklineBillladingWaybillEntity::getBillladingId, Function.identity())); + List removeBillladingWaybillIds = new ArrayList<>(); billladingPackageMap.keySet().forEach(billladingId -> { BillladingPackageVO billladingPackageVO = billladingPackageMap.get(billladingId); Integer num = billladingPackageVO.getNum(); @@ -961,7 +1005,7 @@ public class OpenOrderAsyncServiceImpl implements IOpenOrderAsyncService { billladingNoWaybillEntity.setRealNum(realNum - num); } else { billladingNoWaybillEntity.setRealNum(0); - billladingNoWaybillEntity.setIsDeleted(1); + removeBillladingWaybillIds.add(billladingNoWaybillEntity.getId()); } updateBillladingWaybillEntities.add(billladingNoWaybillEntity); TrunklineBillladingWaybillEntity addbillladingWaybillEntity = new TrunklineBillladingWaybillEntity(); @@ -987,7 +1031,9 @@ public class OpenOrderAsyncServiceImpl implements IOpenOrderAsyncService { trunklineBillladingWaybillService.updateBillladingFeeByBillladingId(billladingEntity); } - + if(CollUtil.isNotEmpty(removeBillladingWaybillIds)){ + trunklineBillladingWaybillService.deleteLogic(removeBillladingWaybillIds); + } } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingWaybillServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingWaybillServiceImpl.java index 09622b80e..51ce7a84f 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingWaybillServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingWaybillServiceImpl.java @@ -114,6 +114,11 @@ public class TrunklineBillladingWaybillServiceImpl extends BaseServiceImpl Date: Wed, 12 Mar 2025 15:49:41 +0800 Subject: [PATCH 2/2] =?UTF-8?q?1.=E4=BF=AE=E5=A4=8D=E5=B9=B2=E7=BA=BFbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../trunkline/service/impl/TrunklineCarsLoadServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java index c12a813a2..b9b3eddd8 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java @@ -12654,7 +12654,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl