Browse Source

fix:修改订单节点查询 按照新的原型开发

fix-sign
pref_mail@163.com 3 months ago
parent
commit
7def35fccd
  1. 6
      blade-service-api/logpm-data-sharing-api/src/main/java/com/logpm/datasharing/vo/NodeInfoVO.java
  2. 51
      blade-service-api/logpm-data-sharing-api/src/main/java/com/logpm/datasharing/vo/WaybillInfoVO.java
  3. 2
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java
  4. 19
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IQualityDeliverClient.java
  5. 12
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/feign/ITrunklineCarsLoadScanClient.java
  6. 10
      blade-service/logpm-data-sharing/pom.xml
  7. 369
      blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/impl/LogpmDataSearchServiceImpl.java
  8. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java
  9. 17
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/QualityDeliverClient.java
  10. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java
  11. 13
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml
  12. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java
  13. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java
  14. 2
      blade-service/logpm-report/src/main/java/com/logpm/report/ReportApplication.java
  15. 17
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklineCarsLoadScanClient.java

6
blade-service-api/logpm-data-sharing-api/src/main/java/com/logpm/datasharing/vo/NodeInfoVO.java

@ -25,6 +25,12 @@ public class NodeInfoVO implements Serializable {
private String operateWarehouseName;
/**
* 操作网点电话
*/
@ApiModelProperty(value = "操作网点电话")
private String operateWarehousePhone;
/**
* 操作时间
*/

51
blade-service-api/logpm-data-sharing-api/src/main/java/com/logpm/datasharing/vo/WaybillInfoVO.java

@ -14,26 +14,29 @@ import java.util.List;
public class WaybillInfoVO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "联系电话")
private String contactNumber;
/**
* 运单状态 10部分入库
*
* <p>
* 20入库
*
* <p>
* 30部分中转
*
* <p>
* 40 中转
*
* <p>
* 50 目的仓部分到达
*
* <p>
* 60 目的仓到达
*
* <p>
* 70 配送部分装车
*
* <p>
* 80 配送装车
*
* <p>
* 90 部分签收
*
* <p>
* 100 已签收
*/
@ApiModelProperty(value = "运单状态")
@ -46,6 +49,13 @@ public class WaybillInfoVO implements Serializable {
@ApiModelProperty(value = "运单号")
private String waybillNo;
/**
* 订单号
*/
@ApiModelProperty(value = "订单号")
private String orderCode;
/**
* 目的仓
*/
@ -53,7 +63,6 @@ public class WaybillInfoVO implements Serializable {
private String destinationWarehouseName;
/**
* 发站仓
*/
@ -76,15 +85,14 @@ public class WaybillInfoVO implements Serializable {
/**
* 总数
*/
@ApiModelProperty(value = "总数")
@ApiModelProperty(value = "运单总数")
private Integer totalCount;
/**
* 在途数量
* 订单总数
*/
@ApiModelProperty(value = "在途数量")
private Integer onWayCount;
@ApiModelProperty(value = "订单总数")
private Integer orderCount;
/**
@ -119,22 +127,9 @@ public class WaybillInfoVO implements Serializable {
@ApiModelProperty(value = "目的仓数量信息")
private WarehouseNumberVO endWarehouseNumber;
/**
* 配送数量
*/
@ApiModelProperty(value = "配送数量")
private Integer deliveryNum ;
/**
* 签收数量
*/
@ApiModelProperty(value = "签收数量")
private Integer signNum;
@ApiModelProperty(value = "节点信息")
private List<NodeInfoVO> nodeInfoVOList;
}

2
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java

@ -174,6 +174,8 @@ public interface IDistributionParcelListClient {
@GetMapping(API_PREFIX + "/findByWaybillNumber")
List<DistributionParcelListEntity> findByWaybillNumber(@RequestParam String waybillNumber);
@GetMapping(API_PREFIX + "/findByWaybillNumberAndOrderCode")
List<DistributionParcelListEntity> findByWaybillNumberAndOrderCode(@RequestParam String waybillNumber, @RequestParam String orderCode);
@GetMapping(API_PREFIX + "/findEntityListByOrderCodeAndStatus")
List<DistributionParcelListEntity> findEntityListByOrderCodeAndStatus(@RequestParam String orderCode, @RequestParam Long warehouseId, @RequestParam String packageStatus, @RequestParam String waybillNo);

19
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IQualityDeliverClient.java

@ -44,12 +44,29 @@ public interface IQualityDeliverClient {
/**
* 获取通知提货记录列表
*
* @param signTime 签收时间
* @param signTime 签收时间
* @return BladePage
*/
@GetMapping(API_PREFIX + "/findSignListByDate")
List<QualityDeliverEntity> findSignListByDate(@RequestParam("signTime") String signTime);
/**
* 更具运单号查询配送信息
*
* @param waybillNumber
* @return
*/
@GetMapping(API_PREFIX + "/findDeliverByWaybillNumber")
List<QualityDeliverEntity> findSignListByWaybillNumber(@RequestParam("waybillNumber") String waybillNumber);
@GetMapping(API_PREFIX + "/findSignListByWaybillNumberAndOrderCode")
List<QualityDeliverEntity> findSignListByWaybillNumberAndOrderCode(@RequestParam("waybillNumber") String waybillNumber,@RequestParam("orderCode") String orderCode);
@PostMapping(API_PREFIX + "/updateWarehouseCost")
void updateWarehouseCost(@RequestBody Map<Long, BigDecimal> packageCostMap);

12
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/feign/ITrunklineCarsLoadScanClient.java

@ -40,6 +40,18 @@ public interface ITrunklineCarsLoadScanClient {
void removeLoadScanByIds(@RequestBody List<Long> scanloadIdList);
/**
* 根据运单号查询车辆的装车信息
* @param waybillNo
* @return
*/
@GetMapping(API_PREFIX+"/findAllListByWaybillNo")
List<TrunklineCarsLoadScanEntity> findAllListByWaybillNo(@RequestParam String waybillNo);
@GetMapping(API_PREFIX+"/findAllListByWaybillNoAndOrderCode")
List<TrunklineCarsLoadScanEntity> findAllListByWaybillNoAndOrderCode(@RequestParam String waybillNo,@RequestParam String orderCode);
// @PostMapping(API_PREFIX+"/addAdvanceReturnId")
// Long addAdvanceReturnId(@RequestBody TrunklineAdvanceEntity trunklineAdvanceEntity);

10
blade-service/logpm-data-sharing/pom.xml

@ -40,11 +40,21 @@
<artifactId>logpm-warehouse-api</artifactId>
<version>3.2.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>logpm-trunkline-api</artifactId>
<version>3.2.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>logpm-data-sharing-api</artifactId>
<version>3.2.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-system-api</artifactId>
<version>3.2.0.RELEASE</version>
</dependency>
</dependencies>

369
blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/impl/LogpmDataSearchServiceImpl.java

@ -1,16 +1,27 @@
package com.logpm.datasharing.service.impl;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.datasharing.service.ILogpmDataSearchService;
import com.logpm.datasharing.vo.NodeInfoVO;
import com.logpm.datasharing.vo.WarehouseNumberVO;
import com.logpm.datasharing.vo.WaybillInfoVO;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.entity.QualityDeliverEntity;
import com.logpm.distribution.feign.IDistributionParcelListClient;
import com.logpm.distribution.feign.IQualityDeliverClient;
import com.logpm.trunkline.entity.TrunklineCarsLoadScanEntity;
import com.logpm.trunkline.entity.TrunklineWaybillOrderEntity;
import com.logpm.trunkline.feign.ITrunklineCarsLoadScanClient;
import com.logpm.trunkline.feign.ITrunklineWaybillOrderClient;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.feign.IWarehouseWaybillClient;
import lombok.AllArgsConstructor;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.system.entity.Tenant;
import org.springblade.system.feign.ISysClient;
import org.springframework.stereotype.Service;
import java.util.*;
@ -23,6 +34,11 @@ public class LogpmDataSearchServiceImpl implements ILogpmDataSearchService {
private final IWarehouseWaybillClient warehouseWaybillClient;
private final IDistributionParcelListClient distributionParcelListClient;
private final ITrunklineCarsLoadScanClient traceCarsLoadScanClient;
private final IQualityDeliverClient questualityDeliverClient;
private final IBasicdataWarehouseClient basicdataWarehouseClient;
private final ISysClient systemClient;
private final ITrunklineWaybillOrderClient trunklineWaybillOrderClient;
@Override
public R data(String type, String order) {
@ -33,10 +49,9 @@ public class LogpmDataSearchServiceImpl implements ILogpmDataSearchService {
case "order":
// 订单查询
return dataOrder(order);
case "waybill":
// 运单查询
return R.data(dataWEaybill(order)) ;
return R.data(dataWEaybill(order));
default:
// 需要没有参数的查询全部的情况
return R.fail("参数错误");
@ -47,18 +62,177 @@ public class LogpmDataSearchServiceImpl implements ILogpmDataSearchService {
/**
* 运单查询
*
* @param waybillNo
* @return
*/
private WaybillInfoVO dataWEaybillByOrderCode(String waybillNo,String orderCode) {
WaybillInfoVO result = new WaybillInfoVO();
// todo 查询运单
WarehouseWaybillEntity byWaybillNo = warehouseWaybillClient.findByWaybillNo(waybillNo);
if (Objects.isNull(byWaybillNo)) {
throw new CustomerException("运单信息不存在~");
}
// 获取租户信息
R<Tenant> tenant = systemClient.getTenant(AuthUtil.getTenantId());
if (tenant.isSuccess() && !Objects.isNull(tenant.getData())) {
Tenant data = tenant.getData();
result.setContactNumber(data.getContactNumber());
}
result.setOrderCode(orderCode);
// 获取到订单在这个运单的件数
TrunklineWaybillOrderEntity entityByWaybillNoAndOrderCode = trunklineWaybillOrderClient.findEntityByWaybillNoAndOrderCode(waybillNo, orderCode);
if(entityByWaybillNoAndOrderCode != null){
result.setOrderCount(entityByWaybillNoAndOrderCode.getTotalNumber());
}
result.setWaybillNo(byWaybillNo.getWaybillNo());
result.setDestinationWarehouseName(byWaybillNo.getDestinationWarehouseName());
result.setDepartureWarehouseName(byWaybillNo.getDepartureWarehouseName());
result.setShipper(byWaybillNo.getShipper());
result.setShipperName(byWaybillNo.getShipperName());
result.setConsignee(byWaybillNo.getConsignee());
result.setConsigneeName(byWaybillNo.getConsigneeName());
result.setTotalCount(byWaybillNo.getTotalCount());
List<DistributionParcelListEntity> distributionParcelListEntities = distributionParcelListClient.findByWaybillNumberAndOrderCode(waybillNo,orderCode);
// 按照仓库ID进行分组
Map<String, List<DistributionParcelListEntity>> groupedByWarehouse = distributionParcelListEntities.stream()
.collect(Collectors.groupingBy(DistributionParcelListEntity::getWarehouse));
// 判断当前map 中的key长度
Set<String> keys = groupedByWarehouse.keySet();
List<WarehouseNumberVO> models = null;
for (String key : keys) {
if (models == null) {
models = new ArrayList<>();
}
WarehouseNumberVO middleWarehouseNumberVO = buildWarehouse(groupedByWarehouse, key);
if(middleWarehouseNumberVO!=null){
models.add(middleWarehouseNumberVO);
}
}
// 加入中转的数据
result.setMiddleWarehouseNumber(models);
// 运单状态
result.setStatusName(changeStatusName(byWaybillNo.getWaybillStatus()));
// 增加节点信息
List<NodeInfoVO> nodeInfoVOList = new ArrayList<>();
// 入库
NodeInfoVO nodeInfoVO = buildFristRuKu(groupedByWarehouse, result.getDepartureWarehouseName(), result.getTotalCount());
if(nodeInfoVO != null){
nodeInfoVOList.add(nodeInfoVO);
}
// 干线发车
List<TrunklineCarsLoadScanEntity> allListByWaybillNo = traceCarsLoadScanClient.findAllListByWaybillNoAndOrderCode(waybillNo,orderCode);
if (allListByWaybillNo != null && !allListByWaybillNo.isEmpty()) {
// 按照 车次号进行分组
Map<String, List<TrunklineCarsLoadScanEntity>> groupedByLoadId = allListByWaybillNo.stream().collect(Collectors.groupingBy(TrunklineCarsLoadScanEntity::getLoadCode));
Set<String> strings = groupedByLoadId.keySet();
for (String key : strings) {
List<TrunklineCarsLoadScanEntity> trunklineCarsLoadScanEntities = groupedByLoadId.get(key);
//干线发车
nodeInfoVO = buildTrunklineByLoadCar(trunklineCarsLoadScanEntities, key);
if (nodeInfoVO != null) {
nodeInfoVOList.add(nodeInfoVO);
}
// 干线到达
nodeInfoVO = buildTrunklineByUnLoadCar(trunklineCarsLoadScanEntities, key);
if (nodeInfoVO != null) {
nodeInfoVOList.add(nodeInfoVO);
}
}
}
List<QualityDeliverEntity> signListByWaybillNumber = questualityDeliverClient.findSignListByWaybillNumberAndOrderCode(waybillNo,orderCode);
if (signListByWaybillNumber != null && !signListByWaybillNumber.isEmpty()) {
//统计装车数量load_num
int loadNum = signListByWaybillNumber.stream().mapToInt(QualityDeliverEntity::getLoadNum).sum();
// 计划配送数 plan_num
int planNum = signListByWaybillNumber.stream().mapToInt(QualityDeliverEntity::getPlanNum).sum();
// 计算签收数量sign_num
int signNum = signListByWaybillNumber.stream().mapToInt(QualityDeliverEntity::getSignNum).sum();
// 配送装车
QualityDeliverEntity qualityDeliverEntity = signListByWaybillNumber.get(0);
if (loadNum != 0) {
nodeInfoVO = new NodeInfoVO();
nodeInfoVO.setOperateName("配送装车");
nodeInfoVO.setOperateNumber(loadNum + "");
nodeInfoVO.setOperateWarehouseName(qualityDeliverEntity.getWarehouseName());
nodeInfoVO.setOperateTime(qualityDeliverEntity.getCreateTime());
// 增加网点电话
BasicdataWarehouseEntity entityWarehouseId = basicdataWarehouseClient.getEntityWarehouseId(qualityDeliverEntity.getWarehouseId());
if (entityWarehouseId != null) {
nodeInfoVO.setOperateWarehousePhone(entityWarehouseId.getContactNumber());
}
nodeInfoVOList.add(nodeInfoVO);
}
if (planNum != 0) {
nodeInfoVO = new NodeInfoVO();
nodeInfoVO.setOperateName("配送签收");
nodeInfoVO.setOperateNumber(signNum + "/" + loadNum);
nodeInfoVO.setOperateWarehouseName(qualityDeliverEntity.getWarehouseName());
nodeInfoVO.setOperateTime(qualityDeliverEntity.getCreateTime());
// 增加网点电话
BasicdataWarehouseEntity entityWarehouseId = basicdataWarehouseClient.getEntityWarehouseId(qualityDeliverEntity.getWarehouseId());
if (entityWarehouseId != null) {
nodeInfoVO.setOperateWarehousePhone(entityWarehouseId.getContactNumber());
}
nodeInfoVOList.add(nodeInfoVO);
}
result.setNodeInfoVOList(nodeInfoVOList);
}
// 配送签收
return result;
}
/**
* 运单查询
*
* @param waybillNo
* @return
*/
private WaybillInfoVO dataWEaybill(String waybillNo) {
WaybillInfoVO result = new WaybillInfoVO();
int temp =0;
// todo 查询运单
WarehouseWaybillEntity byWaybillNo = warehouseWaybillClient.findByWaybillNo(waybillNo);
if(Objects.isNull(byWaybillNo)){
if (Objects.isNull(byWaybillNo)) {
throw new CustomerException("运单信息不存在~");
}
// 获取租户信息
R<Tenant> tenant = systemClient.getTenant(AuthUtil.getTenantId());
if (tenant.isSuccess() && !Objects.isNull(tenant.getData())) {
Tenant data = tenant.getData();
result.setContactNumber(data.getContactNumber());
}
result.setWaybillNo(byWaybillNo.getWaybillNo());
result.setDestinationWarehouseName(byWaybillNo.getDestinationWarehouseName());
result.setDepartureWarehouseName(byWaybillNo.getDepartureWarehouseName());
@ -68,75 +242,172 @@ public class LogpmDataSearchServiceImpl implements ILogpmDataSearchService {
result.setConsigneeName(byWaybillNo.getConsigneeName());
result.setTotalCount(byWaybillNo.getTotalCount());
List<DistributionParcelListEntity> distributionParcelListEntities = distributionParcelListClient.findByWaybillNumber(waybillNo);
List<DistributionParcelListEntity> distributionParcelListEntities = distributionParcelListClient.findByWaybillNumber(waybillNo);
// 按照仓库ID进行分组
Map<String, List<DistributionParcelListEntity>> groupedByWarehouse= distributionParcelListEntities.stream()
Map<String, List<DistributionParcelListEntity>> groupedByWarehouse = distributionParcelListEntities.stream()
.collect(Collectors.groupingBy(DistributionParcelListEntity::getWarehouse));
// 获取始发仓的入库数据
WarehouseNumberVO startWarehouseNumber =buildWarehouse(groupedByWarehouse,result.getDepartureWarehouseName());
// WarehouseNumberVO startWarehouseNumber = buildWarehouse(groupedByWarehouse, result.getDepartureWarehouseName());
// 移除当前的仓库
groupedByWarehouse.remove(result.getDepartureWarehouseName());
result.setStartWarehouseNumber(startWarehouseNumber);
temp +=startWarehouseNumber!=null?startWarehouseNumber.getNumber():0;
// groupedByWarehouse.remove(result.getDepartureWarehouseName());
// result.setStartWarehouseNumber(startWarehouseNumber);
/*********************************m目的仓 start********************************/
String destinationWarehouseName = result.getDestinationWarehouseName();
WarehouseNumberVO endWarehouseNumber=buildWarehouse(groupedByWarehouse,destinationWarehouseName);
temp +=endWarehouseNumber!=null?endWarehouseNumber.getNumber():0;
// 计算预约数量
List<DistributionParcelListEntity> end = groupedByWarehouse.get(destinationWarehouseName);
if(end!=null){
int resNum = end.stream().filter(t->"20".equals(t.getOrderPackageReservationStatus())).mapToInt(DistributionParcelListEntity::getQuantity).sum();
result.setDeliveryNum(resNum);
}
// String destinationWarehouseName = result.getDestinationWarehouseName();
// WarehouseNumberVO endWarehouseNumber = buildWarehouse(groupedByWarehouse, destinationWarehouseName);
groupedByWarehouse.remove(result.getDestinationWarehouseName());
result.setEndWarehouseNumber(endWarehouseNumber);
// groupedByWarehouse.remove(result.getDestinationWarehouseName());
// result.setEndWarehouseNumber(endWarehouseNumber);
/*********************************m目的仓 end********************************/
// 判断当前map 中的key长度
Set<String> keys = groupedByWarehouse.keySet();
List<WarehouseNumberVO> models = null;
for (String key : keys) {
if(models==null){
if (models == null) {
models = new ArrayList<>();
}
WarehouseNumberVO middleWarehouseNumberVO = buildWarehouse(groupedByWarehouse,key);
models.add(middleWarehouseNumberVO);
temp +=middleWarehouseNumberVO!=null?middleWarehouseNumberVO.getNumber():0;
WarehouseNumberVO middleWarehouseNumberVO = buildWarehouse(groupedByWarehouse, key);
if(middleWarehouseNumberVO != null){
models.add(middleWarehouseNumberVO);
}
}
// 加入中转的数据
result.setMiddleWarehouseNumber(models);
// 查询运单的签收数量
result.setSignNum(byWaybillNo.getSignNum());
// 运单状态
result.setStatusName(changeStatusName(byWaybillNo.getWaybillStatus()));
// 计算在途数量
result.setOnWayCount(result.getTotalCount()-temp);
// 增加节点信息
List<NodeInfoVO> nodeInfoVOList = new ArrayList<>();;
List<NodeInfoVO> nodeInfoVOList = new ArrayList<>();
// 入库
NodeInfoVO nodeInfoVO =buildFristRuKu(groupedByWarehouse,result.getDepartureWarehouseName(),result.getTotalCount());
nodeInfoVOList.add(nodeInfoVO);
NodeInfoVO nodeInfoVO = buildFristRuKu(groupedByWarehouse, result.getDepartureWarehouseName(), result.getTotalCount());
if(nodeInfoVO != null){
nodeInfoVOList.add(nodeInfoVO);
}
// 干线发车
List<TrunklineCarsLoadScanEntity> allListByWaybillNo = traceCarsLoadScanClient.findAllListByWaybillNo(waybillNo);
if (allListByWaybillNo != null && !allListByWaybillNo.isEmpty()) {
// 按照 车次号进行分组
Map<String, List<TrunklineCarsLoadScanEntity>> groupedByLoadId = allListByWaybillNo.stream().collect(Collectors.groupingBy(TrunklineCarsLoadScanEntity::getLoadCode));
Set<String> strings = groupedByLoadId.keySet();
for (String key : strings) {
List<TrunklineCarsLoadScanEntity> trunklineCarsLoadScanEntities = groupedByLoadId.get(key);
//干线发车
nodeInfoVO = buildTrunklineByLoadCar(trunklineCarsLoadScanEntities, key);
if (nodeInfoVO != null) {
nodeInfoVOList.add(nodeInfoVO);
}
// 干线到达
nodeInfoVO = buildTrunklineByUnLoadCar(trunklineCarsLoadScanEntities, key);
if (nodeInfoVO != null) {
nodeInfoVOList.add(nodeInfoVO);
}
}
}
List<QualityDeliverEntity> signListByWaybillNumber = questualityDeliverClient.findSignListByWaybillNumber(waybillNo);
if (signListByWaybillNumber != null && !signListByWaybillNumber.isEmpty()) {
//统计装车数量load_num
int loadNum = signListByWaybillNumber.stream().mapToInt(QualityDeliverEntity::getLoadNum).sum();
// 计划配送数 plan_num
int planNum = signListByWaybillNumber.stream().mapToInt(QualityDeliverEntity::getPlanNum).sum();
// 计算签收数量sign_num
int signNum = signListByWaybillNumber.stream().mapToInt(QualityDeliverEntity::getSignNum).sum();
// 配送装车
QualityDeliverEntity qualityDeliverEntity = signListByWaybillNumber.get(0);
if (loadNum != 0) {
nodeInfoVO = new NodeInfoVO();
nodeInfoVO.setOperateName("配送装车");
nodeInfoVO.setOperateNumber(loadNum + "");
nodeInfoVO.setOperateWarehouseName(qualityDeliverEntity.getWarehouseName());
nodeInfoVO.setOperateTime(qualityDeliverEntity.getCreateTime());
// 增加网点电话
BasicdataWarehouseEntity entityWarehouseId = basicdataWarehouseClient.getEntityWarehouseId(qualityDeliverEntity.getWarehouseId());
if (entityWarehouseId != null) {
nodeInfoVO.setOperateWarehousePhone(entityWarehouseId.getContactNumber());
}
nodeInfoVOList.add(nodeInfoVO);
}
if (planNum != 0) {
nodeInfoVO = new NodeInfoVO();
nodeInfoVO.setOperateName("配送签收");
nodeInfoVO.setOperateNumber(signNum + "/" + loadNum);
nodeInfoVO.setOperateWarehouseName(qualityDeliverEntity.getWarehouseName());
nodeInfoVO.setOperateTime(qualityDeliverEntity.getCreateTime());
// 增加网点电话
BasicdataWarehouseEntity entityWarehouseId = basicdataWarehouseClient.getEntityWarehouseId(qualityDeliverEntity.getWarehouseId());
if (entityWarehouseId != null) {
nodeInfoVO.setOperateWarehousePhone(entityWarehouseId.getContactNumber());
}
nodeInfoVOList.add(nodeInfoVO);
}
result.setNodeInfoVOList(nodeInfoVOList);
}
// 配送签收
return result;
}
private NodeInfoVO buildFristRuKu(Map<String, List<DistributionParcelListEntity>> groupedByWarehouse, String departureWarehouseName,Integer totalCount) {
private NodeInfoVO buildTrunklineByUnLoadCar(List<TrunklineCarsLoadScanEntity> trunklineCarsLoadScanEntities, String key) {
// 获取卸车集合
List<TrunklineCarsLoadScanEntity> collect = trunklineCarsLoadScanEntities.stream().filter(t -> t.getScanStatus().equals("2")).collect(Collectors.toList());
if (collect.isEmpty()) {
return null;
}
TrunklineCarsLoadScanEntity trunklineCarsLoadScanEntity = collect.get(0);
NodeInfoVO nodeInfoVO = new NodeInfoVO();
nodeInfoVO.setOperateName("干线到达");
nodeInfoVO.setOperateNumber(collect.size() + "");
nodeInfoVO.setOperateWarehouseName(trunklineCarsLoadScanEntity.getWarehouseName());
nodeInfoVO.setOperateTime(trunklineCarsLoadScanEntity.getCreateTime());
return nodeInfoVO;
}
private NodeInfoVO buildTrunklineByLoadCar(List<TrunklineCarsLoadScanEntity> trunklineCarsLoadScanEntities, String key) {
// 判断trunklineCarsLoadScanEntities 中 warehouseId 不是null的集合
List<TrunklineCarsLoadScanEntity> collect = trunklineCarsLoadScanEntities.stream().filter(t -> t.getWarehouseId() != null).collect(Collectors.toList());
if (collect.isEmpty()) {
return null;
}
TrunklineCarsLoadScanEntity trunklineCarsLoadScanEntity = collect.get(0);
NodeInfoVO nodeInfoVO = new NodeInfoVO();
nodeInfoVO.setOperateName("干线发车");
nodeInfoVO.setOperateNumber(collect.size() + "");
nodeInfoVO.setOperateWarehouseName(trunklineCarsLoadScanEntity.getWarehouseName());
nodeInfoVO.setOperateTime(trunklineCarsLoadScanEntity.getCreateTime());
return nodeInfoVO;
}
private NodeInfoVO buildFristRuKu(Map<String, List<DistributionParcelListEntity>> groupedByWarehouse, String departureWarehouseName, Integer totalCount) {
if(groupedByWarehouse.isEmpty()){
return null;
}
NodeInfoVO nodeInfoVO = new NodeInfoVO();
nodeInfoVO.setOperateName("入库");
@ -144,7 +415,7 @@ public class LogpmDataSearchServiceImpl implements ILogpmDataSearchService {
List<DistributionParcelListEntity> distributionParcelListEntities = groupedByWarehouse.get(departureWarehouseName);
// 获取第一个时间
nodeInfoVO.setOperateTime(distributionParcelListEntities.get(0).getCreateTime());
nodeInfoVO.setOperateNumber(distributionParcelListEntities.size()+"/"+totalCount);
nodeInfoVO.setOperateNumber(distributionParcelListEntities.size() + "/" + totalCount);
return nodeInfoVO;
}
@ -152,11 +423,11 @@ public class LogpmDataSearchServiceImpl implements ILogpmDataSearchService {
private String changeStatusName(String waybillStatus) {
if(waybillStatus==null){
waybillStatus="";
if (waybillStatus == null) {
waybillStatus = "";
}
switch (waybillStatus){
switch (waybillStatus) {
case "20":
return "已入库";
@ -187,22 +458,18 @@ public class LogpmDataSearchServiceImpl implements ILogpmDataSearchService {
}
}
private WarehouseNumberVO buildWarehouse(Map<String, List<DistributionParcelListEntity>> groupedByWarehouse,String warehouseName){
private WarehouseNumberVO buildWarehouse(Map<String, List<DistributionParcelListEntity>> groupedByWarehouse, String warehouseName) {
List<DistributionParcelListEntity> end = groupedByWarehouse.get(warehouseName);
if(end==null){
if (end == null) {
return null;
}
// 获取始发仓的在库数量
int num = end.stream().filter(t->"20".equals(t.getOrderPackageStatus()) && t.getQuantity()!=0).mapToInt(DistributionParcelListEntity::getQuantity).sum();
if(num != 0) {
int num = end.stream().filter(t -> "20".equals(t.getOrderPackageStatus()) && t.getQuantity() != 0).mapToInt(DistributionParcelListEntity::getQuantity).sum();
if (num != 0) {
WarehouseNumberVO endWarehouseNumber = new WarehouseNumberVO();
endWarehouseNumber.setNumber(num);
endWarehouseNumber.setWarehouseName(warehouseName);
@ -215,8 +482,6 @@ public class LogpmDataSearchServiceImpl implements ILogpmDataSearchService {
}
private R dataOrder(String order) {
// 通过订单查询运单号
List<WarehouseWaybillEntity> waybillVOByOrderCode = warehouseWaybillClient.findWaybillVOByOrderCode(order);
@ -226,7 +491,7 @@ public class LogpmDataSearchServiceImpl implements ILogpmDataSearchService {
Set<String> keys = groupedByWaybillNo.keySet();
List<WaybillInfoVO> data = new ArrayList<>();
for (String key : keys) {
WaybillInfoVO waybillInfoVO = dataWEaybill(key);
WaybillInfoVO waybillInfoVO = dataWEaybillByOrderCode(key,order);
data.add(waybillInfoVO);
}
return R.data(data);

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java

@ -345,6 +345,11 @@ public class DistributionParcelListClient implements IDistributionParcelListClie
return distributionParcelListService.findByWaybillNumber(waybillNumber);
}
@Override
public List<DistributionParcelListEntity> findByWaybillNumberAndOrderCode(String waybillNumber,String orderCode) {
return distributionParcelListService.findByWaybillNumberAndOrderCode(waybillNumber,orderCode);
}
@Override
public List<DistributionParcelListEntity> findEntityListByOrderCodeAndStatus(String orderCode, Long warehouseId, String packageStatus, @RequestParam String waybillNo) {
return distributionParcelListService.findEntityListByOrderCodeAndStatus(orderCode, warehouseId, packageStatus, waybillNo);

17
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/QualityDeliverClient.java

@ -78,4 +78,21 @@ public class QualityDeliverClient implements IQualityDeliverClient {
qualityDeliverService.updateBatchById(list);
}
}
@Override
public List<QualityDeliverEntity> findSignListByWaybillNumber(String waybillNumber) {
LambdaQueryWrapper<QualityDeliverEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(QualityDeliverEntity::getWaybillNumber,waybillNumber);
return qualityDeliverService.list(lambdaQueryWrapper);
}
@Override
public List<QualityDeliverEntity> findSignListByWaybillNumberAndOrderCode(String waybillNumber, String orderCode) {
LambdaQueryWrapper<QualityDeliverEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(QualityDeliverEntity::getWaybillNumber,waybillNumber);
lambdaQueryWrapper.eq(QualityDeliverEntity::getOrderCode,orderCode);
return qualityDeliverService.list(lambdaQueryWrapper);
}
}

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java

@ -171,6 +171,7 @@ public interface DistributionParcelListMapper extends BaseMapper<DistributionPar
List<Map<String, Integer>> selectAllErrorReservationOrder();
List<DistributionParcelListEntity> findByWaybillNumber(@Param("waybillNumber") String waybillNumber);
List<DistributionParcelListEntity> findByWaybillNumberAndOrderCode(@Param("waybillNumber") String waybillNumber,@Param("orderCode") String orderCode);
/**
* 还原包件状态 -- 未出库

13
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml

@ -2303,6 +2303,18 @@
limit 1
</select>
<select id="findByWaybillNumberAndOrderCode"
resultType="com.logpm.distribution.entity.DistributionParcelListEntity">
SELECT ldpl.* FROM logpm_distribution_parcel_list ldpl
WHERE ldpl.waybill_number = #{waybillNumber}
<if test="orderCode!=null and orderCode!=''">
and ldpl.order_code = #{orderCode}
</if>
and is_deleted=0
</select>
<select id="findListByOrderPackageCodesAndCode" resultType="com.logpm.distribution.entity.DistributionParcelListEntity">
select ldpl.id,
ldpl.order_package_code
@ -2313,7 +2325,6 @@
</foreach>
and ldpl.is_deleted = 0
</select>
<select id="findSignOrderPackageCodes" resultType="String">
select order_package_code
from logpm_distribution_parcel_list

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java

@ -179,6 +179,8 @@ public interface IDistributionParcelListService extends BaseService<Distribution
*/
List<DistributionParcelListEntity> findByWaybillNumber(String waybillId);
List<DistributionParcelListEntity> findByWaybillNumberAndOrderCode(String waybillNumber, String orderCode);
/**
* 批量还原包件状态
* @param packageIds

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java

@ -1040,6 +1040,11 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
return baseMapper.findByWaybillNumber(waybillNumber);
}
@Override
public List<DistributionParcelListEntity> findByWaybillNumberAndOrderCode(String waybillNumber,String orderCode) {
return baseMapper.findByWaybillNumberAndOrderCode(waybillNumber,orderCode);
}
@Override
public Integer restorePakcageByIds(List<Long> packageIds) {
return baseMapper.restorePakcageByIds(packageIds);

2
blade-service/logpm-report/src/main/java/com/logpm/report/ReportApplication.java

@ -13,4 +13,4 @@ public class ReportApplication {
public static void main(String[] args) {
BladeApplication.run(ModuleNameConstant.APPLICATION_REPORT_NAME, ReportApplication.class, args);
}
}
}

17
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklineCarsLoadScanClient.java

@ -1,5 +1,6 @@
package com.logpm.trunkline.feign;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.logpm.trunkline.entity.TrunklineCarsLoadScanEntity;
import com.logpm.trunkline.service.ITrunklineCarsLoadScanService;
import com.logpm.trunkline.service.ITrunklineCarsLoadService;
@ -55,4 +56,20 @@ public class TrunklineCarsLoadScanClient implements ITrunklineCarsLoadScanClient
public void removeLoadScanByIds(List<Long> scanloadIdList) {
trunklineCarsLoadScanService.deleteListByCarsLoadScanIds(scanloadIdList);
}
@Override
public List<TrunklineCarsLoadScanEntity> findAllListByWaybillNo(String waybillNo) {
LambdaQueryWrapper<TrunklineCarsLoadScanEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(TrunklineCarsLoadScanEntity::getWaybillNo,waybillNo);
return trunklineCarsLoadScanService.list(lambdaQueryWrapper);
}
@Override
public List<TrunklineCarsLoadScanEntity> findAllListByWaybillNoAndOrderCode(String waybillNo, String orderCode) {
LambdaQueryWrapper<TrunklineCarsLoadScanEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(TrunklineCarsLoadScanEntity::getWaybillNo,waybillNo);
lambdaQueryWrapper.eq(TrunklineCarsLoadScanEntity::getOrderCode,orderCode);
return trunklineCarsLoadScanService.list(lambdaQueryWrapper);
}
}

Loading…
Cancel
Save