Browse Source

配送详情页导出、自提修复

pull/4/head
汤建军 1 year ago
parent
commit
89b986a8cc
  1. 12
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockListVO.java
  2. 67
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/bean/MyExcelUtil.java
  3. 25
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java
  4. 23
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionDeliveryExcelDTO.java
  5. 212
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistributionDeliveryClientExcel.java
  6. 140
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistributionDeliveryInventoryExcel.java
  7. 163
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistributionDeliveryOrderExcel.java
  8. 242
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistributionDeliveryPackageExcel.java
  9. 21
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.java
  10. 167
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml
  11. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.java
  12. 21
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml
  13. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml
  14. 16
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryInfoService.java
  15. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java
  16. 26
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java
  17. 67
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryInfoServiceImpl.java
  18. 195
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

12
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockListVO.java

@ -44,6 +44,12 @@ public class DistributionStockListVO extends DistributionStockListEntity {
*/
@ApiModelProperty(value = "装车数量")
private String loadingNumber;
/**
* 装车数量
*/
@ApiModelProperty(value = "签收数量")
private String signedingNumber;
/**
* 添加数量
*/
@ -96,6 +102,12 @@ public class DistributionStockListVO extends DistributionStockListEntity {
@ApiModelProperty(value = "以备件数")
private Integer stockupNum;
/**
* 以备件数
*/
@ApiModelProperty(value = "以备件数")
private Integer readyStock;
/**
* 托盘id

67
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/bean/MyExcelUtil.java

@ -5,12 +5,20 @@ import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.builder.ExcelWriterBuilder;
import com.alibaba.excel.write.handler.WriteHandler;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.logpm.distribution.excel.DistributionStockupPackageListDetailExcel;
import com.logpm.distribution.dto.DistributionDeliveryExcelDTO;
import com.logpm.distribution.excel.*;
import com.logpm.distribution.vo.DistributionDeliveryInfoVO;
import com.logpm.distribution.vo.DistributionParcelListVO;
import com.logpm.distribution.vo.DistributionStockArticleVO;
import com.logpm.distribution.vo.DistributionStockListVO;
import org.apache.commons.codec.Charsets;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.tool.utils.Func;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@ -59,4 +67,61 @@ public class MyExcelUtil extends ExcelUtil {
}
public static void exDeliveryDetailedList(HttpServletResponse response, DistributionDeliveryExcelDTO map, String fileName) {
ServletOutputStream outputStream = null;
try {
response.setContentType("application/vnd.ms-excel");
fileName = URLEncoder.encode(fileName, Charsets.UTF_8.name());
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
response.setHeader("content-Type", "application/vnd.ms-excel");
response.setCharacterEncoding("UTF-8");
outputStream = response.getOutputStream();
ExcelWriter build = EasyExcel.write(outputStream).build();
// Object o = map.get("client");
WriteSheet clientList = EasyExcel.writerSheet(1,"客户列表").head(DistributionDeliveryClientExcel.class).build();
WriteSheet orderList = EasyExcel.writerSheet("订单列表").head(DistributionDeliveryOrderExcel.class).build();
WriteSheet inventoryList = EasyExcel.writerSheet("库存品列表").head(DistributionDeliveryInventoryExcel.class).build();
WriteSheet packageList = EasyExcel.writerSheet("包件列表").head(DistributionDeliveryPackageExcel.class).build();
if (Func.isNotEmpty(map.getDeliveryInfoVOS())){
List<DistributionDeliveryClientExcel> deliveryClientExcels = new ArrayList<>();
for (DistributionDeliveryInfoVO deliveryInfoVO : map.getDeliveryInfoVOS()) {
DistributionDeliveryClientExcel clientExcel = Func.copy(deliveryInfoVO, DistributionDeliveryClientExcel.class);
deliveryClientExcels.add(clientExcel);
}
build.write(deliveryClientExcels,clientList);
}
if (Func.isNotEmpty(map.getDistributionStockArticleVOS())){
List<DistributionDeliveryOrderExcel> distributionStockArticleVOS = new ArrayList<>();
for (DistributionStockArticleVO distributionStockArticleVO : map.getDistributionStockArticleVOS()) {
DistributionDeliveryOrderExcel deliveryOrderExcel = Func.copy(distributionStockArticleVO, DistributionDeliveryOrderExcel.class);
distributionStockArticleVOS.add(deliveryOrderExcel);
}
build.write(distributionStockArticleVOS,orderList);
}
if (Func.isNotEmpty(map.getPackageListByDeliverylistId())){
List<DistributionDeliveryPackageExcel> distributionDeliveryPackageExcelList = new ArrayList<>();
for (DistributionParcelListVO distributionParcelListVO : map.getPackageListByDeliverylistId()) {
DistributionDeliveryPackageExcel distributionDeliveryPackageExcel = Func.copy(distributionParcelListVO, DistributionDeliveryPackageExcel.class);
distributionDeliveryPackageExcelList.add(distributionDeliveryPackageExcel);
}
build.write(distributionDeliveryPackageExcelList,packageList);
}
if (Func.isNotEmpty(map.getDistributionStockListVOS())){
List<DistributionDeliveryInventoryExcel> distributionDeliveryPackageExcelList = new ArrayList<>();
for (DistributionStockListVO distributionStockListVO : map.getDistributionStockListVOS()) {
DistributionDeliveryInventoryExcel distributionDeliveryInventoryExcel = Func.copy(distributionStockListVO, DistributionDeliveryInventoryExcel.class);
distributionDeliveryPackageExcelList.add(distributionDeliveryInventoryExcel);
}
build.write(distributionDeliveryPackageExcelList,inventoryList);
}
build.finish();
} catch (Exception e) {
throw new RuntimeException("请稍后再试....");
}
}
}

25
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java

@ -22,6 +22,8 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.distribution.bean.MyExcelUtil;
import com.logpm.distribution.dto.DistributionDeliveryExcelDTO;
import com.logpm.distribution.dto.DistributionDeliveryInfoDTO;
import com.logpm.distribution.dto.DistributionDeliveryListDTO;
import com.logpm.distribution.dto.DistrilbutionAppsignforDTO;
@ -55,6 +57,7 @@ import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.text.ParseException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -532,6 +535,28 @@ public class DistributionDeliveryListController extends BladeController {
}
/**
* 导出数据
*/
@GetMapping("/export-distributionDeliveryListDetail")
@ApiOperationSupport(order = 9)
@ApiOperation(value = "导出数据", notes = "传入distributionDeliveryList")
public void exportDistributionDeliveryListDetail(@ApiIgnore @RequestParam Long deliveryId, BladeUser bladeUser, HttpServletResponse response) {
// BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
// if (Func.isEmpty(myCurrentWarehouse)){
// return R.fail(403,"未授权仓库!!!");
// }
// DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListService.getById(deliveryId);
// if (Func.isEmpty(deliveryListEntity)){
// log.info("#####################");
// return R.fail(403,"未授权仓库!!!");
// }
DistributionDeliveryExcelDTO map = distributionDeliveryListService.exportDistributionDeliveryListDetail(deliveryId);
MyExcelUtil.exDeliveryDetailedList(response,map,"配送清单");
}

23
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionDeliveryExcelDTO.java

@ -0,0 +1,23 @@
package com.logpm.distribution.dto;
import com.logpm.distribution.vo.DistributionDeliveryInfoVO;
import com.logpm.distribution.vo.DistributionParcelListVO;
import com.logpm.distribution.vo.DistributionStockArticleVO;
import com.logpm.distribution.vo.DistributionStockListVO;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
@Data
public class DistributionDeliveryExcelDTO {
private List<DistributionDeliveryInfoVO> deliveryInfoVOS;
private List<DistributionStockArticleVO> distributionStockArticleVOS;
private List<DistributionStockListVO> distributionStockListVOS;
private List<DistributionParcelListVO> packageListByDeliverylistId;
}

212
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistributionDeliveryClientExcel.java

@ -0,0 +1,212 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.distribution.excel;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.logpm.distribution.entity.DistributionDeliveryInfoEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 配送装车中间表 视图实体类
*
* @author TJJ
* @since 2023-06-16
*/
@Data
@ColumnWidth(25)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class DistributionDeliveryClientExcel implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("车次号")
private String trainNumber;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("预约单号")
private String reservationCode;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("运单号")
private String waybillNo;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("商场名称")
private String mallName;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("收货人")
private String consignee;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("收货电话")
private String deliveryPhone;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("收货地址")
private String deliveryAddress;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("收货单位")
private String receivingUnit;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("计划包件数")
private Integer reservationNum;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("计划库存品数")
private Integer reservationStockListNum;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("装车包件数")
private Integer loadedNub;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("装车库存品数")
private Integer inventoryNub;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("签收数")
private Integer receivedQuantity;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("备注")
private String remarks;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("是否加急")
private String isUrgentName;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("备货状态")
private String stockupStatusName;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("备货人员")
private String forkliftName;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("出库时间")
private Date outboundDate;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("备货时间")
private Date stockupDate;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("装车状态")
private String loadingStatus;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("签收状态")
private String reservationSigningStatus;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("配送状态")
private String driverSigning;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("文员复核状态")
private String signingStatus;
}

140
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistributionDeliveryInventoryExcel.java

@ -0,0 +1,140 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.distribution.excel;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import lombok.Data;
import java.io.Serializable;
/**
* 配送装车中间表 视图实体类
*
* @author TJJ
* @since 2023-06-16
*/
@Data
@ColumnWidth(25)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class DistributionDeliveryInventoryExcel implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("入库批次号")
private String incomingBatch;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("订单自编号")
private String orderCode;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("商场名称")
private String marketName;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("品牌")
private String brandName;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("物料编码")
private String cargoNumber;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("物料名称")
private String descriptionGoods;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("物料规格")
private String cargoNorms;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("物料单位")
private String cargoUnit;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("计划出库数")
private String plannedQuantity;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("实际出库数")
private String loadingNumber;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("签收数量")
private String signedingNumber;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("备货数量")
private Integer readyStock;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("签收状态")
private String signingStatusName;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("备货状态")
private String stockUpStatusName;
}

163
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistributionDeliveryOrderExcel.java

@ -0,0 +1,163 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.distribution.excel;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 配送装车中间表 视图实体类
*
* @author TJJ
* @since 2023-06-16
*/
@Data
@ColumnWidth(25)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class DistributionDeliveryOrderExcel implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("运单号")
private String waybillNumber;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("服务号")
private String serviceNumber;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("订单自编号")
private String orderCode;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("物料名称")
private String materialName;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("包件总数")
private Integer totalNumber;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("在库数量")
private Integer handQuantity;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("计划数量")
private String readyStock;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("以备数量")
private Integer stockupNumber;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("装车数量")
private Integer loadingNumber;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("签收数量")
private String signingNumber;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("订单状态")
private String orderStatusName;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("收货单位")
private String consigneeUnit;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("运单收货人")
private String consigneePerson;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("运单收货地址")
private String consigneeAddress;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("终端收货人")
private String customerName;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("终端收货地址")
private String customerAddress;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("终端收货电话")
private String customerTelephone;
}

242
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistributionDeliveryPackageExcel.java

@ -0,0 +1,242 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.distribution.excel;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 配送装车中间表 视图实体类
*
* @author TJJ
* @since 2023-06-16
*/
@Data
@ColumnWidth(25)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class DistributionDeliveryPackageExcel implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("运单号")
private String waybillNumber;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("服务号")
private String serviceNumber;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("订单自编号")
private String orderCode;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("包条码")
private String orderPackageCode;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("仓库")
private String warehouse;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("发站仓")
private String sendWarehouseName;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("目的仓")
private String acceptWarehouseName;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("入库车次")
private String trainNumber;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("一级品")
private String firsts;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("二级品")
private String second;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("三级品")
private String thirdProduct;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("入库时间")
private Date warehouseEntryTimeEnd;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("当前状态")
private String orderPackageStatusName;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("冻结状态")
private String orderPackageFreezeStatusName;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("上架状态")
private String orderPackageGroundingStatusName;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("备货状态")
private String orderPackageStockupStatusName;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("预约状态")
private String orderPackageReservationStatusName;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("装车状态")
private String orderPackageLoadingStatusName;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("包件数量")
private Integer quantity;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("计划数量")
private Integer reservationNum;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("装车数量")
private Integer loadingNub;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("签收数量")
private Integer signingNub;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("装车方式")
private String scanStatus;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("计划装车人")
private String driverName;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("实际装车人")
private String scanUser;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("装车时间")
private String loadingTime;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("签收人")
private String signingUser;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("签收扫描时间")
private String signingTime;
}

21
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.java

@ -79,7 +79,11 @@ public interface DistributionDeliveryInfoMapper extends BaseMapper<DistributionD
* @return
*/
List<DistributionDeliveryInfoVO> selectcustomList(@Param("id") Long id);
List<DistributionDeliveryInfoVO> selectClientList(@Param("id") Long id, @Param("param")Map<String,Object> param);
List<DistributionDeliveryInfoVO> selectClientListByDeliveryId(@Param("id") Long id);
/**
* 从预约客户查询包条自定义分页
* @param page
@ -111,18 +115,33 @@ public interface DistributionDeliveryInfoMapper extends BaseMapper<DistributionD
* @return
*/
List<DistributionStockListVO> selectDistributionDeliveryinventoryPage(IPage<DistributionStockListVO> page,@Param("param") DistributionDeliveryInfoDTO distributionDeliveryInfoDTO);
/**
* 通过配送Id查询库存
*
* @return
*/
List<DistributionStockListVO> selectDistributionDeliveryinventoryByDeliveryId(@Param("deliveryId") Long deliveryId);
/**
* 通过配送查询订单
*
* @return
*/
List<DistributionStockArticleVO> selectDistributionDeliveryOrderPage(IPage<DistributionStockArticleVO> page,@Param("param") Map<String,Object> distributionStockArticle);
/**
* 通过配送Id查询订单
*
* @return
*/
List<DistributionStockArticleVO> selectDistributionDeliveryOrderPageByDeliveryId(@Param("deliveryId")Long deliveryId);
/**
* App-通过配送查询客户信息
*
* @return
*/
List<DistributionAppReservationVO> selectAppcustomList( Long id);
List<DistributionAppReservationVO> selectAppcustomList(Long id);
/**
* App-通过客户查询订单
*

167
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml

@ -282,6 +282,44 @@
lds.is_deleted =0 and lddl.id = #{param.deliveryId}
</where>
</select>
<select id="selectDistributionDeliveryinventoryByDeliveryId" resultType="com.logpm.distribution.vo.DistributionStockListVO">
select
ldsl.sku sku,
ldsl.incoming_batch AS incomingBatch,
ldsl.order_code AS order_code,
ldsl.warehouse_name AS warehouseName,
ldsl.market_name AS marketName,
ldsl.brand_name AS brandName,
ldrsl.reservation_num AS plannedQuantity,
ldsl.description_goods descriptionGoods,
ldsl.cargo_unit cargoUnit,
( SELECT
sum(ldrsl.reservation_num)
FROM
logpm_distribution_reservation_stocklist ldrsl
WHERE
ldrsl.stocklist_id = ldsl.id) deliveryNumber,
(
SELECT
COALESCE(count(*), 0)
FROM
logpm_distribution_stock lds
WHERE
ldsl.id = lds.stock_list_id
) readyStock,
( SELECT COALESCE ( count(*), 0 ) FROM logpm_dis_stock_list_detail ldsld WHERE ldsl.id = ldsld.stock_list_id AND ldrsl.reservation_id = ldsld.reservation_id AND ldsld.stock_locking_status = '20' ) AS loadedinNumber,
( SELECT COALESCE ( count(*), 0 ) FROM logpm_dis_stock_list_detail ldsld WHERE ldsl.id = ldsld.stock_list_id AND ldrsl.reservation_id = ldsld.reservation_id AND ldsld.stock_signfo_status = '20' ) AS signedinNumber,
ldsl.storage_location goodsAllocation,
ldsl.cargo_number cargoNumber
FROM
logpm_distribution_reservation_stocklist ldrsl
JOIN logpm_distribution_signfor lds on lds.reservation_id = ldrsl.reservation_id
JOIN logpm_distribution_delivery_list lddl on lddl.id = lds.delivery_id
join logpm_distribution_stock_list ldsl on ldrsl.stocklist_id = ldsl.id
<where>
lds.is_deleted =0 and lddl.id = #{deliveryId}
</where>
</select>
<select id="selectDistributionDeliveryOrderPage" resultType="com.logpm.distribution.vo.DistributionStockArticleVO">
SELECT
distinct ldsa.order_code orderCode,
@ -391,6 +429,79 @@
</where>
</select>
<select id="selectDistributionDeliveryOrderPageByDeliveryId" resultType="com.logpm.distribution.vo.DistributionStockArticleVO">
SELECT
distinct ldsa.order_code orderCode,
ldsa.consignee_unit,
ldsa.id,
ldsa.consignee_person,
ldsa.consignee_address,
ldsa.consignee_mobile,
ldsa.order_status,
ldsa.customer_name,
ldsa.customer_telephone,
ldsa.customer_address,
ldsa.total_number,
ldsa.hand_quantity,
ldsa.waybill_number,
ldsa.service_number,
ldrs.reservation_num AS deliveryNumber,
(
SELECT DISTINCT
group_concat( DISTINCT ldpl.material_name ) AS materialName
FROM
logpm_distribution_parcel_list ldpl
WHERE
ldpl.stock_article_id = ldsa.id
GROUP BY
ldpl.stock_article_id
) AS materialName,
<!-- (SELECT COUNT(*) from logpm_distribution_reservation_package ldrp WHERE ldrp.stock_article_id = ldsa.id ) deliveryNumber,-->
(
SELECT
count(*)
FROM
logpm_distribution_reservation_package ldrp
WHERE
ldrp.reservation_id = lds.reservation_id and ldrp.packet_bar_status != 2
) readyStock,
(
SELECT
GROUP_CONCAT( ldpl.pallet SEPARATOR ',' )
FROM
logpm_distribution_parcel_list ldpl
JOIN logpm_distribution_reservation_package ldrp ON ldrp.parce_list_id = ldpl.id
WHERE
ldrp.reservation_id = lds.reservation_id
) pallet,
(
SELECT
GROUP_CONCAT( ldpl.goods_allocation SEPARATOR ',' )
FROM
logpm_distribution_parcel_list ldpl
JOIN logpm_distribution_reservation_package ldrp ON ldrp.parce_list_id = ldpl.id
WHERE
ldrp.reservation_id = lds.reservation_id
) goodsAllocation,
ldrs.stock_article_status stockArticleState,
( select sum(loaded_nub) FROM
logpm_distribution_loadscan AS ldl
WHERE ldl.order_id=ldrs.stock_article_id and ldl.scan_status != 1 and ldl.reservation_id = lds.reservation_id
) AS loadingNumber,
( select count(*) FROM
logpm_distribution_stock AS lstock
WHERE lstock.stock_article=ldrs.stock_article_id
) AS stockupNumber
FROM
logpm_distribution_signfor lds
JOIN logpm_distribution_reservation_stockarticle ldrs ON lds.reservation_id = ldrs.reservation_id
JOIN logpm_distribution_delivery_list lddl ON lddl.id = lds.delivery_id
JOIN logpm_distribution_stock_article ldsa ON ldrs.stock_article_id = ldsa.id
<where>
lddl.id = #{deliveryId} AND ldrs.stock_article_status != 2
</where>
</select>
<select id="selectAppcustomList" resultType="com.logpm.distribution.vo.app.DistributionAppReservationVO">
SELECT
@ -712,4 +823,60 @@ FROM
</if>
</where>
</select>
<select id="selectClientListByDeliveryId" resultType="com.logpm.distribution.vo.DistributionDeliveryInfoVO">
SELECT
ldr.reservation_num,
ldr.is_urgent isUrgent,
ldr.mall_name mallName,
ldr.reservation_code reservationCode,
ldr.remarks remarks,
ldr.loading_status loadingStatus,
ldr.signing_status reservationSigningStatus,
ldr.receiving_unit receivingUnit,
ldr.consignee consignee,
lds.train_number trainNumber,
ldr.delivery_address deliveryAddress,
ldr.delivery_phone deliveryPhone,
ldr.waybill_no waybillNo,
ldr.reservation_num packageNub,
ldr.reservation_stock_list_num reservationStockListNum,
lds.loaded_number loadedNub,
lds.loadedin_number inventoryNub,
(lds.received_quantity + lds.receivedin_quantity) receivedQuantity,
lds.is_have_abnormal_package isHaveAbnormalPackage,
lds.signee_name signeeName,
(SELECT
ldss.forklift_name
FROM
logpm_distribution_stockup_info AS ldsi
LEFT JOIN logpm_distribution_stockup AS ldss ON ldsi.stockup_id = ldss.id
WHERE
ldsi.reservation_id = lds.reservation_id
) AS forkliftName,
CASE
WHEN ldr.stockup_status ='10' THEN '待指派'
WHEN ldr.stockup_status ='20' THEN '待备货'
WHEN ldr.stockup_status ='30' THEN '备货中'
WHEN ldr.stockup_status ='40' THEN '备货完成'
END stockupStatusName,
CASE
WHEN ldr.is_urgent ='1' THEN '否'
else '是'
END isUrgentName,
CASE
WHEN lds.signing_status ='1' THEN '待审核'
else '已审核'
END signingStatus,
CASE
WHEN lds.driver_signing ='1' THEN '未完成'
else '已完成'
END driverSigning
FROM
logpm_distribution_signfor lds
JOIN logpm_distribution_reservation ldr ON ldr.id = lds.reservation_id
<where>
lds.is_deleted = 0 and lds.delivery_id = #{id} and ldr.reservation_status != 40 AND (ldr.reservation_num + ldr.reservation_stock_list_num) > 0
</where>
</select>
</mapper>

8
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.java

@ -124,6 +124,14 @@ public interface DistributionReservationMapper extends BaseMapper<DistributionRe
*/
IPage<DistributionParcelListEntity> getReservationPackage(IPage<DistributionParcelListEntity> page,@Param("orderIds") List<Long> orderIds,@Param("param")Map<String,Object> param);
/**
* 查询预约单下指定订单包件列表
* @param orderIds
* @param param
* @return
*/
List<DistributionParcelListEntity> getReservationPackageByDeliveryId(@Param("orderIds") List<Long> orderIds,@Param("deliveryId")Long deliveryId);
/**
* 删除预约单
* @param id

21
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml

@ -799,6 +799,26 @@
</if>
</where>
</select>
<select id="getReservationPackageByDeliveryId" resultType="com.logpm.distribution.entity.DistributionParcelListEntity">
SELECT
ldpl.*,
ldpl.quantity AS reservationNum
FROM
logpm_distribution_signfor AS lds
LEFT JOIN logpm_distribution_reservation AS ldr ON lds.reservation_id = ldr.id
LEFT JOIN logpm_distribution_reservation_stockarticle AS ldsa ON ldr.id = ldsa.reservation_id
LEFT JOIN logpm_distribution_reservation_package AS ldrp ON ldrp.reservation_id = ldsa.reservation_id and ldrp.stock_article_id = ldsa.stock_article_id
LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldrp.parce_list_id = ldpl.id
<where>
lds.delivery_id = #{deliveryId} and ldrp.packet_bar_status in ('1','3') and ldpl.id is not null
<if test="orderIds !=null and orderIds!= ''">
and ldrp.stock_article_id in
<foreach collection="orderIds" item="id" separator="," close=")" open="(">
#{id}
</foreach>
</if>
</where>
</select>
<select id="selectPackageByReservationAndStockArticle"
resultType="com.logpm.distribution.entity.DistributionParcelListEntity">
SELECT
@ -1777,7 +1797,6 @@
LEFT JOIN logpm_distribution_loadscan As ldl ON ldrzp.reservation_id = ldl.reservation_id AND ldl.package_id = ldpl.id AND ldl.scan_status != 1 AND ldl.is_deleted =0
<where>
ldrzp.reservation_id = #{param.reservationId} AND ldrzp.zero_package_status in ('1','3')
</where>
</select>

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml

@ -492,9 +492,9 @@
</select>
<select id="selectBillLadingPlanNum" resultType="java.lang.Integer">
SELECT(
IF((SELECT sum(packet_number) FROM logpm_distrilbution_bill_package WHERE bill_lading_id = #{billLadingId} AND packet_bar_status != 3) IS NULL,0,(SELECT sum(packet_number) FROM logpm_distrilbution_bill_package WHERE bill_lading_id = #{billLadingId} AND packet_bar_status != 3))
IF((SELECT sum(packet_number) FROM logpm_distrilbution_bill_package WHERE bill_lading_id = #{billLadingId} AND packet_bar_status != 3) IS NULL,0,(SELECT sum(packet_number) FROM logpm_distrilbution_bill_package WHERE bill_lading_id = #{billLadingId} AND packet_bar_status != 2))
+
IF((SELECT sum(quantity) FROM logpm_distribution_delivery_details WHERE bill_lading_id = #{billLadingId} AND inventory_status != 3) IS NULL ,0,(SELECT sum(quantity) FROM logpm_distribution_delivery_details WHERE bill_lading_id = #{billLadingId} AND inventory_status != 3) ) )
IF((SELECT sum(quantity) FROM logpm_distribution_delivery_details WHERE bill_lading_id = #{billLadingId} AND inventory_status != 3) IS NULL ,0,(SELECT sum(quantity) FROM logpm_distribution_delivery_details WHERE bill_lading_id = #{billLadingId} AND inventory_status != 2) ) )
</select>
<select id="selectBillLadingLoading" resultType="java.lang.Integer">
SELECT sum(quantity) FROM logpm_distribution_bill_lading_scan WHERE bill_lading_id =#{billLadingId} AND is_deleted = 0

16
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryInfoService.java

@ -78,6 +78,14 @@ public interface IDistributionDeliveryInfoService extends BaseService<Distributi
* @return
*/
IPage<DistributionStockListVO> selectDistributionDeliveryinventory(IPage<DistributionStockListVO> page, DistributionDeliveryInfoDTO distributionDeliveryInfoDTO);
/**
* 从配送Id查询库存品
*
* @param deliveryId
* @return
*/
List<DistributionStockListVO> selectDistributionDeliveryinventoryByDeliveryId(Long deliveryId);
/**
* 从配送查看订单
*
@ -85,6 +93,14 @@ public interface IDistributionDeliveryInfoService extends BaseService<Distributi
* @return
*/
IPage<DistributionStockArticleVO> selectDistributionDeliveryorder(IPage<DistributionStockArticleVO> page, Map<String, Object> distributionStockArticle);
/**
* 从配送查看订单
*
* @param page
* @return
*/
List<DistributionStockArticleVO> selectDistributionDeliveryorderByDeliveryId(Map<String, Object> distributionStockArticle);
/**
* 从客户查看订单
*

10
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java

@ -20,6 +20,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.aftersales.vo.AftersalesAbnormalPackageVO;
import com.logpm.distribution.bean.Resp;
import com.logpm.distribution.dto.DistributionDeliveryExcelDTO;
import com.logpm.distribution.dto.DistributionDeliveryInfoDTO;
import com.logpm.distribution.dto.DistributionDeliveryListDTO;
import com.logpm.distribution.dto.app.DistributionAppDeliveryListDTO;
@ -193,6 +194,8 @@ public interface IDistributionDeliveryListService extends BaseService<Distributi
IPage<DistributionParcelListVO> getPackageListByDeliverylistId(IPage<DistributionParcelListEntity> page, Map<String,Object> distributionDeliveryInfoDTO) throws ParseException;
List<DistributionParcelListVO> getAllPackageListByDeliverylistId(Long deliveryId) throws ParseException;
/**
* 查询商配计划科操作订单列表
* @param params
@ -432,6 +435,13 @@ public interface IDistributionDeliveryListService extends BaseService<Distributi
*/
void maintenanceDeliveryInfoAndDeliveryStatus(String deliveryIds);
/**
* 配送详情导出数据组装
* @param deliveryId
* @return
*/
DistributionDeliveryExcelDTO exportDistributionDeliveryListDetail(Long deliveryId);
/**
* 查询签收预约客户包件信息

26
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java

@ -1820,18 +1820,20 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
//查询包件
List<DistributionParcelListEntity> distributionParcelListEntities = distributionParcelListService.listByIds(ids);
List<Long> packageIds = distributionParcelListEntities.stream().filter(f -> OrderPackageLoadingStatusConstant.yizhuangche.getValue().equals(f.getOrderPackageLoadingStatus())|| !OrderPackageStatusConstant.yiqianshou.getValue().equals(f.getOrderPackageStatus())).map(DistributionParcelListEntity::getId).collect(Collectors.toList());
distributionParcelListService.update(new UpdateWrapper<DistributionParcelListEntity>().lambda()
.set(DistributionParcelListEntity::getOrderPackageReservationStatus,OrderPackageReservationStatusConstant.daiyuyue.getValue())
.set(DistributionParcelListEntity::getOrderPackageLoadingStatus,OrderPackageLoadingStatusConstant.weizhuancghe.getValue())
.set(DistributionParcelListEntity::getOrderPackageStatus,OrderPackageStatusConstant.yiruku.getValue())
.set(DistributionParcelListEntity::getOrderPackageStockupStatus,OrderPackageStockupStatusConstant.daibeihuo.getValue())
.in(DistributionParcelListEntity::getId,packageIds)
);
billPackageService.update(new UpdateWrapper<DistrilbutionBillPackageEntity>().lambda()
.set(DistrilbutionBillPackageEntity::getPacketBarStatus,2)
.eq(DistrilbutionBillPackageEntity::getBillLadingId,l)
.in(DistrilbutionBillPackageEntity::getParceListId,packageIds)
);
if (Func.isNotEmpty(packageIds)){
distributionParcelListService.update(new UpdateWrapper<DistributionParcelListEntity>().lambda()
.set(DistributionParcelListEntity::getOrderPackageReservationStatus,OrderPackageReservationStatusConstant.daiyuyue.getValue())
.set(DistributionParcelListEntity::getOrderPackageLoadingStatus,OrderPackageLoadingStatusConstant.weizhuancghe.getValue())
.set(DistributionParcelListEntity::getOrderPackageStatus,OrderPackageStatusConstant.yiruku.getValue())
.set(DistributionParcelListEntity::getOrderPackageStockupStatus,OrderPackageStockupStatusConstant.daibeihuo.getValue())
.in(DistributionParcelListEntity::getId,packageIds)
);
billPackageService.update(new UpdateWrapper<DistrilbutionBillPackageEntity>().lambda()
.set(DistrilbutionBillPackageEntity::getPacketBarStatus,2)
.eq(DistrilbutionBillPackageEntity::getBillLadingId,l)
.in(DistrilbutionBillPackageEntity::getParceListId,packageIds)
);
}
String collect = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getOrderCode).distinct().collect(Collectors.joining(","));
distributionStockArticleService.maintenanceOrderInfo(collect,warehouseId);
//维护自提单订单信息

67
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryInfoServiceImpl.java

@ -168,11 +168,16 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl<Distrib
@Override
public IPage<DistributionStockListVO> selectDistributionDeliveryinventory(IPage<DistributionStockListVO> page, DistributionDeliveryInfoDTO distributionDeliveryInfoDTO) {
List<DistributionStockListVO> distributionDeliveryInfoVOS = baseMapper.selectDistributionDeliveryinventoryPage(page, distributionDeliveryInfoDTO);
return page.setRecords(distributionDeliveryInfoVOS);
}
@Override
public List<DistributionStockListVO> selectDistributionDeliveryinventoryByDeliveryId(Long deliveryId) {
List<DistributionStockListVO> distributionDeliveryInfoVOS = baseMapper.selectDistributionDeliveryinventoryByDeliveryId(deliveryId);
return distributionDeliveryInfoVOS;
}
@Override
public IPage<DistributionStockArticleVO> selectDistributionDeliveryorder(IPage<DistributionStockArticleVO> page, Map<String, Object> distributionStockArticle) {
List<DistributionStockArticleVO> distributionDeliveryInfoVOS = baseMapper.selectDistributionDeliveryOrderPage(page, distributionStockArticle);
@ -233,6 +238,66 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl<Distrib
return page.setRecords(distributionDeliveryInfoVOS);
}
public List<DistributionStockArticleVO> selectDistributionDeliveryorderByDeliveryId(Map<String, Object> distributionStockArticle) {
String deliveryId = (String) distributionStockArticle.get("deliveryId");
List<DistributionStockArticleVO> distributionDeliveryInfoVOS = baseMapper.selectDistributionDeliveryOrderPageByDeliveryId(Long.parseLong(deliveryId));
List<DistributionLoadscanEntity> loadList = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda()
.eq(DistributionLoadscanEntity::getDeliveryId, distributionStockArticle.get("deliveryId"))
);
Map<Long, List<DistributionLoadscanEntity>> orderLoadMap;
if (!Objects.isNull(loadList)) {
orderLoadMap = loadList.stream().collect(Collectors.groupingBy(DistributionLoadscanEntity::getOrderId));
} else {
orderLoadMap = null;
}
distributionDeliveryInfoVOS.forEach(s -> {
//匹配当前配送任务签收数量
s.setSigningNumber(0);
if (Func.isNotEmpty(orderLoadMap)) {
List<DistributionLoadscanEntity> orderLoading = orderLoadMap.get(s.getId());
if (Func.isNotEmpty(orderLoading)) {
int signingNum = orderLoading.stream().mapToInt(DistributionLoadscanEntity::getReceivedQuantity).sum();
s.setSigningNumber(signingNum);
}
}
switch (s.getOrderStatus()) {
case "10":
s.setOrderStatusName(OrderStatusConstant.bufenruku.getName());
break;
case "20":
s.setOrderStatusName(OrderStatusConstant.ruku.getName());
break;
case "30":
s.setOrderStatusName(OrderStatusConstant.bufenchuku.getName());
break;
case "40":
s.setOrderStatusName(OrderStatusConstant.chuku.getName());
break;
case "70":
s.setOrderStatusName(OrderStatusConstant.bufenqianshou.getName());
break;
case "80":
s.setOrderStatusName(OrderStatusConstant.qianshou.getName());
break;
default:
log.info("selectDistributionDeliveryorder 不满足匹配值 s.getOrderStatus() {}",s.getOrderStatus());
break;
}
});
// for (DistributionStockArticleVO distributionDeliveryInfoVO : distributionDeliveryInfoVOS) {
// //查询签收数量
// //查询装车数量
//// distributionDeliveryInfoVO.get
//// distributionDeliveryInfoVO.setLoadingNumber();
//// distributionLoadscanService.list(Wrappers.query().lambda().eq())
//// DistributionStockArticleWrapper.build().buildVoInfor(distributionDeliveryInfoVO);
// }
return distributionDeliveryInfoVOS;
}
@Override
public List<DistributionAppStockArticleVO> selectDistributionAppDeliveryorder(DistributionAppDeliveryListDTO distributionAppDeliveryListDTO) {

195
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

@ -4394,6 +4394,105 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
@Override
public List<DistributionParcelListVO> getAllPackageListByDeliverylistId(Long deliveryId) throws ParseException {
// if (Func.isEmpty(distributionDeliveryInfoDTO.get("deliveryId"))) {
// log.info("参数缺失deliveryId");
// return null;
// }
// Long deliveryId = Long.parseLong((String) distributionDeliveryInfoDTO.get("deliveryId"));
//查询零担订单包件
// List<DistributionParcelNumberVO> parcelNumberVOS = baseMapper.getZeroPackageListByDeliveryId(distributionDeliveryInfoDTO.getDeliveryId());
List<DistributionStockArticleVO> deliveryStockArticleInfo = baseMapper.getDeliveryStockArticleInfo(deliveryId);
if (Func.isEmpty(deliveryStockArticleInfo)) {
log.error("配送任务订单查询异常:{}", deliveryStockArticleInfo);
return null;
}
List<DistributionReservationStockarticleEntity> reservationStockarticleEntityList = baseMapper.getReservationStockArticleByDeliveryId(deliveryId);
if (Func.isEmpty(reservationStockarticleEntityList)) {
log.error("配送任务订单查询异常:{}", reservationStockarticleEntityList);
return null;
}
// List<DistributionParcelListVO> parcelListVOIPage = new ArrayList<>();
List<DistributionLoadscanEntity> loadscanEntities = distributionLoadscanMapper.selectList(Wrappers.<DistributionLoadscanEntity>query().lambda().eq(DistributionLoadscanEntity::getDeliveryId, deliveryId).ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()));
Map<Long, DistributionLoadscanEntity> loadingDataMap = null;
if (Func.isNotEmpty(loadscanEntities)) {
loadingDataMap = loadscanEntities.stream().collect(Collectors.toMap(DistributionLoadscanEntity::getPackageId, Function.identity(), (k1, k2) -> k2));
}
SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
ArrayList<DistributionParcelListVO> distributionParcelListVOS = new ArrayList<>();
if (Func.isNotEmpty(reservationStockarticleEntityList)) {
List<Long> orderIds = reservationStockarticleEntityList.stream().filter(order -> order.getIsZero().equals(IsOrNoConstant.no.getValue())).map(DistributionReservationStockarticleEntity::getStockArticleId).collect(Collectors.toList());
if (Func.isNotEmpty(orderIds)) {
//查询该客户的非零但订单包间
List<DistributionParcelListEntity> parcelListEntityList = distributionReservationMapper.getReservationPackageByDeliveryId(orderIds, deliveryId);
// parcelListVOIPage.setTotal(parcelListEntityList.getTotal());
// List<DistributionParcelListEntity> parcelListEntityList = distributionReservationMapper.getReservationPackageNew(distributionDeliveryInfoDTO);
log.info(">>>>>> parcelListEntityList {}", parcelListEntityList);
List<DistributionParcelListVO> parcelListVOList = DistributionParcelListWrapper.build().listVO(parcelListEntityList);
for (DistributionParcelListVO distributionParcelListVO : parcelListVOList) {
log.info(">>>>>> distributionParcelListVO {}", distributionParcelListVO);
if (Func.isNotEmpty(loadingDataMap)) {
DistributionLoadscanEntity loadscanEntity = loadingDataMap.get(distributionParcelListVO.getId());
log.info(">>>>>> loadscanEntity {}", loadscanEntity);
if (Func.isNotEmpty(loadscanEntity)) {
if (loadscanEntity.getSignforState().equals(LoadScanSigningStatusConstant.yiqianshou.getValue())) {
distributionParcelListVO.setSigningNub(loadscanEntity.getReceivedQuantity());
}
if (Func.isNotEmpty(loadscanEntity.getSigningTime())) {
distributionParcelListVO.setSigningTime(loadscanEntity.getSigningTime());
}
if (Func.isNotEmpty(loadscanEntity.getScanUser())) {
distributionParcelListVO.setScanUser(loadscanEntity.getScanUser());
}
if (Func.isNotEmpty(loadscanEntity.getDriverName())) {
distributionParcelListVO.setDriverName(loadscanEntity.getDriverName());
}
if (Func.isNotEmpty(loadscanEntity.getLoadedNub())) {
distributionParcelListVO.setLoadingNub(loadscanEntity.getLoadedNub());
}
if (Func.isNotEmpty(loadscanEntity.getScanTime())) {
distributionParcelListVO.setLoadingTime(loadscanEntity.getScanTime());
}
if (Func.isNotEmpty(loadscanEntity.getSigningUser())) {
distributionParcelListVO.setSigningUser(loadscanEntity.getSigningUser());
}
if (Func.isNotEmpty(loadscanEntity.getScanStatus())) {
switch (loadscanEntity.getScanStatus()) {
case "1":
distributionParcelListVO.setScanStatus(LoadingStatusConstant.quxiao.getName());
break;
case "2":
distributionParcelListVO.setScanStatus(LoadingStatusConstant.saomiao.getName());
break;
case "3":
distributionParcelListVO.setScanStatus(LoadingStatusConstant.queren.getName());
break;
case "4":
distributionParcelListVO.setScanStatus(LoadingStatusConstant.yijianzhuangche.getName());
break;
case "5":
distributionParcelListVO.setScanStatus(LoadingStatusConstant.buluzhuangche.getName());
break;
}
distributionParcelListVO.setLoadingNub(loadscanEntity.getLoadedNub());
}
}
}
log.info(">>>>>> distributionParcelListVO2 {}", distributionParcelListVO);
distributionParcelListVOS.add(distributionParcelListVO);
}
}
} else {
//可能出现配送任务下的所有客户都是库存品
log.info("#############此配送任务下无订单信息,deliveryId:{}", deliveryId);
}
return distributionParcelListVOS;
}
@Override
public IPage<DistributionStockArticleVO> selectDiscussStockArticleInfoList(Map<String, Object> params, Query query, Long deliveryListId) {
IPage<DistributionStockArticleVO> page = Condition.getPage(query);
@ -6103,40 +6202,48 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
Long deliveryId = Long.parseLong((String) distributionReservationDTO.get("deliveryId"));
List<DistributionDeliveryInfoVO> customList = distributionDeliveryInfoMapper.selectClientList(deliveryId, distributionReservationDTO);
List<DistributionDeliveryInfoVO> distributionDeliveryInfoVOS = null;
if (!customList.isEmpty()) {
customList.forEach(c -> {
if (Func.isNotEmpty(c.getLoadingStatus())) {
switch (c.getLoadingStatus()) {
case "10":
c.setLoadingStatus(ReservationLoadingStatusConstant.daizhuangche.getName());
break;
case "20":
c.setLoadingStatus(ReservationLoadingStatusConstant.bufenzhuangche.getName());
break;
case "30":
c.setLoadingStatus(ReservationLoadingStatusConstant.yizhuangche.getName());
break;
}
distributionDeliveryInfoVOS = handleClient(customList);
}
return page.setRecords(distributionDeliveryInfoVOS);
}
public List<DistributionDeliveryInfoVO> handleClient(List<DistributionDeliveryInfoVO> customList){
customList.forEach(c -> {
if (Func.isNotEmpty(c.getLoadingStatus())) {
switch (c.getLoadingStatus()) {
case "10":
c.setLoadingStatus(ReservationLoadingStatusConstant.daizhuangche.getName());
break;
case "20":
c.setLoadingStatus(ReservationLoadingStatusConstant.bufenzhuangche.getName());
break;
case "30":
c.setLoadingStatus(ReservationLoadingStatusConstant.yizhuangche.getName());
break;
}
if (Func.isNotEmpty(c.getReservationSigningStatus())) {
switch (c.getReservationSigningStatus()) {
case "10":
c.setReservationSigningStatus(ReservationSigningStatusConstant.daiqianshou.getName());
break;
case "20":
c.setReservationSigningStatus(ReservationSigningStatusConstant.bufenqianshou.getName());
break;
case "30":
c.setReservationSigningStatus(ReservationSigningStatusConstant.yiqianshou.getName());
break;
}
}
if (Func.isNotEmpty(c.getReservationSigningStatus())) {
switch (c.getReservationSigningStatus()) {
case "10":
c.setReservationSigningStatus(ReservationSigningStatusConstant.daiqianshou.getName());
break;
case "20":
c.setReservationSigningStatus(ReservationSigningStatusConstant.bufenqianshou.getName());
break;
case "30":
c.setReservationSigningStatus(ReservationSigningStatusConstant.yiqianshou.getName());
break;
}
});
}
return page.setRecords(customList);
}
});
return customList;
}
public Map<String, String> getDriverCar(String kind, Long deliveryListEntityId) {
Map<String, String> map = new HashMap<>();
String dirverName = null;
@ -6898,6 +7005,38 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
/**
* @param deliveryId
* @return
*/
@Override
public DistributionDeliveryExcelDTO exportDistributionDeliveryListDetail(Long deliveryId) {
// map.put("deliveryId",deliveryId);
// Map<String,Object> EXResource = new HashMap<>();
DistributionDeliveryExcelDTO distributionDeliveryExcelDTO = new DistributionDeliveryExcelDTO();
try {
List<DistributionDeliveryInfoVO> distributionDeliveryInfoVOS = distributionDeliveryInfoMapper.selectClientListByDeliveryId(deliveryId);
List<DistributionDeliveryInfoVO> deliveryInfoVOS = handleClient(distributionDeliveryInfoVOS);
distributionDeliveryExcelDTO.setDeliveryInfoVOS(deliveryInfoVOS);
// EXResource.put("client",deliveryInfoVOS);
List<DistributionStockArticleVO> distributionStockArticleVOS = distributionDeliveryInfoMapper.selectDistributionDeliveryOrderPageByDeliveryId(deliveryId);
distributionDeliveryExcelDTO.setDistributionStockArticleVOS(distributionStockArticleVOS);
// EXResource.put("order",distributionStockArticleVOS);
List<DistributionStockListVO> distributionStockListVOS = distributionDeliveryInfoMapper.selectDistributionDeliveryinventoryByDeliveryId(deliveryId);
distributionDeliveryExcelDTO.setDistributionStockListVOS(distributionStockListVOS);
// EXResource.put("inventory",distributionStockListVOS);
List<DistributionParcelListVO> packageListByDeliverylistId = distributionDeliveryListService.getAllPackageListByDeliverylistId(deliveryId);
// EXResource.put("package",packageListByDeliverylistId);
distributionDeliveryExcelDTO.setPackageListByDeliverylistId(packageListByDeliverylistId);
} catch (ParseException e) {
throw new RuntimeException(e);
}
// EXResource.put("package",packageListByDeliverylistId);
return distributionDeliveryExcelDTO;
}
@Override
@Transactional
public void maintenanceDeliveryInfo(Long deliveryId) {

Loading…
Cancel
Save