Browse Source

Merge remote-tracking branch 'origin/dev' into dev

training
pref_mail@163.com 1 year ago
parent
commit
d4cb8e0972
  1. 4
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesAbnormalPackageEntity.java
  2. 4
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesDecreaseImageEntity.java
  3. 4
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesProcessorEntity.java
  4. 5
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataGoodsAllocationClient.java
  5. 3
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionDeliveryListClient.java
  6. 11
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionReservationClient.java
  7. 10
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionRetentionScanVo.java
  8. 80
      blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/entity/OrderLocationEntity.java
  9. 2
      blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IOldSystemDataPushClient.java
  10. 22
      blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IOrderLocationClient.java
  11. 8
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/BillladingDTO.java
  12. 1
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineBillladingPackageVO.java
  13. 12
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseRetentionScanEntity.java
  14. 6
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseUpdownTypeClient.java
  15. 20
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/QuestContrastVO.java
  16. 10
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/QuestDetailVO.java
  17. 29
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/RetentionReservationVO.java
  18. 6
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/WarehouseRetentionRecordVO.java
  19. 11
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/WarehouseRetentionScanVO.java
  20. 6
      blade-service/logpm-aftersales/pom.xml
  21. 6
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java
  22. 18
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/dto/AftersalesWorkOrderDTO.java
  23. 3
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/IAftersalesWorkOrderService.java
  24. 89
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java
  25. 11
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTripartiteMallController.java
  26. 13
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataGoodsAllocationClient.java
  27. 22
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java
  28. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionDeliveryListClient.java
  29. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionReservationClient.java
  30. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.java
  31. 65
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml
  32. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.java
  33. 60
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml
  34. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java
  35. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java
  36. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  37. 60
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  38. 22
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/OrderLocationClient.java
  39. 9
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/OrderLocationMapper.java
  40. 9
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IOrderLocationService.java
  41. 29
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/OrderLocationServiceImpl.java
  42. 34
      blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/SyncOrderInfoToPlatform.java
  43. 159
      blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/SyncWarehouseData.java
  44. 5
      blade-service/logpm-patch/src/main/java/com/logpm/patch/service/ISyncOrderInfoService.java
  45. 2
      blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/AsyncDataServiceImpl.java
  46. 529
      blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncOrderInfoServiceImpl.java
  47. 20
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/TaskQuestController.java
  48. 10
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseRetentionRecordController.java
  49. 3
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/QuestDetailDTO.java
  50. 3
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseTrayTypeClient.java
  51. 34
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseUpdownTypeClient.java
  52. 17
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.xml
  53. 14
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseRetentionRecordMapper.java
  54. 123
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseRetentionRecordMapper.xml
  55. 14
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/ITaskQuestService.java
  56. 10
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseRetentionRecordService.java
  57. 232
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java
  58. 69
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionRecordServiceImpl.java
  59. 6
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java

4
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesAbnormalPackageEntity.java

@ -65,7 +65,7 @@ public class AftersalesAbnormalPackageEntity extends TenantEntity {
* 异常ID
*/
@ApiModelProperty(value = "异常ID")
private String workOrderId;
private Long workOrderId;
/**
* 数量
*/
@ -80,7 +80,7 @@ public class AftersalesAbnormalPackageEntity extends TenantEntity {
* 仓库ID
*/
@ApiModelProperty(value = "仓库ID")
private String warehouseId;
private Long warehouseId;
/**
* 包件图片路径
*/

4
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesDecreaseImageEntity.java

@ -65,7 +65,7 @@ public class AftersalesDecreaseImageEntity extends TenantEntity {
* 异常工单Id
*/
@ApiModelProperty(value = "异常工单Id")
private String workOrderId;
private Long workOrderId;
/**
* 图片类型
*/
@ -85,6 +85,6 @@ public class AftersalesDecreaseImageEntity extends TenantEntity {
* 仓库id
*/
@ApiModelProperty(value = "仓库id")
private String warehouseId;
private Long warehouseId;
}

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

@ -75,7 +75,7 @@ public class AftersalesProcessorEntity extends TenantEntity {
* 异常工单ID
*/
@ApiModelProperty(value = "异常工单ID")
private String workOrderId;
private Long workOrderId;
/**
* 状态
*/
@ -90,6 +90,6 @@ public class AftersalesProcessorEntity extends TenantEntity {
* 仓库ID
*/
@ApiModelProperty(value = "仓库ID")
private String warehouseId;
private Long warehouseId;
}

5
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataGoodsAllocationClient.java

@ -25,6 +25,8 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
/**
* 货位 Feign接口类
*
@ -58,4 +60,7 @@ public interface IBasicdataGoodsAllocationClient {
void updateAllocationStatus(@RequestParam("allocationId") Long allocationId, @RequestParam("allocationStatus") String allocationStatus);
@GetMapping(API_PREFIX+"/getEntityByAllocationId")
BasicdataGoodsAllocationEntity getEntityByAllocationId(@RequestParam("allocationId") Long allocationId);
@GetMapping(API_PREFIX+"/findListByNewWarehouseId")
List<BasicdataGoodsAllocationEntity> findListByNewWarehouseId(@RequestParam Long newWarehouseId);
}

3
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionDeliveryListClient.java

@ -97,6 +97,9 @@ public interface IDistributionDeliveryListClient {
@GetMapping(TOP+"/retentionDeliveryReservationZeroPackage")
boolean retentionDeliveryReservationZeroPackage(@RequestParam("deliveryId")Long deliveryId,@RequestParam("reservationId") Long reservationId,@RequestParam("orderPackageId") Long orderPackageId, @RequestParam("retentionQuantity")Integer retentionQuantity, @RequestParam("orderId")Long orderId);
@GetMapping(TOP+"/getRetentionDelivery")
DistributionDeliveryListVO getRetentionDelivery(@RequestParam("deliveryId")Long deliveryId);
// /**
// * 根据配送任务ID查询配送司机信息

11
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionReservationClient.java

@ -18,6 +18,7 @@ package com.logpm.distribution.feign;
import com.logpm.distribution.entity.DistributionReservationEntity;
import com.logpm.distribution.vo.DistributionRetentionScanVo;
import org.apache.ibatis.annotations.Param;
import org.springblade.common.constant.ModuleNameConstant;
import org.springblade.core.mp.support.BladePage;
import org.springframework.cloud.openfeign.FeignClient;
@ -25,6 +26,8 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
/**
* 预约列表 Feign接口类
*
@ -49,4 +52,12 @@ public interface IDistributionReservationClient {
@GetMapping(TOP)
BladePage<DistributionReservationEntity> reservationTop(@RequestParam("current") Integer current, @RequestParam("size") Integer size);
/**
* 查询预约信息
* @param reservationIds
* @return
*/
@GetMapping(TOP+"/getReservationList")
List<DistributionReservationEntity> getReservationList(@RequestParam("reservationIds") String reservationIds);
}

10
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionRetentionScanVo.java

@ -84,5 +84,15 @@ public class DistributionRetentionScanVo {
*/
private String trainNumber;
/**
* 运单号
*/
private String waybillNumber;
/**
* 运单号
*/
private Long waybillId;
}

80
blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/entity/OrderLocationEntity.java

@ -0,0 +1,80 @@
package com.logpm.oldproject.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@Data
@TableName("ht_order_location")
@ApiModel(value = "订单货位对象", description = "订单信息")
public class OrderLocationEntity {
/** ID */
@TableId(
value = "id",
type = IdType.AUTO
)
private Integer id ;
/** 货位标识符 */
@ApiModelProperty(name = "货位标识符",notes = "")
private Integer locationId ;
/** 状态:1启用,0释放 */
@ApiModelProperty(name = "状态:1启用,0释放",notes = "")
private Integer status ;
/** 上架时间 */
@ApiModelProperty(name = "上架时间",notes = "")
private Date createTime ;
/** 修改时间 */
@ApiModelProperty(name = "修改时间",notes = "")
private Date updateTime ;
/** 删除时间 */
@ApiModelProperty(name = "删除时间",notes = "")
private Integer deleteTime ;
/** 创建人 */
@ApiModelProperty(name = "创建人",notes = "")
private Integer administratorsId ;
/** 修改人 */
@ApiModelProperty(name = "修改人",notes = "")
private Integer updateAdministrators ;
/** 合同号 */
@ApiModelProperty(name = "合同号",notes = "")
private String serviceNum ;
/** 下架时间 */
@ApiModelProperty(name = "下架时间",notes = "")
private Date outTime ;
/** 下架备注 */
@ApiModelProperty(name = "下架备注",notes = "")
private String outRemark ;
/** 上架类型:1,按服务号上架,2按自编号上架,3,按包条码上架,4托盘码上架 */
@ApiModelProperty(name = "上架类型:1,按服务号上架,2按自编号上架,3,按包条码上架,4托盘码上架",notes = "")
private Integer type ;
/** 自编号 */
@ApiModelProperty(name = "自编号",notes = "")
private String selfnumber ;
/** 托盘码id */
@ApiModelProperty(name = "托盘码id",notes = "")
private Integer trayId ;
/** 包条码 */
@ApiModelProperty(name = "包条码",notes = "")
@TableField("unitNo")
private String unitNo ;
/** 托盘扫码id */
@ApiModelProperty(name = "托盘扫码id",notes = "")
private Integer trayScanId ;
/** */
@ApiModelProperty(name = "",notes = "")
private Integer oldId ;
/** 是否为零担:1=是,2=否 */
@ApiModelProperty(name = "是否为零担:1=是,2=否",notes = "")
private Integer isZero ;
/** 备注 */
@ApiModelProperty(name = "备注",notes = "")
private String remark ;
}

2
blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IOldSystemDataPushClient.java

@ -24,6 +24,6 @@ public interface IOldSystemDataPushClient {
@PostMapping(API_PREFIX + "/pushOldSystemSignInfo")
@PostMapping(API_PREFIX + "/sendPackageData")
boolean sendPackageData(@RequestBody Map<String,Object> dataMap);
}

22
blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IOrderLocationClient.java

@ -0,0 +1,22 @@
package com.logpm.oldproject.feign;
import com.logpm.oldproject.entity.OrderLocationEntity;
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.RequestParam;
import java.util.List;
@FeignClient(
value = ModuleNameConstant.APPLICATION_OLDPROJECT_NAME
)
public interface IOrderLocationClient {
String API_PREFIX = "/client";
String TOP = API_PREFIX + "/top3";
@GetMapping(API_PREFIX + "/findListByLocationId")
List<OrderLocationEntity> findListByLocationId(@RequestParam Integer locationId);
}

8
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/BillladingDTO.java

@ -20,10 +20,10 @@ public class BillladingDTO extends TrunklineBillladingEntity {
private Integer type;//1开始提货 2提货完成 3取消完成
private String billladingCode;//批次号
private String driverName;//司机名称
private String driverPhone;//司机电话
private String carNumber;//车牌号
// private String billladingCode;//批次号
// private String driverName;//司机名称
// private String driverPhone;//司机电话
// private String carNumber;//车牌号
private String waybillNo;//运单号
private String orderPackageCode;//包件码
private String orderCode;//订单号

1
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineBillladingPackageVO.java

@ -13,7 +13,6 @@ public class TrunklineBillladingPackageVO extends TrunklineBillladingPackageEnti
private String waybillNo;//运单号
private String orderCode;//订单号
private String destination;//到站
private Integer incomingType;//入库类型
private String trayName;//托盘名称
private String trayCode;//托盘编码
private String firstPickName;//一级品类

12
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseRetentionScanEntity.java

@ -229,4 +229,16 @@ public class WarehouseRetentionScanEntity extends TenantEntity {
@ApiModelProperty(value = "取消状态 0-否 1-是")
private String cancelRetentionStatus;
/**
* 运单号
*/
@ApiModelProperty(value = "运单号")
private String waybillNumber;
/**
* 运单Id
*/
@ApiModelProperty(value = "运单Id")
private Long waybillId;
}

6
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseUpdownTypeClient.java

@ -59,4 +59,10 @@ public interface IWarehouseUpdownTypeClient {
@GetMapping(TOP + "/downTray")
R downTray(@RequestParam("trayCode") String trayCode, @RequestParam("warehouseId") Long warehouseId);
@GetMapping(TOP + "/upShelfTray")
boolean upShelfTray(@RequestParam("trayCode") String trayCode, @RequestParam("locationId") Long locationId, @RequestParam("warehouseId") Long warehouseId);
@GetMapping(TOP + "/upShelfPackage")
boolean upShelfPackage(@RequestParam String orderPackageCode, @RequestParam Long locationId, @RequestParam Long warehouseId);
}

20
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/QuestContrastVO.java

@ -2,6 +2,8 @@ package com.logpm.warehouse.vo;
import lombok.Data;
import java.util.Date;
/**
* 对比数据实体
*/
@ -16,6 +18,10 @@ public class QuestContrastVO {
* 品牌名称
*/
private String brandName;
/**
* 入库批次号
*/
private String incomingBatch;
/**
* 商场 名称
*/
@ -35,11 +41,11 @@ public class QuestContrastVO {
/**
* 总件数
*/
private String totalNumber;
private Integer totalNumber;
/**
* 在库数据
*/
private String handQuantity;
private Integer handQuantity;
/**
* 所在托盘
*/
@ -55,15 +61,15 @@ public class QuestContrastVO {
/**
* 盘点时间
*/
private String updateTime;
private Date updateTime;
/**
* 盘点数据
*/
private String questNum;
private Integer questNum;
/**
* 差异数
*/
private String differenceNum;
private Integer differenceNum;
/**
* 托盘码
*/
@ -82,6 +88,10 @@ public class QuestContrastVO {
* 货物状态
*/
private String questStatusName;
/**
* 货物状态
*/
private String questStatus;

10
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/QuestDetailVO.java

@ -84,6 +84,16 @@ public class QuestDetailVO extends QuestDetailEntity {
*/
@ApiModelProperty(value = "品牌")
private String brandName;
/**
* 盘点对象;1.定制品 2零担 3 库存品
*/
@ApiModelProperty(value = "盘点对象;1.定制品 2零担 3 库存品")
private Integer questTarget;
/**
* 在库数量
*/
@ApiModelProperty(value = "在库数量")
private Integer stockNum;
/**
* 一级品

29
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/RetentionReservationVO.java

@ -0,0 +1,29 @@
package com.logpm.warehouse.vo;
import lombok.Data;
/**
* 滞留预约信息
*/
@Data
public class RetentionReservationVO {
/**
* 预约ID
*/
private Long reservationId;
/**
* 预约单号
*/
private String reservationCode;
// //客户名称
// private String reservationId;
//
// //客户地址
// private String reservationId;
//
// //客户电话
// private String reservationId;
}

6
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/WarehouseRetentionRecordVO.java

@ -16,6 +16,8 @@
*/
package com.logpm.warehouse.vo;
import com.logpm.distribution.entity.DistributionReservationEntity;
import com.logpm.distribution.vo.DistributionDeliveryListVO;
import com.logpm.warehouse.entity.WarehouseRetentionRecordEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
@ -38,4 +40,8 @@ public class WarehouseRetentionRecordVO extends WarehouseRetentionRecordEntity {
private String retentionTypeName;
private List<DistributionReservationEntity> reservationEntityList;
private DistributionDeliveryListVO deliveryListVO;
}

11
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/WarehouseRetentionScanVO.java

@ -31,4 +31,15 @@ import lombok.EqualsAndHashCode;
public class WarehouseRetentionScanVO extends WarehouseRetentionScanEntity {
private static final long serialVersionUID = 1L;
/**
* 滞留方式
*/
private String retentionWayName;
/**
* 货物类型
*/
private String scanTypeName;
}

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

@ -39,6 +39,12 @@
<version>${bladex.project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>logpm-basicdata-api</artifactId>
<version>3.2.0.RELEASE</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>

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

@ -16,6 +16,7 @@
*/
package com.logpm.aftersales.controller;
import com.logpm.aftersales.dto.AftersalesWorkOrderDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -23,6 +24,7 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import lombok.AllArgsConstructor;
import javax.validation.Valid;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
@ -55,6 +57,7 @@ import javax.servlet.http.HttpServletResponse;
@AllArgsConstructor
@RequestMapping("/aftersalesWorkOrder")
@Api(value = "客服异常工单", tags = "客服异常工单接口")
@Slf4j
public class AftersalesWorkOrderController extends BladeController {
private final IAftersalesWorkOrderService aftersalesWorkOrderService;
@ -117,7 +120,8 @@ public class AftersalesWorkOrderController extends BladeController {
@PostMapping("/submit")
@ApiOperationSupport(order = 6)
@ApiOperation(value = "新增或修改", notes = "传入aftersalesWorkOrder")
public R submit(@Valid @RequestBody AftersalesWorkOrderEntity aftersalesWorkOrder) {
public R submit(@Valid @RequestBody AftersalesWorkOrderDTO aftersalesWorkOrder) {
log.info("工单创建的数据{}",aftersalesWorkOrder.toString());
return R.status(aftersalesWorkOrderService.saveOrUpdateOwn(aftersalesWorkOrder));
}

18
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/dto/AftersalesWorkOrderDTO.java

@ -16,10 +16,12 @@
*/
package com.logpm.aftersales.dto;
import com.logpm.aftersales.entity.AftersalesWorkOrderEntity;
import com.logpm.aftersales.entity.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
/**
* 客服异常工单 数据传输对象实体类
*
@ -30,5 +32,19 @@ import lombok.EqualsAndHashCode;
@EqualsAndHashCode(callSuper = true)
public class AftersalesWorkOrderDTO extends AftersalesWorkOrderEntity {
private static final long serialVersionUID = 1L;
/**
* 包件
*/
private List<AftersalesAbnormalPackageEntity> packageEntityList;
/**
* 责任方和处理方
*/
private List<AftersalesProcessorEntity> processorEntityList;
/**
* 货损图片
*/
private List<AftersalesDecreaseImageEntity> decreaseImageEntityList;
}

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

@ -17,6 +17,7 @@
package com.logpm.aftersales.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.logpm.aftersales.dto.AftersalesWorkOrderDTO;
import com.logpm.aftersales.entity.AftersalesWorkOrderEntity;
import com.logpm.aftersales.vo.AftersalesWorkOrderVO;
import com.logpm.aftersales.excel.AftersalesWorkOrderExcel;
@ -54,5 +55,5 @@ public interface IAftersalesWorkOrderService extends BaseService<AftersalesWorkO
* @param aftersalesWorkOrder
* @return
*/
boolean saveOrUpdateOwn(AftersalesWorkOrderEntity aftersalesWorkOrder);
boolean saveOrUpdateOwn(AftersalesWorkOrderDTO aftersalesWorkOrder);
}

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

@ -17,15 +17,35 @@
package com.logpm.aftersales.service.impl;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.logpm.aftersales.dto.AftersalesWorkOrderDTO;
import com.logpm.aftersales.entity.AftersalesAbnormalPackageEntity;
import com.logpm.aftersales.entity.AftersalesDecreaseImageEntity;
import com.logpm.aftersales.entity.AftersalesProcessorEntity;
import com.logpm.aftersales.entity.AftersalesWorkOrderEntity;
import com.logpm.aftersales.service.IAftersalesAbnormalPackageService;
import com.logpm.aftersales.service.IAftersalesDecreaseImageService;
import com.logpm.aftersales.service.IAftersalesProcessorService;
import com.logpm.aftersales.vo.AftersalesWorkOrderVO;
import com.logpm.aftersales.excel.AftersalesWorkOrderExcel;
import com.logpm.aftersales.mapper.AftersalesWorkOrderMapper;
import com.logpm.aftersales.service.IAftersalesWorkOrderService;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseEntity;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.utils.BeanUtil;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
@ -35,8 +55,17 @@ import java.util.List;
* @since 2023-11-17
*/
@Service
@Slf4j
@AllArgsConstructor
public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWorkOrderMapper, AftersalesWorkOrderEntity> implements IAftersalesWorkOrderService {
private final IAftersalesAbnormalPackageService aftersalesAbnormalPackageService;
private final IAftersalesDecreaseImageService aftersalesDecreaseImageService;
private final IAftersalesProcessorService aftersalesProcessorService;
private final IBasicdataWarehouseClient warehouseClient;
@Override
public IPage<AftersalesWorkOrderVO> selectAftersalesWorkOrderPage(IPage<AftersalesWorkOrderVO> page, AftersalesWorkOrderVO aftersalesWorkOrder) {
return page.setRecords(baseMapper.selectAftersalesWorkOrderPage(page, aftersalesWorkOrder));
@ -58,10 +87,66 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
* @return
*/
@Override
public boolean saveOrUpdateOwn(AftersalesWorkOrderEntity aftersalesWorkOrder) {
@Transactional(rollbackFor = Exception.class)
public boolean saveOrUpdateOwn(AftersalesWorkOrderDTO aftersalesWorkOrder) {
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(ObjectUtils.isNull(myCurrentWarehouse)){
throw new ServiceException("请选择仓库!!");
}
BladeUser user = AuthUtil.getUser();
if(ObjectUtils.isNull(aftersalesWorkOrder.getId())){
//新增
return baseMapper.insert(aftersalesWorkOrder) > 0 ? true : false;
aftersalesWorkOrder.setInitiationIdentification("PC");
aftersalesWorkOrder.setCreateUser(user.getUserId());
aftersalesWorkOrder.setCreateTime(new Date());
aftersalesWorkOrder.setCreateDept(Long.valueOf(user.getDeptId()));
aftersalesWorkOrder.setIsDeleted(0);
aftersalesWorkOrder.setStatus(1);
baseMapper.insert(aftersalesWorkOrder);
if(ObjectUtils.isNotNull(aftersalesWorkOrder.getPackageEntityList())){
//包件信息
List<AftersalesAbnormalPackageEntity> list = new ArrayList<>();
aftersalesWorkOrder.getPackageEntityList().stream().forEach(i ->{
AftersalesAbnormalPackageEntity packageEntity = new AftersalesAbnormalPackageEntity();
BeanUtil.copyProperties(i,packageEntity);
packageEntity.setWorkOrderId(aftersalesWorkOrder.getId());
packageEntity.setWarehouseId(myCurrentWarehouse.getId());
list.add(packageEntity);
});
if(!list.isEmpty()){
aftersalesAbnormalPackageService.saveBatch(list);
}
}
if(ObjectUtils.isNotNull(aftersalesWorkOrder.getDecreaseImageEntityList())){
//货损图片
List<AftersalesDecreaseImageEntity> list = new ArrayList<>();
aftersalesWorkOrder.getDecreaseImageEntityList().stream().forEach(i ->{
AftersalesDecreaseImageEntity packageEntity = new AftersalesDecreaseImageEntity();
BeanUtil.copyProperties(i,packageEntity);
packageEntity.setWorkOrderId(aftersalesWorkOrder.getId());
packageEntity.setWarehouseId(myCurrentWarehouse.getId());
list.add(packageEntity);
});
if(!list.isEmpty()){
aftersalesDecreaseImageService.saveBatch(list);
}
}
if(ObjectUtils.isNotNull(aftersalesWorkOrder.getProcessorEntityList())){
//责任方 处理方
List<AftersalesProcessorEntity> list = new ArrayList<>();
aftersalesWorkOrder.getProcessorEntityList().stream().forEach(i ->{
AftersalesProcessorEntity packageEntity = new AftersalesProcessorEntity();
BeanUtil.copyProperties(i,packageEntity);
packageEntity.setWorkOrderId(aftersalesWorkOrder.getId());
packageEntity.setWarehouseId(myCurrentWarehouse.getId());
list.add(packageEntity);
});
if(!list.isEmpty()){
aftersalesProcessorService.saveBatch(list);
}
}
return true;
}else{
//修改

11
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTripartiteMallController.java

@ -18,6 +18,7 @@ package com.logpm.basicdata.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.basicdata.entity.BasicdataTripartiteMallEntity;
import com.logpm.basicdata.excel.BasicdataTripartiteMallExcel;
@ -75,7 +76,15 @@ public class BasicdataTripartiteMallController extends BladeController {
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入basicdataTripartiteMall")
public R<IPage<BasicdataTripartiteMallEntity>> list(@ApiIgnore @RequestParam Map<String, Object> basicdataTripartiteMall, Query query) {
IPage<BasicdataTripartiteMallEntity> pages = basicdataTripartiteMallService.page(Condition.getPage(query), Condition.getQueryWrapper(basicdataTripartiteMall, BasicdataTripartiteMallEntity.class));
Object o = basicdataTripartiteMall.get("clientId");
if(ObjectUtils.isNotNull(o)){
basicdataTripartiteMall.remove("clientId");
}
QueryWrapper<BasicdataTripartiteMallEntity> queryWrapper = Condition.getQueryWrapper(basicdataTripartiteMall, BasicdataTripartiteMallEntity.class);
if(ObjectUtils.isNotNull(o)){
queryWrapper.eq("client_id",o);
}
IPage<BasicdataTripartiteMallEntity> pages = basicdataTripartiteMallService.page(Condition.getPage(query),queryWrapper);
return R.data(pages);
}

13
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataGoodsAllocationClient.java

@ -16,6 +16,7 @@
*/
package com.logpm.basicdata.feign;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.basicdata.entity.BasicdataGoodsAllocationEntity;
@ -28,6 +29,8 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
/**
* 货位 Feign实现类
*
@ -79,4 +82,14 @@ public class BasicdataGoodsAllocationClient implements IBasicdataGoodsAllocation
return BasicdataGoodsAllocationService.getById(allocationId);
}
@Override
public List<BasicdataGoodsAllocationEntity> findListByNewWarehouseId(Long newWarehouseId) {
QueryWrapper<BasicdataGoodsAllocationEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("warehouse_id",newWarehouseId)
.eq("enable_status","1")
.eq("allocation_status","1")
.eq("is_deleted",0);
return BasicdataGoodsAllocationService.list(queryWrapper);
}
}

22
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java

@ -154,6 +154,16 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
if (ObjectUtils.isNull(basicdataClient.getPid())) {
basicdataClient.setPid(0L);
}
//查询客户编码和客户名称是否存在
BasicdataClientEntity basicdataClient1 = baseMapper.selectOne(Wrappers.<BasicdataClientEntity>query().lambda()
.eq(BasicdataClientEntity::getClientCode, basicdataClient.getClientCode())
.or()
.eq(BasicdataClientEntity::getClientName, basicdataClient.getClientName())
);
if(ObjectUtils.isNotNull(basicdataClient1)){
throw new ServiceException("客户编码或客户名称已存在");
}
//添加
this.save(basicdataClient);
// //绑定客户账号和客户关系
@ -291,6 +301,8 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
List<DictBiz> clientBiz = DictBizCache.getList(DictBizConstant.CLIENT_TYPE); //客 工
List<DictBiz> freightBiz = DictBizCache.getList(DictBizConstant.BASIC_FREIGHT_TYPE); //客 工
Set<String> set =new HashSet<>();
QueryWrapper<BasicdataClientEntity> queryWrapper = new QueryWrapper<>();
List<BasicdataClientEntity> basicdataClients = baseMapper.selectList(queryWrapper);
for (BasicdataClientExcel i : data) {
log.info("导入数据《》《》{}",i);
if(set.isEmpty()){
@ -301,10 +313,18 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
continue;
}
}
if(ObjectUtils.isNull(i.getClientCode()) || ObjectUtils.isNull(i.getClientName())){
throw new ServiceException("客户编码或客户名称不能为空!");
}
BasicdataClientEntity basicdataClient = new BasicdataClientEntity();
BeanUtil.copyProperties(i,basicdataClient);
//查询客户编码和客户名称是否存在
boolean b = basicdataClients.stream().anyMatch(ii -> ii.getClientCode().equals(basicdataClient.getClientCode())
|| ii.getClientName().equals(basicdataClient.getClientName()));
if(b){
throw new ServiceException("客户编码或客户名称已存在");
}
// Optional<DictBiz> first = dictBizs.stream().filter(ii -> ii.getDictValue().equals(i.getTypeService())).findFirst();
Optional<DictBiz> clientFirst = clientBiz.stream().filter(ii -> ii.getDictValue().equals(i.getClientType())).findFirst();
// i.setTypeService(first.get().getDictValue());

6
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionDeliveryListClient.java

@ -76,5 +76,11 @@ public class DistributionDeliveryListClient implements IDistributionDeliveryList
return distributionDeliveryListService.retentionDeliveryReservationZeroPackage(deliveryId,reservationId,orderPackageId,retentionQuantity,orderId);
}
@Override
public DistributionDeliveryListVO getRetentionDelivery(Long deliveryId) {
return distributionDeliveryListService.getRetentionDelivery(deliveryId);
}
}

7
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionReservationClient.java

@ -24,10 +24,13 @@ import lombok.AllArgsConstructor;
import org.springblade.core.mp.support.BladePage;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
/**
* 预约列表 Feign实现类
*
@ -51,6 +54,10 @@ public class DistributionReservationClient implements IDistributionReservationCl
return BladePage.of(page);
}
@Override
public List<DistributionReservationEntity> getReservationList(String reservationIds) {
return reservationService.getRetentionReservationList(reservationIds);
}
}

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

@ -453,4 +453,11 @@ public interface DistributionDeliveryListMapper extends BaseMapper<DistributionD
* @return
*/
SignPushDataDTO selectPushOldDelivery(@Param("reservationId") Long reservationId,@Param("deliveryId") Long deliveryId);
/**
* 查询滞留的配送任务信息
* @param deliveryId
* @return
*/
DistributionDeliveryListVO selectDeliveryById(Long deliveryId);
}

65
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml

@ -1646,6 +1646,8 @@
ldpl.order_package_code AS orderPackageCode,
ldpl.quantity AS retentionQuantity,
1 AS conditions,
ldpl.waybill_number AS waybillNumber,
ldpl.waybill_id AS waybillId,
1 AS scanType
FROM
logpm_distribution_delivery_list AS lddl
@ -1670,6 +1672,8 @@
ldrs.reservation_num AS maxRetention,
ldrzp.parcel_list_id AS orderPackageId,
ldpl.firsts AS materialName,
ldpl.waybill_number AS waybillNumber,
ldpl.waybill_id AS waybillId,
3 AS conditions,
2 AS scanType
FROM
@ -1734,5 +1738,66 @@
LEFT JOIN logpm_distribution_delivery_list AS lddl ON lds.delivery_id = lddl.id
LEFT JOIN logpm_distribution_reservation AS ldr ON lds.reservation_id = ldr.id
</select>
<select id="selectDeliveryById" resultType="com.logpm.distribution.vo.DistributionDeliveryListVO">
SELECT
id,
tenant_id,
create_user,
create_time,
update_user,
update_time,
status,
is_deleted,
create_dept,
reserve1,
reserve2,
reserve3,
reserve4,
reserve5,
train_number,
warehouse_name,
warehouse_id,
type,
forklift_id,
forklift_name,
kind,
vehicle_name,
driver_name,
vehicle_id,
driver_id,
distribution_company,
distribution_company_id,
delivery_status,
delivery_list_loading_status,
customers_number,
price,
added_services_id,
order_number,
delivery_number,
scanned_number,
loading_team_type,
loading_team_id,
loading_team_name,
reservation_id,
lead_time,
order_code,
order_id,
loading_time,
note_number,
source,
fee,
task_time,
inventory_nub,
preparation_time,
positioning,
positioning_adr,
remarks,
unloading_team_id,
unloading_team_name
FROM
logpm_distribution_delivery_list
WHERE
id = #{deliveryId}
</select>
</mapper>

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

@ -307,4 +307,11 @@ public interface DistributionReservationMapper extends BaseMapper<DistributionRe
* @return
*/
int cancelReservationZeroPackage(Long reservationId, Long orderPackageId, Integer retentionQuantity);
/**
* 查询滞留任务预约信息
* @param reservationIds
* @return
*/
List<DistributionReservationEntity> getRetentionReservationList(@Param("ids") List<String> reservationIds);
}

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

@ -1191,5 +1191,65 @@
WHERE
ldr.id = #{reservationId} AND ldrs.stocklist_id = #{stockListId}
</select>
<select id="getRetentionReservationList"
resultType="com.logpm.distribution.entity.DistributionReservationEntity">
SELECT id,
tenant_id,
create_user,
create_time,
update_user,
update_time,
status,
is_deleted,
create_dept,
stock_article_id,
mall_id,
mail_phone,
mall_name,
store_id,
store_name,
consignee,
delivery_address,
reservation_date,
serve_type,
delivery_way,
delivery_type,
collect_fee,
other_fee,
replace_fee,
delivery_phone,
reservation_status,
order_source,
stockup_status,
signing_status,
loading_status,
goods_area_name,
goods_area_id,
reserve1,
reserve2,
reserve3,
reserve4,
reserve5,
remarks,
shopping_id,
period_of_time,
fee,
reservation_num,
reservation_stock_list_num,
reservation_code,
service_number,
cancel_reason,
is_urgent,
collection_fee,
warehouse_name,
warehouse_id,
receiving_unit,
waybill_id,
waybill_no
FROM logpm_distribution_reservation WHERE id IN
<foreach collection="ids" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</select>
</mapper>

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

@ -353,6 +353,13 @@ public interface IDistributionDeliveryListService extends BaseService<Distributi
*/
boolean retentionDeliveryReservationZeroPackage(Long deliveryId, Long reservationId, Long orderPackageId, Integer retentionQuantity,Long orderId);
/**
* 查询滞留配送任务
* @param deliveryId
* @return
*/
DistributionDeliveryListVO getRetentionDelivery(Long deliveryId);
// /**
// * 滞留取消配送
// * @param distributionRetentionScanVo

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

@ -234,4 +234,10 @@ public interface IDistributionReservationService extends BaseService<Distributio
*/
IPage<DistributionReservationVO> reservationList(IPage<DistributionReservationVO> page, Map<String, Object> distrbutionReservation);
/**
* 查询滞留预约信息
* @param reservationIds
* @return
*/
List<DistributionReservationEntity> getRetentionReservationList(String reservationIds);
}

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

@ -5423,7 +5423,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
.eq(DistributionLoadscanEntity::getOrderPackageCode, distrilbutionloadingscanDTO.getBarcode())
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())
);
List<DistributionParcelListEntity> parcelListEntities = baseMapper.selectPackageListByDeliveryListId(distrilbutionloadingscanDTO.getDeliveryId());
// List<DistributionParcelListEntity> parcelListEntities = baseMapper.selectPackageListByDeliveryListId(distrilbutionloadingscanDTO.getDeliveryId());
if (Func.isNotEmpty(loadscanEntityList)) {
if (loadscanEntityList.size() == 1) {
//包件存在装车才能进行滞留
@ -5732,6 +5732,12 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
}
@Override
public DistributionDeliveryListVO getRetentionDelivery(Long deliveryId) {
//查询滞留的配送任务 这里需要注意配送任务可能会进行删除
return baseMapper.selectDeliveryById(deliveryId);
}
public Map<String, String> getDriverCar(String kind, Long deliveryListEntityId) {
Map<String, String> map = new HashMap<>();
String dirverName = null;

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

@ -202,7 +202,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
private DistributionReservationZeroPackageMapper distributionReservationZeroPackageMapper;
@Autowired
private IBasicdataClientClient basicdataClientClient;
private IBasicdataClientClient basicdataClientClient;
@Override
@ -212,29 +212,30 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
/**
* 预约导出
*
* @param distrbutionReservation
* @return
*/
@Override
public List<DistributionReservationExcel> exportDistrbutionReservation(Map<String, Object> distrbutionReservation) {
Object o = distrbutionReservation.get("ids");
if(ObjectUtils.isNotNull(o)){
if (ObjectUtils.isNotNull(o)) {
distrbutionReservation.remove("ids");
}
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if(ObjectUtils.isNull()){
if (ObjectUtils.isNull()) {
throw new ServiceException("请选择仓库!");
}
QueryWrapper<DistributionReservationEntity> queryWrapper = Condition.getQueryWrapper(distrbutionReservation, DistributionReservationEntity.class);
queryWrapper.lambda().eq(DistributionReservationEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
if(ObjectUtils.isNotNull(o)){
queryWrapper.in("id",String.valueOf(o).split(","));
if (ObjectUtils.isNotNull(o)) {
queryWrapper.in("id", String.valueOf(o).split(","));
}
queryWrapper.eq("warehouse_id",myCurrentWarehouse.getId());
queryWrapper.eq("warehouse_id", myCurrentWarehouse.getId());
// List<DistributionReservationExcel> distrbutionReservationList = baseMapper.exportDistrbutionReservation(queryWrapper);
List<DistributionReservationVO> distrbutionReservationList = baseMapper.exportDistrbutionReservation(queryWrapper);
List<DistributionReservationExcel> excelList = new ArrayList<>();
distrbutionReservationList.forEach( dis -> {
distrbutionReservationList.forEach(dis -> {
// distrbutionReservation.setTypeName(DictCache.getValue(DictEnum.YES_NO, DistrbutionReservation.getType()));
DistributionReservationExcel reservationExcel = new DistributionReservationExcel();
reservationExcel.setReservationCode(dis.getReservationCode());
@ -249,7 +250,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
reservationExcel.setReservationData(dis.getReservationDate());
String value3 = DictBizCache.getValue(DictBizConstant.PERIOD_OF_TIME, dis.getPeriodOfTime());
reservationExcel.setPeriodTimeName(value3); //时段
if(ObjectUtils.isNotNull(dis.getTypeService())){
if (ObjectUtils.isNotNull(dis.getTypeService())) {
String[] split = dis.getServeType().split(",");
StringBuffer sb = new StringBuffer();
for (String s : split) {
@ -258,7 +259,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
}
reservationExcel.setServeTypeName(String.valueOf(sb));
}
if(ObjectUtils.isNotNull(dis.getDeliveryType())){
if (ObjectUtils.isNotNull(dis.getDeliveryType())) {
String[] split = dis.getDeliveryType().split(",");
StringBuffer sb = new StringBuffer();
for (String s : split) {
@ -1706,7 +1707,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
Integer newQuantityOccupied = distributionStockListEntity.getQuantityOccupied() - reservationNum;
distributionStockListEntity.setQuantityOccupied(newQuantityOccupied);
distributionStockListService.updateById(distributionStockListEntity);
disStockListDetailMapper.deleteInventoryByStockListId(distributionReservationStocklistEntity.getStocklistId(),distributionReservationStocklistEntity.getReservationId());
disStockListDetailMapper.deleteInventoryByStockListId(distributionReservationStocklistEntity.getStocklistId(), distributionReservationStocklistEntity.getReservationId());
List<DisStockListDetailEntity> list = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda()
.eq(DisStockListDetailEntity::getReservationId, distributionReservationStocklistEntity.getReservationId()).eq(DisStockListDetailEntity::getStockListId, distributionReservationStocklistEntity.getStocklistId()));
list.forEach(l -> l.setStockPackageStatus(InventoryPackageStatusConstant.quxiao.getValue()));
@ -1724,7 +1725,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
reservationEntity.setServeType(distributionReservationDTO.getServeType());
reservationEntity.setReservationNum(packTotal.get());
reservationEntity.setMallName(String.join(",", mallName));
if (Func.isNotEmpty(mallId)){
if (Func.isNotEmpty(mallId)) {
reservationEntity.setMallId(mallId.get(0));
}
reservationEntity.setStoreName(String.join(",", storeName));
@ -2073,7 +2074,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
reservationEntity.setWaybillId(String.join(",", waybillId));
reservationEntity.setMailPhone(String.join(",", marketPhone));
reservationEntity.setMallName(String.join(",", mallName));
if (Func.isNotEmpty(mallId)){
if (Func.isNotEmpty(mallId)) {
reservationEntity.setMallId(mallId.get(0));
}
reservationEntity.setStoreName(String.join(",", storeName));
@ -2797,7 +2798,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
return R.fail("订单已预约!!!");
}
stockArticleList.forEach(s -> {
if (Func.isNotEmpty(s.getAllocation())){
if (Func.isNotEmpty(s.getAllocation())) {
s.setAllocation(null);
}
DistributionStockArticleDTO stockArticleDTO = Func.copy(s, DistributionStockArticleDTO.class);
@ -2882,7 +2883,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
});
s.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue());
s.setAvailableQuantity(0);
if (Func.isNotEmpty(s.getAllocation())){
if (Func.isNotEmpty(s.getAllocation())) {
s.setAllocation(null);
}
distributionStockArticleService.updateById(s);
@ -3032,7 +3033,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
// i.setQuantityOccupied(count);
DistributionStockListEntity stockListEntity = distributionStockListService.getById(i.getId());
int keyongshuliang = stockListEntity.getQuantityStock() - stockListEntity.getQuantityOccupied();
if (i.getReservationNum() > keyongshuliang){
if (i.getReservationNum() > keyongshuliang) {
throw new RuntimeException("库存品库内数量不足!!!");
}
if (Func.isNotBlank(i.getServiceNumber())) {
@ -3108,7 +3109,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
}
reservationEntity.setWaybillNo(String.join(",", waybillNo));
reservationEntity.setWaybillId(String.join(",", waybillId));
if (Func.isNotEmpty(mallId)){
if (Func.isNotEmpty(mallId)) {
reservationEntity.setMallId(mallId.get(0));
}
@ -3200,31 +3201,36 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
reservationOrderPackageVO.setPackageList(allPackageList);
return R.data(reservationOrderPackageVO);
}
@Override
public IPage<DistributionReservationVO> reservationList(IPage<DistributionReservationVO> page, Map<String, Object> distrbutionReservation) {
// 查询登陆人 映射的商场ID
List<BasicdataClientUserEntity> basicdataClientUserEntityListByUserIds = basicdataClientClient.getBasicdataClientUserEntityListByUserId(AuthUtil.getUserId());
List clientIds =null;
if(Func.isNotEmpty(basicdataClientUserEntityListByUserIds)){
List clientIds = null;
if (Func.isNotEmpty(basicdataClientUserEntityListByUserIds)) {
clientIds = basicdataClientUserEntityListByUserIds.stream().map(BasicdataClientUserEntity::getClientId).collect(Collectors.toList());
}
if(ObjectUtil.isEmpty(clientIds)){
if (ObjectUtil.isEmpty(clientIds)) {
throw new ServiceException("当前登陆人无商场");
}
distrbutionReservation.put("clientIds",clientIds);
distrbutionReservation.put("clientIds", clientIds);
List<DistributionReservationEntity> distributionReservationEntities =baseMapper.reservationList(page,distrbutionReservation);
List<DistributionReservationEntity> distributionReservationEntities = baseMapper.reservationList(page, distrbutionReservation);
List<DistributionReservationVO> distributionReservationVOS = DistributionReservationWrapper.build().listVO(distributionReservationEntities);
page.setRecords(distributionReservationVOS);
return page;
}
@Override
public List<DistributionReservationEntity> getRetentionReservationList(String reservationIds) {
log.info("查询ID>>>>>>>>>>>>>>>>:{}", reservationIds);
// List<Long> ids = Func.toLongList(",", reservationIds);
if (Func.isEmpty(reservationIds)) {
return null;
}
List<String> ids = Func.toLongList(",", reservationIds).stream().map(Objects::toString).collect(Collectors.toList());
List<DistributionReservationEntity> retentionReservationList = baseMapper.getRetentionReservationList(ids);
return retentionReservationList;
}
}

22
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/OrderLocationClient.java

@ -0,0 +1,22 @@
package com.logpm.oldproject.feign;
import com.logpm.oldproject.entity.OrderLocationEntity;
import com.logpm.oldproject.service.IOrderLocationService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
@ApiIgnore()
@RestController
@AllArgsConstructor
public class OrderLocationClient implements IOrderLocationClient{
private final IOrderLocationService orderLocationService;
@Override
public List<OrderLocationEntity> findListByLocationId(Integer locationId) {
return orderLocationService.findListByLocationId(locationId);
}
}

9
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/OrderLocationMapper.java

@ -0,0 +1,9 @@
package com.logpm.oldproject.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.oldproject.entity.OrderLocationEntity;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface OrderLocationMapper extends BaseMapper<OrderLocationEntity> {
}

9
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IOrderLocationService.java

@ -0,0 +1,9 @@
package com.logpm.oldproject.service;
import com.logpm.oldproject.entity.OrderLocationEntity;
import java.util.List;
public interface IOrderLocationService {
List<OrderLocationEntity> findListByLocationId(Integer locationId);
}

29
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/OrderLocationServiceImpl.java

@ -0,0 +1,29 @@
package com.logpm.oldproject.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.logpm.oldproject.entity.OrderLocationEntity;
import com.logpm.oldproject.mapper.OrderLocationMapper;
import com.logpm.oldproject.service.IOrderLocationService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.List;
@Slf4j
@Service
@AllArgsConstructor
public class OrderLocationServiceImpl implements IOrderLocationService {
private final OrderLocationMapper orderLocationMapper;
@Override
public List<OrderLocationEntity> findListByLocationId(Integer locationId) {
QueryWrapper<OrderLocationEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("status",1)
.eq("is_zero",2)
.eq("location_id",locationId)
.orderByDesc("type");
return orderLocationMapper.selectList(queryWrapper);
}
}

34
blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/SyncOrderInfoToPlatform.java

@ -51,7 +51,6 @@ public class SyncOrderInfoToPlatform {
for (WarehouseMappingDataEntity mappingDataEntity:warehouseMappingDataEntityList){
Integer oldWarehouseId = mappingDataEntity.getOldWarehouseId();//老系统仓库id
Long newWarehouseId = mappingDataEntity.getNewWarehouseId();//新系统仓库id
Integer inventoryId = mappingDataEntity.getInventoryId();
//查询新系统是否已有仓库信息
BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(newWarehouseId);
@ -106,7 +105,7 @@ public class SyncOrderInfoToPlatform {
try{
List<String> orderCodeList = orderClient.findOrderCodeListByPage(param,oldWarehouseId,j,pageSize);
syncOrderInfoService.handleData(orderCodeList,oldWarehouseId,newWarehouseId,inventoryId);
syncOrderInfoService.handleData(orderCodeList,oldWarehouseId,newWarehouseId);
log.info("################syncOrderInfo: 同步成功{}个订单",orderCodeList.size());
one.setCurrentPage(j+1);
@ -130,6 +129,37 @@ public class SyncOrderInfoToPlatform {
return ReturnT.SUCCESS;
}
@XxlJob("syncUpdownData")
public ReturnT<String> syncUpdownData(String param) {
//查询需要同步的仓库
List<WarehouseMappingDataEntity> warehouseMappingDataEntityList = warehouseMappingDataService.getWarehouseMapping();
if(warehouseMappingDataEntityList.isEmpty()){
log.warn("###############syncUpdownData: 当前没有配置需要同步的仓库信息");
return ReturnT.FAIL;
}
for (WarehouseMappingDataEntity mappingDataEntity:warehouseMappingDataEntityList){
Long newWarehouseId = mappingDataEntity.getNewWarehouseId();
Integer oldWarehouseId = mappingDataEntity.getOldWarehouseId();
try{
//同步上架信息
syncOrderInfoService.syncUpdownData(oldWarehouseId,newWarehouseId);
}catch (CustomerException e){
log.error(e.message,e);
return ReturnT.FAIL;
}catch (Exception e){
log.error("#############syncUpdownData: 同步数据失败",e);
return ReturnT.FAIL;
}
}
log.error("#############syncUpdownData: 同步上架数据完成");
return ReturnT.SUCCESS;
}
@XxlJob("syncZeroOrderInfo")

159
blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/SyncWarehouseData.java

@ -0,0 +1,159 @@
package com.logpm.patch.jobhandle;
import com.logpm.basicdata.entity.BasicdataGoodsAllocationEntity;
import com.logpm.basicdata.entity.BasicdataGoodsAreaEntity;
import com.logpm.basicdata.entity.BasicdataGoodsShelfEntity;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.*;
import com.logpm.oldproject.entity.CargoEntity;
import com.logpm.oldproject.entity.LocationEntity;
import com.logpm.oldproject.entity.ShelfEntity;
import com.logpm.oldproject.feign.*;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@Slf4j
@AllArgsConstructor
@Component
public class SyncWarehouseData {
//-----------------新系统
private final IBasicdataWarehouseClient basicdataWarehouseClient;//仓库
private final IBasicdataGoodsAreaClient basicdataGoodsAreaClient;//货区
private final IBasicdataGoodsShelfClient basicdataGoodsShelfClient;//货架
private final IBasicdataGoodsAllocationClient basicdataGoodsAllocationClient;//货位
private final IBasicdataTrayClient basicdataTrayClient;//托盘
//-----------------老系统
private final IWarehouseClient warehouseClient;//仓库
private final ICargoClient cargoClient;//货区
private final IShelfClient shelfClient;//货架
private final ILocationClient locationClient;//货位
private final ITrayClient trayClient;//托盘
@XxlJob("syncAllocationInfo")
public ReturnT<String> syncAllocationInfo(String param) {
log.info("####################syncAllocationInfo: 同步库位信息开始");
if(StringUtil.isBlank(param)){
log.warn("#############syncAllocationInfo: 仓库参数为空");
return ReturnT.FAIL;
}
BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(Long.parseLong(param));
Long warehouseId = basicdataWarehouseEntity.getId();
Integer oldId = basicdataWarehouseEntity.getOldId();
boolean b = saveAllocationData(warehouseId, oldId);
if(!b){
return ReturnT.FAIL;
}else {
return ReturnT.SUCCESS;
}
}
private boolean saveAllocationData(Long newWarehouseId, Integer oldWarehouseId) {
BasicdataWarehouseEntity warehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(newWarehouseId);
//通过老系统仓库id去查有哪些货区
List<CargoEntity> cargoEntityList = cargoClient.getAllByWarehouseId(oldWarehouseId);
for (CargoEntity cargoEntity:cargoEntityList){
//货区数据存储
Integer cargoId = cargoEntity.getId();//老系统货区id
BasicdataGoodsAreaEntity goodsAreaEntity = new BasicdataGoodsAreaEntity();
goodsAreaEntity.setTenantId("627683");
goodsAreaEntity.setCreateUser(1714696768639311873L);
goodsAreaEntity.setUpdateUser(1714696768639311873L);
goodsAreaEntity.setCreateDept(1649331096241836033L);
goodsAreaEntity.setWarehouseId(newWarehouseId);
goodsAreaEntity.setHeadline(cargoEntity.getTitle());
goodsAreaEntity.setEnableStatus("1");
goodsAreaEntity.setAreaType("2");
goodsAreaEntity.setOldId(cargoId);
Long newAreaId = basicdataGoodsAreaClient.addCargo(goodsAreaEntity);
if(Objects.isNull(newAreaId)){
log.warn("#################saveAllocationData: 保存货区信息失败cargoId={},oldWarehouseId={}",cargoId,oldWarehouseId);
return false;
}else{
//货架数据存储
//通过老系统货区id查询所有货架
Map<Integer,Integer> shelfIsEmptyMap = new HashMap<>();
shelfIsEmptyMap.put(1,1);
shelfIsEmptyMap.put(0,2);
List<ShelfEntity> shelfEntityList = shelfClient.getAllByWarehouseIdAndCargoId(cargoId);
for (ShelfEntity shelfEntity:shelfEntityList){
Integer oldShelfId = shelfEntity.getId();
//通过货架id查询最大行数和列数
Map<String,Integer> storeyAndRow = locationClient.getStoreyAndRowByShelfId(oldShelfId);
//存入新系统货架信息
BasicdataGoodsShelfEntity goodsShelfEntity = new BasicdataGoodsShelfEntity();
goodsShelfEntity.setTenantId("627683");
goodsShelfEntity.setCreateUser(1714696768639311873L);
goodsShelfEntity.setUpdateUser(1714696768639311873L);
goodsShelfEntity.setCreateDept(1649331096241836033L);
goodsShelfEntity.setGoodsAreaId(newAreaId);
goodsShelfEntity.setGoodsShelfName(shelfEntity.getTitle());
goodsShelfEntity.setWarehouseId(newWarehouseId);
goodsShelfEntity.setWarehouseCode(warehouseEntity.getWarehouseCode());
goodsShelfEntity.setGoodsShelfStatus(2);
goodsShelfEntity.setEnableStatus(1);
goodsShelfEntity.setStoreyNum(storeyAndRow.get("storey"));
goodsShelfEntity.setRowNum(storeyAndRow.get("row"));
goodsShelfEntity.setRemarks("");
goodsShelfEntity.setOldId(oldShelfId);
Long newShelfId = basicdataGoodsShelfClient.addShelf(goodsShelfEntity);
if(Objects.isNull(newShelfId)){
log.warn("#################saveAllocationData: 保存货架信息失败oldShelfId={},oldWarehouseId={}",oldShelfId,oldWarehouseId);
return false;
}else{
//货位数据存储
Map<Integer,Integer> locationIsEmptyMap = new HashMap<>();
locationIsEmptyMap.put(1,2);
locationIsEmptyMap.put(0,1);
List<LocationEntity> locationEntities = locationClient.getAllByShelfId(oldShelfId);
// List<BasicdataGoodsAllocationEntity> newLocations = new ArrayList<>();
for (LocationEntity locationEntity:locationEntities){
Integer locationId = locationEntity.getId();
BasicdataGoodsAllocationEntity entity = new BasicdataGoodsAllocationEntity();
entity.setTenantId("627683");
entity.setId(locationId.longValue());
entity.setCreateUser(1714696768639311873L);
entity.setUpdateUser(1714696768639311873L);
entity.setCreateDept(1649331096241836033L);
entity.setGoodsAreaId(newAreaId);
entity.setGoodsAllocationName(locationEntity.getTitle());
entity.setWarehouseId(newWarehouseId);
entity.setGoodsShelfId(newShelfId);
entity.setEnableStatus("1");
entity.setAllocationStatus("1");
entity.setLayerNum(locationEntity.getFloor());
entity.setColumnNum(locationEntity.getRow());
entity.setQrCode(shelfEntity.getTitle()+"排"+locationEntity.getFloor()+"层"+locationEntity.getRow()+"列");
entity.setOldId(locationId);
Long newLocationId = basicdataGoodsAllocationClient.addLocation(entity);
if(Objects.isNull(newLocationId)){
log.warn("#################saveAllocationData: 保存货位信息失败locationId={},oldWarehouseId={}",locationId,oldWarehouseId);
return false;
}else{
log.info("#################saveAllocationData: 保存货位信息成功locationId={},oldWarehouseId={}",locationId,oldWarehouseId);
}
}
}
}
}
}
return true;
}
}

5
blade-service/logpm-patch/src/main/java/com/logpm/patch/service/ISyncOrderInfoService.java

@ -3,7 +3,7 @@ package com.logpm.patch.service;
import java.util.List;
public interface ISyncOrderInfoService {
void handleData(List<String> orderCodeList,Integer oldWarehouseId,Long newWarehouseId,Integer inventoryId);
void handleData(List<String> orderCodeList,Integer oldWarehouseId,Long newWarehouseId);
void handleDataZero(List<String> orderCodeList, Integer oldWarehouseId, Long newWarehouseId);
@ -13,4 +13,7 @@ public interface ISyncOrderInfoService {
void supplementOrderInfo(String orderCode, Long newWarehouseId, Integer oldWarehouseId);
void handleDataAndInventoryId(List<String> orderCodeList, Integer oldWarehouseId, Long newWarehouseId, Integer inventoryId);
void syncUpdownData(Integer oldWarehouseId, Long newWarehouseId);
}

2
blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/AsyncDataServiceImpl.java

@ -106,7 +106,7 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
try{
List<String> orderCodeList = orderClient.findOrderCodeListByPage("",oldWarehouseId,j,pageSize);
syncOrderInfoService.handleData(orderCodeList,oldWarehouseId,newWarehouseId,inventoryId);
syncOrderInfoService.handleDataAndInventoryId(orderCodeList,oldWarehouseId,newWarehouseId,inventoryId);
log.info("################syncOrderInfo: 同步成功{}个订单",orderCodeList.size());
one.setCurrentPage(j+1);

529
blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncOrderInfoServiceImpl.java

@ -4,14 +4,8 @@ import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.logpm.basic.entity.BasicMaterialEntity;
import com.logpm.basic.feign.IBasicMaterialClient;
import com.logpm.basicdata.entity.BasicdataClientEntity;
import com.logpm.basicdata.entity.BasicdataStoreBusinessEntity;
import com.logpm.basicdata.entity.BasicdataTrayEntity;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataClientClient;
import com.logpm.basicdata.feign.IBasicdataStoreBusinessClient;
import com.logpm.basicdata.feign.IBasicdataTrayClient;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.basicdata.entity.*;
import com.logpm.basicdata.feign.*;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.entity.DistributionParcelNumberEntity;
import com.logpm.distribution.entity.DistributionStockArticleEntity;
@ -25,6 +19,7 @@ import com.logpm.patch.service.ISyncOrderInfoService;
import com.logpm.warehouse.entity.WarehouseWayBillDetail;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.feign.IWarehouseTrayTypeClient;
import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient;
import com.logpm.warehouse.feign.IWarehouseWaybillClient;
import com.logpm.warehouse.feign.IWarehouseWaybillDetailClient;
import lombok.AllArgsConstructor;
@ -69,29 +64,32 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
private final IInventoryDetailClient inventoryDetailClient;
private final IBasicdataTrayClient basicdataTrayClient;
private final ITrayClient trayClient;
private final IBasicdataGoodsAllocationClient basicdataGoodsAllocationClient;
private final IOrderLocationClient orderLocationClient;
private final IWarehouseUpdownTypeClient warehouseUpdownTypeClient;
@Transactional(rollbackFor = Exception.class)
@Override
public void handleData(List<String> orderCodeList,Integer oldWarehouseId,Long newWarehouseId,Integer inventoryId) {
public void handleData(List<String> orderCodeList,Integer oldWarehouseId,Long newWarehouseId) {
log.info("#############handleData: 处理订单开始");
for (String orderCode:orderCodeList){
log.info("#############handleData: 当前处理orderCode={}的订单 盘点任务 inventoryId={}",orderCode,inventoryId);
log.info("#############handleData: 当前处理orderCode={}的订单 ",orderCode);
// DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCode(orderCode);
// if(!Objects.isNull(stockArticleEntity)){
// log.info("#############handleData: 订单orderCode={}已存在",orderCode);
// continue;
// }
//查询订单是否在盘点任务中有被盘点到
InventoryDetailEntity inventoryDetailEntity = inventoryDetailClient.findOrderIsExist(orderCode,inventoryId);
if(!Objects.isNull(inventoryDetailEntity)){
// InventoryDetailEntity inventoryDetailEntity = inventoryDetailClient.findOrderIsExist(orderCode,inventoryId);
// if(!Objects.isNull(inventoryDetailEntity)){
try{
//定单
saveOrderInfo(orderCode,oldWarehouseId,newWarehouseId,inventoryId);
saveOrderInfo(orderCode,oldWarehouseId,newWarehouseId);
//存入打托信息
// saveTrayTypeInfoPackage(orderCode,oldWarehouseId,newWarehouseId);
saveTrayTypeInfoPackageNew(orderCode,oldWarehouseId,newWarehouseId,inventoryId);
saveTrayTypeInfoPackage(orderCode,oldWarehouseId,newWarehouseId);
}catch (CustomerException e){
log.error("同步订单"+orderCode+"失败: "+e.message,e);
@ -99,10 +97,84 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
log.error("同步订单"+orderCode+"失败",e);
}
// }
}
}
@Transactional(rollbackFor = Exception.class)
@Override
public void handleDataAndInventoryId(List<String> orderCodeList,Integer oldWarehouseId,Long newWarehouseId,Integer inventoryId) {
log.info("#############handleData: 处理订单开始");
for (String orderCode:orderCodeList){
log.info("#############handleData: 当前处理orderCode={}的订单 盘点任务 inventoryId={}",orderCode,inventoryId);
// DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCode(orderCode);
// if(!Objects.isNull(stockArticleEntity)){
// log.info("#############handleData: 订单orderCode={}已存在",orderCode);
// continue;
// }
//查询订单是否在盘点任务中有被盘点到
// InventoryDetailEntity inventoryDetailEntity = inventoryDetailClient.findOrderIsExist(orderCode,inventoryId);
// if(!Objects.isNull(inventoryDetailEntity)){
try{
//定单
saveOrderInfoAndInventoryId(orderCode,oldWarehouseId,newWarehouseId,inventoryId);
//存入打托信息
// saveTrayTypeInfoPackage(orderCode,oldWarehouseId,newWarehouseId);
saveTrayTypeInfoPackageNew(orderCode,oldWarehouseId,newWarehouseId,inventoryId);
}catch (CustomerException e){
log.error("同步订单"+orderCode+"失败: "+e.message,e);
}catch (Exception e){
log.error("同步订单"+orderCode+"失败",e);
}
// }
}
}
@Override
public void syncUpdownData(Integer oldWarehouseId, Long newWarehouseId) {
//先查询有多少个货位
List<BasicdataGoodsAllocationEntity> ls = basicdataGoodsAllocationClient.findListByNewWarehouseId(newWarehouseId);
for (BasicdataGoodsAllocationEntity basicdataGoodsAllocationEntity:ls){
Long locationId = basicdataGoodsAllocationEntity.getId();
List<OrderLocationEntity> orderLocationEntityList = orderLocationClient.findListByLocationId(locationId.intValue());
for (OrderLocationEntity orderLocationEntity:orderLocationEntityList){
Integer type = orderLocationEntity.getType();
if(type == 4){
//整托上架
Integer trayId = orderLocationEntity.getTrayId();
String trayCode = "T"+trayId;
boolean a=warehouseUpdownTypeClient.upShelfTray(trayCode,locationId,newWarehouseId);
if(a){
log.info("#############syncUpdownData: 上架托盘成功 trayCode={} locationId={}",trayCode,locationId);
}else{
log.error("#############syncUpdownData: XXXX上架托盘失败 trayCode={} locationId={}",trayCode,locationId);
}
}else{
String orderPackageCode = orderLocationEntity.getUnitNo();
boolean a=warehouseUpdownTypeClient.upShelfPackage(orderPackageCode,locationId,newWarehouseId);
if(a){
log.info("#############syncUpdownData: 上架包件成功 orderPackageCode={} locationId={}",orderPackageCode,locationId);
}else{
log.error("#############syncUpdownData: XXXX上架包件失败 orderPackageCode={} locationId={}",orderPackageCode,locationId);
}
}
}
}
}
@Transactional(rollbackFor = Exception.class)
@Override
public void handleDataZero(List<String> orderCodeList,Integer oldWarehouseId,Long newWarehouseId) {
@ -459,15 +531,31 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
Integer trayScanId = trayScanDesEntity.getTrayScanId();
String unitNo = trayScanDesEntity.getUnitNo();//包条码
// InventoryDetailEntity inventoryDetailEntity = inventoryDetailClient.findUnitNoIsExist(unitNo);
// if(Objects.isNull(inventoryDetailEntity)){
// log.info("###########saveTrayTypeInfoPackage: 包条不在盘点任务中存在,不同步 unitNo={}",unitNo);
// continue;
// }
//查询打托方式信息
TrayScanEntity trayScanEntity = trayScanClient.getEntityByTrayScanId(trayScanId);
Integer type = trayScanEntity.getType();
Integer trayId = trayScanEntity.getTrayId();
BasicdataTrayEntity basicdataTrayEntity = basicdataTrayClient.getTrayByTrayCode("T" + trayId);
if(Objects.isNull(basicdataTrayEntity)){
log.info("############syncTrayTypeData: 托盘信息不存在");
//如果托盘不存在就去同步该托盘
TrayEntity trayEntity = trayClient.getTrayById(trayId);
basicdataTrayEntity = new BasicdataTrayEntity();
basicdataTrayEntity.setTenantId("627683");
basicdataTrayEntity.setCreateUser(1714696768639311873L);
basicdataTrayEntity.setUpdateUser(1714696768639311873L);
basicdataTrayEntity.setCreateDept(1649331096241836033L);
basicdataTrayEntity.setPalletName(trayEntity.getTrayNo());
basicdataTrayEntity.setPalletCode("T"+trayId);
basicdataTrayEntity.setWarehouseId(newWarehouseId);
basicdataTrayEntity.setTrayStatus(trayEntity.getStatus()+"");
basicdataTrayEntity.setType(1);
basicdataTrayEntity.setOldId(trayId);
// basicdataTrayEntity.setNowWarehouseId(nowNewWarehouseId);
basicdataTrayClient.addTray(basicdataTrayEntity);
}
String customerName = trayScanEntity.getCustomerName();
String customerPhone = trayScanEntity.getCustomerPhone();
@ -880,7 +968,7 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
}
private void saveOrderInfo(String orderCode, Integer oldWarehouseId, Long newWarehouseId,Integer inventoryId) {
private void saveOrderInfoAndInventoryId(String orderCode, Integer oldWarehouseId, Long newWarehouseId,Integer inventoryId) {
//通过订单号查询暂存单
AdvanceEntity advanceEntity = advanceClient.getQueryDataOne(orderCode);
@ -890,7 +978,7 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
}
Integer advanceId = advanceEntity.getId();
//判断新系统是否有这条订单数据
DistributionStockArticleEntity distributionStockArticleEntity = distributionStockArticleClient.findByAdvanceId(advanceId);
DistributionStockArticleEntity distributionStockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode,newWarehouseId);
OrderCountEntity orderCountEntity = orderCountClient.getEntityByOrderCode(orderCode,oldWarehouseId);
if(Objects.isNull(orderCountEntity)){
@ -900,17 +988,12 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
Integer total = orderCountEntity.getTotal();
WayBillEntity wayBillEntity = wayBillClient.getByWayBillByAdvanceId(advanceId);
// if(Objects.isNull(wayBillEntity)){
// log.warn("#################saveOrderInfo: 未查询到运单信息 advanceId={}",advanceId);
// throw new CustomerException(403,"未查询到运单信息");
// }
BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(newWarehouseId);
if(Objects.isNull(basicdataWarehouseEntity)){
log.warn("#################saveOrderInfo: 未查询到仓库信息 newWarehouseId={}",newWarehouseId);
throw new CustomerException(403,"未查询到仓库信息");
}
Long id;
String wayBillNo = null;
@ -919,34 +1002,15 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
distributionStockArticleEntity = new DistributionStockArticleEntity();
distributionStockArticleEntity.setOrderCode(orderCode);
// 其实是客户
// distributionStockArticleEntity.setMallName(advanceEntity.getDealerName());
distributionStockArticleEntity.setWarehouseEntryTime(orderCountEntity.getCreateTime());
distributionStockArticleEntity.setWarehouseEntryTimeEnd(orderCountEntity.getLatestInTime());
distributionStockArticleEntity.setTotalNumber(total);
distributionStockArticleEntity.setHandQuantity(orderCountEntity.getInNum());
distributionStockArticleEntity.setHandQuantity(0);
distributionStockArticleEntity.setTenantId(TenantNum.HUITONGCODE);// 对应租户ID
// distributionStockArticleEntity.setWaybillNumber();// 运单号
//判断是否齐套 查询该订单自编号下面的包件是都全部都交由汇通了
Integer allNum = advanceDetailClient.getAllNumByOrderNo(orderCode);
if (total.equals(allNum)) {
//如果数据库中的数据和订单上的数量相等就是齐套
distributionStockArticleEntity.setCompleteSet(1);
} else {
distributionStockArticleEntity.setCompleteSet(0);
}
log.info("############saveOrderInfo {}", basicdataWarehouseEntity);
distributionStockArticleEntity.setCreateDept(basicdataWarehouseEntity.getDepartment());
distributionStockArticleEntity.setConsigneeUnit(advanceEntity.getDealerName());//收货单位(经销商)
distributionStockArticleEntity.setConsigneePerson(advanceEntity.getCustomerName());//收货人
distributionStockArticleEntity.setConsigneeAddress(advanceEntity.getCustomerRoad());//收货人地址
distributionStockArticleEntity.setConsigneeMobile(advanceEntity.getCustomerPhone());//收货人电话
distributionStockArticleEntity.setWarehouse(basicdataWarehouseEntity.getName());
distributionStockArticleEntity.setWarehouseId(basicdataWarehouseEntity.getId());
distributionStockArticleEntity.setDealerCode(advanceEntity.getDealerCode());
@ -975,14 +1039,11 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
if(ObjectUtils.isNotNull(t)){
distributionStockArticleEntity.setAcceptWarehouseName(t.getName());
distributionStockArticleEntity.setAcceptWarehouseId(t.getId());
// TODO 这里存在问题 后需要知道当前作业仓库
// distributionStockArticleEntity.setWarehouse(t.getName());
// distributionStockArticleEntity.setWarehouseId(t.getId());
}
String customerName = wayBillEntity.getTakeCompany();//客户名称
distributionStockArticleEntity.setTypeService("1");//默认商配
BasicdataClientEntity basicdataClientEntity = basicdataClientClient.findByName(customerName);
log.info("订单同步出现的客户编号{} 匹配的客户", basicdataClientEntity);
if (!Objects.isNull(basicdataClientEntity)) {
@ -991,11 +1052,6 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
distributionStockArticleEntity.setMallName(basicdataClientEntity.getClientName());
distributionStockArticleEntity.setMallCode(basicdataClientEntity.getClientCode());
// distributionStockArticleEntity.setDealerCode(basicdataClientEntity.getClientCode());
// distributionStockArticleEntity.setDealerName(basicdataClientEntity.getClientName());
// todo 这里需要去查询门店 和新系统的门店ID 进行绑定
String peisongType = getPeisongTypeByClientId(basicdataClientEntity.getId());
log.info("订单同步peisongType {} ", peisongType);
@ -1004,69 +1060,270 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
}
}
}
distributionStockArticleEntity.setGenre(1);
distributionStockArticleEntity.setAdvanceId(advanceId);
//--------------2023-07-06 新增字段处理
// 增加订单 经销商信息 和门店信息
buildDealerAndStore(distributionStockArticleEntity, advanceEntity);
//通过客户名称去查询客户的服务类型、
distributionStockArticleEntity.setTypeService("1");//默认商配
distributionStockArticleEntity.setCreateUser(1714696768639311873L);
distributionStockArticleEntity.setUpdateUser(1714696768639311873L);
distributionStockArticleEntity.setCreateDept(1649331096241836033L);
distributionStockArticleEntity.setSortingQuantity(0); //分拣件数
distributionStockArticleEntity.setDeliveryQuantity(0); //配送件数
distributionStockArticleEntity.setTransferQuantity(0); //中转件数
distributionStockArticleEntity.setSigninQuantity(0); //签收件数
//1=部分入库,2=已入库,3=已出库,4=部分签收,5=待出库,6=已上架,7=已分拣,8=部分出库,9=部分装车,10=已装车,11=已签收,12=部分配送,13=已配送
distributionStockArticleEntity.setFreezeStatus(OrderFreezeStatusConstant.weidongjie.getValue()); //冻结状态
distributionStockArticleEntity.setReservationStatus(OrderReservationStatusConstant.daiyuyue.getValue()); //预约状态
distributionStockArticleEntity.setStockupStatus(OrderStockupStatusConstant.daibeihuo.getValue()); //备货状态
distributionStockArticleEntity.setGroundingStatus(OrderGroundingStatusConstant.daishangjia.getValue()); //上架状态
// BasicdataClientEntity basicdataClientEntity = basicdataClientClient.findByName(customerName);
// log.info("订单同步出现的客户编号{} 匹配的客户", basicdataClientEntity);
// if (!Objects.isNull(basicdataClientEntity)) {
// //商城
// distributionStockArticleEntity.setMallId(basicdataClientEntity.getId());
// distributionStockArticleEntity.setMallName(basicdataClientEntity.getClientName());
// distributionStockArticleEntity.setMallCode(basicdataClientEntity.getClientCode());
//
// distributionStockArticleEntity.setDealerCode(basicdataClientEntity.getClientCode());
// distributionStockArticleEntity.setDealerName(basicdataClientEntity.getClientName());
//
//
// // todo 这里需要去查询门店 和新系统的门店ID 进行绑定
// String peisongType = getPeisongTypeByClientId(basicdataClientEntity.getId());
// log.info("订单同步peisongType {} ", peisongType);
//
// if (StringUtil.isNoneBlank(peisongType)) {
// distributionStockArticleEntity.setTypeService(peisongType);
// }
distributionStockArticleEntity.setWarehouseEntryTime(date);
id = distributionStockArticleClient.addData(distributionStockArticleEntity);
distributionStockArticleEntity.setId(id);
if (id == 0) {
log.warn("#################handleDataToPlatform: 保存订单信息失败 orderCode={}", orderCode);
throw new CustomerException(405, "保存订单信息失败");
}
}else{
id = distributionStockArticleEntity.getId();
}
//保存包件信息
saveOrderPackageAndInventoryId(distributionStockArticleEntity,basicdataWarehouseEntity,wayBillNo,CommonUtil.dateToString(new Date()),oldWarehouseId,inventoryId);
}
private void saveOrderPackageAndInventoryId(DistributionStockArticleEntity distributionStockArticleEntity, BasicdataWarehouseEntity basicdataWarehouseEntity, String waybillNo,String operationTime,Integer oldWarehouseId,Integer inventoryId) {
String orderCode = distributionStockArticleEntity.getOrderCode();
//查询订单下的所有包件
List<OrderDetailEntity> orderDetailList = orderDetailClient.findByOrderCode(orderCode,oldWarehouseId);
for (OrderDetailEntity orderDetailEntity:orderDetailList){
String unitNo = orderDetailEntity.getUnitNo();
DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCode(unitNo);
if(!Objects.isNull(parcelListEntity)){
log.info("###########saveOrderPackageAndInventoryId: 包条已存在,不同步 unitNo={}",unitNo);
continue;
}
InventoryDetailEntity inventoryDetailEntity = inventoryDetailClient.findUnitNoIsExist(unitNo,inventoryId);
if(Objects.isNull(inventoryDetailEntity)){
log.info("###########saveOrderPackageAndInventoryId: 包条不在盘点任务中存在,不同步 unitNo={}",unitNo);
continue;
}
Integer status = orderDetailEntity.getStatus();
Integer carsType = orderDetailEntity.getCarsType();
Integer signState = orderDetailEntity.getSignState();
waybillNo = orderDetailEntity.getWaybillNo();
//存入运单信息
WayBillEntity waybillEntity = saveWaybillEntity(waybillNo);
DistributionParcelListEntityVO vo = advanceDetailClient.getByUnitNoAndWarehouseId(unitNo,oldWarehouseId);
DistributionParcelListEntity entity = new DistributionParcelListEntity();
BeanUtil.copyProperties(vo, entity);
entity.setOrderPackageCode(vo.getPacketBarCode());
entity.setConditions(1);
entity.setWarehouse(distributionStockArticleEntity.getWarehouse());
entity.setWarehouseId(distributionStockArticleEntity.getWarehouseId());
entity.setStockArticleId(distributionStockArticleEntity.getId());
entity.setOrderPackageStatus(OrderPackageStatusConstant.yiruku.getValue());
//状态:1到货,2分拣,3装车,4卸货,5出库,6配送
// if(1 == status){
// entity.setOrderPackageStatus(OrderPackageStatusConstant.yiruku.getValue());
// }
// if(3==carsType||4 == carsType){
// entity.setOrderPackageStatus(OrderPackageStatusConstant.yichuku.getValue());
// }
if(2 == signState){
entity.setOrderPackageStatus(OrderPackageStatusConstant.yiqianshou.getValue());
}
entity.setOrderPackageFreezeStatus(OrderPackageFreezeStatusConstant.weidongjie.getValue());
entity.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.daiyuyue.getValue());
entity.setOrderPackageGroundingStatus(OrderPackageGroundingStatusConstant.daishangjia.getValue());
entity.setOrderPackageStockupStatus(OrderPackageStockupStatusConstant.daibeihuo.getValue());
entity.setOrderCode(distributionStockArticleEntity.getOrderCode());
entity.setServiceNumber(distributionStockArticleEntity.getServiceNumber());
entity.setWaybillNumber(waybillNo);
// 增加 进销商 名称 编码 发站仓
entity.setSendWarehouseName(distributionStockArticleEntity.getSendWarehouseName());
entity.setSendWarehouseId(distributionStockArticleEntity.getSendWarehouseId());
//收货仓库
entity.setAcceptWarehouseName(distributionStockArticleEntity.getAcceptWarehouseName());
entity.setAcceptWarehouseId(distributionStockArticleEntity.getAcceptWarehouseId());
//进销售
entity.setDealerCode(distributionStockArticleEntity.getDealerCode());
entity.setDealerName(distributionStockArticleEntity.getDealerName());
entity.setWarehouseEntryTimeEnd(CommonUtil.StringToDate(operationTime));
entity.setMaterialCode(vo.getMaterialCode());
entity.setMaterialName(vo.getMaterialName());
entity.setCreateUser(1714696768639311873L);
entity.setUpdateUser(1714696768639311873L);
entity.setCreateDept(1649331096241836033L);
entity.setTenantId(TenantNum.HUITONGCODE);
if (StringUtil.isNotBlank(entity.getMaterialName()) && StringUtil.isNotBlank(entity.getMaterialCode())) {
// 查询物料信息
String sku = "";
BasicMaterialEntity basicMaterialEntity = basicMaterialClient.getMaterialOwn(entity.getMaterialCode(), entity.getMaterialName(), sku);
if (ObjectUtils.isNotNull(basicMaterialEntity)) {
entity.setMaterialId(basicMaterialEntity.getId());
entity.setMaterialCode(basicMaterialEntity.getProductCode());
entity.setMaterialUnit(basicMaterialEntity.getLogpmUnit());
}
}
boolean b = distributionParcelListClient.add(entity);
if (!b) {
log.warn("#################saveOrderPackageAndInventoryId: 保存包件信息失败 orderCode={}", entity.getOrderCode());
}else{
log.info("################saveOrderPackageAndInventoryId: 保存包件成功 OrderPackageCode={}",vo.getPacketBarCode());
Integer handQuantity = distributionStockArticleEntity.getHandQuantity();
Integer totalNumber = distributionStockArticleEntity.getTotalNumber();
if(handQuantity+1 >= totalNumber){
distributionStockArticleEntity.setCompleteSet(1);
distributionStockArticleEntity.setOrderReceiveStatus(OrderReceiveStatusConstant.yishouhuo.getValue());
distributionStockArticleEntity.setOrderStatus(OrderStatusConstant.ruku.getValue());
}else{
distributionStockArticleEntity.setCompleteSet(0);
distributionStockArticleEntity.setOrderReceiveStatus(OrderReceiveStatusConstant.bufenshouhuo.getValue());
distributionStockArticleEntity.setOrderStatus(OrderStatusConstant.bufenruku.getValue());
}
distributionStockArticleClient.saveOrUpdate(distributionStockArticleEntity);
}
}
}
private void saveOrderInfo(String orderCode, Integer oldWarehouseId, Long newWarehouseId) {
//通过订单号查询暂存单
AdvanceEntity advanceEntity = advanceClient.getQueryDataOne(orderCode);
if(Objects.isNull(advanceEntity)){
log.warn("#################saveOrderInfo: 未查询单订单信息 orderCode={}",orderCode);
throw new CustomerException(403,"未查询单订单信息");
}
Integer advanceId = advanceEntity.getId();
//判断新系统是否有这条订单数据
DistributionStockArticleEntity distributionStockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode,newWarehouseId);
OrderCountEntity orderCountEntity = orderCountClient.getEntityByOrderCode(orderCode,oldWarehouseId);
if(Objects.isNull(orderCountEntity)){
log.warn("#################saveOrderInfo: 未查询单订单信息 orderCode={}",orderCode);
throw new CustomerException(403,"未查询单订单信息");
}
Integer total = orderCountEntity.getTotal();
WayBillEntity wayBillEntity = wayBillClient.getByWayBillByAdvanceId(advanceId);
BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(newWarehouseId);
if(Objects.isNull(basicdataWarehouseEntity)){
log.warn("#################saveOrderInfo: 未查询到仓库信息 newWarehouseId={}",newWarehouseId);
throw new CustomerException(403,"未查询到仓库信息");
}
Long id;
String wayBillNo = null;
if (Objects.isNull(distributionStockArticleEntity)) {
Date date = new Date();
distributionStockArticleEntity = new DistributionStockArticleEntity();
distributionStockArticleEntity.setOrderCode(orderCode);
distributionStockArticleEntity.setWarehouseEntryTime(orderCountEntity.getCreateTime());
distributionStockArticleEntity.setWarehouseEntryTimeEnd(orderCountEntity.getLatestInTime());
distributionStockArticleEntity.setTotalNumber(total);
distributionStockArticleEntity.setHandQuantity(0);
distributionStockArticleEntity.setTenantId(TenantNum.HUITONGCODE);// 对应租户ID
log.info("############saveOrderInfo {}", basicdataWarehouseEntity);
distributionStockArticleEntity.setCreateDept(basicdataWarehouseEntity.getDepartment());
distributionStockArticleEntity.setWarehouse(basicdataWarehouseEntity.getName());
distributionStockArticleEntity.setWarehouseId(basicdataWarehouseEntity.getId());
distributionStockArticleEntity.setDealerCode(advanceEntity.getDealerCode());
distributionStockArticleEntity.setDealerName(advanceEntity.getDealerName());
if (ObjectUtils.isNotNull(wayBillEntity)) {
distributionStockArticleEntity.setConsigneeUnit(wayBillEntity.getTakeCompany());//收货单位(经销商)
distributionStockArticleEntity.setConsigneePerson(wayBillEntity.getTakePerson());//收货人
distributionStockArticleEntity.setConsigneeAddress(wayBillEntity.getTakeAddress());//收货人地址
distributionStockArticleEntity.setConsigneeMobile(wayBillEntity.getTakePhone());//收货人电话
wayBillNo = wayBillEntity.getWaybillNo();
distributionStockArticleEntity.setWaybillNumber(wayBillNo);
// 根据老运单上的仓库名称找寻新的仓库名称
// 发站
String warehouseName = wayBillEntity.getStartSite();
BasicdataWarehouseEntity t = basicdataWarehouseClient.findByName(warehouseName);
if(ObjectUtils.isNotNull(t)){
distributionStockArticleEntity.setSendWarehouseName(t.getName());
distributionStockArticleEntity.setSendWarehouseId(t.getId());
}
//收货仓库
warehouseName = wayBillEntity.getWarehouseName();
t = basicdataWarehouseClient.findByName(warehouseName);
if(ObjectUtils.isNotNull(t)){
distributionStockArticleEntity.setAcceptWarehouseName(t.getName());
distributionStockArticleEntity.setAcceptWarehouseId(t.getId());
}
String customerName = wayBillEntity.getTakeCompany();//客户名称
distributionStockArticleEntity.setTypeService("1");//默认商配
BasicdataClientEntity basicdataClientEntity = basicdataClientClient.findByName(customerName);
log.info("订单同步出现的客户编号{} 匹配的客户", basicdataClientEntity);
if (!Objects.isNull(basicdataClientEntity)) {
//商城
distributionStockArticleEntity.setMallId(basicdataClientEntity.getId());
distributionStockArticleEntity.setMallName(basicdataClientEntity.getClientName());
distributionStockArticleEntity.setMallCode(basicdataClientEntity.getClientCode());
String peisongType = getPeisongTypeByClientId(basicdataClientEntity.getId());
log.info("订单同步peisongType {} ", peisongType);
if (StringUtil.isNoneBlank(peisongType)) {
distributionStockArticleEntity.setTypeService(peisongType);
}
}
}
distributionStockArticleEntity.setGenre(1);
distributionStockArticleEntity.setAdvanceId(advanceId);
//--------------2023-07-06 新增字段处理
// 增加订单 经销商信息 和门店信息
buildDealerAndStore(distributionStockArticleEntity, advanceEntity);
distributionStockArticleEntity.setCreateUser(1123598821738675201L);
distributionStockArticleEntity.setSortingQuantity(orderCountEntity.getSorting()); //分拣件数
distributionStockArticleEntity.setDeliveryQuantity(orderCountEntity.getDeliveNum()); //配送件数
distributionStockArticleEntity.setTransferQuantity(orderCountEntity.getTransNum()); //中转件数
distributionStockArticleEntity.setSigninQuantity(orderCountEntity.getSignNum()); //签收件数
distributionStockArticleEntity.setCreateUser(1714696768639311873L);
distributionStockArticleEntity.setUpdateUser(1714696768639311873L);
distributionStockArticleEntity.setCreateDept(1649331096241836033L);
distributionStockArticleEntity.setSortingQuantity(0); //分拣件数
distributionStockArticleEntity.setDeliveryQuantity(0); //配送件数
distributionStockArticleEntity.setTransferQuantity(0); //中转件数
distributionStockArticleEntity.setSigninQuantity(0); //签收件数
//1=部分入库,2=已入库,3=已出库,4=部分签收,5=待出库,6=已上架,7=已分拣,8=部分出库,9=部分装车,10=已装车,11=已签收,12=部分配送,13=已配送
distributionStockArticleEntity.setFreezeStatus(OrderFreezeStatusConstant.weidongjie.getValue()); //冻结状态
distributionStockArticleEntity.setReservationStatus(OrderReservationStatusConstant.daiyuyue.getValue()); //预约状态
distributionStockArticleEntity.setStockupStatus(OrderStockupStatusConstant.daibeihuo.getValue()); //备货状态
distributionStockArticleEntity.setGroundingStatus(OrderGroundingStatusConstant.daishangjia.getValue()); //上架状态
Integer status = orderCountEntity.getStatus();
if(1 == status){
distributionStockArticleEntity.setOrderStatus(OrderStatusConstant.bufenruku.getValue());
}else if(2 == status){
distributionStockArticleEntity.setOrderStatus(OrderStatusConstant.ruku.getValue());
}else if(3 == status || 10 == status){
distributionStockArticleEntity.setOrderStatus(OrderStatusConstant.chuku.getValue());
}else if(4 == status){
distributionStockArticleEntity.setOrderStatus(OrderStatusConstant.bufenqianshou.getValue());
}else if(8 == status || 9 == status){
distributionStockArticleEntity.setOrderStatus(OrderStatusConstant.bufenchuku.getValue());
}else if(11 == status){
distributionStockArticleEntity.setOrderStatus(OrderStatusConstant.qianshou.getValue());
}else{
distributionStockArticleEntity.setOrderStatus("100");
}
distributionStockArticleEntity.setOrderReceiveStatus(OrderReceiveStatusConstant.yishouhuo.getValue());
distributionStockArticleEntity.setWarehouseEntryTime(date);
id = distributionStockArticleClient.addData(distributionStockArticleEntity);
@ -1080,11 +1337,11 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
}
//保存包件信息
saveOrderPackage(distributionStockArticleEntity,basicdataWarehouseEntity,wayBillNo,CommonUtil.dateToString(new Date()),oldWarehouseId,inventoryId);
saveOrderPackage(distributionStockArticleEntity,basicdataWarehouseEntity,wayBillNo,CommonUtil.dateToString(new Date()),oldWarehouseId);
}
private void saveOrderPackage(DistributionStockArticleEntity distributionStockArticleEntity, BasicdataWarehouseEntity basicdataWarehouseEntity, String waybillNo,String operationTime,Integer oldWarehouseId,Integer inventoryId) {
private void saveOrderPackage(DistributionStockArticleEntity distributionStockArticleEntity, BasicdataWarehouseEntity basicdataWarehouseEntity, String waybillNo,String operationTime,Integer oldWarehouseId) {
String orderCode = distributionStockArticleEntity.getOrderCode();
@ -1098,11 +1355,11 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
continue;
}
InventoryDetailEntity inventoryDetailEntity = inventoryDetailClient.findUnitNoIsExist(unitNo,inventoryId);
if(Objects.isNull(inventoryDetailEntity)){
log.info("###########saveOrderPackage: 包条不在盘点任务中存在,不同步 unitNo={}",unitNo);
continue;
}
// InventoryDetailEntity inventoryDetailEntity = inventoryDetailClient.findUnitNoIsExist(unitNo,inventoryId);
// if(Objects.isNull(inventoryDetailEntity)){
// log.info("###########saveOrderPackage: 包条不在盘点任务中存在,不同步 unitNo={}",unitNo);
// continue;
// }
Integer status = orderDetailEntity.getStatus();
Integer carsType = orderDetailEntity.getCarsType();
@ -1121,13 +1378,14 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
entity.setWarehouse(distributionStockArticleEntity.getWarehouse());
entity.setWarehouseId(distributionStockArticleEntity.getWarehouseId());
entity.setStockArticleId(distributionStockArticleEntity.getId());
entity.setOrderPackageStatus(OrderPackageStatusConstant.yiruku.getValue());
//状态:1到货,2分拣,3装车,4卸货,5出库,6配送
if(1 == status){
entity.setOrderPackageStatus(OrderPackageStatusConstant.yiruku.getValue());
}
if(3==carsType||4 == carsType){
entity.setOrderPackageStatus(OrderPackageStatusConstant.yichuku.getValue());
}
// if(1 == status){
// entity.setOrderPackageStatus(OrderPackageStatusConstant.yiruku.getValue());
// }
// if(3==carsType||4 == carsType){
// entity.setOrderPackageStatus(OrderPackageStatusConstant.yichuku.getValue());
// }
if(2 == signState){
entity.setOrderPackageStatus(OrderPackageStatusConstant.yiqianshou.getValue());
}
@ -1138,12 +1396,8 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
entity.setOrderCode(distributionStockArticleEntity.getOrderCode());
entity.setServiceNumber(distributionStockArticleEntity.getServiceNumber());
entity.setWaybillNumber(waybillNo);
// if(ObjectUtil.isNotEmpty(warehouseWaybill)){
// entity.setWarehouseId(warehouseWaybill.getId());
// }
// 增加 进销商 名称 编码 发站仓
entity.setSendWarehouseName(distributionStockArticleEntity.getSendWarehouseName());
entity.setSendWarehouseId(distributionStockArticleEntity.getSendWarehouseId());
@ -1154,22 +1408,17 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
//进销售
entity.setDealerCode(distributionStockArticleEntity.getDealerCode());
entity.setDealerName(distributionStockArticleEntity.getDealerName());
// if(Objects.isNull(waybillEntity)){
// entity.setDealerCode(distributionStockArticleEntity.getDealerCode());
// entity.setDealerName(distributionStockArticleEntity.getDealerName());
// }else{
// entity.setDealerCode(distributionStockArticleEntity.getDealerCode());
// entity.setDealerName(waybillEntity.getTakeCompany());
// }
entity.setWarehouseEntryTimeEnd(CommonUtil.StringToDate(operationTime));
// 绑定部门--仓库
if (!Objects.isNull(basicdataWarehouseEntity)) {
entity.setCreateDept(basicdataWarehouseEntity.getDepartment());
}
entity.setCreateUser(1123598821738675201L);
entity.setMaterialCode(vo.getMaterialCode());
entity.setMaterialName(vo.getMaterialName());
entity.setCreateUser(1714696768639311873L);
entity.setUpdateUser(1714696768639311873L);
entity.setCreateDept(1649331096241836033L);
entity.setTenantId(TenantNum.HUITONGCODE);
if (StringUtil.isNoneBlank(entity.getMaterialName()) && StringUtil.isNoneBlank(entity.getMaterialCode())) {
if (StringUtil.isNotBlank(entity.getMaterialName()) && StringUtil.isNotBlank(entity.getMaterialCode())) {
// 查询物料信息
String sku = "";
BasicMaterialEntity basicMaterialEntity = basicMaterialClient.getMaterialOwn(entity.getMaterialCode(), entity.getMaterialName(), sku);
@ -1182,6 +1431,21 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
boolean b = distributionParcelListClient.add(entity);
if (!b) {
log.warn("#################handleDataToPlatform: 保存包件信息失败 orderCode={}", entity.getOrderCode());
}else{
log.info("################handleDataToPlatform: 保存包件成功 OrderPackageCode={}",vo.getPacketBarCode());
Integer handQuantity = distributionStockArticleEntity.getHandQuantity();
Integer totalNumber = distributionStockArticleEntity.getTotalNumber();
if(handQuantity+1 >= totalNumber){
distributionStockArticleEntity.setCompleteSet(1);
distributionStockArticleEntity.setOrderReceiveStatus(OrderReceiveStatusConstant.yishouhuo.getValue());
distributionStockArticleEntity.setOrderStatus(OrderStatusConstant.ruku.getValue());
}else{
distributionStockArticleEntity.setCompleteSet(0);
distributionStockArticleEntity.setOrderReceiveStatus(OrderReceiveStatusConstant.bufenshouhuo.getValue());
distributionStockArticleEntity.setOrderStatus(OrderStatusConstant.bufenruku.getValue());
}
distributionStockArticleClient.saveOrUpdate(distributionStockArticleEntity);
}
}
@ -1196,9 +1460,6 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
distributionStockArticleEntity.setStoreName(advanceEntity.getStoreName());
distributionStockArticleEntity.setStoreCode(advanceEntity.getStoreNo());
// distributionStockArticleEntity.setDealerCode(advanceEntity.getDealerCode());
// distributionStockArticleEntity.setDealerName(advanceEntity.getDealerName());
// 最终客户
distributionStockArticleEntity.setCustomerName(advanceEntity.getCustomerName());
distributionStockArticleEntity.setCustomerAddress(advanceEntity.getCustomerRoad());
@ -1211,7 +1472,7 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
// 品牌
distributionStockArticleEntity.setBrand(advanceEntity.getType());
distributionStockArticleEntity.setResource(advanceEntity.getType());
distributionStockArticleEntity.setResource(advanceEntity.getSystemType());
}

20
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/TaskQuestController.java

@ -193,6 +193,26 @@ public class TaskQuestController extends BladeController {
return R.status(taskQuestService.updateByIdCustom(taskQuest));
}
/**
* 盘点任务 修改
*/
@PostMapping("/updateInfo")
@ApiOperationSupport(order = 5)
@ApiOperation(value = "修改", notes = "传入taskQuest")
public R updateInfo(@Valid @RequestBody TaskQuestDTO taskQuest) {
return R.status(taskQuestService.updateByInfo(taskQuest));
}
/**
* 盘点任务 盘点后的数据修改
*/
@PutMapping("/updateQuestChildInfo")
@ApiOperationSupport(order = 5)
@ApiOperation(value = "修改", notes = "传入taskQuest")
public R updateQuestInfo(@Valid @RequestBody List<QuestDetailDTO> questDetailDTO) {
return R.status(taskQuestService.updateQuestInfo(questDetailDTO));
}
/**
* 盘点任务 修改时间
*/

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

@ -23,6 +23,7 @@ import com.logpm.warehouse.entity.WarehouseRetentionRecordEntity;
import com.logpm.warehouse.excel.WarehouseRetentionRecordExcel;
import com.logpm.warehouse.service.IWarehouseRetentionRecordService;
import com.logpm.warehouse.vo.WarehouseRetentionRecordVO;
import com.logpm.warehouse.vo.WarehouseRetentionScanVO;
import com.logpm.warehouse.vo.WarehouseWaybillDetentionVO;
import com.logpm.warehouse.wrapper.WarehouseRetentionRecordWrapper;
import io.swagger.annotations.Api;
@ -81,6 +82,15 @@ public class WarehouseRetentionRecordController extends BladeController {
return R.data(WarehouseRetentionRecordWrapper.build().pageVO(pages));
}
@GetMapping("/getRetentionPackageByType")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入warehouseRetentionRecord")
public R<List<WarehouseRetentionScanVO>> getRetentionPackageByType(@RequestParam Long retentionId, @RequestParam Integer type) {
List<WarehouseRetentionScanVO> warehouseRetentionScanVOS = warehouseRetentionRecordService.getRetentionPackageByType(retentionId,type);
return R.data(warehouseRetentionScanVOS);
}
/**
* 滞留记录 自定义分页
*/

3
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/QuestDetailDTO.java

@ -47,5 +47,8 @@ public class QuestDetailDTO extends QuestDetailEntity {
private String allocationId;//上架后的库位id
private String cargoName;//盘点的包件状态名称
}

3
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseTrayTypeClient.java

@ -4,6 +4,7 @@ import com.logpm.warehouse.dto.ZeroOrderVO;
import com.logpm.warehouse.service.IWarehouseTrayTypeService;
import com.logpm.warehouse.vo.TrayTypeDataVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
@ -12,6 +13,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@Slf4j
@ApiIgnore()
@RestController
@AllArgsConstructor
@ -43,6 +45,7 @@ public class WarehouseTrayTypeClient implements IWarehouseTrayTypeClient {
if(r.getCode() == 200){
return true;
}else{
log.error("############orderScanOrderPackageCode: orderPackageCode={} code={} msg={}",orderPackageCode,r.getCode(),r.getMsg());
return false;
}
}

34
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseUpdownTypeClient.java

@ -22,6 +22,7 @@ import com.logpm.warehouse.dto.UpShelfStockDTO;
import com.logpm.warehouse.dto.UpShelfZeroOrderDTO;
import com.logpm.warehouse.service.IWarehouseUpdownTypeService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
@ -35,6 +36,7 @@ import java.util.List;
* @author lmy
* @since 2023-08-15
*/
@Slf4j
@ApiIgnore()
@RestController
@AllArgsConstructor
@ -80,6 +82,38 @@ public class WarehouseUpdownTypeClient implements IWarehouseUpdownTypeClient {
return warehouseUpdownTypeService.downTrayCode(trayCode,warehouseId);
}
@Override
public boolean upShelfTray(String trayCode, Long locationId,Long warehouseId) {
R r = warehouseUpdownTypeService.upShelfTray(trayCode, locationId, warehouseId);
int code = r.getCode();
if(code == 200){
return true;
}else{
log.error("############upShelfTray: trayCode={} locationId={} code={} msg={}",trayCode,locationId,r.getCode(),r.getMsg());
return false;
}
}
@Override
public boolean upShelfPackage(String orderPackageCode, Long locationId, Long warehouseId) {
String[] split = orderPackageCode.split(",");
List<UpShelfPackageDTO> ls = new ArrayList<>();
for (String packageCode:split){
UpShelfPackageDTO upShelfPackageDTO = new UpShelfPackageDTO();
upShelfPackageDTO.setOrderPackageCode(packageCode);
ls.add(upShelfPackageDTO);
}
R r = warehouseUpdownTypeService.upShelfPackage(ls,locationId,warehouseId);
int code = r.getCode();
if(code == 200){
return true;
}else{
log.error("############upShelfTray: ls={} locationId={} code={} msg={}",ls,locationId,r.getCode(),r.getMsg());
return false;
}
}
@Override
public R downZeroOrder(List<JSONObject> zeroOrders) {

17
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.xml

@ -198,6 +198,7 @@
<if test="param.questId != null and param.questId != ''">and quest_id =#{param.questId } </if>
<if test="param.questType != null and param.questType != ''">and quest_type =#{param.questType } </if>
<if test="param.questTarget != null and param.questTarget != ''">and quest_target =#{param.questTarget } </if>
<if test="param.questStatus != null ">and quest_status =#{param.questStatus } </if>
<if test="param.warehouseId != null and param.warehouseId != ''">and warehouse_id =#{param.warehouseId } </if>
<if test="param.allocationId != null and param.allocationId != ''">and allocation_id =#{param.allocationId } </if>
<if test="param.trayId != null and param.trayId != ''">and tray_id =#{param.trayId } </if>
@ -212,11 +213,12 @@
</where>
</select>
<select id="selectContrastDataInfo" resultType="com.logpm.warehouse.vo.QuestContrastVO" >
select DISTINCT ldpl.order_code orderCode,GROUP_CONCAT(DISTINCT ldpl.brand_name) brandName,GROUP_CONCAT(DISTINCT ldsa.mall_name) mallName
,GROUP_CONCAT(DISTINCT ldsa.customer_name) customerName, p.quest_status questStatus
,GROUP_CONCAT(DISTINCT ldpl.third_product) thirdProduct,GROUP_CONCAT(DISTINCT ldpl.material_name) materialName,ldsa.total_number totalNumber
,ldsa.hand_quantity handQuantity ,p.tray_code trayCode,p.tray_id trayId,p.position_code positionCode,
p.allocation_id allocationId,p.update_user updateUser,p.update_time updateTime,p.grounding_position_code groundingPositionCode
select DISTINCT ldsa.order_code,GROUP_CONCAT(DISTINCT ldpl.brand_name) brandName,GROUP_CONCAT(DISTINCT ldsa.mall_name) mallName,GROUP_CONCAT(DISTINCT ldsa.customer_name) customerName
,GROUP_CONCAT(DISTINCT ldpl.third_product) thirdProduct,GROUP_CONCAT(DISTINCT ldpl.material_name) materialName,GROUP_CONCAT(DISTINCT p.tray_code) trayCode,
GROUP_CONCAT(DISTINCT p.tray_id) trayId ,GROUP_CONCAT(DISTINCT p.position_code) positionCode,SUM(p.stock_num) handQuantity
,ldsa.total_number totalNumber,GROUP_CONCAT(DISTINCT p.allocation_id) allocationId,GROUP_CONCAT(DISTINCT p.update_user) updateUser
,GROUP_CONCAT(DISTINCT p.grounding_position_code) groundingPositionCode,GROUP_CONCAT(DISTINCT p.quest_status) questStatus,
GROUP_CONCAT(DISTINCT p.update_time) updateTime
from ${questNum} p
LEFT JOIN logpm_distribution_parcel_list ldpl on p.order_package_id = ldpl.id
LEFT JOIN logpm_distribution_stock_article ldsa on ldsa.id = ldpl.stock_article_id
@ -224,10 +226,9 @@
<where>
p.order_package_id is not null
<if test="param.questId != null and param.questId != ''">and p.quest_id = #{param.questId}</if>
<if test="param.questTarget != null and param.questTarget != ''">and p.quest_target = #{param.questTarget}</if>
</where>
GROUP BY ldpl.order_code,ldsa.total_number,ldsa.hand_quantity,p.tray_code,p.tray_id,p.position_code,p.allocation_id,p.update_user,
p.update_time,p.grounding_position_code ,p.quest_status
GROUP BY ldsa.order_code,ldsa.total_number
</select>
<select id="selectTaskTrayInfo" resultType="com.logpm.warehouse.entity.QuestDetailEntity">

14
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseRetentionRecordMapper.java

@ -23,6 +23,7 @@ import com.logpm.warehouse.dto.RetentionDTO;
import com.logpm.warehouse.entity.WarehouseRetentionRecordEntity;
import com.logpm.warehouse.excel.WarehouseRetentionRecordExcel;
import com.logpm.warehouse.vo.WarehouseRetentionRecordVO;
import com.logpm.warehouse.vo.WarehouseRetentionScanVO;
import com.logpm.warehouse.vo.WarehouseWaybillDetentionVO;
import org.apache.ibatis.annotations.Param;
@ -44,7 +45,7 @@ public interface WarehouseRetentionRecordMapper extends BaseMapper<WarehouseRete
* @param warehouseRetentionRecord
* @return
*/
List<WarehouseRetentionRecordVO> selectWarehouseRetentionRecordPage(IPage page, WarehouseRetentionRecordVO warehouseRetentionRecord);
List<WarehouseRetentionRecordVO> selectWarehouseRetentionRecordPage(IPage page,@Param("par") WarehouseRetentionRecordVO warehouseRetentionRecord);
/**
* 滞留运单
@ -57,4 +58,15 @@ public interface WarehouseRetentionRecordMapper extends BaseMapper<WarehouseRete
List<WarehouseRetentionRecordExcel> exportWarehouseRetentionRecord(@Param("paramMap") Map<String, Object> paramMap, @Param("idArr") List<String> idArr);
List<WarehouseRetentionScanVO> selectWarehouseRetentionScanVoList(@Param("rerentionId") Long id);
/**
* 查询指定类型的滞留包件列表
* @param retentionId
* @param type
* @return
*/
List<WarehouseRetentionScanVO> selectWarehouseRetentionScanVoListByType(@Param("rerentionId")Long retentionId,@Param("type") Integer type);
}

123
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseRetentionRecordMapper.xml

@ -3,6 +3,33 @@
<mapper namespace="com.logpm.warehouse.mapper.WarehouseRetentionRecordMapper">
<!-- 通用查询映射结果 -->
<select id="selectWarehouseRetentionRecordPage" resultMap="warehouseRetentionRecordResultMap">
select * from logpm_warehouse_retention_record
<where>
is_deleted = 0
<if test="par.retentionWarehouseId != null and par.retentionWarehouseId != ''">
and retention_warehouse_id =#{par.retentionWarehouseId}
</if>
<if test="par.retentionCarNo != null and par.retentionCarNo != ''">
and retention_car_no like concat('%',#{par.retentionCarNo},'%')
</if>
<if test="par.retentionType != null and par.retentionType != ''">
and retention_type =#{par.retentionType}
</if>
<if test="par.retentionType != null and par.retentionType != ''">
and retention_type =#{par.retentionType}
</if>
<if test="par.assembleCarPersonName != null and par.assembleCarPersonName != ''">
and assemble_car_person_name like concat('%',#{par.retentionType},'%')
</if>
<if test="par.retentionCreateUserName != null and par.retentionCreateUserName != ''">
and retention_create_user_name like concat('%',#{par.retentionCreateUserName},'%')
</if>
</where>
</select>
<resultMap id="warehouseRetentionRecordResultMap" type="com.logpm.warehouse.entity.WarehouseRetentionRecordEntity">
<result column="id" property="id"/>
<result column="tenant_id" property="tenantId"/>
@ -35,11 +62,6 @@
<result column="cancel_remark" property="cancelRemark"/>
</resultMap>
<select id="selectWarehouseRetentionRecordPage" resultMap="warehouseRetentionRecordResultMap">
select * from logpm_warehouse_retention_record where is_deleted = 0
</select>
<select id="selectWarehouseWaybillRecordPage" resultType="com.logpm.warehouse.vo.WarehouseWaybillDetentionVO">
SELECT lwrr.waybill_no waybillNo,GROUP_CONCAT( lwrr.retention_warehouse_name SEPARATOR ',' ) retentionWarehouseName FROM logpm_warehouse_retention_record lwrr GROUP BY lwrr.waybill_no
</select>
@ -90,6 +112,97 @@
</if>
</where>
</select>
<select id="selectWarehouseRetentionScanVoList"
resultType="com.logpm.warehouse.vo.WarehouseRetentionScanVO">
SELECT
lwrs.train_number,
lwrs.order_id,
lwrs.reservation_id,
lwrs.order_code,
lwrs.waybill_number,
lwrs.waybill_id,
lwrs.reservation_code,
lwrs.order_package_id,
lwrs.order_package_code,
lwrs.retention_scan_user_id,
lwrs.retention_scan_username,
lwrs.retention_scan_time,
lwrs.delivery_id,
lwrs.ref_id,
lwrs.tray_id,
lwrs.tray_code,
lwrs.tray_name,
lwrs.scan_type,
lwrs.retention_way,
lwrs.material_number,
lwrs.material_name,
lwrs.inventory_id,
CASE lwrs.conditions
WHEN 1 THEN '包件'
WHEN 2 THEN '库存品'
WHEN 3 THEN '零担'
ELSE
''
END scanTypeName,
CASE lwrs.retention_way
WHEN 1 THEN '扫描'
WHEN 2 THEN '托盘'
ELSE
''
END retentionWayName
FROM
logpm_warehouse_retention_record AS lwrr
LEFT JOIN logpm_warehouse_retention_scan AS lwrs ON lwrr.id = lwrs.ref_id
WHERE
lwrr.id=#{rerentionId} and lwrs.cancel_retention_status = 0
</select>
<select id="selectWarehouseRetentionScanVoListByType"
resultType="com.logpm.warehouse.vo.WarehouseRetentionScanVO">
SELECT
lwrs.train_number,
lwrs.order_id,
lwrs.reservation_id,
lwrs.order_code,
lwrs.waybill_number,
lwrs.waybill_id,
lwrs.reservation_code,
lwrs.order_package_id,
lwrs.order_package_code,
lwrs.retention_scan_user_id,
lwrs.retention_scan_username,
lwrs.retention_scan_time,
lwrs.delivery_id,
lwrs.ref_id,
lwrs.tray_id,
lwrs.tray_code,
lwrs.tray_name,
lwrs.scan_type,
lwrs.retention_way,
lwrs.material_number,
lwrs.material_name,
lwrs.inventory_id,
CASE lwrs.conditions
WHEN 1 THEN '包件'
WHEN 2 THEN '库存品'
WHEN 3 THEN '零担'
ELSE
''
END scanTypeName,
CASE lwrs.retention_way
WHEN 1 THEN '扫描'
WHEN 2 THEN '托盘'
ELSE
''
END retentionWayName
FROM
logpm_warehouse_retention_record AS lwrr
LEFT JOIN logpm_warehouse_retention_scan AS lwrs ON lwrr.id = lwrs.ref_id
WHERE
lwrr.id=#{rerentionId} and lwrs.cancel_retention_status = 0
<if test="type!=null and type !=''">
and lwrs.conditions = #{type}
</if>
</select>
</mapper>

14
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/ITaskQuestService.java

@ -231,4 +231,18 @@ public interface ITaskQuestService extends BaseService<TaskQuestEntity> {
* @return
*/
R getMaterialName(TaskSearchDTO taskSearchDTO, IPage<Object> page);
/**
* 修改数据
* @param taskQuest
* @return
*/
Boolean updateByInfo(TaskQuestDTO taskQuest);
/**
* 盘点数据修改
* @param questDetailDTO
* @return
*/
boolean updateQuestInfo(List<QuestDetailDTO> questDetailDTO);
}

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

@ -25,7 +25,9 @@ import com.logpm.warehouse.dto.WarehouseRetentionScanDTO;
import com.logpm.warehouse.entity.WarehouseRetentionRecordEntity;
import com.logpm.warehouse.excel.WarehouseRetentionRecordExcel;
import com.logpm.warehouse.vo.WarehouseRetentionRecordVO;
import com.logpm.warehouse.vo.WarehouseRetentionScanVO;
import com.logpm.warehouse.vo.WarehouseWaybillDetentionVO;
import org.apache.ibatis.annotations.Param;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.tool.api.R;
@ -88,4 +90,12 @@ public interface IWarehouseRetentionRecordService extends BaseService<WarehouseR
* @return
*/
WarehouseRetentionRecordVO getDetail(Long id);
/**
* 查询指定类型的滞留包件列表
* @param retentionId
* @param type
* @return
*/
List<WarehouseRetentionScanVO> getRetentionPackageByType(@Param("retentionId") Long retentionId,@Param("type") Integer type);
}

232
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java

@ -56,6 +56,8 @@ import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.system.cache.UserCache;
import org.springblade.system.entity.User;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -867,13 +869,170 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
*/
@Override
public List<QuestContrastVO> getContrastInfo(QuestDetailDTO questDetailDTO, IPage<Object> page) {
List<QuestContrastVO> voList = new ArrayList<>();
//查询的有数据的信息
// questDetailDTO.setQuestTarget(1);
List<QuestContrastVO> list = baseMapper.selectContrastDataInfo(questDetailDTO.getQuestNum(),questDetailDTO);
list.stream().forEach(i ->{
String[] split = i.getQuestStatus().split(",");
//盘点状态;0 待盘点 1. 已盘 2未盘点 3已排除
Integer yiPan = 0;
for (String s : split) {
switch (s){
case "1":
yiPan += 1;
i.setQuestStatusName("部分盘点");
break;
}
}
if(ObjectUtils.isNotNull(i.getUpdateUser())){
StringBuffer buffer = new StringBuffer();
String[] split1 = i.getUpdateUser().split(",");
for (String s : split1) {
User user = UserCache.getUser(Long.valueOf(s));
buffer.append(user.getAccount());
}
i.setUpdateUser(buffer.toString());
}
i.setQuestNum(yiPan);
int i1 = i.getHandQuantity() - yiPan;
i.setDifferenceNum(i1);
if(ObjectUtils.isNull(i.getGroundingPositionCode())){
i.setGroundingPositionCode("无更新");
}
});
//查询零担
QuestDetailEntity questContrastVO = new QuestDetailEntity();
questContrastVO.setQuestId(questDetailDTO.getQuestId());
questContrastVO.setQuestTarget(2);
List<QuestDetailEntity> list1 = baseMapper.selectQuestDetailList(questDetailDTO.getQuestNum(), questContrastVO);
if(ObjectUtils.isNotNull(list1)){
list1.stream().collect(Collectors.groupingBy(QuestDetailEntity::getOrderId)).forEach((k,v) ->{
//查询订单信息
DistributionStockArticleEntity entityByStockArticle = distributionStockArticleClient.findEntityByStockArticleId(k);
if(ObjectUtils.isNull(entityByStockArticle)){
log.info("没有订单数据!!");
return;
}
//已盘数量
AtomicReference<Integer> yi = new AtomicReference<>(0);
StringBuffer buffer = new StringBuffer();
QuestContrastVO q = new QuestContrastVO();
q.setQuestNum(yi.get()); //盘点数
q.setTotalNumber(entityByStockArticle.getTotalNumber());
q.setHandQuantity(entityByStockArticle.getHandQuantity());
q.setBrandName(entityByStockArticle.getBrand());
q.setMallName(entityByStockArticle.getMallName());
q.setCustomerName(entityByStockArticle.getCustomerName());
q.setMaterialName(entityByStockArticle.getDescriptionGoods());
v.stream().forEach( i ->{
switch (i.getQuestStatus()){
case 1:
yi.updateAndGet(v1 -> v1 + 1);
q.setQuestStatusName("部分盘点");
User user = UserCache.getUser(i.getUpdateUser());
q.setUpdateUser(user.getAccount());
q.setUpdateTime(i.getUpdateTime());
break;
}
q.setOrderCode(i.getOrderCode());
if(ObjectUtils.isNull(i.getGroundingPositionCode())){
q.setGroundingPositionCode("无更新");
}
//库位
if(ObjectUtils.isNull(buffer) && ObjectUtils.isNotNull( i.getPositionCode())){
buffer.append(i.getPositionCode());
}else if(ObjectUtils.isNotNull(buffer) && ObjectUtils.isNotNull( i.getPositionCode()) && !buffer.toString().contains(i.getPositionCode())){
buffer.append(",").append(i.getPositionCode());
}
//托盘
if(ObjectUtils.isNotNull(i.getTrayCode())){
if(ObjectUtils.isNull(q.getTrayCode()) ){
q.setTrayCode(i.getPositionCode());
}else if(ObjectUtils.isNotNull(q.getTrayCode()) && !q.getTrayCode().contains(i.getTrayCode())){
q.setTrayCode(q.getTrayCode()+","+i.getPositionCode());
}
}
//更新的货位
if(ObjectUtils.isNotNull(i.getGroundingPositionCode())){
if(ObjectUtils.isNull(q.getGroundingPositionCode())){
q.setGroundingPositionCode(i.getGroundingPositionCode());
}else if(ObjectUtils.isNotNull(q.getGroundingPositionCode()) && !q.getGroundingPositionCode().contains(i.getGroundingPositionCode())){
q.setGroundingPositionCode(q.getGroundingPositionCode()+","+i.getGroundingPositionCode());
}
}
});
q.setDifferenceNum(entityByStockArticle.getHandQuantity() - yi.get());
q.setPositionCode(buffer.toString());
voList.add(q);
});
}
return null;
//查询库存品
questContrastVO.setQuestTarget(3);
List<QuestDetailEntity> list2 = baseMapper.selectQuestDetailList(questDetailDTO.getQuestNum(), questContrastVO);
if(ObjectUtils.isNotNull(list2)){
list2.stream().collect(Collectors.groupingBy(QuestDetailEntity::getStockId)).forEach( (k,v) ->{
DistributionStockListEntity stockListBy = distributionStockListClient.getStockListById(k);
if(ObjectUtils.isNull(stockListBy)){
return;
}
QuestContrastVO q = new QuestContrastVO();
q.setOrderCode(stockListBy.getOrderCode());
q.setIncomingBatch(stockListBy.getIncomingBatch());
q.setTotalNumber(stockListBy.getQuantityStock());
q.setHandQuantity(stockListBy.getQuantityStock());
q.setBrandName(stockListBy.getBrandName());
q.setMaterialName(stockListBy.getDescriptionGoods());
StringBuffer buffer = new StringBuffer();
//已盘数量
AtomicReference<Integer> yi = new AtomicReference<>(0);
v.stream().forEach( i ->{
switch (i.getQuestStatus()){
case 1:
yi.updateAndGet(v1 -> v1 + 1);
q.setQuestStatusName("部分盘点");
User user = UserCache.getUser(i.getUpdateUser());
q.setUpdateUser(user.getAccount());
q.setUpdateTime(i.getUpdateTime());
break;
}
//库位
if(ObjectUtils.isNull(buffer) && ObjectUtils.isNotNull( i.getPositionCode())){
buffer.append(i.getPositionCode());
}else if(ObjectUtils.isNotNull(buffer) && ObjectUtils.isNotNull( i.getPositionCode()) && !buffer.toString().contains(i.getPositionCode())){
buffer.append(",").append(i.getPositionCode());
}
//托盘
if(ObjectUtils.isNotNull(i.getTrayCode())){
if(ObjectUtils.isNull(q.getTrayCode()) ){
q.setTrayCode(i.getPositionCode());
}else if(ObjectUtils.isNotNull(q.getTrayCode()) && !q.getTrayCode().contains(i.getTrayCode())){
q.setTrayCode(q.getTrayCode()+","+i.getPositionCode());
}
}
//更新的货位
if(ObjectUtils.isNotNull(i.getGroundingPositionCode())){
if(ObjectUtils.isNull(q.getGroundingPositionCode())){
q.setGroundingPositionCode(i.getGroundingPositionCode());
}else if(ObjectUtils.isNotNull(q.getGroundingPositionCode()) && !q.getGroundingPositionCode().contains(i.getGroundingPositionCode())){
q.setGroundingPositionCode(q.getGroundingPositionCode()+","+i.getGroundingPositionCode());
}
}
});
q.setDifferenceNum(stockListBy.getQuantityStock() - yi.get());
q.setPositionCode(buffer.toString());
voList.add(q);
});
}
voList.addAll(list);
return voList;
}
/**
@ -888,6 +1047,75 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
return R.data(top);
}
/**
* 盘点任务修改数据
* @param taskQuest
* @return
*/
@Override
public Boolean updateByInfo(TaskQuestDTO taskQuest) {
return baseMapper.updateById(taskQuest) > 0 ? true : false;
}
/**
* 修改盘点后的数据
* @param questDetailDTO
* @return
*/
@Override
public boolean updateQuestInfo(List<QuestDetailDTO> questDetailDTO) {
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(ObjectUtils.isNull(myCurrentWarehouse)){
throw new ServiceException("请选择仓库!!");
}
BladeUser user = AuthUtil.getUser();
if(ObjectUtils.isNull(questDetailDTO)){
questDetailDTO.stream().forEach( i ->{
if(i.getStockNum() > 0 || i.getWornNum() > 0 || i.getLossNum() > 0 || i.getNoRepairNum() > 0 || i.getDeliveNum() > 0 || i.getNoReceivedNum()> 0){
//添加
List<QuestDetailChildEntity> childList = new ArrayList<>();
childList.add(addQuestDetailChild(i.getStockNum(),"10",i.getQuestId(),myCurrentWarehouse.getId(),i.getQuestNum()));
childList.add(addQuestDetailChild(i.getWornNum(),"20",i.getQuestId(),myCurrentWarehouse.getId(),i.getQuestNum()));
childList.add(addQuestDetailChild(i.getLossNum(),"30",i.getQuestId(),myCurrentWarehouse.getId(),i.getQuestNum()));
childList.add(addQuestDetailChild(i.getNoRepairNum(),"40",i.getQuestId(),myCurrentWarehouse.getId(),i.getQuestNum()));
childList.add(addQuestDetailChild(i.getDeliveNum(),"50",i.getQuestId(),myCurrentWarehouse.getId(),i.getQuestNum()));
childList.add(addQuestDetailChild(i.getNoReceivedNum(),"60",i.getQuestId(),myCurrentWarehouse.getId(),i.getQuestNum()));
if(!childList.isEmpty()){
boolean b = childList.stream().anyMatch(ii -> ObjectUtils.isNull(ii.getId()));
if(b){
//添加
baseMapper.insertQuestDetailChildList(i.getQuestNum()+"_child",childList);
}else{
//修改
List<QuestDetailChildEntity> collect = childList.stream().filter( ii -> ObjectUtils.isNotNull(ii.getQuestNum()) && ii.getQuestNum() > 0).collect(Collectors.toList());
baseMapper.updetaQuestDetailChildList(i.getQuestNum()+"_child",collect);
}
}
}
//修改盘点数据
List<QuestDetailEntity> list = new ArrayList<>();
QuestDetailEntity questDetail = new QuestDetailEntity();
questDetail.setId(i.getId());
questDetail.setQuestStatus(i.getQuestStatus());
questDetail.setUpdateUser(user.getUserId());
questDetail.setUpdateTime(new Date());
if(ObjectUtils.isNotNull(i.getOrderCode())){
questDetail.setOrderCode(i.getOrderCode());
}
if(ObjectUtils.isNotNull(i.getOrderPackageCode())){
questDetail.setOrderPackageCode(i.getOrderPackageCode());
}
list.add(questDetail);
baseMapper.updatePositionCodeList(i.getQuestNum(),list);
});
return true;
}else{
return false;
}
}
/**
* 查询货位上的数据
* @param taskSearchDTO

69
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionRecordServiceImpl.java

@ -24,9 +24,12 @@ import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.distribution.entity.DistributionLoadscanEntity;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.entity.DistributionReservationEntity;
import com.logpm.distribution.feign.IDistributionDeliveryListClient;
import com.logpm.distribution.feign.IDistributionLoadscanClient;
import com.logpm.distribution.feign.IDistributionParcelListClient;
import com.logpm.distribution.feign.IDistributionReservationClient;
import com.logpm.distribution.vo.DistributionDeliveryListVO;
import com.logpm.warehouse.bean.Resp;
import com.logpm.warehouse.dto.*;
import com.logpm.warehouse.entity.WarehouseRetentionRecordEntity;
@ -36,6 +39,7 @@ import com.logpm.warehouse.mapper.WarehouseRetentionRecordMapper;
import com.logpm.warehouse.service.IWarehouseRetentionRecordService;
import com.logpm.warehouse.service.IWarehouseRetentionScanService;
import com.logpm.warehouse.vo.WarehouseRetentionRecordVO;
import com.logpm.warehouse.vo.WarehouseRetentionScanVO;
import com.logpm.warehouse.vo.WarehouseWaybillDetentionVO;
import com.logpm.warehouse.wrapper.WarehouseRetentionRecordWrapper;
import com.logpm.warehouse.wrapper.WarehouseRetentionScanWrapper;
@ -78,9 +82,23 @@ public class WarehouseRetentionRecordServiceImpl extends BaseServiceImpl<Warehou
private final IBasicdataWarehouseClient warehouseClient;
// private final IDistributionReservationClient distributionReservationClient;
private final IDistributionDeliveryListClient distributionDeliveryListClient;
private final IDistributionReservationClient distributionReservationClient;
@Override
public IPage<WarehouseRetentionRecordVO> selectWarehouseRetentionRecordPage(IPage<WarehouseRetentionRecordVO> page, WarehouseRetentionRecordVO warehouseRetentionRecord) {
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (AuthUtil.getUser().getUserName().equals("admin")){
if (Func.isNotEmpty(myCurrentWarehouse)){
warehouseRetentionRecord.setRetentionWarehouseId(myCurrentWarehouse.getId());
}
}else {
if (Func.isEmpty(myCurrentWarehouse)){
return null;
}
warehouseRetentionRecord.setRetentionWarehouseId(myCurrentWarehouse.getId());
}
return page.setRecords(baseMapper.selectWarehouseRetentionRecordPage(page, warehouseRetentionRecord));
}
@ -201,9 +219,9 @@ public class WarehouseRetentionRecordServiceImpl extends BaseServiceImpl<Warehou
retentionTotal.getAndAdd(r.getRetentionQuantity());
r.setDeliveryId(warehouseRetentionRecordDTO.getDeliveryId());
r.setRefId(warehouseRetentionRecordEntity.getId());
warehouseRetentionScanService.save(Func.copy(r, WarehouseRetentionScanEntity.class));
//进行滞留之后需要对包件进行取消配送的操作
Integer conditions = r.getConditions();
warehouseRetentionScanService.save(Func.copy(r, WarehouseRetentionScanEntity.class));
switch (conditions) {
case 1:
//订制品
@ -325,7 +343,54 @@ public class WarehouseRetentionRecordServiceImpl extends BaseServiceImpl<Warehou
@Override
public WarehouseRetentionRecordVO getDetail(Long id) {
return null;
WarehouseRetentionRecordEntity warehouseRetentionRecordEntity = this.getById(id);
WarehouseRetentionRecordVO warehouseRetentionRecordVO = Func.copy(warehouseRetentionRecordEntity, WarehouseRetentionRecordVO.class);
//查询滞留列表信息 然后这里需要对滞留包件进行分组处理
List<WarehouseRetentionScanVO> warehouseRetentionScanVOS = baseMapper.selectWarehouseRetentionScanVoList(id);
if (Func.isEmpty(warehouseRetentionScanVOS)){
log.info("##########查询滞留包件信息空:{}",id);
return null;
}
warehouseRetentionRecordVO.setRetentionScanVOList(warehouseRetentionScanVOS);
//查询配送信息
List<Long> deliveryIds = warehouseRetentionScanVOS.stream().filter(del -> Func.isNotEmpty(del.getDeliveryId())).map(WarehouseRetentionScanVO::getDeliveryId).distinct().collect(Collectors.toList());
if (deliveryIds.size() == 1){
DistributionDeliveryListVO deliveryDriverInfo = distributionDeliveryListClient.getRetentionDelivery(deliveryIds.get(0));
if (Func.isNotEmpty(deliveryDriverInfo)){
warehouseRetentionRecordVO.setDeliveryListVO(deliveryDriverInfo);
}
}else {
return null;
}
//获取客户信息
List<Long> reservationIds = warehouseRetentionScanVOS.stream().filter(f->Func.isNotEmpty(f.getReservationId())).map(WarehouseRetentionScanVO::getReservationId).collect(Collectors.toList());
if (Func.isNotEmpty(reservationIds)){
String ids = reservationIds.stream().map(Objects::toString).collect(Collectors.joining(","));
List<DistributionReservationEntity> reservationEntityList = distributionReservationClient.getReservationList(ids);
if (Func.isNotEmpty(reservationEntityList)){
//构造滞留所需要展示的预约信息
warehouseRetentionRecordVO.setReservationEntityList(reservationEntityList);
}else {
log.error("##########查询多个预约ID为空:{}",reservationIds);
return null;
}
}else {
return null;
}
return warehouseRetentionRecordVO;
}
@Override
public List<WarehouseRetentionScanVO> getRetentionPackageByType(Long retentionId, Integer type) {
if (type == 0){
type = null;
}
List<WarehouseRetentionScanVO> warehouseRetentionScanVOS = baseMapper.selectWarehouseRetentionScanVoListByType(retentionId,type);
return warehouseRetentionScanVOS;
}
}

6
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java

@ -448,6 +448,9 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
String tt = trayTypeEntity.getTrayType();
Long filterId = trayTypeEntity.getFilterId();
String filterValue = trayTypeEntity.getFilterValue();
if(StringUtil.isBlank(filterValue)){
filterValue = "";
}
Long trayTypeId = trayTypeEntity.getId();
Long trayTypeEntityWarehouseId = trayTypeEntity.getWarehouseId();
@ -642,6 +645,9 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
String tt = trayTypeEntity.getTrayType();
Long filterId = trayTypeEntity.getFilterId();
String filterValue = trayTypeEntity.getFilterValue();
if(StringUtil.isBlank(filterValue)){
filterValue = "";
}
Long trayTypeId = trayTypeEntity.getId();
Long trayTypeEntityWarehouseId = trayTypeEntity.getWarehouseId();

Loading…
Cancel
Save