Browse Source

备货重构、增加售后mq配置、工单导出增加责任方、工单号规则修改、预约单bug修复

pre-production
汤建军 3 months ago
parent
commit
36529ca57e
  1. 12
      blade-biz-common/src/main/java/org/springblade/common/constant/RabbitConstant.java
  2. 4
      blade-biz-common/src/main/java/org/springblade/common/constant/aftersales/ProcessorTypesOfStatusConstant.java
  3. 3
      blade-biz-common/src/main/java/org/springblade/common/constant/basiccode/BasicCodeTypeConstant.java
  4. 57
      blade-biz-common/src/main/java/org/springblade/common/constant/common/RoleConstant.java
  5. 2
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesProcessorEntity.java
  6. 1
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesWorkOrderEntity.java
  7. 1
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderVO.java
  8. 3
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DisStockOrdercodeRecoEntity.java
  9. 17
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockEntity.java
  10. 6
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistrilbutionBillLadingEntity.java
  11. 3
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistrilbutionBillLadingAppVO.java
  12. 56
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppStockUpClientVO.java
  13. 41
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppStockUpInventoryConfiglVO.java
  14. 46
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppStockUpInventoryDetailVO.java
  15. 43
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppStockUpOrderDetailVO.java
  16. 38
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppStockUpPackageDetailVO.java
  17. 42
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppStockUpScanDetailVO.java
  18. 62
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppStockUpVO.java
  19. 41
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppStockUpZeroOrderDetailVO.java
  20. 80
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseInventoryLogEntity.java
  21. 39
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseInventoryLogClient.java
  22. 5
      blade-service/logpm-aftersales/pom.xml
  23. 48
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/aspect/RabbitAnnotationAspect.java
  24. 155
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/config/CustomMessageConverter.java
  25. 54
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/config/RabbitMqConfiguration.java
  26. 119
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java
  27. 54
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/dto/AftersalesWorkOrderQueryDTO.java
  28. 8
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/jobhandler/AftersalesXxlJob.java
  29. 19
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.java
  30. 163
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml
  31. 14
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/IAftersalesWorkOrderService.java
  32. 248
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java
  33. 245
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionStockupAppController.java
  34. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/StockupDTO.java
  35. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryDetailsMapper.java
  36. 47
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryDetailsMapper.xml
  37. 48
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml
  38. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationStocklistMapper.java
  39. 24
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationStocklistMapper.xml
  40. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.java
  41. 17
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.xml
  42. 9
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockMapper.java
  43. 23
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockMapper.xml
  44. 121
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.java
  45. 1008
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml
  46. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.java
  47. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml
  48. 19
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java
  49. 9
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockService.java
  50. 103
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockupService.java
  51. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillLadingService.java
  52. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java
  53. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  54. 9
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java
  55. 26
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  56. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockServiceImpl.java
  57. 2123
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java
  58. 22
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java
  59. 46
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseInventoryLogController.java
  60. 17
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseInventoryLogClient.java
  61. 10
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseInventoryLogMapper.java
  62. 6
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseInventoryLogMapper.xml
  63. 10
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseInventoryLogService.java
  64. 23
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseInventoryLogServiceImpl.java

12
blade-biz-common/src/main/java/org/springblade/common/constant/RabbitConstant.java

@ -231,5 +231,17 @@ public interface RabbitConstant {
/****************售后 start *************************/
String AFTERSALES_QUEUE = "aftersalesr_queue" + ModuleNameConstant.DEVAUTH;
String AFTERSALES_EXCHANGE = "aftersales_exchange" + ModuleNameConstant.DEVAUTH;
String AFTERSALES_ROUTING = "aftersales_routing" + ModuleNameConstant.DEVAUTH;
String AFTERSALES_OVER_TIME_QUEUE = "aftersales_over_time_queue" + ModuleNameConstant.DEVAUTH;
String AFTERSALES_OVER_TIME_EXCHANGE = "aftersales_over_time_exchange" + ModuleNameConstant.DEVAUTH;
String AFTERSALES_OVER_TIME_ROUTING = "aftersales_over_time_routing" + ModuleNameConstant.DEVAUTH;
}

4
blade-biz-common/src/main/java/org/springblade/common/constant/aftersales/ProcessorTypesOfStatusConstant.java

@ -2,7 +2,9 @@ package org.springblade.common.constant.aftersales;
public enum ProcessorTypesOfStatusConstant {
zerenfang("责任方","1"),
chulifang("处理方","2");
chulifang("处理方","2"),
ziji("自己","3")
;
/**
* 状态

3
blade-biz-common/src/main/java/org/springblade/common/constant/basiccode/BasicCodeTypeConstant.java

@ -41,7 +41,8 @@ public enum BasicCodeTypeConstant {
APPOINTMENT_CODE("预约单码","22"),
// 备货码
STOCK_CODE("备货码","23"),
RENTION_CODE("回库码","24");
RENTION_CODE("回库码","24"),
AFTERSALSE_CODE("工单码","25");
/**

57
blade-biz-common/src/main/java/org/springblade/common/constant/common/RoleConstant.java

@ -0,0 +1,57 @@
package org.springblade.common.constant.common;
/**
* 订单冻结状态枚举
* 对应码表 freeze_status
* @author pref
*/
public enum RoleConstant {
ADMINISTRATOR("超级管理员","administrator"),
ADMIN("管理员","admin"),
WAREHOUSE_MANAGER("仓库经理","仓库经理"),
DELIVERY_DRIVER("配送司机","配送司机"),
WAREHOUSE_MANAGEMENT("仓库库管","仓库库管"),
DISTRIBUTOR("经销商管理权限","经销商管理"),
PICKING_STAFF("拣货员","拣货员"),
LOADING_AND_UNLOADING_WORKERS("装卸工","装卸工"),
CUSTOMER_SERVICE_SUPERVISOR("客服主管","客服主管"),
OPERATION_SPECIALIST ("运营专员","运营专员"),
HEADQUARTERS_CUSTOMER_SERVICE_MANAGER("总部客服经理","总部客服经理"),
WAREHOUSE_CUSTOMER_SERVICE("仓库客服","仓库客服"),
HEADQUARTERS_CUSTOMER_SERVICE("总部客服","总部客服");
/**
* 状态
*/
private String name;
/**
*
*/
private String value;
private RoleConstant(String name, String value) {
this.name = name;
this.value = value;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}

2
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesProcessorEntity.java

@ -82,7 +82,7 @@ public class AftersalesProcessorEntity extends TenantEntity {
@ApiModelProperty(value = "状态")
private String conditions;
/**
* 类型 类型 1 责任方 2 处理方
* 类型 类型 1 责任方 2 处理方 3 自己
*/
@ApiModelProperty(value = "类型")
private String typesOf;

1
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesWorkOrderEntity.java

@ -320,6 +320,7 @@ public class AftersalesWorkOrderEntity extends TenantEntity {
* 品牌名称
*/
private String brandName;
/**
* 离职状态
*/

1
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderVO.java

@ -119,6 +119,7 @@ public class AftersalesWorkOrderVO extends AftersalesWorkOrderEntity {
private String ids;
private String typeServiceName;
private String responsibilityName;
/**
* 是否能申述

3
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DisStockOrdercodeRecoEntity.java

@ -52,6 +52,9 @@ public class DisStockOrdercodeRecoEntity extends TenantEntity {
private String codeType;
@ApiModelProperty(value = "仓库Id")
private Long warehouseId;
@ApiModelProperty(value = "库存品ID")
private Long stockListId;
/**

17
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockEntity.java

@ -24,6 +24,8 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.util.Date;
/**
* PAD备货扫描记录 实体类
*
@ -184,7 +186,22 @@ public class DistributionStockEntity extends TenantEntity {
@ApiModelProperty(value = "备货区Id")
private Long stockupId;
@ApiModelProperty(value = "仓库ID")
private Long warehouseId;
@ApiModelProperty(value = "仓库名称")
private String warehouseName;
@ApiModelProperty(value = "扫码类型 1包件 2库存品")
private Integer type;
@ApiModelProperty(value = "取消状态 0否 1是")
private Integer cancelStatus;
@ApiModelProperty(value = "取消时间")
private Date cancelTime;
@ApiModelProperty(value = "取消操作人")
private String cancelUser;
}

6
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistrilbutionBillLadingEntity.java

@ -186,6 +186,12 @@ public class DistrilbutionBillLadingEntity extends TenantEntity {
@ApiModelProperty(value = "仓库名称")
private String warehouseName;
/**
* 仓库名称
*/
@ApiModelProperty(value = "客户Id")
private Long clientId;

3
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistrilbutionBillLadingAppVO.java

@ -94,6 +94,9 @@ public class DistrilbutionBillLadingAppVO extends DistrilbutionBillLadingEntity
private Integer inventoryNub;//库存品数
@ApiModelProperty(value = "包装规格")
private String packingSpecification;//包装规格
@ApiModelProperty(value = "物料编码")
private String cargoNumber;//包装规格
private List<DistrilbutionAppBillLadingDetailVO> list = new ArrayList<>();

56
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppStockUpClientVO.java

@ -0,0 +1,56 @@
/*
* 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.vo.app;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 在库订单包件清单 视图实体类
*
* @author cyz
* @since 2023-06-13
*/
@Data
public class DistributionAppStockUpClientVO implements Serializable {
private static final long serialVersionUID = 1L;
private Long reservationId;
private String reservationCode;
private String marketName;
private String consignee;
private Integer typeService;
private String deliveryTypeName;
private Integer orderNum;
private Integer planNum;
private Integer scanNum;
private Integer inventoryNum;
private List<DistributionAppStockUpOrderDetailVO> stockUpOrderDetailVOList;
private List<DistributionAppStockUpInventoryDetailVO> stockUpInventoryDetailVOList;
private List<DistributionAppStockUpZeroOrderDetailVO> stockUpZeroOrderDetailVOList;
private List<DistributionAppStockUpPackageDetailVO> deliveryPackageDetailList;
}

41
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppStockUpInventoryConfiglVO.java

@ -0,0 +1,41 @@
/*
* 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.vo.app;
import lombok.Data;
import java.io.Serializable;
/**
* 在库订单包件清单 视图实体类
*
* @author cyz
* @since 2023-06-13
*/
@Data
public class DistributionAppStockUpInventoryConfiglVO implements Serializable {
private String orderPackageCode;
private String descriptionGoods;
private String clientName;
private String address;
}

46
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppStockUpInventoryDetailVO.java

@ -0,0 +1,46 @@
/*
* 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.vo.app;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
/**
* 在库订单包件清单 视图实体类
*
* @author cyz
* @since 2023-06-13
*/
@Data
public class DistributionAppStockUpInventoryDetailVO implements Serializable {
private String cargoNumber;
private String materialName;
private String cargoNorms;
private Integer planNum;
private Integer realNum;
private String allocations;
private List<Map<String, Object>> allocationList;
}

43
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppStockUpOrderDetailVO.java

@ -0,0 +1,43 @@
/*
* 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.vo.app;
import lombok.Data;
import java.io.Serializable;
/**
* 在库订单包件清单 视图实体类
*
* @author cyz
* @since 2023-06-13
*/
@Data
public class DistributionAppStockUpOrderDetailVO implements Serializable {
private Long orderId;
private String waybillNumber;
private String orderCode;
private Integer planNum;
private Integer scanNum;
private String allocationNames;
}

38
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppStockUpPackageDetailVO.java

@ -0,0 +1,38 @@
/*
* 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.vo.app;
import lombok.Data;
import java.io.Serializable;
/**
* 在库订单包件清单 视图实体类
*
* @author cyz
* @since 2023-06-13
*/
@Data
public class DistributionAppStockUpPackageDetailVO implements Serializable {
private String orderCode;
private String orderPackageCode;
private String goodsAllocation;
private String pallet;
private String stockupStatusName;
}

42
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppStockUpScanDetailVO.java

@ -0,0 +1,42 @@
/*
* 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.vo.app;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 在库订单包件清单 视图实体类
*
* @author cyz
* @since 2023-06-13
*/
@Data
public class DistributionAppStockUpScanDetailVO implements Serializable {
private static final long serialVersionUID = 1L;
private Long Id;
private String orderPackageCode;
private String typeName;
private String goodsName;
private String orderCode;
private String stockupAllocation;
}

62
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppStockUpVO.java

@ -0,0 +1,62 @@
/*
* 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.vo.app;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* 在库订单包件清单 视图实体类
*
* @author cyz
* @since 2023-06-13
*/
@Data
public class DistributionAppStockUpVO implements Serializable {
private static final long serialVersionUID = 1L;
private Long stockupId;
private String stockupCode;
private String forkliftName;
private String consignee;
private String deliveryTypeName;
private String stockupStatusName;
private Integer orderNum;
private Integer planNum;
private Integer scanNum;
private Integer inventoryNum;
private List<DistributionAppStockUpClientVO> stockUpClientVOList;
}

41
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppStockUpZeroOrderDetailVO.java

@ -0,0 +1,41 @@
/*
* 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.vo.app;
import lombok.Data;
import java.io.Serializable;
/**
* 在库订单包件清单 视图实体类
*
* @author cyz
* @since 2023-06-13
*/
@Data
public class DistributionAppStockUpZeroOrderDetailVO implements Serializable {
private Long orderId;
private Long packageId;
private String waybillNumber;
private String orderCode;
private String categoryName;
private Integer planNum;
private String scanNum;
}

80
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseInventoryLogEntity.java

@ -0,0 +1,80 @@
package com.logpm.warehouse.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springblade.core.mp.base.BaseEntity;
import java.math.BigDecimal;
@Data
@ApiModel(value = "库存品操作日志",description = "")
@TableName("logpm_warehouse_inventory_log")
public class WarehouseInventoryLogEntity extends BaseEntity {
/**
* 预留1
*/
@ApiModelProperty(value = "预留1")
private String reserve1;
/**
* 预留2
*/
@ApiModelProperty(value = "预留2")
private String reserve2;
/**
* 预留3
*/
@ApiModelProperty(value = "预留3")
private String reserve3;
/**
* 预留4
*/
@ApiModelProperty(value = "预留4")
private String reserve4;
/**
* 预留5
*/
@ApiModelProperty(value = "预留5")
private String reserve5;
/**
* 预留5
*/
@ApiModelProperty(value = "仓库ID")
private Long warehouseId;
/**
* 预留5
*/
@ApiModelProperty(value = "仓库名称")
private String warehouseName;
/**
* 预留5
*/
@ApiModelProperty(value = "描述")
private String content;
/**
* 预留5
*/
@ApiModelProperty(value = "操作人")
private String operationUser;
/**
* 预留5
*/
@ApiModelProperty(value = "操作节点 待定")
private String operationNode;
}

39
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseInventoryLogClient.java

@ -0,0 +1,39 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* ReWarehouse and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* ReWarehouses of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* ReWarehouses 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 Warehouse.
* 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.warehouse.feign;
import com.logpm.warehouse.entity.WarehouseConfigEntity;
import org.springblade.common.constant.ModuleNameConstant;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
/**
* 备货扫描记录 Feign接口类
*
* @author lmy
* @since 2023-08-24
*/
@FeignClient(
value = ModuleNameConstant.APPLICATION_WAREHOUSE_NAME
)
public interface IWarehouseInventoryLogClient {
}

5
blade-service/logpm-aftersales/pom.xml

@ -102,6 +102,11 @@
<version>3.2.0.RELEASE</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>logpm-basic-api</artifactId>
<version>3.2.0.RELEASE</version>
</dependency>
<!--mq-->
<dependency>
<groupId>org.springframework.boot</groupId>

48
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/aspect/RabbitAnnotationAspect.java

@ -0,0 +1,48 @@
package com.logpm.aftersales.aspect;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springblade.core.secure.utils.AuthUtil;
import org.springframework.stereotype.Component;
@Aspect
@Component
@Slf4j
public class RabbitAnnotationAspect {
/**
* 该方法为一个切面用于对标记了@RabbitListener注解的方法进行增强主要增加了日志记录和数据源上下文处理的功能
*
* @param joinPoint 切面的连接点表示当前被拦截的方法
* @return 返回被拦截方法的执行结果
* @throws Throwable 如果执行过程中发生异常则抛出
*/
@Around("@annotation(org.springframework.amqp.rabbit.annotation.RabbitListener)")
public Object rabbitMethods(ProceedingJoinPoint joinPoint) throws Throwable {
// 在方法执行前,获取当前租户ID并设置到数据源上下文中
String tenantId = AuthUtil.getTenantId();
DynamicDataSourceContextHolder.push(tenantId);
// 执行原方法
Object result = joinPoint.proceed();
// 在方法执行后,从数据源上下文中移除租户ID
DynamicDataSourceContextHolder.poll();
return result;
}
@Around("@annotation(org.springframework.amqp.rabbit.annotation.RabbitHandler)")
public Object rabbitHandlerMethods(ProceedingJoinPoint joinPoint) throws Throwable {
// 在方法执行前,获取当前租户ID并设置到数据源上下文中
String tenantId = AuthUtil.getTenantId();
DynamicDataSourceContextHolder.push(tenantId);
// 执行原方法
Object result = joinPoint.proceed();
// 在方法执行后,从数据源上下文中移除租户ID
DynamicDataSourceContextHolder.poll();
return result;
}
}

155
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/config/CustomMessageConverter.java

@ -0,0 +1,155 @@
package com.logpm.aftersales.config;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.utils.ThreadLocalUtil;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessageProperties;
import org.springframework.amqp.support.converter.AllowedListDeserializingMessageConverter;
import org.springframework.amqp.support.converter.MessageConversionException;
import org.springframework.amqp.utils.SerializationUtils;
import org.springframework.beans.factory.BeanClassLoaderAware;
import org.springframework.http.HttpHeaders;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.remoting.rmi.CodebaseAwareObjectInputStream;
import org.springframework.stereotype.Component;
import org.springframework.util.ClassUtils;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import java.io.*;
import java.util.List;
import java.util.Map;
/**
* @author zhaoqiaobo
* @create 2024-05-08
*/
@Component
public class CustomMessageConverter extends AllowedListDeserializingMessageConverter implements BeanClassLoaderAware {
private final String defaultCharset = "UTF-8";
private ClassLoader beanClassLoader = ClassUtils.getDefaultClassLoader();
private String codebaseUrl;
@Deprecated
public void setCodebaseUrl(String codebaseUrl) {
this.codebaseUrl = codebaseUrl;
}
@Override
public Object fromMessage(Message message) throws MessageConversionException {
Object content = null;
MessageProperties properties = message.getMessageProperties();
if (properties != null) {
String contentType = properties.getContentType();
if (contentType != null && contentType.startsWith("text")) {
String encoding = properties.getContentEncoding();
if (encoding == null) {
encoding = "UTF-8";
}
try {
content = new String(message.getBody(), encoding);
} catch (UnsupportedEncodingException var8) {
throw new MessageConversionException("failed to convert text-based Message content", var8);
}
} else if (contentType != null && contentType.equals("application/x-java-serialized-object")) {
try {
content = SerializationUtils.deserialize(this.createObjectInputStream(new ByteArrayInputStream(message.getBody()), this.codebaseUrl));
} catch (IllegalArgumentException | IllegalStateException | IOException var7) {
throw new MessageConversionException("failed to convert serialized Message content", var7);
}
}
}
Map<String, Object> headers = properties.getHeaders();
HttpHeaders httpHeaders = new HttpHeaders();
for (Map.Entry<String, Object> entry : headers.entrySet()) {
if (StrUtil.equals("Blade-Auth", entry.getKey())
|| StrUtil.equals("Authorization", entry.getKey())
|| StrUtil.equals("blade-auth", entry.getKey())
|| StrUtil.equals("authorization", entry.getKey())) {
List value = (List) entry.getValue();
for (Object o : value) {
httpHeaders.add(entry.getKey(), String.valueOf(o));
}
}
}
ThreadLocalUtil.put("bladeContext", httpHeaders);
Object bladeUser = headers.get("bladeUser");
MockHttpServletRequest request = new MockHttpServletRequest();
BladeUser bladeUser1 = JSONUtil.toBean(bladeUser.toString(), BladeUser.class);
request.setAttribute("_BLADE_USER_REQUEST_ATTR_", bladeUser1);
RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(request));
if (content == null) {
content = message.getBody();
}
return content;
}
@Override
protected Message createMessage(Object object, MessageProperties messageProperties) throws MessageConversionException {
byte[] bytes = null;
if (object instanceof byte[]) {
bytes = (byte[]) object;
messageProperties.setContentType("application/octet-stream");
} else if (object instanceof String) {
try {
bytes = ((String) object).getBytes(this.defaultCharset);
} catch (UnsupportedEncodingException var6) {
throw new MessageConversionException("failed to convert to Message content", var6);
}
messageProperties.setContentType("text/plain");
messageProperties.setContentEncoding(this.defaultCharset);
} else if (object instanceof Serializable) {
try {
bytes = SerializationUtils.serialize(object);
} catch (IllegalArgumentException var5) {
throw new MessageConversionException("failed to convert to serialized Message content", var5);
}
messageProperties.setContentType("application/x-java-serialized-object");
}
HttpHeaders headers = ThreadLocalUtil.get("bladeContext");
if (headers != null && !headers.isEmpty()) {
headers.forEach((key, values) -> {
values.forEach((value) -> {
messageProperties.setHeader(key, new String[]{value});
});
});
}
BladeUser user = AuthUtil.getUser();
BladeUser bladeUser = new BladeUser();
bladeUser.setTenantId(user.getTenantId());
bladeUser.setUserId(user.getUserId());
bladeUser.setAccount(user.getAccount());
bladeUser.setRoleId(user.getRoleId());
messageProperties.setHeader("bladeUser", JSONUtil.toJsonStr(bladeUser));
if (bytes != null) {
messageProperties.setContentLength(bytes.length);
return new Message(bytes, messageProperties);
} else {
throw new IllegalArgumentException(this.getClass().getSimpleName() + " only supports String, byte[] and Serializable payloads, received: " + object.getClass().getName());
}
}
@Override
public void setBeanClassLoader(ClassLoader classLoader) {
this.beanClassLoader = beanClassLoader;
}
protected ObjectInputStream createObjectInputStream(InputStream is, String codebaseUrl) throws IOException {
return new CodebaseAwareObjectInputStream(is, this.beanClassLoader, codebaseUrl) {
@Override
protected Class<?> resolveClass(ObjectStreamClass classDesc) throws IOException, ClassNotFoundException {
Class<?> clazz = super.resolveClass(classDesc);
CustomMessageConverter.this.checkAllowedList(clazz);
return clazz;
}
};
}
}

54
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/config/RabbitMqConfiguration.java

@ -0,0 +1,54 @@
package com.logpm.aftersales.config;
import com.alibaba.nacos.shaded.com.google.common.collect.Maps;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.RabbitConstant;
import org.springframework.amqp.core.*;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
import org.springframework.amqp.rabbit.connection.CorrelationData;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.HashMap;
import java.util.Map;
/**
* RabbitMQ配置主要是配置队列如果提前存在该队列可以省略本配置类
*
* @author yangkai.shen
*/
@Slf4j
@Configuration
public class RabbitMqConfiguration {
@Bean
public RabbitTemplate createRabbitTemplate(ConnectionFactory connectionFactory){
RabbitTemplate template = new RabbitTemplate();
template.setConnectionFactory(connectionFactory);
template.setMandatory(true);
template.setMessageConverter(new CustomMessageConverter());
template.setConfirmCallback(new RabbitTemplate.ConfirmCallback() {
@Override
public void confirm(CorrelationData correlationData, boolean b, String s) {
System.out.println("确认回调-相关数据:"+correlationData);
System.out.println("确认回调-确认情况:"+b);
System.out.println("确认回调-原因:"+s);
}
});
template.setReturnsCallback(new RabbitTemplate.ReturnsCallback() {
@Override
public void returnedMessage(ReturnedMessage returnedMessage) {
System.out.println("返回回调-消息:"+returnedMessage.getMessage());
System.out.println("返回回调-回应码:"+returnedMessage.getReplyCode());
System.out.println("返回回调-回应信息:"+returnedMessage.getReplyText());
System.out.println("返回回调-交换机:"+returnedMessage.getExchange());
System.out.println("返回回调-路由键:"+returnedMessage.getRoutingKey());
}
});
return template;
}
}

119
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java

@ -26,6 +26,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.aftersales.dto.AftersalesWorkOrderDTO;
import com.logpm.aftersales.dto.AftersalesWorkOrderListExcelDTO;
import com.logpm.aftersales.dto.AftersalesWorkOrderQueryDTO;
import com.logpm.aftersales.entity.AftersaleSurveyRecordEntity;
import com.logpm.aftersales.entity.AftersalesAppealEntity;
import com.logpm.aftersales.entity.AftersalesCompletionRecipientEntity;
@ -47,8 +48,11 @@ import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import jodd.system.SystemUtil;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.RabbitConstant;
import org.springblade.common.constant.factorydata.FactoryDataConstants;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.log.exception.ServiceException;
@ -59,6 +63,10 @@ import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.system.entity.User;
import org.springframework.amqp.AmqpException;
import org.springframework.amqp.core.*;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
@ -74,13 +82,10 @@ import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException;
import java.math.BigDecimal;
import java.nio.charset.StandardCharsets;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
@ -103,6 +108,8 @@ public class AftersalesWorkOrderController extends BladeController {
private final IAftersalesPersonResponsibleService aftersalesPersonResponsibleService;
private final IAftersaleSurveyRecordService aftersaleSurveyRecordService;
private final IAftersalesCompletionRecipientService aftersalesCompletionRecipientService;
@Autowired
private RabbitTemplate rabbitTemplate;
/**
* 客服异常工单 详情
@ -151,9 +158,28 @@ public class AftersalesWorkOrderController extends BladeController {
log.error("工单查询系统异常》》》{}", e.getMessage());
return R.fail("系统异常!");
}
}
/**
* 客服异常工单 查询异常工单完整数据集合
*/
@PostMapping("/pageAllList")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "查询异常工单完整数据集合", notes = "传入aftersalesWorkOrder")
public R ageAllList(@ApiIgnore @RequestBody AftersalesWorkOrderQueryDTO workOrderQueryDTO, Query query) {
try {
R r = aftersalesWorkOrderService.ageAllList(workOrderQueryDTO, Condition.getPage(query));
return r;
} catch (Exception e) {
log.error("工单查询系统异常》》》{}", e.getMessage());
return R.fail("系统异常!");
}
}
/**
* 客服异常工单 查询异常工单理赔信息
*/
@ -681,6 +707,8 @@ public class AftersalesWorkOrderController extends BladeController {
}
/**
* 客服异常工单 仓库查询待处理的异常工单
*/
@ -783,22 +811,23 @@ public class AftersalesWorkOrderController extends BladeController {
data.add(8, exportDatum.getWaybillMall());
data.add(9, exportDatum.getFirst());
data.add(10, exportDatum.getWorkOrderStatusName());
data.add(11, exportDatum.getBusinessName());
data.add(12, sdf.format(exportDatum.getCreateTime()));
data.add(13, sdf.format(exportDatum.getEndCreateTime()));
data.add(14, Objects.isNull(exportDatum.getUpdateTime()) ? "" : sdf.format(exportDatum.getUpdateTime()));
data.add(11, exportDatum.getResponsibilityName());
data.add(12, exportDatum.getBusinessName());
data.add(13, sdf.format(exportDatum.getCreateTime()));
data.add(14, sdf.format(exportDatum.getEndCreateTime()));
data.add(15, Objects.isNull(exportDatum.getUpdateTime()) ? "" : sdf.format(exportDatum.getUpdateTime()));
Date createTime = exportDatum.getCreateTime();
Date updateTime = Objects.isNull(exportDatum.getUpdateTime()) ? new Date() : exportDatum.getUpdateTime();
int a = (int) ((updateTime.getTime() - createTime.getTime()) / (1000 * 3600 * 24));
data.add(15, a > 2 ? "是" : "否");
data.add(16, exportDatum.getCustomerServiceName());
data.add(17, exportDatum.getHeadquartersName());
data.add(18, exportDatum.getResultTypes());
data.add(19, exportDatum.getTotalAmountNum());
data.add(20, exportDatum.getCompleteTime());
data.add(21, exportDatum.getIsAppeal());
data.add(22, exportDatum.getAppealStatusName());
data.add(23, exportDatum.getProcessNumber());
data.add(16, a > 2 ? "是" : "否");
data.add(17, exportDatum.getWarehouseServiceName());
data.add(18, exportDatum.getHeadquartersName());
data.add(19, exportDatum.getResultTypes());
data.add(20, exportDatum.getTotalAmountNum());
data.add(21, exportDatum.getCompleteTime());
data.add(22, exportDatum.getIsAppeal());
data.add(23, exportDatum.getAppealStatusName());
data.add(24, exportDatum.getProcessNumber());
//查询此工单是否存在有责任方如果存在有责任方完善表头
// List<AftersalesPersonResponsibleEntity> entityList = aftersalesPersonResponsibleService.list(Wrappers.<AftersalesPersonResponsibleEntity>query().lambda()
// .eq(AftersalesPersonResponsibleEntity::getWordOrderId, exportDatum.getId())
@ -865,15 +894,16 @@ public class AftersalesWorkOrderController extends BladeController {
data.add(8, exportDatum.getWaybillMall());
data.add(9, exportDatum.getFirst());
data.add(10, exportDatum.getWorkOrderStatusName());
data.add(11, exportDatum.getBusinessName());
data.add(12, sdf.format(exportDatum.getCreateTime()));
data.add(13, sdf.format(exportDatum.getEndCreateTime()));
data.add(14, Objects.isNull(exportDatum.getUpdateTime()) ? "" : sdf.format(exportDatum.getUpdateTime()));
data.add(11, exportDatum.getResponsibilityName());
data.add(12, exportDatum.getBusinessName());
data.add(13, sdf.format(exportDatum.getCreateTime()));
data.add(14, sdf.format(exportDatum.getEndCreateTime()));
data.add(15, Objects.isNull(exportDatum.getUpdateTime()) ? "" : sdf.format(exportDatum.getUpdateTime()));
Date createTime = exportDatum.getCreateTime();
Date updateTime = Objects.isNull(exportDatum.getUpdateTime()) ? new Date() : exportDatum.getUpdateTime();
int a = (int) ((updateTime.getTime() - createTime.getTime()) / (1000 * 3600 * 24));
data.add(15, a > 2 ? "是" : "否");
data.add(16, exportDatum.getCustomerServiceName());
data.add(16, a > 2 ? "是" : "否");
data.add(17, exportDatum.getWarehouseServiceName());
if (personResponsibleMap!= null && Objects.isNull(personResponsibleMap.get(exportDatum.getId()))) {
handleResponsibility(basicTitle, entityList, data);
}
@ -938,17 +968,18 @@ public class AftersalesWorkOrderController extends BladeController {
data.add(8, exportDatum.getWaybillMall());
data.add(9, exportDatum.getFirst());
data.add(10, exportDatum.getWorkOrderStatusName());
data.add(11, exportDatum.getBusinessName());
data.add(12, sdf.format(exportDatum.getCreateTime()));
data.add(13, sdf.format(exportDatum.getEndCreateTime()));
data.add(14, Objects.isNull(exportDatum.getUpdateTime()) ? "" : sdf.format(exportDatum.getUpdateTime()));
data.add(11, exportDatum.getResponsibilityName());
data.add(12, exportDatum.getBusinessName());
data.add(13, sdf.format(exportDatum.getCreateTime()));
data.add(14, sdf.format(exportDatum.getEndCreateTime()));
data.add(15, Objects.isNull(exportDatum.getUpdateTime()) ? "" : sdf.format(exportDatum.getUpdateTime()));
Date createTime = exportDatum.getCreateTime();
Date updateTime = Objects.isNull(exportDatum.getUpdateTime()) ? new Date() : exportDatum.getUpdateTime();
int a = (int) ((updateTime.getTime() - createTime.getTime()) / (1000 * 3600 * 24));
data.add(15, a > 2 ? "是" : "否");
data.add(16, "");
data.add(17, exportDatum.getResultTypes());
data.add(18, exportDatum.getTotalAmountNum());
data.add(16, a > 2 ? "是" : "否");
data.add(17, "");
data.add(18, exportDatum.getResultTypes());
data.add(19, exportDatum.getTotalAmountNum());
//查询此工单是否存在有责任方如果存在有责任方完善表头
if (personResponsibleMap!= null && !Objects.isNull(personResponsibleMap.get(exportDatum.getId()))) {
@ -1016,19 +1047,20 @@ public class AftersalesWorkOrderController extends BladeController {
data.add(8, exportDatum.getWaybillMall());
data.add(9, exportDatum.getFirst());
data.add(10, exportDatum.getWorkOrderStatusName());
data.add(11, exportDatum.getBusinessName());
data.add(12, sdf.format(exportDatum.getCreateTime()));
data.add(13, sdf.format(exportDatum.getEndCreateTime()));
data.add(14, Objects.isNull(exportDatum.getUpdateTime()) ? "" : sdf.format(exportDatum.getUpdateTime()));
data.add(11, exportDatum.getResponsibilityName());
data.add(12, exportDatum.getBusinessName());
data.add(13, sdf.format(exportDatum.getCreateTime()));
data.add(14, sdf.format(exportDatum.getEndCreateTime()));
data.add(15, Objects.isNull(exportDatum.getUpdateTime()) ? "" : sdf.format(exportDatum.getUpdateTime()));
Date createTime = exportDatum.getCreateTime();
Date updateTime = Objects.isNull(exportDatum.getUpdateTime()) ? new Date() : exportDatum.getUpdateTime();
int a = (int) ((updateTime.getTime() - createTime.getTime()) / (1000 * 3600 * 24));
data.add(15, a > 2 ? "是" : "否");
data.add(16, exportDatum.getCustomerServiceName());
data.add(17, exportDatum.getHeadquartersName());
data.add(18, exportDatum.getResultTypes());
data.add(19, exportDatum.getTotalAmountNum());
data.add(20, "");
data.add(16, a > 2 ? "是" : "否");
data.add(17, exportDatum.getWarehouseServiceName());
data.add(18, exportDatum.getHeadquartersName());
data.add(19, exportDatum.getResultTypes());
data.add(20, exportDatum.getTotalAmountNum());
data.add(21, "");
//查询此工单是否存在有责任方如果存在有责任方完善表头
AftersalesWorkOrderDTO workOrderDTO = new AftersalesWorkOrderDTO();
workOrderDTO.setId(exportDatum.getId());
@ -1399,4 +1431,5 @@ public class AftersalesWorkOrderController extends BladeController {
}
}
}

54
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/dto/AftersalesWorkOrderQueryDTO.java

@ -0,0 +1,54 @@
/*
* 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.aftersales.dto;
import com.logpm.aftersales.entity.*;
import com.logpm.aftersales.vo.AftersalesAbnormalPackageVO;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
import java.util.List;
/**
* 客服异常工单 数据传输对象实体类
*
* @author BladeX
* @since 2023-11-17
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class AftersalesWorkOrderQueryDTO extends AftersalesWorkOrderEntity {
private String workOrderType;
private String discoveryNode;
private String workOrderNumber;
private String waybillNumber;
private String orderCode;
private String packageCode;
private String brandName;
private String waybillMall;
private String first;
private String workOrderStatus;
private String processedBy;
private String ceator;
private Date startCreateTime;
private Date endCreateTime;
private Date createTime;
}

8
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/jobhandler/AftersalesXxlJob.java

@ -72,6 +72,14 @@ public class AftersalesXxlJob {
}
@XxlJob("overTimeAfterSales")
public ReturnT<String> overTimeAfterSales(String param) throws Exception {
logger.info("修改预账单工单是否可以申述>>>>>>>>{}", param);
aftersalesWorkOrderService.overTimeAfterSales();
return ReturnT.SUCCESS;
}
/**
* 根据异常列表创建异常工单
*

19
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.java

@ -17,6 +17,8 @@
package com.logpm.aftersales.mapper;
import com.logpm.aftersales.dto.AftersalesWorkOrderDTO;
import com.logpm.aftersales.dto.AftersalesWorkOrderQueryDTO;
import com.logpm.aftersales.entity.AftersalesProcessorEntity;
import com.logpm.aftersales.entity.AftersalesSettlementEntity;
import com.logpm.aftersales.entity.AftersalesWorkOrderEntity;
import com.logpm.aftersales.vo.AftersalesAbnormalPackageVO;
@ -52,7 +54,7 @@ public interface AftersalesWorkOrderMapper extends BaseMapper<AftersalesWorkOrde
/**
* 获取导出数据
*
* @param queryWrapper
* @param
* @return
*/
List<AftersalesWorkOrderVO> exportAftersalesWorkOrder(@Param("param") AftersalesWorkOrderEntity workOrderEntity);
@ -126,4 +128,19 @@ public interface AftersalesWorkOrderMapper extends BaseMapper<AftersalesWorkOrde
* @return
*/
List<AftersalesWorkOrderVO> getBasicExportData(@Param("param") AftersalesWorkOrderDTO workOrderDTO,@Param("ids") List<Long> ids,@Param("warehouseIds")List<Long> warehouseIds);
/**
* 查询所有的
* @return
*/
List<AftersalesProcessorEntity> overTimeAfterSalesList();
/**
* 工单查询列表
* @param page
* @param workOrderQueryDTO
* @param warehouseIds
* @return
*/
IPage<AftersalesWorkOrderVO> pageAllList(IPage<AftersalesWorkOrderVO> page,@Param("param") AftersalesWorkOrderQueryDTO workOrderQueryDTO,@Param("warehouseId") List<Long> warehouseIds);
}

163
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml

@ -86,6 +86,7 @@
lawo.audit_time,
lawo.entry_time,
lawo.operator,
lawo.initiation_identification,
lawo.person_responsible,
lawo.process_number,
lawo.customer_service_name customerServiceName,
@ -1105,8 +1106,8 @@
WHEN '100' THEN '申述中'
WHEN '110' THEN '已结束' ELSE '未知状态'
END workOrderStatusName,
lawo.processed_by AS businessName,
<!-- GROUP_CONCAT(DISTINCT lap.business_name) AS businessName,-->
(SELECT GROUP_CONCAT(DISTINCT business_name) FROM logpm_aftersales_processor WHERE work_order_id = lawo.id AND is_deleted = 0 AND types_of = '1')AS responsibilityName,
(SELECT GROUP_CONCAT(DISTINCT business_name) FROM logpm_aftersales_processor WHERE work_order_id = lawo.id AND is_deleted = 0 AND types_of = '2')AS businessName,
lawo.create_time,
(lawo.create_time + INTERVAL 2 DAY) AS endCreateTime,
lawo.update_time,
@ -1242,6 +1243,164 @@
group by lawo.id
ORDER BY lawo.create_time DESC
</select>
<select id="overTimeAfterSalesList" resultType="com.logpm.aftersales.entity.AftersalesProcessorEntity">
SELECT
lbp.*
FROM
logpm_aftersales_processor AS lbp
WHERE
lbp.types_of != 3
AND lbp.processing_status IN ( '1', '3' )
AND lbp.is_deleted = 0
AND DATEDIFF(DATE_FORMAT(lbp.create_time,'%y%m%d'), DATE_FORMAT(NOW(),'%y%m%d')) &lt;= -3
</select>
<select id="pageAllList" resultType="com.logpm.aftersales.vo.AftersalesWorkOrderVO">
SELECT DISTINCT
lawo.id,
lawo.ceator,
lawo.warehouse_name,
lawo.work_order_type,
lawo.discovery_node,
lawo.work_order_number,
lawo.order_code,
lawo.train_number,
t.`first` AS `first`,
t.secondary AS secondary,
t.brand_name AS brandName,
t.waybill_number AS waybillNumber,
t.package_code AS packageCode,
lawo.vehicle_route,
lawo.deliver_goods_time,
lawo.discovery_time,
lawo.warehousing_time,
lawo.waybill_mall,
lawo.remarks,
lawo.delivery_time,
lawo.delivery_driver,
lawo.work_order_status,
lawo.problem_description,
lawo.responsible_person,
lawo.processed_by,
lawo.create_time,
lawo.over_time,
lawo.reviewed_by,
lawo.audit_time,
lawo.entry_time,
lawo.operator,
lawo.initiation_identification,
lawo.person_responsible,
lawo.process_number,
lawo.customer_service_name customerServiceName,
lawo.warehouse_id warehouseId,
lawo.investigation_process investigationProcess,
lawo.customer_service_id customerServiceId,
lawo.compensation_money totalAmountNum,
GROUP_CONCAT( DISTINCT lapr.result_type ) AS resultTypes,
GROUP_CONCAT( DISTINCT lapr.compensation_method ) AS compensationMethods
FROM
logpm_aftersales_work_order lawo
LEFT JOIN logpm_aftersales_completion_record lacr ON lacr.work_order_id = lawo.id
AND lacr.is_deleted = '0'
LEFT JOIN (
SELECT
a.id,
group_concat( DISTINCT b.`first` SEPARATOR ',' ) AS `first`,
group_concat( DISTINCT b.secondary SEPARATOR ',' ) AS secondary,
group_concat( DISTINCT b.brand_name SEPARATOR ',' ) AS brand_name,
group_concat( DISTINCT b.package_code SEPARATOR ',' ) AS package_code,
group_concat( DISTINCT b.waybill_number SEPARATOR ',' ) AS waybill_number
FROM
logpm_aftersales_work_order AS a
LEFT JOIN logpm_aftersales_abnormal_package AS b ON a.id = b.work_order_id
WHERE
a.is_deleted = 0
AND b.is_deleted = 0
GROUP BY
a.id
) AS t ON t.id = lawo.id
LEFT JOIN logpm_aftersales_processor AS lap ON lawo.id = lap.work_order_id
AND lap.is_deleted = 0
LEFT JOIN logpm_aftersales_processing_results AS lapr ON lapr.work_order_id = lawo.id
AND lapr.is_deleted = 0
AND lap.types_of != '3'
AND lap.types_of != '3'
<where>
lawo.is_deleted = 0
<if test="param.workOrderNumbers != null and param.workOrderNumbers != '' ">
and lawo.work_order_number in
<foreach collection="param.workOrderNumbers.split(',')" item="workOrderNumber" separator="," open="(" close=")">
#{workOrderNumber}
</foreach>
</if>
<if test="param.orderCodes != null and param.orderCodes != '' ">
and lawo.order_code in
<foreach collection="param.orderCodes.split(',')" item="orderCode" separator="," open="(" close=")">
#{orderCode}
</foreach>
</if>
<if test="param.startCreateTime != null and param.endCreateTime != null ">
and lawo.create_time between #{param.startCreateTime} and #{param.endCreateTime}
</if>
<if test="param.ceator != null and param.ceator != null ">
and lawo.ceator like concat('%', #{param.ceator },'%')
</if>
<if test="warehouseIds != null ">
and lap.business_id IN
<foreach collection="warehouseIds" item="warehouseId" open="(" separator="," close=")" >
#{warehouseId}
</foreach>
</if>
<if test="param.workOrderType != null and param.workOrderType != '' ">
and lawo.workOrder_type = #{param.ceator }
</if>
<if test="param.discoveryNode != null and param.discoveryNode != '' ">
and lawo.discovery_node = #{param.discoveryNode }
</if>
<if test="param.workOrderNumber != null and param.workOrderNumber != '' ">
and lawo.work_order_number like concat('%',#{param.workOrderNumber },'%')
</if>
<if test="param.workOrderNumber != null and param.waybillNumber != '' ">
and lawo.waybill_number like concat('%',#{param.waybillNumber },'%')
</if>
<if test="param.orderCode != null and param.orderCode != '' ">
and lawo.order_code like concat('%',#{param.orderCode },'%')
</if>
<if test="param.orderCode != null and param.orderCode != '' ">
and lawo.order_code like concat('%',#{param.orderCode },'%')
</if>
<if test="param.packageCode != null and param.packageCode != '' ">
and lawo.package_code like concat('%',#{param.packageCode },'%')
</if>
<if test="param.brandName != null and param.brandName != '' ">
and lawo.brand_name like concat('%',#{param.brandName },'%')
</if>
<if test="param.waybillMall != null and param.waybillMall != '' ">
and lawo.waybill_mall like concat('%',#{param.waybillMall },'%')
</if>
<if test="param.first != null and param.first != '' ">
and lawo.first like concat('%',#{param.first },'%')
</if>
<if test="param.workOrderStatus != null and param.workOrderStatus != '' ">
and lawo.work_order_status = #{param.workOrderStatus }
</if>
<if test="param.processedBy != null and param.processedBy != '' ">
and lawo.processed_by like concat('%',#{param.processedBy },'%')
</if>
<if test="param.processedBy != null and param.processedBy != '' ">
and lawo.processed_by like concat('%',#{param.processedBy },'%')
</if>
<if test="param.ceator != null and param.ceator != '' ">
and lawo.ceator like concat('%',#{param.ceator },'%')
</if>
<if test="param.createTime != null and param.createTime != '' ">
AND DATE_FORMAT(lawo.create_time,'%y%m%d') = DATE_FORMAT(#{param.createTime },'%y%m%d')
</if>
</where>
GROUP BY
lawo.id
ORDER BY
lawo.create_time DESC
</select>
<update id="updateFinanceTime">

14
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/IAftersalesWorkOrderService.java

@ -19,6 +19,7 @@ package com.logpm.aftersales.service;
import com.logpm.aftersales.dto.AftersalesPackageScanDTO;
import com.logpm.aftersales.dto.AftersalesWorkOrderDTO;
import com.logpm.aftersales.dto.AftersalesWorkOrderListExcelDTO;
import com.logpm.aftersales.dto.AftersalesWorkOrderQueryDTO;
import com.logpm.aftersales.entity.AftersalesAppealEntity;
import com.logpm.aftersales.entity.AftersalesSettlementEntity;
import com.logpm.aftersales.entity.AftersalesWorkOrderEntity;
@ -319,4 +320,17 @@ public interface IAftersalesWorkOrderService extends BaseService<AftersalesWorkO
* @return
*/
List<AftersalesWorkOrderVO> getBasicExportData(Map<String, Object> aftersalesWorkOrder);
/**
* 处理工单超时
*/
void overTimeAfterSales();
/**
* 查询全部工单信息
* @param workOrderQueryDTO
* @param page
* @return
*/
R ageAllList(AftersalesWorkOrderQueryDTO workOrderQueryDTO, IPage<AftersalesWorkOrderVO> page);
}

248
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java

@ -37,6 +37,8 @@ import com.logpm.aftersales.mapper.AftersalesWorkOrderMapper;
import com.logpm.aftersales.service.*;
import com.logpm.aftersales.vo.*;
import com.logpm.aftersales.wrapper.AftersalesWorkOrderWrapper;
import com.logpm.basic.entity.BasicTenantCodeEntity;
import com.logpm.basic.feign.IBasicTenantCodeClient;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataStoreBusinessClient;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
@ -49,9 +51,12 @@ import org.springblade.common.annotations.LogpmAsync;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.DictTimeoutEnum;
import org.springblade.common.constant.aftersales.*;
import org.springblade.common.constant.basiccode.BasicCodeShowConstant;
import org.springblade.common.constant.basiccode.BasicCodeTypeConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
@ -106,11 +111,13 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
private final AftersalesAppealMapper aftersalesAppealService;
private final ISysClient sysClient;
private final BladeRedis bladeRedis;
private final AftersalesCustomerMallMapper aftersalesCustomerMallMapper;
private final IUserSearchClient userSearchClient;
private final IBasicdataStoreBusinessClient basicdataStoreBusinessClient;
private final IAftersalesProcessingMoneyService aftersalesProcessingMoneyService;
private final IBasicTenantCodeClient basicTenantCodeClient;
// private final IAftersalesWorkOrderService aftersalesWorkOrderService;
@Override
@ -276,38 +283,106 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
return aftersalesWorkOrderList;
}
/**
* 生成异常工单号
*
* @return
*/
public String getWorkOrderNumber(String name, String workOrderType) {
// work_order_number_rules
// WorkOrderTypeConstant[] values = WorkOrderTypeConstant.values();
// Optional<WorkOrderTypeConstant> first = Arrays.stream(values).filter(i -> i.getValue().equals(workOrderType)).findFirst();
//查询客服岗位
List<DictBiz> pcWorkOrder = DictBizCache.getList("pc_work_order");
//查询客服岗位
List<DictBiz> numberRules = DictBizCache.getList("work_order_number_rules");
SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss");
if (ObjectUtils.isNull(numberRules) || numberRules.isEmpty()) {
log.info("注意,注意!工单号字典未配置!请配置!");
} else {
Optional<DictBiz> first2 = pcWorkOrder.stream().filter(i -> i.getDictKey().equals(workOrderType)).findFirst();
//工单号规则待完善
if (first2.isPresent()) {
DictBiz dictBiz = first2.get();
Optional<DictBiz> first1 = numberRules.stream().filter(i -> i.getDictValue().equals(dictBiz.getDictValue())).findFirst();
return first1.map(DictBiz -> DictBiz.getDictKey() + name + format.format(new Date())).orElseGet(() -> "YC" + name + format.format(new Date()));
public String afterMa() {
StringBuilder sb = new StringBuilder();
BasicTenantCodeEntity basicTenantCodeByCodeAndShowType = basicTenantCodeClient.findBasicTenantCodeByCodeAndShowType(BasicCodeTypeConstant.AFTERSALSE_CODE.getValue(), BasicCodeShowConstant.QR_CODE.getValue());
String tenantCode = "";
if (ObjectUtils.isNull(basicTenantCodeByCodeAndShowType)) {
tenantCode = "YC";
log.warn(" afterMa 获取预约码失败");
} else {
if (!Func.isBlank(basicTenantCodeByCodeAndShowType.getCode())){
tenantCode = basicTenantCodeByCodeAndShowType.getCode();
}
}
sb.append(tenantCode);
BladeUser user = AuthUtil.getUser();
SimpleDateFormat format = new SimpleDateFormat("yyMMdd");
String format1 = format.format(new Date());
BasicdataWarehouseEntity warehouseByDepartment = warehouseClient.getMyCurrentWarehouse();
if (org.springblade.core.tool.utils.ObjectUtil.isNotEmpty(warehouseByDepartment)) {
sb.append(warehouseByDepartment.getWarehouseCode());
sb.append(format1);
String s = tenantCode + warehouseByDepartment.getWarehouseCode();
String s1 = jiShuan(s);
sb.append(s1);
} else {
sb.append("00");
sb.append(format1);
String s = tenantCode + "00";
String s1 = jiShuan(s);
sb.append(s1);
}
return sb.toString();
}
private String jiShuan(String s) {
String n = "001";
if (Func.notNull(bladeRedis.get(s))) {
Object o1 = bladeRedis.get(s);
int anInt = Integer.parseInt(String.valueOf(o1));
if (anInt < 10) {
if (anInt + 1 == 10) {
n = String.format("0%d", anInt + 1);
} else {
n = String.format("00%d", anInt + 1);
}
} else if (anInt < 100) {
if (anInt + 1 == 100) {
n = String.format("%d", anInt + 1);
} else {
n = String.format("0%d", anInt + 1);
}
} else {
n = String.valueOf(anInt + 1);
}
bladeRedis.set(s, n);
return n;
} else {
bladeRedis.set(s, n);
return n;
}
return "YC" + name + format.format(new Date());
}
/**
* 生成异常工单号
*
* @return
*/
// public String getWorkOrderNumber(String name, String workOrderType) {
// //查询自身维护的工单码
// BasicTenantCodeEntity basicTenantCodeByCodeAndShowType = basicTenantCodeClient.findBasicTenantCodeByCodeAndShowType(BasicCodeTypeConstant.AFTERSALSE_CODE.getValue(), BasicCodeShowConstant.QR_CODE.getValue());
// String basicCode= "";
// if (!Objects.isNull(basicTenantCodeByCodeAndShowType)){
// basicCode = basicTenantCodeByCodeAndShowType.getCode();
// }
// //查询客服岗位
// List<DictBiz> pcWorkOrder = DictBizCache.getList("pc_work_order");
// //查询客服岗位
// List<DictBiz> numberRules = DictBizCache.getList("work_order_number_rules");
// SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss");
// if (ObjectUtils.isNull(numberRules) || numberRules.isEmpty()) {
// log.info("注意,注意!工单号字典未配置!请配置!");
// } else {
// Optional<DictBiz> first2 = pcWorkOrder.stream().filter(i -> i.getDictKey().equals(workOrderType)).findFirst();
// //工单号规则待完善
//
// if (first2.isPresent()) {
// DictBiz dictBiz = first2.get();
// Optional<DictBiz> first1 = numberRules.stream().filter(i -> i.getDictValue().equals(dictBiz.getDictValue())).findFirst();
// return first1.map(DictBiz -> DictBiz.getDictKey() + name + format.format(new Date())).orElseGet(() -> "YC" + name + format.format(new Date()));
// }
//
// }
// return "YC" + name + format.format(new Date());
// }
/**
* 添加或修改
*
@ -342,7 +417,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
aftersalesWorkOrder.setWaybillNumber(aftersalesWorkOrder.getWaybillNumber());
aftersalesWorkOrder.setStatus(1);
if (ObjectUtils.isNull(aftersalesWorkOrder.getWorkOrderNumber())) {
aftersalesWorkOrder.setWorkOrderNumber(getWorkOrderNumber(myCurrentWarehouse.getWarehouseCode(), aftersalesWorkOrder.getWorkOrderType()));
aftersalesWorkOrder.setWorkOrderNumber(afterMa());
}
aftersalesWorkOrder.setWarehouseId(myCurrentWarehouse.getId());
aftersalesWorkOrder.setWarehouseName(myCurrentWarehouse.getName());
@ -996,7 +1071,16 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
List<AftersalesCompletionRecordEntity> list1 = completionRecordService.list(queryWrapper1);
// 赔款方付款分组
Map<Long, List<AftersalesCompletionRecordEntity>> collect1 = list1.stream().collect(Collectors.groupingBy(AftersalesCompletionRecordEntity::getWorkOrderId));
boolean match1 = iPage.getRecords().stream().allMatch(f1 -> Objects.isNull(f1.getInitiationIdentification()));
if (match1) {
List<AftersalesWorkOrderEntity> collect2 = iPage.getRecords().stream().filter(f1 -> Objects.isNull(f1.getInitiationIdentification())).collect(Collectors.toList());
}
boolean match2 = iPage.getRecords().stream().allMatch(f2 -> Objects.isNull(f2.getWorkOrderStatus()));
if (match2) {
List<AftersalesWorkOrderEntity> collect2 = iPage.getRecords().stream().filter(f2 -> Objects.isNull(f2.getWorkOrderStatus())).collect(Collectors.toList());
}
IPage<AftersalesWorkOrderVO> data = AftersalesWorkOrderWrapper.build().pageVO(iPage);
@ -1803,12 +1887,13 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
aftersalesReplyingPartyService.update(updateWrapper);
//修改工单状态
AftersalesWorkOrderEntity workOrderEntity1 = baseMapper.selectById(aftersalesWorkOrderDTO.getId());
if (workOrderEntity1.getWorkOrderStatus().equals(WorkOrderStatusConstant.daichuli.getValue())) {
AftersalesWorkOrderEntity workOrderEntity = new AftersalesWorkOrderEntity();
AftersalesWorkOrderEntity workOrderEntity = new AftersalesWorkOrderEntity();
workOrderEntity.setId(aftersalesWorkOrderDTO.getId());
workOrderEntity.setUpdateTime(new Date());
workOrderEntity.setWarehouseServiceName(AuthUtil.getNickName());
workOrderEntity.setWorkOrderStatus(WorkOrderStatusConstant.chulizhong.getValue());
baseMapper.updateById(workOrderEntity);
}
//添加或修改新的处理方
chuLiFang(aftersalesWorkOrderDTO, myCurrentWarehouse, user, list, surveyRecordDTO);
//修改处理方待回复信息
@ -2067,8 +2152,6 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
String dictValue = first.get().getDictKey();
switch (dictValue) {
case "2": // 营业部客服
//查询是否必须回复
List<AftersalesProcessorEntity> processorEntityList = aftersalesProcessorService.list(Wrappers.<AftersalesProcessorEntity>query().lambda().
eq(AftersalesProcessorEntity::getWorkOrderId, aftersalesWorkOrderDTO.getId())
@ -2091,6 +2174,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
//查询调查数据
List<AftersaleSurveyRecordEntity> list = aftersaleSurveyRecordService.list(Wrappers.<AftersaleSurveyRecordEntity>query().lambda()
.eq(AftersaleSurveyRecordEntity::getWorkOrderId, aftersalesWorkOrderDTO.getId())
.orderByDesc(AftersaleSurveyRecordEntity::getCreateTime)
//.eq(AftersaleSurveyRecordEntity::getDifference, "1")
);
aftersalesWorkOrderVO.setSurveyRecordEntities(list);
@ -2709,25 +2793,28 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
List<String> head10 = new ArrayList<>(Arrays.asList("工单状态"));
title.add(10, head10);
List<String> head11 = new ArrayList<>(Arrays.asList("工单处理方"));
List<String> head11 = new ArrayList<>(Arrays.asList("工单责任方"));
title.add(11, head11);
List<String> head12 = new ArrayList<>(Arrays.asList("工单创建时间"));
List<String> head12 = new ArrayList<>(Arrays.asList("工单处理方"));
title.add(12, head12);
List<String> head13 = new ArrayList<>(Arrays.asList("工单最晚处理时间"));
List<String> head13 = new ArrayList<>(Arrays.asList("工单创建时间"));
title.add(13, head13);
List<String> head14 = new ArrayList<>(Arrays.asList("工单最处理时间"));
List<String> head14 = new ArrayList<>(Arrays.asList("工单最处理时间"));
title.add(14, head14);
List<String> head15 = new ArrayList<>(Arrays.asList("是否超时"));
List<String> head15 = new ArrayList<>(Arrays.asList("工单最新处理时间"));
title.add(15, head15);
List<String> head16 = new ArrayList<>(Arrays.asList("营业部处理客服"));
List<String> head16 = new ArrayList<>(Arrays.asList("是否超时"));
title.add(16, head16);
List<String> head17 = new ArrayList<>(Arrays.asList("总部处理客服"));
List<String> head17 = new ArrayList<>(Arrays.asList("营业部处理客服"));
title.add(17, head17);
List<String> head18 = new ArrayList<>(Arrays.asList("总部处理客服"));
title.add(18, head18);
return title;
}
@ -2817,6 +2904,93 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
return exportData;
}
@Override
public void overTimeAfterSales() {
//获取道处理方或者责任方的id
String[] strings = new String[]{ProcessorProcessingStatusStatusConstant.daichuli.getValue(),ProcessorProcessingStatusStatusConstant.yichaoshi.getValue()};
List<String> list1 = Arrays.asList(strings);
//查询所有的超时列表,包括已经超时的
List<AftersalesProcessorEntity> processorEntityList = baseMapper.overTimeAfterSalesList();
if (!processorEntityList.isEmpty()) {
for (AftersalesProcessorEntity processorEntity : processorEntityList) {
// 假设有两个时间戳(秒数)
long timestamp2 = 0L;
if (!Objects.isNull(processorEntity)){
//进入此队列即为到48小时,判断是否进行回复了
timestamp2 = processorEntity.getCreateTime().getTime() / 1000;
if (ProcessorProcessingStatusStatusConstant.daichuli.getValue().equals(processorEntity.getProcessingStatus())){
//此时还未进行处理进行超时记录并且重新进入到48小时判定
//处理方
AftersalesProcessorEntity processor = new AftersalesProcessorEntity();
processor.setProcessingStatus("3");//回复超时
processor.setId(processorEntity.getId());
aftersalesProcessorService.updateById(processor);
}else if (ProcessorProcessingStatusStatusConstant.yichaoshi.getValue().equals(processorEntity.getProcessingStatus())){
//进行二次超时记录
List<AftersalesOvertimeFineEntity> list = aftersalesOvertimeFineService.list(Wrappers.<AftersalesOvertimeFineEntity>query().lambda()
.eq(AftersalesOvertimeFineEntity::getBusinessId, processorEntity.getBusinessId())
.eq(AftersalesOvertimeFineEntity::getProcessorId, processorEntity.getId())
.eq(AftersalesOvertimeFineEntity::getWorkOrderId, processorEntity.getWorkOrderId())
.orderByDesc(AftersalesOvertimeFineEntity::getCreateTime)
);
if (!list.isEmpty()) {
AftersalesOvertimeFineEntity aftersalesOvertimeFineEntity = list.get(0);
timestamp2 =aftersalesOvertimeFineEntity.getCreateTime().getTime() / 1000; // 修改时间
}
}
}
long timestamp1 = System.currentTimeMillis() / 1000; // 现在时间
// 将时间戳转换为Instant对象
Instant instant1 = Instant.ofEpochSecond(timestamp1);
Instant instant2 = Instant.ofEpochSecond(timestamp2);
// 计算两个时间戳之间的小时差
Duration duration = Duration.between(instant1, instant2);
long seconds = duration.getSeconds();
long hours1 = seconds / 3600;
int compare = Long.compare(hours1, -72);
if (compare < 1){
long minutes = (seconds % 3600) / 60;
long remainingseconds = seconds % 60;
String formattedTime = String.format("%02d:%02d:%02d", Math.abs(hours1), Math.abs(minutes), Math.abs(remainingseconds)); // 差值格式化为HH:m:ss形武
//添加超时记录
AftersalesOvertimeFineEntity overtimeFineEntity = new AftersalesOvertimeFineEntity();
overtimeFineEntity.setWorkOrderId(processorEntity.getWorkOrderId());
overtimeFineEntity.setTenantId(processorEntity.getTenantId());
overtimeFineEntity.setMoney(BigDecimal.valueOf(50));
System.out.println("时间差为: " + formattedTime); // 出结
overtimeFineEntity.setTimeout(formattedTime);
overtimeFineEntity.setBusinessId(processorEntity.getBusinessId());
overtimeFineEntity.setBusinessName(processorEntity.getBusinessName());
overtimeFineEntity.setProcessorId(processorEntity.getId());
aftersalesOvertimeFineService.save(overtimeFineEntity);
}
}
}
}
@Override
public R ageAllList(AftersalesWorkOrderQueryDTO workOrderQueryDTO, IPage<AftersalesWorkOrderVO> page) {
if (ObjectUtil.isNotEmpty(workOrderQueryDTO.getStartCreateTime()) || ObjectUtil.isNotEmpty(workOrderQueryDTO.getEndCreateTime())) {
boolean withinOneMonth = DateUtil.between(workOrderQueryDTO.getStartCreateTime(), workOrderQueryDTO.getEndCreateTime(), DateUnit.DAY) <= 60;
if (!withinOneMonth) {
throw new ServiceException("日期范伟不能超过两个月");
}
} else {
throw new ServiceException("导出时日期必填");
}
//查询当前登录人
List<BasicdataWarehouseEntity> warehouseList = warehouseClient.getMyWatchWarehouse();
List<Long> warehouseIds = new ArrayList<>();
if (!warehouseList.isEmpty()) {
warehouseIds.addAll(warehouseList.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList())) ;
}
IPage<AftersalesWorkOrderVO> iPage = baseMapper.pageAllList(page, workOrderQueryDTO, warehouseIds);
return R.data(iPage);
}
/**
* 判断是否是客服角色
*

245
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionStockupAppController.java

@ -36,6 +36,8 @@ import com.logpm.distribution.entity.*;
import com.logpm.distribution.mapper.DistributionReservationMapper;
import com.logpm.distribution.service.*;
import com.logpm.distribution.vo.*;
import com.logpm.distribution.vo.app.DistributionAppStockUpClientVO;
import com.logpm.distribution.vo.app.DistributionAppStockUpVO;
import com.logpm.trunkline.feign.ITrunklinePackageTrackLogClient;
import com.logpm.warehouse.entity.WarehouseUpdownGoodsEntity;
import com.logpm.warehouse.feign.*;
@ -143,6 +145,9 @@ public class DistributionStockupAppController extends BladeController {
return R.data(pages);
}
/**
* 备货信息表 详情分页列表
*/
@ -170,6 +175,7 @@ public class DistributionStockupAppController extends BladeController {
return R.data(map);
}
/**
* 对象转map
*
@ -349,6 +355,10 @@ public class DistributionStockupAppController extends BladeController {
}
@ResponseBody
@PostMapping("/stockConfigList")
@ApiOperationSupport(order = 1)
@ -362,6 +372,37 @@ public class DistributionStockupAppController extends BladeController {
}
@ResponseBody
@PostMapping("/stockInventoryPackageList")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "配置包条码", notes = "传入stockupDTO")
public R stockInventoryPackageList(@RequestBody StockupDTO stockupDTO) {
if (ObjectUtils.isNull(stockupDTO.getReservationId())) {
return R.fail("计划参数缺失");
}
if (ObjectUtils.isNull(stockupDTO.getDescriptionGoods())) {
return R.fail("计划参数缺失");
}
Long reservationId = stockupDTO.getReservationId();
String descriptionGoods = stockupDTO.getDescriptionGoods();
return R.data(distributionStockService.list(Wrappers.<DistributionStockEntity>query().lambda()
.eq(DistributionStockEntity::getReservationId,reservationId)
.eq(DistributionStockEntity::getGoodsName,descriptionGoods)
.eq(DistributionStockEntity::getCancelStatus,Integer.parseInt(IsOrNoConstant.no.getValue()))
));
}
@ResponseBody
@PostMapping("/inventoryPackageConfig")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "配置包条码", notes = "传入stockupDTO")
public R inventoryPackageConfig(@RequestBody StockupDTO stockupDTO) {
R r = distributionStockupService.createInventoryPackageConfig(stockupDTO);
return r;
}
@ResponseBody
@PostMapping("/orderInfo")
@ApiOperationSupport(order = 1)
@ -406,8 +447,6 @@ public class DistributionStockupAppController extends BladeController {
DistributionStockupOrderInfoVO infoVO = distributionStockupService.selectOrderInfo(stockupDTO);
return R.data(infoVO);
}
} else if (orderStatus == 2) { //库存品
Long stockListId = stockupDTO.getStockListId();//库存品id
if (ObjectUtils.isNull(allocationId)) {
@ -440,6 +479,8 @@ public class DistributionStockupAppController extends BladeController {
}
@ResponseBody
@PostMapping("/stockupStockListPackageCode")
@ApiOperationSupport(order = 1)
@ -449,7 +490,6 @@ public class DistributionStockupAppController extends BladeController {
if (ObjectUtils.isNull(stockupDTO.getTypeService())) {
throw new ServiceException("服务类型不能为空!!");
}
// 根据当前库位获取最早入库的入库批次
Long stockListId = distributionStockupService.selectStockListInfoByCargoNumber(stockupDTO.getReservationId(), stockupDTO.getCargoNumber(), stockupDTO.getAllocationId(), stockupDTO.getTypeService());
log.warn("##############stockupStockListPackageCode: 库存品id为空 stockListId={}", stockListId);
@ -577,11 +617,8 @@ public class DistributionStockupAppController extends BladeController {
});
return R.data(listMarket);
}
}
}
return Resp.scanFail("当前待备货的库存品未上架,请上架后在继续备货操作!!!", "当前待备货的库存品未上架,请上架后在继续备货操作!!!");
}
@ -1004,7 +1041,7 @@ public class DistributionStockupAppController extends BladeController {
@ResponseBody
@PostMapping("/stockupScan")
@PostMapping("/stockupScan0")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "备货扫描", notes = "传入stockupDTO")
public R stockupScan(@RequestBody StockupDTO stockupDTO) {
@ -1026,13 +1063,205 @@ public class DistributionStockupAppController extends BladeController {
if (fail != null) {
return fail;
}
}
log.warn("###################stockupScan: 未知的扫码类型 scanType={}", scanType);
return R.fail("未知的扫码类型");
}
/**
* 备货信息表 任务客户 分页列表
*/
@ResponseBody
@PostMapping("/newPageList")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "PDA备货列表", notes = "传入stockupDTO")
public R newPageList(@RequestBody StockupDTO stockupDTO) {
R pageData = distributionStockupService.selectNewStockupPage(stockupDTO);
return pageData;
}
@ResponseBody
@PostMapping("/newClientDetail")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "PDA备货客户详情", notes = "传入stockupDTO")
public R newClientDetail(@RequestBody StockupDTO stockupDTO) {
if (Objects.isNull(stockupDTO.getStockupId())){
log.error("newClientDetail参数缺失,stockupDTO.getStockupId()");
return R.fail("查询备货ID不能为空");
}
R stockUpVO = distributionStockupService.selectNewClientDetail(stockupDTO);
return R.data(stockUpVO);
}
@ResponseBody
@PostMapping("/newOrderList")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "客户下库位订单列表", notes = "传入stockupDTO")
public R newOrderList(@RequestBody StockupDTO stockupDTO) throws IllegalAccessException {
R r = distributionStockupService.newOrderList(stockupDTO);
return r;
}
@ResponseBody
@PostMapping("/packageDetail")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "客户订单包件列表", notes = "传入stockupDTO")
public R packageDetail(@RequestBody StockupDTO stockupDTO) {
if (Objects.isNull(stockupDTO.getReservationId())){
return R.fail("stockupDTO.getReservationId()参数缺失");
}
if (Objects.isNull(stockupDTO.getOrderId())){
return R.fail("stockupDTO.getOrderId()参数缺失");
}
if (Objects.isNull(stockupDTO.getTypeService())){
return R.fail("stockupDTO.getTypeService()参数缺失");
}
String typeService = stockupDTO.getTypeService();
Long orderId = stockupDTO.getOrderId();
Long reservationId = stockupDTO.getReservationId();
switch (typeService){
case "1": case "2":
return distributionStockupService.handleDeliveryPackageDetailList(reservationId,orderId);
case "3":
return distributionStockupService.handleBillPackageDetailList(reservationId,orderId);
default:
return R.fail("未知的typeService");
}
}
@ResponseBody
@PostMapping("/stockupScan")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "备货扫描", notes = "传入stockupDTO")
public R newStockupScan(@RequestBody StockupDTO stockupDTO) {
String lockKey = "Lock:" + stockupDTO.getPacketBarCode() + stockupDTO.getStockupId();
String method = "#######################DistributionStockupAppController.newStockupScan";
log.info("#################stockupScan:获取redisson对象开始");
if (redis.exists(lockKey)) {
String audioValue2 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, PdaAudioLingoStatus.chongfusaomiao.getValue());
return Resp.scanFail(PdaAudioLingoStatus.chongfusaomiao.getName(), audioValue2);
}
redis.setEx(lockKey, stockupDTO.getPacketBarCode() + stockupDTO.getStockupId(), 5L);
//针对商市配、自提分别进行处理
if (Objects.isNull(stockupDTO.getTypeService())){
log.error(method+"参数:stockupDTO.getTypeService()缺失");
return Resp.scanFail("参数缺失,请联系管理员!!!","参数缺失,请联系管理员!!!");
}
if (Objects.isNull(stockupDTO.getStockupId())){
log.error(method+"参数:stockupDTO.getStockupId()缺失");
return Resp.scanFail("参数缺失,请联系管理员!!!","参数缺失,请联系管理员!!!");
}
if (Objects.isNull(stockupDTO.getScanType())){
log.error(method+"参数:stockupDTO.getScanType()缺失");
return Resp.scanFail("参数缺失,请联系管理员!!!","参数缺失,请联系管理员!!!");
}
if (Objects.isNull(stockupDTO.getReservationId())){
log.error(method+"参数:stockupDTO.getReservationId()缺失");
return Resp.scanFail("参数缺失,请联系管理员!!!","参数缺失,请联系管理员!!!");
}
String typeService = stockupDTO.getTypeService();
Long stockupId = stockupDTO.getStockupId();
DistributionStockupEntity stockupEntity = distributionStockupService.getById(stockupId);
boolean b = distributionStockupService.judgeIsPickingStaff(AuthUtil.getUser());
if (!b) {
return Resp.scanFail("当前操作人无此操作权限","当前操作人无此操作权限");
}else {
if (!stockupEntity.getStockupUserId().equals(AuthUtil.getUserId())){
return Resp.scanFail("与任务指派拣货员不一致","与任务指派拣货员不一致");
}
}
switch (typeService){
case "1": case "2":
//商市配
//处理配送备货任务
R deliveryStockUp = distributionStockupService.handleDeliveryStockUp(stockupDTO);
if (deliveryStockUp.isSuccess()) {
//进行配送备货任务的状态维护
distributionStockupService.maintainDeliveryStockUpEntity(stockupDTO.getStockupId());
}
return deliveryStockUp;
case "3":
//自提
R billStockUp = distributionStockupService.handleBillStockUp(stockupDTO);
if (billStockUp.isSuccess()){
//进行自提备货任务的维护
distributionStockupService.maintainBillStockUpEntity(stockupDTO.getStockupId());
}
return billStockUp;
default:
log.error("未知typeService>>>>>>>>>>>>:{}",typeService);
return Resp.scanFail("未知扫码类型","未知扫码类型");
}
}
@ResponseBody
@PostMapping("/stockupScanDetail")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "备货扫描", notes = "传入stockupDTO")
public R stockupScanDetail(@RequestBody StockupDTO stockupDTO) {
String lockKey = "Lock:" + stockupDTO.getPacketBarCode() + stockupDTO.getStockupId();
String method = "#######################DistributionStockupAppController.newStockupScan";
log.info("#################stockupScan:获取redisson对象开始");
if (redis.exists(lockKey)) {
String audioValue2 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, PdaAudioLingoStatus.chongfusaomiao.getValue());
return Resp.scanFail(PdaAudioLingoStatus.chongfusaomiao.getName(), audioValue2);
}
redis.setEx(lockKey, stockupDTO.getPacketBarCode() + stockupDTO.getStockupId(), 5L);
//针对商市配、自提分别进行处理
if (Objects.isNull(stockupDTO.getReservationId())){
log.error(method+"参数:stockupDTO.getTypeService()缺失");
return Resp.scanFail("参数缺失,请联系管理员!!!","参数缺失,请联系管理员!!!");
}
if (Objects.isNull(stockupDTO.getStockupId())){
log.error(method+"参数:stockupDTO.getStockupId()缺失");
return Resp.scanFail("参数缺失,请联系管理员!!!","参数缺失,请联系管理员!!!");
}
R r = distributionStockupService.stockupScanDetail(stockupDTO);
return r;
}
@PostMapping("/newStockupArea")
@ApiOperation(value = "查看仓库部门的所有备货库位")
public R newStockupArea(@RequestBody StockupDTO stockupDTO) {
R r = distributionStockupService.newStockupArea(stockupDTO);
return r;
}
@PostMapping("/upStockUpShelf")
@ApiOperation(value = "上架至备货库位")
public R upStockUpShelf(@RequestBody StockupDTO stockupDTO) {
if (Objects.isNull(stockupDTO.getStockupAllocationId())){
return R.fail("请选择备货库位");
}
if (Objects.isNull(stockupDTO.getStockupId())){
return R.fail("StockupId参数缺失");
}
if (Objects.isNull(stockupDTO.getStockIds())){
return R.fail("StockIds参数缺失");
}
//进行备货库位上架
R r = distributionStockupService.upStockUpShelf(stockupDTO);
return r;
}
@PostMapping("/cancelStock")
@ApiOperation(value = "取消备货记录")
public R cancelStock(@RequestBody StockupDTO stockupDTO) {
if (Objects.isNull(stockupDTO.getStockIds())){
return R.fail("StockIds参数缺失");
}
if (Objects.isNull(stockupDTO.getStockupId())){
return R.fail("StockupId参数缺失");
}
//进行备货库位上架
R r = distributionStockupService.cancelStock(stockupDTO);
return r;
}
}

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/StockupDTO.java

@ -66,7 +66,7 @@ public class StockupDTO implements Serializable {
private String stockupArea;//备货区
private String stockupAreaCode;//备货区编码
private Long stockupAreaId;//备货区ID
private Long stockupId;//备货任务Id
private Long stockupId;//备货任务Id
private String type;//类型 1 扫码 2 选择
private Long stockListId;//库存品id
private Long newStockListId;//库存品id
@ -75,5 +75,8 @@ public class StockupDTO implements Serializable {
// 商场名
private String mallName;
private Long orderId;
private Long packageId;
private String stockIds;
}

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

@ -92,4 +92,12 @@ public interface DistributionDeliveryDetailsMapper extends BaseMapper<Distributi
* @return
*/
List<DistributionDeliveryDetailsEntity> selectStockListByReservationIdAndCargoNumber(@Param("billId")Long billId,@Param("cargoNumber") String cargoNumber,@Param("oldStockId") Long oldStockId);
/**
* 维护自提库存品计划信息
* @param billId
* @param stockListId
* @param warehouseId
*/
void maintenanceStockListStockup(@Param("billId") Long billId,@Param("stockListId") Long stockListId,@Param("warehouseId") Long warehouseId);
}

47
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryDetailsMapper.xml

@ -22,6 +22,53 @@
<!-- <result column="stock_id" property="stockId"/>-->
<result column="quantity" property="quantity"/>
</resultMap>
<update id="maintenanceStockListStockup">
UPDATE logpm_distribution_delivery_details AS lddd
SET lddd.quantity = (
SELECT
IFNULL( SUM( num ), 0 )
FROM
logpm_dis_stock_list_detail
WHERE
reservation_id = lddd.bill_lading_id
AND stock_list_id = lddd.stock_list_id
AND warehouse_id = #{warehouseId}
AND stock_package_status != 2
),
lddd.reality_quantity = (
SELECT
IFNULL( SUM( num ), 0 )
FROM
logpm_dis_stock_list_detail
WHERE
reservation_id = lddd.bill_lading_id
AND stock_list_id = lddd.stock_list_id
AND warehouse_id = #{warehouseId}
AND stock_status = '20'
AND stock_package_status != 2
),
lddd.start_time_stocking = IFNULL(
lddd.start_time_stocking,
now()),
lddd.end_time_stocking =
IF
( lddd.quantity = lddd.reality_quantity, NOW(), NULL ),
lddd.stock_status =
IF
(
lddd.quantity = lddd.reality_quantity,
3,
IF
( lddd.reality_quantity = 0, 1, 2 )),
lddd.stock_status =
IF
( lddd.quantity = 0, 2, lddd.stock_status )
WHERE
lddd.is_deleted = 0
AND lddd.inventory_status != 2
AND lddd.bill_lading_id = #{billId}
AND lddd.stock_list_id = #{stockListId}
</update>
<select id="selectDistributionDeliveryDetailsPage" resultMap="distributionDeliveryDetailsResultMap">

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

@ -541,25 +541,35 @@
group by ldpl.pallet
</select>
<select id="getParcelListOwn" resultType="com.logpm.distribution.vo.DistributionParcelListVO">
<!-- select ldrp.parce_list_id id,ldrp.packet_bar_code orderPackageCode,ldsk.type stockupStatus, ldpl.firsts,ldpl.second,ldpl.third_product thirdProduct,
ldpl.material_name materialName,lds.stockup_date stockupDate,lds.stockup_area stockupArea,ldpl.goods_allocation goodsAllocation,ldpl.pallet
from logpm_distribution_stockup lds
left join logpm_distribution_stockup_info ldsi on ldsi.stockup_id = lds.id
INNER JOIN logpm_distribution_reservation_package ldrp on ldrp.reservation_id = ldsi.reservation_id
LEFT JOIN logpm_distribution_stock ldsk on ldsk.parcel_list_id = ldrp.parce_list_id
LEFT JOIN logpm_distribution_parcel_list ldpl on ldpl.id = ldrp.parce_list_id
<where>
lds.id =#{id}
</where>-->
select ldsi.stockup_id , ldr.reservation_code, ldpl.id id,ldpl.order_package_code orderPackageCode,lds.type
stockupStatus,ldpl.firsts,ldpl.second,ldpl.third_product thirdProduct,
ldpl.material_name materialName,lds.create_time stockupDate,lds.stockup_area stockupArea,ldpl.goods_allocation
goodsAllocation,ldpl.pallet pallet
from logpm_distribution_stockup_info ldsi
LEFT JOIN logpm_distribution_reservation ldr on ldr.id= ldsi.reservation_id
LEFT JOIN logpm_distribution_reservation_package ldrp on ldrp.reservation_id = ldsi.reservation_id
LEFT JOIN logpm_distribution_parcel_list ldpl on ldpl.id = ldrp.parce_list_id
LEFT JOIN logpm_distribution_stock lds on ldpl.id = lds.parcel_list_id and lds.stockup_id = ldsi.stockup_id
SELECT
ldsi.stockup_id,
ldr.reservation_code,
ldpl.id id,
ldpl.order_package_code orderPackageCode,
lds.type stockupStatus,
ldpl.firsts,
ldpl.SECOND,
ldpl.third_product thirdProduct,
ldpl.material_name materialName,
lds.create_time stockupDate,
lds.stockup_area stockupArea,
ldpl.goods_allocation goodsAllocation,
ldpl.pallet pallet,
ldpl.order_package_stockup_status,
lds.allocation_title AS '下架库位',
lds.goods_allocation AS '备货库位'
FROM
logpm_distribution_stockup_info ldsi
LEFT JOIN logpm_distribution_reservation ldr ON ldr.id = ldsi.reservation_id
AND ldr.is_deleted = 0
AND ldr.reservation_status != 40
LEFT JOIN logpm_distribution_reservation_package ldrp ON ldrp.reservation_id = ldsi.reservation_id
AND ldrp.is_deleted = 0
AND ldrp.packet_bar_status != 2
LEFT JOIN logpm_distribution_parcel_list ldpl ON ldpl.id = ldrp.parce_list_id
LEFT JOIN logpm_distribution_stock lds ON ldpl.id = lds.parcel_list_id
AND lds.is_deleted = 0
AND lds.stockup_id = ldsi.stockup_id
<where>
ldsi.stockup_id =#{id} and ldpl.order_package_code is not null and ldsi.stock_status != 4 AND ldrp.packet_bar_status != 2
</where>

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

@ -90,4 +90,12 @@ public interface DistributionReservationStocklistMapper extends BaseMapper<Distr
* @return
*/
int deductionStockListReservationNum(@Param("reservationId") Long reservationId,@Param("stockListId") Long stockListId,@Param("num") Integer num);
/**
* 维护库存品备货信息
* @param reservationId
* @param stockListId
* @param warehouseId
*/
void maintenanceStockListStockup(@Param("reservationId")Long reservationId,@Param("stockListId") Long stockListId,@Param("warehouseId") Long warehouseId);
}

24
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationStocklistMapper.xml

@ -25,6 +25,30 @@
<update id="deductionStockListReservationNum">
UPDATE logpm_distribution_reservation_stocklist SET reservation_num = (reservation_num -#{num}) WHERE reservation_id = #{reservationId} AND stocklist_id = #{stockListId}
</update>
<update id="maintenanceStockListStockup">
UPDATE logpm_distribution_reservation_stocklist AS ldrs
SET ldrs.reservation_num = ( SELECT SUM( num ) FROM logpm_dis_stock_list_detail WHERE reservation_id = ldrs.reservation_id AND stock_list_id = ldrs.stocklist_id AND warehouse_id = #{warehouseId} AND stock_package_status != 2 ),
ldrs.reality_num = ( SELECT SUM( num ) FROM logpm_dis_stock_list_detail WHERE reservation_id = ldrs.reservation_id AND stock_list_id = ldrs.stocklist_id AND warehouse_id = #{warehouseId} AND stock_status = '20' ),
ldrs.start_time_stocking = IFNULL(
ldrs.start_time_stocking,
now()),
ldrs.end_time_stocking =
IF
( ldrs.reality_num = ldrs.reservation_num, NOW(), NULL ),
ldrs.stock_status =
IF
(
ldrs.reality_num = ldrs.reservation_num,
3,
IF
( ldrs.reality_num = 0, 1, 2 )),
ldrs.stock_list_status = IF(ldrs.reservation_num = 0,2,ldrs.stock_list_status)
WHERE
ldrs.is_deleted = 0
AND ldrs.stock_list_status != 2
AND ldrs.reservation_id = #{reservationId}
AND stocklist_id = #{stockListId}
</update>
<delete id="deleteReservationStocklist">
DELETE FROM logpm_distribution_reservation_stocklist WHERE reservation_id=#{id}

6
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.java

@ -160,4 +160,10 @@ public interface DistributionStockListMapper extends BaseMapper<DistributionStoc
void clearTraysByIds(@Param("stockListIds") List<Long> clearTrayStockListIds);
void clearAllocationByIds(@Param("stockListIds") List<Long> clearAllocationStockListIds);
/**
* 维护订制品的冻结数量
* @param stockListId
*/
void maintenanceStockListQuantityOccupied(@Param("stockListId")Long stockListId);
}

17
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.xml

@ -689,5 +689,22 @@
#{stockListId}
</foreach>
</update>
<update id="maintenanceStockListQuantityOccupied">
UPDATE logpm_distribution_stock_list AS ldsl
SET ldsl.quantity_occupied = (
SELECT
IFNULL(SUM( num ) ,0)
FROM
logpm_dis_stock_list_detail
WHERE
stock_list_id = ldsl.id
AND is_deleted = 0
AND warehouse_id = ldsl.warehouse_id
AND stock_package_status != 2
AND stock_signfo_status != 20
AND stock_locking_status != 20
)
WHERE ldsl.id = #{stockListId}
</update>
</mapper>

9
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockMapper.java

@ -23,6 +23,7 @@ import com.logpm.distribution.entity.DistributionStockEntity;
import com.logpm.distribution.excel.DistributionStockExcel;
import com.logpm.distribution.vo.DistributionStockAllocationVO;
import com.logpm.distribution.vo.DistributionStockVO;
import com.logpm.distribution.vo.app.DistributionAppStockUpScanDetailVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -99,4 +100,12 @@ public interface DistributionStockMapper extends BaseMapper<DistributionStockEnt
* @return
*/
Integer selectStockNumByReservationId(@Param("reservationId")Long reservationId);
/**
* 查询备货扫描详情
* @param reservationId
* @param stockupId
* @return
*/
List<DistributionAppStockUpScanDetailVO> selectScanDetail(@Param("reservationId")Long reservationId,@Param("stockupId") Long stockupId);
}

23
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockMapper.xml

@ -114,6 +114,29 @@
<select id="selectStockNumByReservationId" resultType="java.lang.Integer">
SELECT IF(SUM(stock_quantity) is null,0,SUM(stock_quantity)) FROM logpm_distribution_stock AS lds WHERE reservation_id = #{reservationId}
</select>
<select id="selectScanDetail"
resultType="com.logpm.distribution.vo.app.DistributionAppStockUpScanDetailVO">
SELECT
lds.id,
lds.coding AS orderPackageCode,
CASE lds.type
WHEN 1 THEN '订制品'
WHEN 2 THEN '库存品'
WHEN 3 THEN '零担'
ELSE
'未知包件类型'
END typeName,
lds.goods_name AS goodsName,
lds.order_self_numbering AS orderCode,
lds.goods_allocation AS stockupAllocation
FROM
logpm_distribution_stock AS lds
WHERE
lds.is_deleted = 0
AND cancel_status = 0
AND lds.reservation_id = #{reservationId}
AND lds.stockup_id = #{stockupId}
</select>
</mapper>

121
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.java

@ -20,13 +20,16 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.distribution.dto.app.StockupDTO;
import com.logpm.distribution.dto.app.StockupZeroDTO;
import com.logpm.distribution.entity.DisStockListDetailEntity;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.entity.DistributionReservationZeroPackageEntity;
import com.logpm.distribution.entity.DistributionStockupEntity;
import com.logpm.distribution.excel.DistributionCityExcel;
import com.logpm.distribution.excel.DistributionMarketExcel;
import com.logpm.distribution.excel.DistributionSelfExcel;
import com.logpm.distribution.excel.DistributionStockupPackageListDetailExcel;
import com.logpm.distribution.vo.*;
import com.logpm.distribution.vo.app.StockupZeroVO;
import com.logpm.distribution.vo.app.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -276,4 +279,120 @@ public interface DistributionStockupMapper extends BaseMapper<DistributionStocku
Integer cancelStockUpTasks(@Param("reservationIds")List<Long> reservationIds,@Param("stockUpId") Long stockUpId);
/**
* PDA备货主页面数据
* @param stockupDTO
* @return
*/
List<DistributionAppStockUpVO> selectNewHomeStockupPage(@Param("param")StockupDTO stockupDTO);
/**
*
* @param stockupId
*/
List<DistributionAppStockUpClientVO> selectNewClientDetail(@Param("stockupId")Long stockupId);
/**
* 查询预约定制品信息
* @param reservationId
* @return
*/
List<DistributionAppStockUpOrderDetailVO> selectDeliveryOrder(@Param("reservationId")Long reservationId);
/**
* 查询单个客户详情
* @param reservationId
* @return
*/
DistributionAppStockUpClientVO selectPlanClientDetailById(@Param("reservationId")Long reservationId);
/**
* 查询自提订制品备货列表
* @param reservationId
* @return
*/
List<DistributionAppStockUpOrderDetailVO> selectBillOrder(@Param("reservationId")Long reservationId);
/**
* 查询配送库存品详情
* @param reservationId
* @param warehouseId
* @param mallName
* @return
*/
List<DistributionAppStockUpInventoryDetailVO> selectStockupDeliveryInventoryDetail(@Param("reservationId")Long reservationId,@Param("warehouseId") Long warehouseId,@Param("mallName") String mallName);
/**
* 查询自提库存品备货详情
* @param id
* @param warehouseId
* @param consigneeUnit
* @return
*/
List<DistributionAppStockUpInventoryDetailVO> selectStockupBillInventoryDetail(@Param("reservationId") Long reservationId,@Param("warehouseId") Long warehouseId,@Param("consigneeUnit") String consigneeUnit);
/**
* 查询配送零担订单备货详情
* @param id
* @return
*/
List<DistributionAppStockUpZeroOrderDetailVO> selectDeliveryZeroOrder(@Param("reservationId") Long reservationId);
/**
* 查询零担备货详情
* @param billId
* @return
*/
List<DistributionAppStockUpZeroOrderDetailVO> selectBillZeroOrder(@Param("billId")Long billId);
/**
* 查询配送备货的订制品包件列表数据
* @param stockupId
* @return
*/
List<DistributionParcelListEntity> selectDeliveryStockupPackageEntityList(@Param("stockupId")Long stockupId);
/**
* 查询备货库存品信息
* @param stockupId
* @return
*/
List<DisStockListDetailEntity> selectDeliveryStockupInventoryEntityList(@Param("stockupId")Long stockupId);
/**
* 查询备货零担信息
* @param stockupId
* @return
*/
List<DistributionReservationZeroPackageEntity> selectDeliveryStockupZeroEntityList(@Param("stockupId")Long stockupId);
/**
* 查询客户订单详情
* @param reservationId
* @param orderId
* @return
*/
List<DistributionAppStockUpPackageDetailVO> selectDeliveryPackageDetailList(@Param("reservationId")Long reservationId,@Param("orderId") Long orderId);
/**
* 查询自提包件列表
* @param billId
* @param orderId
* @return
*/
List<DistributionAppStockUpPackageDetailVO> selectBillPackageDetailList(@Param("billId")Long billId,@Param("orderId") Long orderId);
/**
* 查询自提备货所有包件
* @param stockupId
* @return
*/
List<DistributionParcelListEntity> selectBillStockupPackageEntityList(@Param("stockupId")Long stockupId);
List<DisStockListDetailEntity> selectBillStockupInventoryEntityList(@Param("stockupId")Long stockupId);
List<DistributionReservationZeroPackageEntity> selectBillStockupZeroEntityList(@Param("stockupId")Long stockupId);
}

1008
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml

File diff suppressed because it is too large Load Diff

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

@ -215,6 +215,8 @@ public interface DistrilbutionBillLadingMapper extends BaseMapper<DistrilbutionB
List<DisStockListDetailEntity> selectInventoryListByBill(@Param("billId")Long billId);
// Page<DistrilbutionBillLadingAppVO> getInventoryPage(IPage<Object> page, DistrilbutionBillLadingEntity distrilbutionBillLadingEntity);
}

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

@ -32,6 +32,7 @@
#{id}
</foreach>
</update>
<select id="pageList" resultType="com.logpm.distribution.vo.DistrilbutionBillLadingVO">
SELECT
dbl.id,
@ -605,8 +606,8 @@
</select>
<select id="getInventory" resultType="com.logpm.distribution.vo.DistrilbutionBillLadingAppVO">
select ldbl.id ,lddd.stock_list_id stockListId,lddd.quantity,ldsl.description_goods
descriptionGoods,ldsl.cargo_unit cargoUnit,ldsl.sku,(
select ldbl.id ,lddd.stock_list_id stockListId,IFNULL(sum(lddd.quantity),0),,ldsl.description_goods
descriptionGoods,ldsl.cargo_unit cargoUnit,ldsl.sku,ldsl.cargo_number,(
select count(1)
from logpm_distribution_stock lds
where lds.bill_lading_id = #{param.id} and lds.is_deleted = 0
@ -618,6 +619,8 @@
<where>
ldbl.id = #{param.id} and lddd.is_deleted = '0'
</where>
GROUP BY
lbm.id
</select>
<select id="getBillLadingNum" resultType="com.logpm.distribution.vo.DistrilbutionBillLadingVO">
select DISTINCT (select count(conditions)

19
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java

@ -26,6 +26,8 @@ import com.logpm.distribution.entity.DistributionLoadscanAbnormalEntity;
import com.logpm.distribution.entity.DistributionReservationEntity;
import com.logpm.distribution.excel.DistributionReservationExcel;
import com.logpm.distribution.vo.*;
import com.logpm.distribution.vo.app.DistributionAppStockUpInventoryDetailVO;
import org.apache.ibatis.annotations.Param;
import org.jetbrains.annotations.NotNull;
import org.springblade.common.enums.BizOperationEnums;
import org.springblade.common.model.NodeFanoutMsg;
@ -334,4 +336,21 @@ public interface IDistributionReservationService extends BaseService<Distributio
*/
void cancelReservationZeroPackage(List<DistributionLoadscanAbnormalEntity> cancelZeroData,Long warehouseId);
/**
* 维护库存品信息
* @param reservationId
* @param stockListId
* @param id
*/
void maintenanceStockListStockup(Long reservationId, Long stockListId, Long id);
/**
* 查询配送库存品备货详情
* @param id
* @param warehouseId
* @param mallName
* @return
*/
List<DistributionAppStockUpInventoryDetailVO> selectStockupDeliveryInventoryDetail(@Param("reservationId") Long reservationId, @Param("warehouseId") Long warehouseId, @Param("mallName") String mallName);
}

9
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockService.java

@ -23,6 +23,7 @@ import com.logpm.distribution.entity.DistributionStockEntity;
import com.logpm.distribution.excel.DistributionStockExcel;
import com.logpm.distribution.vo.DistributionStockAllocationVO;
import com.logpm.distribution.vo.DistributionStockVO;
import com.logpm.distribution.vo.app.DistributionAppStockUpScanDetailVO;
import org.springblade.core.mp.base.BaseService;
import java.util.List;
@ -94,4 +95,12 @@ public interface IDistributionStockService extends BaseService<DistributionStock
* @return
*/
DistributionStockAllocationVO selectSelfAllocation(Long reservationId, Long stockupId, Long parcelListId);
/**
* 查询备货扫描详情
* @param reservationId
* @param stockupId
* @return
*/
List<DistributionAppStockUpScanDetailVO> selectScanDetail(Long reservationId, Long stockupId);
}

103
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockupService.java

@ -26,9 +26,11 @@ import com.logpm.distribution.excel.DistributionMarketExcel;
import com.logpm.distribution.excel.DistributionSelfExcel;
import com.logpm.distribution.excel.DistributionStockupPackageListDetailExcel;
import com.logpm.distribution.vo.*;
import com.logpm.distribution.vo.app.DistributionAppStockUpVO;
import org.springblade.common.model.NodeFanoutMsg;
import org.springblade.common.model.StockUpVO;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.tool.api.R;
import org.springblade.system.entity.User;
@ -318,4 +320,105 @@ public interface IDistributionStockupService extends BaseService<DistributionSto
R stockupScanByStock(StockupDTO stockupDTO);
NodeFanoutMsg<StockUpVO> buildStockUpNodeData(DistributionStockupEntity distributionStockupEntity, DistributionStockEntity entity ,DistributionParcelListEntity parcelListEntitys);
/**
* 处理配送备货扫描
* @param stockupDTO
* @return
*/
R handleDeliveryStockUp(StockupDTO stockupDTO);
/**
* 处理自提备货库存品
* @param stockupDTO
* @return
*/
R handleBillStockUp(StockupDTO stockupDTO);
/**
* 新备货PDA页面
* @param stockupDTO
* @return
*/
R selectNewStockupPage(StockupDTO stockupDTO);
/**
* 查询备货内容详情
* @param stockupDTO
* @return
*/
R selectNewClientDetail(StockupDTO stockupDTO);
/**
* 备货内容详情
* @param stockupDTO
* @return
*/
R newOrderList(StockupDTO stockupDTO);
/**
* 维护配送备货任务状态
* @param stockupId
*/
void maintainDeliveryStockUpEntity(Long stockupId);
/**
* 查询备货扫描PDA包件详情
* @param reservationId
* @param orderId
* @return
*/
R handleDeliveryPackageDetailList(Long reservationId, Long orderId);
/**
* 查询自提包件数据
* @param reservationId
* @param orderId
* @return
*/
R handleBillPackageDetailList(Long reservationId, Long orderId);
/**
* 配置库存品包条码
* @param stockupDTO
* @return
*/
R createInventoryPackageConfig(StockupDTO stockupDTO);
/**
* 维护自提备货任务状态
* @param stockupId
*/
void maintainBillStockUpEntity(Long stockupId);
/**
* 查询扫描详情
* @param stockupDTO
* @return
*/
R stockupScanDetail(StockupDTO stockupDTO);
/**
* 查询当前仓库的备货库位
* @param stockupDTO
* @return
*/
R newStockupArea(StockupDTO stockupDTO);
/**
* 备货库位上架
* @param stockupDTO
* @return
*/
R upStockUpShelf(StockupDTO stockupDTO);
/**
* 进行备货记录取消
* @param stockupDTO
* @return
*/
R cancelStock(StockupDTO stockupDTO);
boolean judgeIsPickingStaff(BladeUser user);
}

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

@ -279,4 +279,12 @@ public interface IDistrilbutionBillLadingService extends BaseService<Distrilbuti
void sendFactory(String string);
/**
* 维护自提库存品计划备货信息
* @param reservationId
* @param id
* @param id1
*/
void maintenanceStockListStockup(Long reservationId, Long id, Long id1);
}

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

@ -2773,13 +2773,13 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
DistributionReservationEntity reservationEntity = new DistributionReservationEntity();
boolean fa = false;
if (distributionStockupEntity.getStockupStatus().equals(StockupStatusConstant.beihuozhong.getValue())) {
distributionStockup.setId(stockupDTO.getStockupId());
if (i > 0) {
// 有数量
fa = true;
} else if (i == 0) {
//修改完成状态
//修改备货状态
distributionStockup.setId(stockupDTO.getStockupId());
distributionStockup.setStockupStatus(StockupStatusConstant.yibeihuo.getValue());
reservationEntity.setId(stockupDTO.getReservationId());
@ -2901,7 +2901,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
DistributionStockupEntity distributionStockup = new DistributionStockupEntity();
boolean fa = false;
if (distributionStockupEntity.getStockupStatus().equals(StockupStatusConstant.beihuozhong.getValue())) {
distributionStockup.setId(stockupDTO.getStockupId());
if (i > 0) {
//有数据
fa = true;

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

@ -3293,11 +3293,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if (Func.isEmpty(list)) {
log.error("###########################预约包件查询错误:{}", list);
log.error("###########################查询错误预约Id:{}", reservationEntity.getId());
throw new RuntimeException("服务器正忙...");
throw new RuntimeException(reservationEntity.getId()+"订单信息错误:"+s.getId());
}
//list 对这个集合 按照getParceListId 进行分组
Map<String, List<DistributionReservationPackageEntity>> oldPackageList = list.stream().collect(Collectors.groupingBy(DistributionReservationPackageEntity::getPacketBarCode));
//查看订单包件是否发生变化
//此订单包件数量统计l

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

@ -40,6 +40,7 @@ import com.logpm.distribution.mapper.DistributionParcelListMapper;
import com.logpm.distribution.mapper.DistributionStockArticleMapper;
import com.logpm.distribution.service.*;
import com.logpm.distribution.vo.*;
import com.logpm.trunkline.feign.ITrunklineAdvanceDetailClient;
import com.logpm.trunkline.feign.ITrunklinePackageTrackLogClient;
import com.logpm.warehouse.entity.WarehouseConfigEntity;
import com.logpm.warehouse.entity.WarehouseUpdownGoodsEntity;
@ -136,6 +137,9 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
@Autowired
private ITrunklinePackageTrackLogClient trunklinePackageTrackLogClient;
@Autowired
private ITrunklineAdvanceDetailClient trunklineAdvanceDetailClient;
@Autowired
private IWarehouseConfigClient warehouseConfigClient;
@Autowired
@ -499,7 +503,11 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
queryWrapper.eq("id", o);
}
queryWrapper.eq("conditions", 1);
queryWrapper.eq("is_transfer", 0);
List<DistributionParcelListEntity> list1 = baseMapper.selectList(queryWrapper);
if (list1.isEmpty()) {
return R.fail("包件信息错误");
}
boolean flag = list1.stream().anyMatch(p -> OrderPackageReservationStatusConstant.yiyueyue.getValue().equals(p.getOrderPackageReservationStatus()));
if (flag){
String collect = list1.stream().map(DistributionParcelListEntity::getOrderPackageCode).collect(Collectors.joining(","));
@ -600,6 +608,7 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
if (!aaa.isEmpty()) {
trunklinePackageTrackLogClient.addPackageTrackLog(aaa);
}
return R.success("操作成功!");
}
return R.fail("没有可用数据!");

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

@ -46,6 +46,15 @@ import com.logpm.distribution.mapper.DistributionStockMapper;
import com.logpm.distribution.mapper.DistributionStockupInfoMapper;
import com.logpm.distribution.mapper.DistributionStockupMapper;
import com.logpm.distribution.service.*;
import com.logpm.distribution.vo.DistributionParcelListVO;
import com.logpm.distribution.vo.DistributionParcelNumberVO;
import com.logpm.distribution.vo.DistributionReservationOrderPackageVO;
import com.logpm.distribution.vo.DistributionReservationVO;
import com.logpm.distribution.vo.DistributionStockArticleVO;
import com.logpm.distribution.vo.DistributionStockListVO;
import com.logpm.distribution.vo.DistributionStockupOrderListVO;
import com.logpm.distribution.vo.DistributionStockupStockListVO;
import com.logpm.distribution.vo.app.DistributionAppStockUpInventoryDetailVO;
import com.logpm.distribution.vo.*;
import com.logpm.distribution.wrapper.DistributionParcelListWrapper;
import com.logpm.distribution.wrapper.DistributionReservationWrapper;
@ -930,7 +939,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
BasicTenantCodeEntity basicTenantCodeByCodeAndShowType = basicTenantCodeClient.findBasicTenantCodeByCodeAndShowType(BasicCodeTypeConstant.APPOINTMENT_CODE.getValue(), BasicCodeShowConstant.QR_CODE.getValue());
String tenantCode = "YY";
if (ObjectUtils.isNull(basicTenantCodeByCodeAndShowType)) {
log.warn(" reservationMa 获取货区码失败");
log.warn(" reservationMa 获取预约码失败");
} else {
tenantCode = basicTenantCodeByCodeAndShowType.getCode();
}
@ -1770,6 +1779,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
reservationStockarticleEntity.setIsZero(distributionStockArticleDTO.getIsZero());
reservationStockarticleEntity.setReservationId(id);
reservationStockarticleEntity.setReservationNum(packageNum.get());
reservationStockarticleEntity.setIsZero(distributionStockArticleDTO.getIsZero());
distributionReservationStockarticleService.save(reservationStockarticleEntity);
packTotal.getAndAdd(reservationStockarticleEntity.getReservationNum());
String status = distributionReservationPackageService.judgmentStatus(distributionStockArticleDTO);
@ -3602,11 +3612,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
nodeFanoutMsg.setWarehouse(reservationEntity.getWarehouseName());
nodeFanoutMsg.setWarehouseId(reservationEntity.getWarehouseId());
nodeFanoutMsg.setTenantId(AuthUtil.getTenantId());
ReservationVO reservationVO = getReservationVO(reservationEntity);
List<PackageData> packageDataList = new ArrayList<>();
List<DistributionReservationPackageEntity> list = map.get("1");
if(Func.isNotEmpty(list)){
@ -4369,6 +4375,16 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
}
@Override
public void maintenanceStockListStockup(Long reservationId, Long stockListId, Long warehouseId) {
distributionReservationStocklistMapper.maintenanceStockListStockup(reservationId,stockListId,warehouseId);
}
@Override
public List<DistributionAppStockUpInventoryDetailVO> selectStockupDeliveryInventoryDetail(Long reservationId, Long warehouseId, String mallName) {
return null;
}
private JSONObject handleLogJSONObject(BasicdataWarehouseEntity warehouse, BladeUser user, String orderPackageCode, String content, Integer node) {
JSONObject trunklinePackageTrackLog = new JSONObject();

6
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockServiceImpl.java

@ -31,6 +31,7 @@ import com.logpm.distribution.service.*;
import com.logpm.distribution.vo.DistributionDeliveryDetailsVO;
import com.logpm.distribution.vo.DistributionStockAllocationVO;
import com.logpm.distribution.vo.DistributionStockVO;
import com.logpm.distribution.vo.app.DistributionAppStockUpScanDetailVO;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.apache.logging.log4j.util.Strings;
@ -472,4 +473,9 @@ public class DistributionStockServiceImpl extends BaseServiceImpl<DistributionSt
return baseMapper.selectSelfAllocation(reservationId, stockupId, parcelListId);
}
@Override
public List<DistributionAppStockUpScanDetailVO> selectScanDetail(Long reservationId, Long stockupId) {
return baseMapper.selectScanDetail(reservationId,stockupId);
}
}

2123
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java

File diff suppressed because it is too large Load Diff

22
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java

@ -32,7 +32,9 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.logpm.basic.entity.BasicTenantCodeEntity;
import com.logpm.basic.feign.IBasicTenantCodeClient;
import com.logpm.basicdata.entity.BasicdataClientEntity;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataClientClient;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.distribution.bean.Resp;
import com.logpm.distribution.dto.DistributionBillLadingExcelDTO;
@ -46,6 +48,7 @@ import com.logpm.distribution.excel.DistributionBillInventoryExcel;
import com.logpm.distribution.excel.DistributionBillOrderExcel;
import com.logpm.distribution.excel.DistributionBillOrderPackExcel;
import com.logpm.distribution.excel.DistrilbutionBillLadingExcel;
import com.logpm.distribution.mapper.DistributionDeliveryDetailsMapper;
import com.logpm.distribution.mapper.DistributionStockListMapper;
import com.logpm.distribution.mapper.DistrilbutionBillLadingMapper;
import com.logpm.distribution.service.*;
@ -157,6 +160,8 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
@Autowired
private IDistributionDeliveryDetailsService distributionDeliveryDetailsService;
@Autowired
private DistributionDeliveryDetailsMapper distributionDeliveryDetailsMapper;
@Autowired
private IDistributionReservationService distributionReservationService;
@Autowired
private IDistributionPrintService distributionPrintService;
@ -234,6 +239,9 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
@Autowired
private IBasicTenantCodeClient basicTenantCodeClient;
@Autowired
private IBasicdataClientClient clientClient;
@Override
public IPage<DistrilbutionBillLadingVO> selectDistrilbutionBillLadingPage(IPage<DistrilbutionBillLadingVO> page, DistrilbutionBillLadingVO distrilbutionBillLading) {
@ -1587,6 +1595,11 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
}
}
@Override
public void maintenanceStockListStockup(Long reservationId, Long stockListId, Long warehouseId) {
distributionDeliveryDetailsMapper.maintenanceStockListStockup(reservationId,stockListId,warehouseId);
}
/**
* 转换老系统的ID
*
@ -3330,7 +3343,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
inventory.forEach(i -> {
List<DisStockListDetailEntity> listed = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda()
.eq(DisStockListDetailEntity::getReservationId, i.getId())
.eq(DisStockListDetailEntity::getStockListId, i.getStockListId())
.eq(DisStockListDetailEntity::getSku, i.getSku())
.ne(DisStockListDetailEntity::getStockPackageStatus, ReservationPackageStatusConstant.quxiao.getValue())
);
if (Func.isNotEmpty(listed)) {
@ -4565,7 +4578,12 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
String consigneeUnit = distrilbutionBillLading.getConsigneeUnit();
distrilbutionBillLading.setConsigneeUnit(consigneeUnit);
}
String consignee = distrilbutionBillLading.getConsigneeUnit();
BasicdataClientEntity client = clientClient.findByName(consignee);
if (Objects.isNull(client)){
throw new CustomerException(consignee+"查询客户信息失败");
}
distrilbutionBillLading.setClientId(client.getId());
this.save(distrilbutionBillLading);
//新增自提日志
// 创建备货任务

46
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseInventoryLogController.java

@ -0,0 +1,46 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* ReWarehouse and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* ReWarehouses of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* ReWarehouses 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 Warehouse.
* 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.warehouse.controller;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.warehouse.entity.WarehouseConfigEntity;
import com.logpm.warehouse.service.IWarehouseConfigService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
/**
* 备货扫描记录 控制器
*
* @author lmy
* @since 2023-08-24
*/
@RestController
@AllArgsConstructor
@RequestMapping("/warehouseConfig")
@Api(value = "库存品操作日志", tags = "库存品操作日志")
public class WarehouseInventoryLogController extends BladeController {
}

17
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseInventoryLogClient.java

@ -0,0 +1,17 @@
package com.logpm.warehouse.feign;
import com.logpm.warehouse.service.IWarehouseInventoryLogService;
import com.logpm.warehouse.service.IWarehouseSettingService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
@ApiIgnore()
@RestController
@AllArgsConstructor
public class WarehouseInventoryLogClient implements IWarehouseInventoryLogClient{
private final IWarehouseInventoryLogService warehouseInventoryLogService;
}

10
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseInventoryLogMapper.java

@ -0,0 +1,10 @@
package com.logpm.warehouse.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.warehouse.entity.WarehouseInventoryLogEntity;
import com.logpm.warehouse.entity.WarehouseLog;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface WarehouseInventoryLogMapper extends BaseMapper<WarehouseInventoryLogEntity> {
}

6
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseInventoryLogMapper.xml

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.logpm.warehouse.mapper.WarehouseInventoryLogMapper">
</mapper>

10
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseInventoryLogService.java

@ -0,0 +1,10 @@
package com.logpm.warehouse.service;
import com.logpm.warehouse.entity.WarehouseInventoryLogEntity;
import com.logpm.warehouse.entity.WarehouseLog;
import org.springblade.core.mp.base.BaseService;
public interface IWarehouseInventoryLogService extends BaseService<WarehouseInventoryLogEntity> {
}

23
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseInventoryLogServiceImpl.java

@ -0,0 +1,23 @@
package com.logpm.warehouse.service.impl;
import com.logpm.warehouse.entity.WarehouseInventoryLogEntity;
import com.logpm.warehouse.entity.WarehouseLog;
import com.logpm.warehouse.mapper.WarehouseInventoryLogMapper;
import com.logpm.warehouse.mapper.WarehouseInventoryMapper;
import com.logpm.warehouse.mapper.WarehouseLogMapper;
import com.logpm.warehouse.service.IWarehouseInventoryLogService;
import com.logpm.warehouse.service.IWarehouseLogService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
@Slf4j
@AllArgsConstructor
@Service
public class WarehouseInventoryLogServiceImpl extends BaseServiceImpl<WarehouseInventoryLogMapper, WarehouseInventoryLogEntity> implements IWarehouseInventoryLogService {
private final WarehouseInventoryMapper warehouseInventoryMapper;
}
Loading…
Cancel
Save