Browse Source

Merge branch 'dev' into pre-production

newStockUp
zhenghaoyu 2 years ago
parent
commit
0e17faeae3
  1. 4
      blade-biz-common/src/main/java/org/springblade/common/constant/RabbitConstant.java
  2. 6
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionDeliveryChargeEntity.java
  3. 3
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionDeliveryDetailsEntity.java
  4. 6
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionDeliveryTripartiteEntity.java
  5. 3
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionPackagereceiptEntity.java
  6. 3
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionReservationPackageEntity.java
  7. 3
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionReservationStockarticleEntity.java
  8. 3
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionReservationStocklistEntity.java
  9. 6
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionUnpackingDetailsEntity.java
  10. 3
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistrilbutionCallDeliveryEntity.java
  11. 4
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionParcelTrayVO.java
  12. 1
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupVO.java
  13. 5
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/wrapper/DistributionPrintWrapper.java
  14. 5
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/wrapper/DistributionStockListInfoWrapper.java
  15. 13
      blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/oupai/entity/FactoryOrderEntity.java
  16. 73
      blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/oupai/entity/OpOutGoingOrderEntity.java
  17. 89
      blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/oupai/entity/OpSignBillEntity.java
  18. 44
      blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/oupai/entity/OpSignPackageEntity.java
  19. 52
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseUpdownTypeClient.java
  20. 7
      blade-service/logpm-basic/src/main/java/com/logpm/basic/service/impl/BasicMaterialServiceImpl.java
  21. 15
      blade-service/logpm-basic/src/main/java/com/logpm/basic/service/impl/BasicPrintTemplateServiceImpl.java
  22. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataWarehouseController.java
  23. 10
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsAllocationServiceImpl.java
  24. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataShopServiceImpl.java
  25. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataStoreContactServiceImpl.java
  26. 11
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java
  27. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryDetailsMapper.xml
  28. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.xml
  29. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.java
  30. 43
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml
  31. 11
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAsyncService.java
  32. 40
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java
  33. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryInfoServiceImpl.java
  34. 129
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  35. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationPackageServiceImpl.java
  36. 156
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java
  37. 77
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java
  38. 18
      blade-service/logpm-factory/src/main/java/com/logpm/factory/config/RabbitMqConfiguration.java
  39. 12
      blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/mapper/OpOutGoingOrderMapper.java
  40. 5
      blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/mapper/OpOutGoingOrderMapper.xml
  41. 9
      blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/mapper/OpSignBillMapper.java
  42. 5
      blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/mapper/OpSignBillMapper.xml
  43. 9
      blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/mapper/OpSignPackageMapper.java
  44. 5
      blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/mapper/OpSignPackageMapper.xml
  45. 7
      blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/receiver/OpReceivingDataHandler.java
  46. 274
      blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/receiver/OpSignDataHandler.java
  47. 9
      blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/IOpOutGoingOrderService.java
  48. 8
      blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/IOpSignBillService.java
  49. 8
      blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/IOpSignPackageService.java
  50. 21
      blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OpOutGoingOrderServiceImpl.java
  51. 21
      blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OpSignBillServiceImpl.java
  52. 21
      blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OpSignPackageServiceImpl.java
  53. 44
      blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryServiceImpl.java
  54. 51
      blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java
  55. 1
      blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/DealWithDataHandler.java
  56. 297
      blade-service/logpm-factory/src/test/java/com/logpm/factory/TestService.java
  57. 3
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/AdvanceDetailClient.java
  58. 3
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/AdvanceDetailServiceImpl.java
  59. 99
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseUpdownTypeClient.java
  60. 4
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayGoodsServiceImpl.java
  61. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java
  62. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownGoodsServiceImpl.java

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

@ -56,6 +56,10 @@ public interface RabbitConstant {
String OUPAI_RECEIVING_EXCHANGE = "oupai_receiving_exchange";
String OUPAI_RECEIVING_ROUTING = "oupai_receiving_routing";
String OUPAI_SIGN_QUEUE = "oupai_sign_queue";
String OUPAI_SIGN_EXCHANGE = "oupai_sign_exchange";
String OUPAI_SIGN_ROUTING = "oupai_sign_routing";
//----------------------distribution---------------------
//备货消费失败队列
String DISTRIBUTION_ERROR_QUEUE = "distribution_error_queue";

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

@ -18,14 +18,14 @@ package com.logpm.distribution.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.math.BigDecimal;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.math.BigDecimal;
/**
* 提货费用记录 实体类
*

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

@ -17,9 +17,10 @@
package com.logpm.distribution.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;

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

@ -17,14 +17,14 @@
package com.logpm.distribution.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.math.BigDecimal;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.math.BigDecimal;
/**
* 外协配送信息列表 实体类
*

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

@ -17,9 +17,10 @@
package com.logpm.distribution.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;

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

@ -17,9 +17,10 @@
package com.logpm.distribution.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;

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

@ -17,9 +17,10 @@
package com.logpm.distribution.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;

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

@ -17,9 +17,10 @@
package com.logpm.distribution.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;

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

@ -17,10 +17,12 @@
package com.logpm.distribution.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.License;
import lombok.AllArgsConstructor;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.springblade.core.tenant.mp.TenantEntity;

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

@ -17,9 +17,10 @@
package com.logpm.distribution.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;

4
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionParcelTrayVO.java

@ -10,8 +10,8 @@ import lombok.Data;
**/
@Data
public class DistributionParcelTrayVO {
private String trayId; //托盘id
private Long trayId; //托盘id
private String trayCode; //托盘名称
private String trayPackNum; //托盘名称
private Integer trayPackNum; //托盘名称
}

1
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupVO.java

@ -34,6 +34,7 @@ public class DistributionStockupVO extends DistributionStockupEntity {
private static final long serialVersionUID = 1L;
private String headline;
private String cargoUnit; //数量
private String groupName;
private String warehouseName; //仓库名称

5
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/wrapper/DistributionPrintWrapper.java

@ -16,11 +16,10 @@
*/
package com.logpm.distribution.wrapper;
import com.logpm.distribution.entity.DistributionPrintEntity;
import com.logpm.distribution.vo.DistributionPrintVO;
import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;
import com.logpm.distribution.entity.DistributionPrintEntity;
import com.logpm.distribution.vo.DistributionPrintVO;
import java.util.Objects;
/**

5
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/wrapper/DistributionStockListInfoWrapper.java

@ -16,11 +16,10 @@
*/
package com.logpm.distribution.wrapper;
import com.logpm.distribution.entity.DistributionStockListInfoEntity;
import com.logpm.distribution.vo.DistributionStockListInfoVO;
import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;
import com.logpm.distribution.entity.DistributionStockListInfoEntity;
import com.logpm.distribution.vo.DistributionStockListInfoVO;
import java.util.Objects;
/**

13
blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/oupai/entity/FactoryOrderEntity.java

@ -249,4 +249,17 @@ public class FactoryOrderEntity extends BaseEntity {
*/
@ApiModelProperty(name = "转发状态 1转送 0未转送", notes = "")
private Integer turnStatus;
/**
* 商场编码
*/
@ApiModelProperty(name = "商场编码", notes = "")
private String shopCode;
/**
* 商场名称
*/
@ApiModelProperty(name = "商场名称", notes = "")
private String shopName;
}

73
blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/oupai/entity/OpOutGoingOrderEntity.java

@ -0,0 +1,73 @@
package com.logpm.factory.oupai.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import java.util.Date;
@Data
@TableName("op_out_going_order")
@ApiModel(value = "OpOutGoingOrder对象", description = "欧派工厂配送单")
@EqualsAndHashCode(callSuper = true)
public class OpOutGoingOrderEntity extends BaseEntity {
/** 预留1 */
@ApiModelProperty(name = "预留1",notes = "")
private String reserve1 ;
/** 预留2 */
@ApiModelProperty(name = "预留2",notes = "")
private String reserve2 ;
/** 预留3 */
@ApiModelProperty(name = "预留3",notes = "")
private String reserve3 ;
/** 预留4 */
@ApiModelProperty(name = "预留4",notes = "")
private String reserve4 ;
/** 预留5 */
@ApiModelProperty(name = "预留5",notes = "")
private String reserve5 ;
/** 配送单编码 */
@ApiModelProperty(name = "配送单编码",notes = "")
private String code ;
/** 配送单状态 */
@ApiModelProperty(name = "配送单状态",notes = "")
private Integer outGoingOrderStatus ;
/** 配送仓库编码 */
@ApiModelProperty(name = "配送仓库编码",notes = "")
private String warehouseCode ;
/** 配送仓库名称 */
@ApiModelProperty(name = "配送仓库名称",notes = "")
private String warehouseName ;
/** 配送仓库地址 */
@ApiModelProperty(name = "配送仓库地址",notes = "")
private String warehouseAddress ;
/** 配送车牌号 */
@ApiModelProperty(name = "配送车牌号",notes = "")
private String truckPlate ;
/** 配送日期 */
@ApiModelProperty(name = "配送日期",notes = "")
private Date deliveryDate ;
/** 创建者 */
@ApiModelProperty(name = "创建者",notes = "")
private String creator ;
/** 创建时间 */
@ApiModelProperty(name = "创建时间",notes = "")
private Date createTime ;
@ApiModelProperty(name = "门店编码",notes = "")
private String storeCode;
@ApiModelProperty(name = "门店名称",notes = "")
private String storeName;
@ApiModelProperty(name = "商场编码",notes = "")
private String shopCode;
@ApiModelProperty(name = "商场名称",notes = "")
private String shopName;
/** 发货时间 */
@ApiModelProperty(name = "发货时间",notes = "")
private Date sendTime ;
}

89
blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/oupai/entity/OpSignBillEntity.java

@ -0,0 +1,89 @@
package com.logpm.factory.oupai.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import java.math.BigDecimal;
import java.util.Date;
@Data
@TableName("op_sign_bill")
@ApiModel(value = "OpSignBill对象", description = "欧派工厂签收单")
@EqualsAndHashCode(callSuper = true)
public class OpSignBillEntity extends BaseEntity {
/** 预留1 */
@ApiModelProperty(name = "预留1",notes = "")
private String reserve1 ;
/** 预留2 */
@ApiModelProperty(name = "预留2",notes = "")
private String reserve2 ;
/** 预留3 */
@ApiModelProperty(name = "预留3",notes = "")
private String reserve3 ;
/** 预留4 */
@ApiModelProperty(name = "预留4",notes = "")
private String reserve4 ;
/** 预留5 */
@ApiModelProperty(name = "预留5",notes = "")
private String reserve5 ;
@ApiModelProperty(name = "配送单id",notes = "")
private Long outGoingOrderId ;
@ApiModelProperty(name = "签收单号",notes = "")
private String code ;
/**
* 新建:0
*
* 已签收:1
*
* 部分签收:2
*/
@ApiModelProperty(name = "状态",notes = "")
private Integer signBillStatus ;
@ApiModelProperty(name = "签收人",notes = "")
private String signPerson ;
@ApiModelProperty(name = "签收人电话",notes = "")
private String signPhone ;
@ApiModelProperty(name = "签收人地址",notes = "")
private String signAddress ;
@ApiModelProperty(name = "签收时间",notes = "")
private Date signTime ;
@ApiModelProperty(name = "签收说明",notes = "")
private String remark;
@ApiModelProperty(name = "配送单号",notes = "")
private String outGoingOrderCode;
@ApiModelProperty(name = "再投原因",notes = "")
private String againsendReason;
@ApiModelProperty(name = "再投描述",notes = "")
private String description;
@ApiModelProperty(name = "是否再投",notes = "")
private Integer isAgainsend;//0否1是
@ApiModelProperty(name = "创建者",notes = "")
private String creator;
@ApiModelProperty(name = "创建时间",notes = "")
private Date createTime ;
@ApiModelProperty(name = "顾客评分",notes = "")
private BigDecimal customerRate ;
@ApiModelProperty(name = "顾客反馈",notes = "")
private String customerFeedback;
@ApiModelProperty(name = "门店编码",notes = "")
private String storeCode;
@ApiModelProperty(name = "门店名称",notes = "")
private String storeName;
@ApiModelProperty(name = "商场编码",notes = "")
private String shopCode;
@ApiModelProperty(name = "商场名称",notes = "")
private String shopName;
@ApiModelProperty(name = "司机电话",notes = "")
private String driverPhone;
@ApiModelProperty(name = "司机名称",notes = "")
private String driverName;
@ApiModelProperty(name = "配送日期",notes = "")
private Date deliveryTime;
}

44
blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/oupai/entity/OpSignPackageEntity.java

@ -0,0 +1,44 @@
package com.logpm.factory.oupai.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
@Data
@TableName("op_sign_package")
@ApiModel(value = "OpSignPackage对象", description = "欧派工厂签收包件")
@EqualsAndHashCode(callSuper = true)
public class OpSignPackageEntity extends BaseEntity {
/** 预留1 */
@ApiModelProperty(name = "预留1",notes = "")
private String reserve1 ;
/** 预留2 */
@ApiModelProperty(name = "预留2",notes = "")
private String reserve2 ;
/** 预留3 */
@ApiModelProperty(name = "预留3",notes = "")
private String reserve3 ;
/** 预留4 */
@ApiModelProperty(name = "预留4",notes = "")
private String reserve4 ;
/** 预留5 */
@ApiModelProperty(name = "预留5",notes = "")
private String reserve5 ;
private Long signBillId;
/** 包件码 */
@ApiModelProperty(name = "包件码",notes = "")
private String orderPackageCode ;
/** 签收状态 */
@ApiModelProperty(name = "签收状态",notes = "")
private Integer packageStatus ;
/** 是否是库存品 */
@ApiModelProperty(name = "是否是库存品",notes = "")
private Integer isInventory ;//0否 1是
}

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

@ -0,0 +1,52 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.warehouse.feign;
import com.alibaba.fastjson.JSONObject;
import org.springblade.common.constant.ModuleNameConstant;
import org.springblade.core.tool.api.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
/**
* 上下架 Feign接口类
*
* @author zhy
* @since 2023-08-15
*/
@FeignClient(
value = ModuleNameConstant.APPLICATION_WAREHOUSE_NAME
)
public interface IWarehouseUpdownTypeClient {
String API_PREFIX = "warehouseUpdownTypeLog/client";
String TOP = API_PREFIX + "/top";
@GetMapping(TOP + "/downPackage")
R downPackage(@RequestParam("orderPackageCodes") String orderPackageCodes);
@PostMapping(TOP + "/downZeroOrder")
R downZeroOrder(@RequestBody List<JSONObject> zeroOrders);
@PostMapping(TOP + "/downStock")
R downStock(@RequestBody List<JSONObject> stockLists);
}

7
blade-service/logpm-basic/src/main/java/com/logpm/basic/service/impl/BasicMaterialServiceImpl.java

@ -72,14 +72,15 @@ public class BasicMaterialServiceImpl extends BaseServiceImpl<BasicMaterialMappe
@Override
@Transactional(rollbackFor = Exception.class)
public void importMaterial(List<BasicMaterialExcel> data) {
log.info("传入参数>>>>>>>>>>>>>>>>{},>>>>>>>>{}",data);
log.info("传入参数>>>>>>>>>>>>>>>>,>>>>>>>>{}",data);
ArrayList<BasicMaterialEntity> arrayList = new ArrayList<>();
for (BasicMaterialExcel datum : data) {
//去重
List<BasicMaterialEntity> basicMaterialEntities = baseMapper.selectList(new QueryWrapper<BasicMaterialEntity>().lambda().eq(BasicMaterialEntity::getProductCode,datum.getProductCode()));
if (basicMaterialEntities.size()>0){continue;}
if (!basicMaterialEntities.isEmpty()){continue;}
BasicMaterialEntity copy = BeanUtil.copy(datum, BasicMaterialEntity.class);
copy.setHide(1);
assert copy != null;
copy.setHide(1);
arrayList.add(copy);
}
// 根据对象的value属性进行去重

15
blade-service/logpm-basic/src/main/java/com/logpm/basic/service/impl/BasicPrintTemplateServiceImpl.java

@ -26,6 +26,7 @@ import com.logpm.basic.mapper.BasicPrintTemplateMapper;
import com.logpm.basic.service.IBasicPrintTemplateService;
import com.logpm.basic.vo.BasicPrintTemplateVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
@ -45,6 +46,7 @@ import java.util.List;
*/
@Service
@AllArgsConstructor
@Slf4j
public class BasicPrintTemplateServiceImpl extends BaseServiceImpl<BasicPrintTemplateMapper, BasicPrintTemplateEntity> implements IBasicPrintTemplateService {
private BasicPrintTemplateMapper printTemplateMapper;
@ -67,13 +69,13 @@ public class BasicPrintTemplateServiceImpl extends BaseServiceImpl<BasicPrintTem
@Override
public boolean insertPrintTemplate(BasicPrintTemplateDTO basicPrintTemplateDTO) {
boolean result = false;
if (Func.isEmpty(basicPrintTemplateDTO)){
log.error("参数异常:{}"+basicPrintTemplateDTO);
return result;
if (Func.isEmpty(basicPrintTemplateDTO)) {
log.info(">>>> {}", basicPrintTemplateDTO);
return false;
}
boolean result = false;
BasicPrintTemplateEntity basicPrintTemplateEntity = new BasicPrintTemplateEntity();
BeanUtils.copyProperties(basicPrintTemplateDTO,basicPrintTemplateEntity);
BeanUtils.copyProperties(basicPrintTemplateDTO, basicPrintTemplateEntity);
BladeUser user = AuthUtil.getUser();
Date date = new Date();
basicPrintTemplateEntity.setTenantId(user.getTenantId());
@ -92,12 +94,13 @@ public class BasicPrintTemplateServiceImpl extends BaseServiceImpl<BasicPrintTem
@Override
public BasicPrintTemplateEntity selectTemplateLink(String templateId) {
BasicPrintTemplateEntity basicPrintTemplateEntity = baseMapper.selectById(templateId);
return basicPrintTemplateEntity;
}
@Override
public boolean save(BasicPrintTemplateEntity entity) {
if (Func.isEmpty(entity)){
if (Func.isEmpty(entity)) {
return false;
}
BladeUser user = AuthUtil.getUser();

2
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataWarehouseController.java

@ -199,7 +199,7 @@ public class BasicdataWarehouseController extends BladeController {
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
boolean result = warehouseService.removeWarehouse(ids);
if (result) {
return R.status(result);
return R.status(true);
} else {
return R.fail("请先删除该仓库下所有资源!!!");
}

10
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsAllocationServiceImpl.java

@ -159,7 +159,7 @@ public class BasicdataGoodsAllocationServiceImpl extends BaseServiceImpl<Basicda
public boolean insertGoodsAllocation(BasicdataGoodsAllocationDTO basicdataGoodsAllocationDto) {
BasicdataGoodsAllocationEntity basicdataGoodsAllocationEntity = new BasicdataGoodsAllocationEntity();
if (Func.isEmpty(basicdataGoodsAllocationDto)) {
log.error("参数不合法:{}" + basicdataGoodsAllocationDto);
log.error("参数不合法:{}" , basicdataGoodsAllocationDto);
return false;
}
BeanUtils.copyProperties(basicdataGoodsAllocationDto, basicdataGoodsAllocationEntity);
@ -180,8 +180,7 @@ public class BasicdataGoodsAllocationServiceImpl extends BaseServiceImpl<Basicda
String code = tenantCodeClient.shelfCode(user.getTenantId(), "5");
String allocationCode = code + "-" + basicdataGoodsAllocationEntity.getColumnNum() + "-" + basicdataGoodsAllocationEntity.getLayerNum() + "-" + basicdataGoodsAllocationEntity.getGoodsAllocationName();
basicdataGoodsAllocationEntity.setQrCode(allocationCode);
boolean result = SqlHelper.retBool(goodsAllocationMapper.insert(basicdataGoodsAllocationEntity));
return result;
return SqlHelper.retBool(goodsAllocationMapper.insert(basicdataGoodsAllocationEntity));
}
@Override
@ -194,8 +193,7 @@ public class BasicdataGoodsAllocationServiceImpl extends BaseServiceImpl<Basicda
.map(BasicdataWarehouseEntity::getId)
.collect(Collectors.toList());
basicdataGoodsAllocation.put("warehouseList",collect);
IPage<BasicdataGoodsAllocationVO> goodsAllocationVOIPage = goodsAllocationMapper.selectGoodsAllocationList(page, basicdataGoodsAllocation);
return goodsAllocationVOIPage;
return goodsAllocationMapper.selectGoodsAllocationList(page, basicdataGoodsAllocation);
}
@ -203,7 +201,7 @@ public class BasicdataGoodsAllocationServiceImpl extends BaseServiceImpl<Basicda
public boolean updateGoodsAllocation(BasicdataGoodsAllocationDTO basicdataGoodsAllocationDto) {
boolean result = false;
if (Func.isEmpty(basicdataGoodsAllocationDto)) {
log.error("参数不合法:{}" + basicdataGoodsAllocationDto);
log.error("参数不合法:{}" , basicdataGoodsAllocationDto);
return result;
}
BasicdataGoodsAllocationEntity basicdataGoodsAllocationEntity = new BasicdataGoodsAllocationEntity();

2
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataShopServiceImpl.java

@ -105,7 +105,7 @@ public class BasicdataShopServiceImpl extends BaseServiceImpl<BasicdataShopMappe
// }
return false;
}catch (Exception e){
log.info("报错信息",e.getMessage());
log.info("报错信息 {}",e.getMessage());
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return false;
}

2
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataStoreContactServiceImpl.java

@ -71,7 +71,7 @@ public class BasicdataStoreContactServiceImpl extends BaseServiceImpl<BasicdataS
});
return true;
}catch (Exception e){
log.info("报错信息:",e.getMessage());
log.info("报错信息:{}",e.getMessage());
return false;
}

11
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java

@ -569,8 +569,17 @@ public class DistributionStockupAppController extends BladeController {
//重复扫码
String audioValue7 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "7");
return Resp.scanFail("包条码不存在!",audioValue7);
case 8:
//重复扫码
String audioValue8 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "8");
return Resp.scanFail("条码已使用!",audioValue8);
case 9:
//重复扫码
String audioValue9 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "9");
return Resp.scanFail("没有待绑定的库存品信息!",audioValue9);
}
}
log.warn("###################stockupScan: 未知的扫码类型 scanType={}",scanType);
return R.fail("未知的扫码类型");

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

@ -60,10 +60,10 @@
<select id="oneListNum" resultType="com.logpm.distribution.vo.DistributionDeliveryDetailsVO">
select sum(lddd.quantity) wholeNum , (
select COUNT(1)
select COUNT(DISTINCT ldbls.id)
from logpm_distribution_delivery_details ldd
LEFT JOIN logpm_distribution_bill_lading_scan ldbls on ldd.stock_list_id = ldbls.stock_list_id
where lddd.bill_lading_id = #{id} and ldd.is_deleted = 0
where ldbls.bill_lading_id = #{id} and ldd.is_deleted = 0
) esauNum
from logpm_distribution_delivery_details lddd
where lddd.bill_lading_id = #{id} and lddd.is_deleted = 0

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

@ -234,7 +234,8 @@
<select id="selectStockListInfoList" resultType="com.logpm.distribution.vo.StockListInfoListVO">
select
s.coding packageCode,
s.goods_name name
s.goods_name name,
ldsl.
from logpm_distribution_reservation ldr
left join logpm_distribution_reservation_stocklist ldrs on ldrs.reservation_id = ldr.id and ldrs.is_deleted = 0 and ldrs.stock_list_status in (1,3)

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

@ -168,4 +168,6 @@ public interface DistributionStockupMapper extends BaseMapper<DistributionStocku
* @return
*/
IPage<DistributionStockupEntity> pageOweList(IPage<Object> page,@Param("param")DistributionStockupEntity distributionStockupEntity);
IPage<DistributionStockupVO> getInventoryOwnSelf(IPage<Object> page,@Param("id") Long id);
}

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

@ -83,6 +83,32 @@
</where>
GROUP BY lds.id
</select>
<select id="getInventoryOwnSelf" resultType="com.logpm.distribution.vo.DistributionStockupVO">
select DISTINCT ldsii.sku,ldsii.cargo_unit cargoUnit,lds.stockup_status stockupStatus,lds.stockup_date stockupDate,lds.stockup_area stockupArea,ldsii.description_goods descriptionGoods
,lddd.quantity reservationNum,ldsii.order_code orderCode,
(
select GROUP_CONCAT(DISTINCT tray_code)
from logpm_warehouse_tray_goods
where association_id = ldsii.id and market_id = ldsii.market_id
) pallet ,
(
select GROUP_CONCAT(DISTINCT position_code)
from logpm_warehouse_updown_goods
where association_id = ldsii.id and market_id = ldsii.market_id
) goodsAllocation,
(
select count(1)
from logpm_distribution_stock ds
WHERE ds.stock_list_id = ldsii.id and ds.bill_lading_id = lddd.bill_lading_id
) number
from logpm_distribution_stockup lds
LEFT JOIN logpm_distribution_stockup_info ldsi on lds.id = ldsi.stockup_id
LEFT JOIN logpm_distribution_delivery_details lddd on lddd.bill_lading_id = ldsi.reservation_id
LEFT JOIN logpm_distribution_stock_list ldsii on ldsii.id = lddd.stock_list_id
<where>
ldsi.stockup_id =#{id}
</where>
</select>
<select id="pageOweList" resultType="com.logpm.distribution.vo.DistributionStockupVO">
select DISTINCT lds.id,lds.stockup_date stockupDate, lds.stockup_user stockupUser, lds.stockup_status stockupStatus, lds.stockup_area stockupArea,
lds.assign_status assignStatus, lds.goods_area_id goodsAreaId, lds.forklift_name forkliftName,
@ -152,7 +178,7 @@
where ds.id = lds.id
) orderNum ,
(
select COUNT(ldrp.id)
select COUNT(DISTINCT ldrp.id)
from logpm_distribution_stockup ds
LEFT JOIN logpm_distribution_stockup_info ldsi on ds.id = ldsi.stockup_id
LEFT JOIN logpm_distribution_reservation_package ldrp on ldrp.reservation_id = ldsi.reservation_id and ldrp.packet_bar_status in (1,3)
@ -215,11 +241,11 @@
LEFT JOIN logpm_distribution_parcel_list ldpl on ldpl.stock_article_id = ldbs.stock_article_id
where ldbs.bill_lading_id = ldsi.reservation_id)
) trays ,
(select COUNT(id)
(select COUNT(DISTINCT id)
from logpm_distrilbution_bill_stock
where bill_lading_id = ldsi.reservation_id and order_status in (1,2) ) orderNum,
(
select COUNT(ldbs.id)
select COUNT(DISTINCT ldbs.id)
from logpm_distrilbution_bill_stock ldbs
LEFT JOIN logpm_distribution_parcel_list ldpl on ldpl.stock_article_id = ldbs.stock_article_id
where ldbs.bill_lading_id = ldsi.reservation_id
@ -230,7 +256,7 @@
where lddd.bill_lading_id = ldbs.bill_lading_id
) inventoryNub,
(
select COUNT(id)
select COUNT(DISTINCT id)
from logpm_distribution_stock
where parcel_list_id in (
select id
@ -238,7 +264,7 @@
where ldbs.stock_article_id = stock_article_id
)
)+(
select COUNT(lds.id)
select COUNT(DISTINCT lds.id)
from logpm_distribution_delivery_details lddd
LEFT JOIN logpm_distribution_stock lds on lddd.stock_list_id = lds.stock_list_id
where lds.bill_lading_id =ldbs.bill_lading_id
@ -554,9 +580,7 @@
where dpl.stock_article_id = ldrsi.stocklist_id
)
) number
from logpm_distribution_stockup_info ldsi
LEFT JOIN logpm_distribution_reservation_stockarticle ldrs on ldsi.reservation_id = ldrs.reservation_id
LEFT JOIN logpm_distribution_reservation_stocklist ldrsi on ldrsi.reservation_id = ldrs.reservation_id
LEFT JOIN logpm_distribution_stockup lds on lds.id = ldsi.stockup_id
@ -589,8 +613,9 @@
and ldsi.is_deleted = 0
</select>
<select id="getInventoryCheSelf" resultType="com.logpm.distribution.vo.DistributionStockupVO">
select lddd.quantity,ldsi.reservation_id
from logpm_distribution_stockup_info ldsi
select lddd.quantity reservationStockListNum,ldsi.reservation_id,lds.type_service
from logpm_distribution_stockup lds
LEFT JOIN logpm_distribution_stockup_info ldsi on ldsi.stockup_id = lds.id
LEFT JOIN logpm_distribution_delivery_details lddd on ldsi.reservation_id = lddd.bill_lading_id
<where>
ldsi.stockup_id =#{id} and lddd.inventory_status in (1,2)

11
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAsyncService.java

@ -121,17 +121,6 @@ public interface IDistributionAsyncService {
*/
void stockupSelfUpdateState(StockupDTO stockupDTO);
/**
* 库存品 查询备货状态修改
* @param stockupDTO
*/
void stockupStockUpdateState(StockupDTO stockupDTO);
/**
* 库存品 查询备货状态修改
* @param stockupDTO
*/
void stockupStockSelfUpdateState(StockupDTO stockupDTO);
/**
* 市配装车扫描接口状态变更

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

@ -32,6 +32,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;
@ -150,7 +151,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
distributionStock.setId(id);
distributionStock.setConditions("3");
int i = distributionStockService.updateById(distributionStock);
return i > 0 ? true : false;
return i > 0 ;
}
@Override
@ -480,13 +481,16 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
List<DistributionParcelListEntity> parcelListEntityList = distributionParcelListService.getBaseMapper().selectList(Wrappers.<DistributionParcelListEntity>query().lambda().eq(DistributionParcelListEntity::getStockArticleId, id));
boolean flag = parcelListEntityList.stream().allMatch(p -> p.getOrderPackageReservationStatus().equals(OrderPackageReservationStatusConstant.yiyueyue.getValue()));
if (flag){
stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue());
assert stockArticleEntity != null;
stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue());
}else {
flag = parcelListEntityList.stream().allMatch(p -> p.getOrderPackageReservationStatus().equals(OrderPackageReservationStatusConstant.daiyuyue.getValue()));
if (flag){
stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.daiyuyue.getValue());
assert stockArticleEntity != null;
stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.daiyuyue.getValue());
}else {
stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.bufenyuyue.getValue());
assert stockArticleEntity != null;
stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.bufenyuyue.getValue());
}
}
distributionStockArticleService.updateById(stockArticleEntity);
@ -571,7 +575,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
.eq(DistributionReservationStockarticleEntity::getReservationId, i.getReservationId())
.apply("stock_article_status in (1,3)")
);
if(distributionReservationStockarticleEntities.size() > 0 ){
if(!distributionReservationStockarticleEntities.isEmpty()){
int sum = distributionReservationStockarticleEntities.stream().mapToInt(DistributionReservationStockarticleEntity::getReservationNum).sum();
nu.set(nu.get() + sum);
}
@ -581,7 +585,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
.eq(DistributionReservationStocklistEntity::getReservationId, i.getReservationId())
.apply("stock_list_status in (1,3)")
);
if(distributionReservationStocklistEntities.size() > 0){
if(!distributionReservationStocklistEntities.isEmpty()){
int sum = distributionReservationStocklistEntities.stream().mapToInt(DistributionReservationStocklistEntity::getReservationNum).sum();
ku.set(ku.get()+ sum);
}
@ -618,6 +622,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
reservationEntity.setStockupStatus(StockupStatusConstant.beihuozhong.getValue());
}else if (i== 0){
distributionStockup.setId(stockupDTO.getStockupId());
distributionStockup.setFixTime(new Date());
distributionStockup.setStockupStatus(StockupStatusConstant.yibeihuo.getValue());
reservationEntity.setId(stockupDTO.getReservationId());
reservationEntity.setStockupStatus(StockupStatusConstant.yibeihuo.getValue());
@ -682,6 +687,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
//改为已完成
//修改备货状态
distributionStockup.setId(stockupDTO.getStockupId());
distributionStockup.setFixTime(new Date());
distributionStockup.setStockupStatus(StockupStatusConstant.yibeihuo.getValue());
}
}else{
@ -698,30 +704,8 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
}
/**
* 库存品 查询备货状态修改
* @param stockupDTO
*/
@Override
public void stockupStockUpdateState(StockupDTO stockupDTO) {
DistributionStockupEntity distributionStockupEntity = distributionStockupService.selectById(stockupDTO.getStockupId());
}
/**
* 库存品 查询备货状态修改
* @param stockupDTO
*/
@Override
public void stockupStockSelfUpdateState(StockupDTO stockupDTO) {
DistributionStockupEntity distributionStockupEntity = distributionStockupService.selectById(stockupDTO.getStockupId());
}
}

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

@ -162,7 +162,7 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl<Distrib
.eq(DistributionLoadscanEntity::getReservationId, k.getReservationId())
.apply("scan_status != 1")
);
if (list.size() > 0) {
if (!list.isEmpty()) {
k.setScanStatus(2);
k.setIsScan("已扫");
} else {

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

@ -44,6 +44,7 @@ import com.logpm.distribution.wrapper.DistributionStockArticleWrapper;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.lang.StringUtils;
import org.jetbrains.annotations.NotNull;
import org.springblade.common.constant.DistributionTypeConstant;
import org.springblade.common.constant.Inventory.InventoryLoadingStatusConstant;
import org.springblade.common.constant.Inventory.InventoryPackageStatusConstant;
@ -171,7 +172,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
// if (detail.getSource() == 1) {
//查询客户信息
List<DistributionDeliveryInfoVO> customList = distributionDeliveryInfoMapper.selectcustomList(detail.getId());
if (Func.isNotEmpty(customList) || customList.size() >= 1) {
if (!customList.isEmpty()) {
customList.forEach(c -> {
if (Func.isNotEmpty(c.getLoadingStatus())) {
switch (c.getLoadingStatus()) {
@ -303,7 +304,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//获取关联的客户信息
if (distributionDeliveryList.getSource() == 1) {
String reservationId = distributionDeliveryList.getReservationId();
List<Long> reservationIds = Arrays.asList(Long.valueOf(String.valueOf(reservationId.split(","))));
List<Long> reservationIds = Collections.singletonList(Long.valueOf(Arrays.toString(reservationId.split(","))));
//查询客户信息,装车情况
// List<DistributionDeliveryInfoEntity> distributionDeliveryInfoEntities = distributionDeliveryInfoMapper.selectList(new QueryWrapper<DistributionDeliveryInfoEntity>().lambda()
// .eq(DistributionDeliveryInfoEntity::getLoadedState, "2")
@ -350,7 +351,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
//获取关联订单
String orderId = distributionDeliveryList.getOrderId();
List<Long> orderIds = Arrays.asList(Long.valueOf(String.valueOf(orderId.split(","))));
List<Long> orderIds = Collections.singletonList(Long.valueOf(Arrays.toString(orderId.split(","))));
//查询在库订单
List<DistributionStockArticleEntity> distributionStockArticleEntities = distributionStockArticleMapper.selectBatchIds(orderIds);
//插入配送详情表
@ -415,7 +416,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
.eq(DistributionLoadscanEntity::getOrderPackageCode, distributionLoadscanEntity.getOrderPackageCode())
.ne(DistributionLoadscanEntity::getScanStatus, 1)
);
if (distributionLoadscanEntitiesflag.size() > 0) {
if (!distributionLoadscanEntitiesflag.isEmpty()) {
return Resp.scanSuccess("重复扫码", "重复扫码");
}
//依次插入该装车记录,设置车辆
@ -563,7 +564,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
Long key = entry.getKey();
List<DistributionLoadscanEntity> loadscanEntities = deliveryPackage.get(key);
if (Func.isEmpty(deliveryPackage.get(entry.getKey()))) {
//todo 未完成代码
}
}
@ -592,10 +593,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
.eq(DistributionLoadscanEntity::getOrderPackageCode, distributionLoadscanEntity.getOrderPackageCode())
.ne(DistributionLoadscanEntity::getScanStatus, 1)
);
if (distributionLoadscanEntitiesflag.size() > 0) {
if (!distributionLoadscanEntitiesflag.isEmpty()) {
return Resp.scanSuccess("有扫描过的货物", "有扫描过的货物");
}
if (distributionLoadscanEntity.getDeliveryId() != distrilbutionloadingscanDTO.getDeliveryId()) {
if (!Objects.equals(distributionLoadscanEntity.getDeliveryId(), distrilbutionloadingscanDTO.getDeliveryId())) {
return Resp.scanSuccess("有其他车次货物", "有其他车次货物");
}
//依次插入该装车记录,设置车辆
@ -629,7 +630,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
.eq(DistributionLoadscanEntity::getOrderPackageCode, distributionLoadscanEntity.getOrderPackageCode())
.ne(DistributionLoadscanEntity::getScanStatus, 1)
);
if (distributionLoadscanEntitiesflag.size() > 0) {
if (!distributionLoadscanEntitiesflag.isEmpty()) {
return Resp.scanSuccess("重复扫描", "重复扫描");
}
//依次插入该装车记录,设置车辆
@ -669,7 +670,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
.eq(DistributionLoadscanEntity::getOrderPackageCode, distributionLoadscanEntity.getOrderPackageCode())
.ne(DistributionLoadscanEntity::getScanStatus, 1)
);
if (distributionLoadscanEntitiesflag.size() > 0) {
if (!distributionLoadscanEntitiesflag.isEmpty()) {
return Resp.scanSuccess("重复扫描", "重复扫描");
}
//依次插入该装车记录,设置车辆
@ -705,7 +706,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
.eq(DistributionLoadscanEntity::getOrderPackageCode, distributionLoadscanEntity.getOrderPackageCode())
.ne(DistributionLoadscanEntity::getScanStatus, 1)
);
if (distributionLoadscanEntitiesflag.size() > 0) {
if (!distributionLoadscanEntitiesflag.isEmpty()) {
return Resp.scanSuccess("重复扫描", "重复扫描");
}
//依次插入该装车记录,设置车辆
@ -865,7 +866,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//查询配送任务配车司机信息
DistributionDeliveryListEntity distributionDeliveryListEntity = distributionDeliveryListMapper.selectById(distrilbutionloadingscanDTO.getDeliveryId());
DistributionDeliverySelfEntity distributionDeliverySelfEntity = null;
DistributionDeliverySelfEntity distributionDeliverySelfEntity = new DistributionDeliverySelfDTO();
if (StringUtils.isBlank(distrilbutionloadingscanDTO.getLoadingId())) {
if (distributionDeliveryListEntity.getKind().equals("1")) {
distributionDeliverySelfEntity = distributionDeliverySelfMapper.selectOne(new QueryWrapper<DistributionDeliverySelfEntity>().lambda()
@ -1226,7 +1227,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
.eq(DistributionLoadscanEntity::getOrderPackageCode, distrilbutionloadingscanDTO.getBarcode())
.eq(DistributionLoadscanEntity::getScanStatus, 1)
);
if (distributionLoadscanEntitiesflag.size() > 0) {
if (!distributionLoadscanEntitiesflag.isEmpty()) {
return R.fail(3002, "重复取消");
}
List<DistributionLoadscaninvnEntity> distributionLoadscanEntitiesflag2 = distributionLoadscaninvnMapper.selectList(new QueryWrapper<DistributionLoadscaninvnEntity>().lambda()
@ -1234,28 +1235,28 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
.eq(DistributionLoadscaninvnEntity::getOrderPackageCode, distrilbutionloadingscanDTO.getBarcode())
.eq(DistributionLoadscaninvnEntity::getScanStatus, 1)
);
if (distributionLoadscanEntitiesflag2.size() > 0) {
if (!distributionLoadscanEntitiesflag2.isEmpty()) {
return R.fail(3002, "重复取消");
}
if (distrilbutionloadingscanDTO.getType() == 1) {
// if (distrilbutionloadingscanDTO.getStockType() == 1) {
//查询该包条是否属于该配送任务
List<DistributionLoadscanEntity> distributionLoadscanEntities = baseMapper.selectdeliverywork(distrilbutionloadingscanDTO.getBarcode(), distrilbutionloadingscanDTO.getDeliveryId());
if (distributionLoadscanEntities.size() > 0) {
if ( null == distributionLoadscanEntities || distributionLoadscanEntities.isEmpty() ) {
return R.fail(3001, "窜货");
}
// 串货后 下面的代码执行的意义不存在
for (DistributionLoadscanEntity distributionLoadscanEntity : distributionLoadscanEntities) {
//取消装车,更新该装车记录
distributionLoadscanMapper.updatecutSumById(distributionLoadscanEntity.getId(), distrilbutionloadingscanDTO);
//更新签收表的装车数量
Integer j = distributionSignforMapper.updateloadreduceByReservationId(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
}
// }
} else if (distrilbutionloadingscanDTO.getType() == 2) {
//TODO 托盘扫描
//查询该包条是否属于该配送任务
List<DistributionLoadscanEntity> distributionLoadscanEntities = baseMapper.selectdeliverypallet(distrilbutionloadingscanDTO.getBarcode(), distrilbutionloadingscanDTO.getDeliveryId());
if (distributionLoadscanEntities.size() <= 0) {
if (null == distributionLoadscanEntities || distributionLoadscanEntities.isEmpty()) {
return R.fail(3001, "窜货");
}
for (DistributionLoadscanEntity distributionLoadscanEntity : distributionLoadscanEntities) {
@ -1272,7 +1273,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if (distributionReservationStockarticleEntity.getIsHaveData() == 1) {
//查询订单是否属于该配送任务
List<DistributionLoadscanEntity> distributionLoadscanEntities = baseMapper.selectOrderpallet(distrilbutionloadingscanDTO.getBarcode(), distrilbutionloadingscanDTO.getDeliveryId());
if (distributionLoadscanEntities.size() < 0) {
if (null == distributionLoadscanEntities || distributionLoadscanEntities.isEmpty()) {
return R.fail(3001, "窜货");
}
for (DistributionLoadscanEntity distributionLoadscanEntity : distributionLoadscanEntities) {
@ -1321,14 +1322,13 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//库存品
//获取当前用户司机
DistributionDeliveryListEntity distributionDeliveryListEntity = distributionDeliveryListMapper.selectById(distrilbutionloadingscanDTO.getDeliveryId());
DistributionDeliverySelfEntity distributionDeliverySelfEntity = null;
DistributionDeliverySelfEntity distributionDeliverySelfEntity = new DistributionDeliverySelfEntity();
if (distributionDeliveryListEntity.getKind().equals("1")) {
distributionDeliverySelfEntity = distributionDeliverySelfMapper.selectById(distrilbutionloadingscanDTO.getLoadingId());
} else {
DistributionDeliveryTripartiteEntity distributionDeliveryTripartiteEntity = distributionDeliveryTripartiteMapper.selectById(distrilbutionloadingscanDTO.getLoadingId());
BeanUtils.copyProperties(distributionDeliveryTripartiteEntity, distributionDeliverySelfEntity);
}
boolean b = false;
//根据传递进来的库存品条码进行库存品的校验
//获取之前的
@ -1354,35 +1354,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
} else {
List<DisStockListDetailEntity> disStockListDetailEntities = detailEntities.stream().filter(d -> d.getStockPackageCode().equals(barcode)).collect(Collectors.toList());
if (disStockListDetailEntities.size() == 1) {
DistributionLoadscaninvnEntity distributionLoadscaninvnEntity = new DistributionLoadscaninvnEntity();
BladeUser user = AuthUtil.getUser();
if (null != distributionDeliverySelfEntity.getDriverId()) {
distributionLoadscaninvnEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
}
if (null != distributionDeliverySelfEntity.getDriverName()) {
distributionLoadscaninvnEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
}
if (null != distributionDeliverySelfEntity.getVehicleId()) {
distributionLoadscaninvnEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
}
if (null != distributionDeliverySelfEntity.getVehicleNub()) {
distributionLoadscaninvnEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
}
if (null != distributionDeliverySelfEntity.getId()) {
distributionLoadscaninvnEntity.setLoadingId(distributionDeliverySelfEntity.getId().toString());
}
distributionLoadscaninvnEntity.setScanStatus(LoadingStatusConstant.saomiao.getValue());
distributionLoadscaninvnEntity.setScanType("1");
distributionLoadscaninvnEntity.setScanUser(user.getUserName());
distributionLoadscaninvnEntity.setScanTime(new Date());
distributionLoadscaninvnEntity.setOrderPackageCode(disStockListDetailEntities.get(0).getStockPackageCode());
distributionLoadscaninvnEntity.setInventoryId(disStockListDetailEntities.get(0).getStockListId());
distributionLoadscaninvnEntity.setReservationId(disStockListDetailEntities.get(0).getReservationId());
distributionLoadscaninvnEntity.setOneClick(1);
distributionLoadscaninvnEntity.setLoadedNub(disStockListDetailEntities.get(0).getNum());
distributionLoadscaninvnEntity.setDeliveryId(distrilbutionloadingscanDTO.getDeliveryId());
distributionLoadscaninvnEntity.setIsInsert(LoadingIsInsertConstant.zhengchang.getValue());
distributionLoadscaninvnEntity.setScanSynchronous(1);
DistributionLoadscaninvnEntity distributionLoadscaninvnEntity = getDistributionLoadscaninvnEntity(distrilbutionloadingscanDTO, distributionDeliverySelfEntity, disStockListDetailEntities);
distributionLoadscaninvnService.save(distributionLoadscaninvnEntity);
//查询本车次是否第一次扫码,没有则更新上车时间
Integer a = distributionDeliveryListMapper.updateloadingTimeById(distributionLoadscaninvnEntity.getDeliveryId());
@ -1404,6 +1376,47 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
return Resp.scanSuccess("扫描成功", "扫描成功");
}
/**
* 构建对象
* @param distrilbutionloadingscanDTO
* @param distributionDeliverySelfEntity
* @param disStockListDetailEntities
* @return
*/
@NotNull
private static DistributionLoadscaninvnEntity getDistributionLoadscaninvnEntity(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO, DistributionDeliverySelfEntity distributionDeliverySelfEntity, List<DisStockListDetailEntity> disStockListDetailEntities) {
DistributionLoadscaninvnEntity distributionLoadscaninvnEntity = new DistributionLoadscaninvnEntity();
BladeUser user = AuthUtil.getUser();
if (null != distributionDeliverySelfEntity.getDriverId()) {
distributionLoadscaninvnEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
}
if (null != distributionDeliverySelfEntity.getDriverName()) {
distributionLoadscaninvnEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
}
if (null != distributionDeliverySelfEntity.getVehicleId()) {
distributionLoadscaninvnEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
}
if (null != distributionDeliverySelfEntity.getVehicleNub()) {
distributionLoadscaninvnEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
}
if (null != distributionDeliverySelfEntity.getId()) {
distributionLoadscaninvnEntity.setLoadingId(distributionDeliverySelfEntity.getId().toString());
}
distributionLoadscaninvnEntity.setScanStatus(LoadingStatusConstant.saomiao.getValue());
distributionLoadscaninvnEntity.setScanType("1");
distributionLoadscaninvnEntity.setScanUser(user.getUserName());
distributionLoadscaninvnEntity.setScanTime(new Date());
distributionLoadscaninvnEntity.setOrderPackageCode(disStockListDetailEntities.get(0).getStockPackageCode());
distributionLoadscaninvnEntity.setInventoryId(disStockListDetailEntities.get(0).getStockListId());
distributionLoadscaninvnEntity.setReservationId(disStockListDetailEntities.get(0).getReservationId());
distributionLoadscaninvnEntity.setOneClick(1);
distributionLoadscaninvnEntity.setLoadedNub(disStockListDetailEntities.get(0).getNum());
distributionLoadscaninvnEntity.setDeliveryId(distrilbutionloadingscanDTO.getDeliveryId());
distributionLoadscaninvnEntity.setIsInsert(LoadingIsInsertConstant.zhengchang.getValue());
distributionLoadscaninvnEntity.setScanSynchronous(1);
return distributionLoadscaninvnEntity;
}
// if (distributionLoadscaninvnEntities.size() == 1) {
// return R.fail("重复扫描");
// }
@ -1531,7 +1544,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
.eq(DistributionLoadscanEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId())
.eq(DistributionLoadscanEntity::getOrderPackageCode, distrilbutionloadingscanDTO.getBarcode())
);
if (distributionLoadscanEntities.size() < 0) {
if (null == distributionLoadscanEntities || distributionLoadscanEntities.isEmpty()) {
return R.fail(3005, "该货物未装车");
}
boolean b = false;
@ -1569,7 +1582,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
//查询司机的任务
List<Long> deliveryIds = distributionDeliverySelfMapper.selectdeliveryList(driverArtery.getId());
if (deliveryIds.size() > 0) {
if (!deliveryIds.isEmpty()) {
distributionAppDeliveryListVOS = baseMapper.selectDistributionAppDeliveryListPage(page, distributionAppDeliveryListDTO, deliveryIds);
} else {
return page.setRecords(distributionAppDeliveryListVOS);
@ -1590,7 +1603,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
queryWrapper.eq("reservation_id", distributionAppDeliveryListVO.getReservationId());
}
List<DistributionStockupInfoEntity> list1 = distributionStockupInfoService.list(queryWrapper);
if (list1.size() > 0) {
if (!list1.isEmpty()) {
DistributionStockupInfoEntity distributionStockupInfoEntity = list1.get(0);
DistributionStockupEntity distributionStockupEntity = distributionStockupMapper.selectById(distributionStockupInfoEntity.getStockupId());
if (ObjectUtils.isNotNull(distributionStockupEntity)) {
@ -1656,7 +1669,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//查询是否备货
distributionAppDeliveryListVO.setIsstock("备货完成");
Integer reNub = distributionStockMapper.selectCount(new QueryWrapper<DistributionStockEntity>().lambda()
.in(reList.size() > 0, DistributionStockEntity::getReservationId, reList)
.in(!reList.isEmpty(), DistributionStockEntity::getReservationId, reList)
).intValue(); //扫描件数
Integer deliveryNumber = distributionAppDeliveryListVO.getDeliveryNumber(); //配送件数
if (reNub < deliveryNumber) {
@ -1664,7 +1677,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
//查询司机
List<DistributionAppDeliverySelfVO> distributionAppDeliverySelfVOS = distributionDeliverySelfMapper.selectListcustom(distributionAppDeliveryListVO.getId());
if (distributionAppDeliverySelfVOS.size() > 0) {
if (!distributionAppDeliverySelfVOS.isEmpty()) {
StringBuilder stringBuilder = new StringBuilder();
distributionAppDeliverySelfVOS.forEach(e -> {
if (e.getIsMaster() == 2) {
@ -1718,7 +1731,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//这里对于同一个配送任务下的预约信息是一致的,这里进行去重的操作,
DistributionReservationVO reservationVOS = distributionReservationMapper.getReservationInfo(id);
if (Func.isNotEmpty(reservationVOS)) {
deliveryListVO.setReservationInfo(reservationVOS);
assert deliveryListVO != null;
deliveryListVO.setReservationInfo(reservationVOS);
//1、查询出订单信息
List<DistributionStockArticleEntity> stockArticleVOS = distributionDeliveryListMapper.getDeliveryDisuccStockArticleInfo(id);
List<DistributionStockArticleVO> stockArticleVOList = DistributionStockArticleWrapper.build().listVO(stockArticleVOS);
@ -1743,7 +1757,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//2、查询出备货信息
DistributionStockupVO stockupEntity = distributionStockupMapper.getDeliveryStockupInfo(id);
if (Func.isNotEmpty(stockupEntity)) {
deliveryListVO.setStockupInfo(stockupEntity);
assert deliveryListVO != null;
deliveryListVO.setStockupInfo(stockupEntity);
//3、查询司机信息
if (deliveryListEntity.getKind().equals(ServiceConstant.DELIVERLIST_KIND_SELF)) {
//自主配送
@ -1765,7 +1780,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
List<DistributionAppReservationVO> customList = distributionDeliveryInfoMapper.selectAppcustomListPage(page, distributionDeliveryList.getId());
for (DistributionAppReservationVO distributionAppReservationVO : customList) {
//查询备货是否完成
Integer aLong = distributionStockMapper.selectCount(new QueryWrapper<DistributionStockEntity>().lambda()
int aLong = distributionStockMapper.selectCount(new QueryWrapper<DistributionStockEntity>().lambda()
.eq(DistributionStockEntity::getReservationId, distributionAppReservationVO.getId())
.eq(DistributionStockEntity::getType, 1)
).intValue();
@ -1947,7 +1962,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//现在前端进行订单提交必然会携带包件信息
List<DistributionParcelListEntity> packageListInfo = s.getPackageListInfo();
AtomicInteger orderPackageNum = new AtomicInteger();
if (packageListInfo.size() > 0) {
if (!packageListInfo.isEmpty()) {
packageListInfo.forEach(p -> {
orderPackageNum.getAndAdd(p.getQuantity());
DistributionReservationPackageEntity reservationPackageEntity = new DistributionReservationPackageEntity();

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

@ -100,8 +100,6 @@ public class DistributionReservationPackageServiceImpl extends BaseServiceImpl<D
b= true;
}
}
return b;
}

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

@ -130,8 +130,6 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
private IDistributionAsyncService distributionAsyncService;
@Override
public IPage<DistributionStockupVO> selectDistributionStockupPage(IPage<DistributionStockupVO> page, DistributionStockupVO distributionStockup) {
return page.setRecords(baseMapper.selectDistributionStockupPage(page, distributionStockup));
@ -167,24 +165,24 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
//判断备货的任务类型
//添加库存品数据
DistributionStockupEntity stockupEntity = distributionStockupService.selectById(s);
if(stockupEntity.getTypeService().equals("3")){
if (stockupEntity.getTypeService().equals("3")) {
//自提
List<DistributionStockListSelfNumVO> distributionStockListSelfNumVOS = distributionStockupInfoService.selectStockListSelfNum(s);
if(distributionStockListSelfNumVOS.size() > 0){
if (distributionStockListSelfNumVOS.size() > 0) {
List<DisStockListDetailEntity> listDetailEntities = new ArrayList<>();
distributionStockListSelfNumVOS.forEach( i ->{
if(ObjectUtils.isNotNull(i)){
distributionStockListSelfNumVOS.forEach(i -> {
if (ObjectUtils.isNotNull(i)) {
Integer quantity = i.getQuantity();
while (quantity > 0){
while (quantity > 0) {
DisStockListDetailEntity disStockListDetail = new DisStockListDetailEntity();
disStockListDetail.setNum(1);
disStockListDetail.setSku(i.getSku());
disStockListDetail.setWarehouseId(i.getWarehouseId());
disStockListDetail.setWarehouseName(i.getWarehouseName());
disStockListDetail.setReservationId(i.getBillLadingId());
disStockListDetail.setStockPackageCode("1");
disStockListDetail.setStockPackageStatus("1");
disStockListDetail.setStockListId(i.getStockListId());
disStockListDetail.setStockLockingStatus(StockLockingStatusConstant.wuzhuangche.getValue());
disStockListDetail.setStockStatus(StockStatusConstant.daibangding.getValue());
@ -195,7 +193,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
}
}
});
if(listDetailEntities.size() > 0){
if (listDetailEntities.size() > 0) {
disStockListDetailService.saveBatch(listDetailEntities);
}
@ -221,14 +219,13 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
// List<Long> collect = myWatchWarehouse.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList());
distributionStockupEntity.setTenantId(AuthUtil.getTenantId());
if(distributionStockupEntity.getTypeService().equals("3")){
if (distributionStockupEntity.getTypeService().equals("3")) {
return baseMapper.pageOweList(page, distributionStockupEntity);
}else{
} else {
return baseMapper.pageList(page, distributionStockupEntity);
}
}
@Override
@ -250,7 +247,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
List<DistributionStockupListVO> records = distributionStockupEntityIPage.getRecords();
for (DistributionStockupListVO vo : records) {
intToStrDistributionStockupListVO(vo);
if(ObjectUtils.isNull(vo.getInventoryNub())){
if (ObjectUtils.isNull(vo.getInventoryNub())) {
vo.setInventoryNub(0);
}
//查询库位信息
@ -328,11 +325,11 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
map.put("stockupArea", vo.getStockupArea());
map.put("stockupStatusStr", vo.getStockupStatusStr());
//查询客户数据
if(vo.getTypeService().equals(3)){
if (vo.getTypeService().equals(3)) {
//自
List<DistributionStockupListVO> list = baseMapper.selectStockupClientInfoSelf(stockupDTO);
map.put("orderList", list);
}else{
} else {
//商 ,市
String[] split = vo.getReservation().split(",");
@ -476,11 +473,11 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
@Override
public List<DistributionStockupOrderListVO> selectStockupOrderList(StockupDTO stockupDTO) {
Long reservationId = stockupDTO.getReservationId();//预约单id
if(stockupDTO.getTypeService().equals("3")){
if (stockupDTO.getTypeService().equals("3")) {
//查询客户数据
List<DistributionStockupOrderListVO> list = distrilbutionBillStockService.selectDistrilbutionBillSelf(reservationId);
return list;
}else{
} else {
//
//1.根据预约单id 查询到对应的数据
List<DistributionStockupOrderListVO> list = distributionReservationService.selectStockupOrderList(reservationId);
@ -492,11 +489,11 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
@Override
public List<DistributionStockupStockListVO> selectStockupStockList(StockupDTO stockupDTO) {
Long reservationId = stockupDTO.getReservationId();//预约单id
if(stockupDTO.getTypeService().equals("3")){
if (stockupDTO.getTypeService().equals("3")) {
//自
List<DistributionStockupStockListVO> list = distributionStockupService.selectStockupSelf(reservationId);
return list;
}else{
} else {
//商,市
List<DistributionStockupStockListVO> list = distributionReservationService.selectStockupStockList(reservationId);
@ -520,7 +517,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
.eq(DistributionStockEntity::getCoding, vo.getPackageBarCode())
.eq(DistributionStockEntity::getParcelListId, vo.getParceListId())
);
if(list1.size() > 0){
if (list1.size() > 0) {
scanNum++; //已扫的数量
vo.setScanId(list1.get(0).getId());
vo.setIsScanStr("1");
@ -548,24 +545,25 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
/**
* 自提备货客户包件数据查询
* @param reservationId 自提id
*
* @param reservationId 自提id
* @param stockArticleId 订单id
* @param stockupId 备货id
* @param trayId 托盘id
* @param stockupId 备货id
* @param trayId 托盘id
* @return
*/
@Override
public DistributionStockupOrderInfoVO selectOrderInfoSelf(Long reservationId, Long stockArticleId, Long stockupId, Long trayId) {
DistributionStockArticleEntity byId = distributionStockArticleService.getById(stockArticleId);
//查询订单数量
DistributionStockupSelfVO distributionStockupSelfVO = distrilbutionBillStockService.selectDistrilbutionBillPackSelf(reservationId,stockupId);
DistributionStockupSelfVO distributionStockupSelfVO = distrilbutionBillStockService.selectDistrilbutionBillPackSelf(reservationId, stockupId);
List<PackageStockupVO> list = distributionParcelListService.selectOrderInfoSelfList(reservationId, stockArticleId, stockupId, trayId);
list.forEach( i -> {
if(ObjectUtils.isNotNull(i.getIsScan())){
list.forEach(i -> {
if (ObjectUtils.isNotNull(i.getIsScan())) {
i.setIsScanStr("已备货");
i.setIsScan(2);
}else{
} else {
i.setIsScanStr("未备货");
i.setIsScan(1);
}
@ -602,7 +600,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
public IPage<DistributionStockupVO> detailOrderOwn(IPage<Object> page, Long id) {
IPage<DistributionStockupVO> distributionStockupVOIPage = baseMapper.detailOrderOwn(page, id);
distributionStockupVOIPage.getRecords().forEach(o -> {
if(ObjectUtils.isNotNull(o.getStockArticleId())){
if (ObjectUtils.isNotNull(o.getStockArticleId())) {
Integer integer = distributionStockService.selectCount(Long.parseLong(o.getStockArticleId()));
o.setNumber(integer);
}
@ -632,17 +630,17 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
@Override
public IPage<DistributionStockupVO> getInventoryOwnSelf(IPage<Object> page, long id) {
IPage<DistributionStockupVO> l = new Page<>();
IPage<DistributionStockupVO> l = new Page<DistributionStockupVO>();
List<DistributionStockupVO> inventoryChe = baseMapper.getInventoryCheSelf(id);
if(inventoryChe.size() > 0){
boolean b = inventoryChe.stream().anyMatch(i ->ObjectUtils.isNotNull(i.getReservationStockListNum()) && i.getReservationStockListNum() > 0);
if (!inventoryChe.isEmpty()) {
boolean b = inventoryChe.stream().anyMatch(i -> ObjectUtils.isNotNull(i.getReservationStockListNum()) && i.getReservationStockListNum() > 0);
if (b) {
//查询库存品
return baseMapper.getInventoryOwn(page, id);
return baseMapper.getInventoryOwnSelf(page, id);
} else {
return l;
}
}else{
} else {
return l;
}
@ -697,7 +695,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
.eq(DistributionStockupInfoEntity::getReservationId, reservationId)
);
if(ObjectUtils.isNotNull(one) && one.getStockUpType().equals("3")){
if (ObjectUtils.isNotNull(one) && one.getStockUpType().equals("3")) {
//自提
//通过预约单id和订单
Integer num = distributionReservationService.getReservationNumStockSelf(reservationId, stockListId);
@ -705,7 +703,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
log.warn("###################createPackageCode: 包条数量与预约数量不正确");
throw new CustomerException(405, "包条数量与预约数量不正确");
}
}else{
} else {
//通过预约单id和订单
Integer num = distributionReservationService.getReservationNumByReservationIdAndStockListId(reservationId, stockListId);
if (packageNum.compareTo(num) > 0) {
@ -721,10 +719,10 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
List<String> ls = new ArrayList<>();
for (int i = 0; i < packageNum; i++) {
String packageCode = "";
if(ObjectUtils.isNotNull(basicdataWarehouseEntity)){
if (ObjectUtils.isNotNull(basicdataWarehouseEntity)) {
packageCode = basicDataCodeClient.getCodeByType(CodeDesEnum.PACKAGE.getCodeNum(), basicdataWarehouseEntity.getWarehouseCode(), "22222222");//TODO 这个滴地方需要传入订单编号来区别是哪个订单的包件
}else{
packageCode = basicDataCodeClient.getCodeByType(CodeDesEnum.PACKAGE.getCodeNum(),"MYHUYU", "1111111");//TODO 这个滴地方需要传入订单编号来区别是哪个订单的包件
} else {
packageCode = basicDataCodeClient.getCodeByType(CodeDesEnum.PACKAGE.getCodeNum(), "MYHUYU", "1111111");//TODO 这个滴地方需要传入订单编号来区别是哪个订单的包件
}
//添加包件码
@ -836,7 +834,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
Iterator<DistributionParcelTrayVO> iterator = list.iterator();
while (iterator.hasNext()) {
if (i.getTrayId().equals(iterator.next().getTrayId())) {
String trayPackNum = iterator.next().getTrayPackNum(); //在这个托盘的数量
Integer trayPackNum = iterator.next().getTrayPackNum(); //在这个托盘的数量
List<WarehouseTrayGoodsEntity> trayIdList = warehouseTrayGoodsClient.getTrayIdList(i.getTrayId());
if (trayPackNum.equals(trayIdList.size())) {
trays.set(true);
@ -860,8 +858,8 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
DistributionStockupEntity distributionStockupEntity = distributionStockupService.selectById(stockupDTO.getStockupId());
Long reservationId = stockupDTO.getReservationId();
Long stockupId = stockupDTO.getStockupId();
if(ObjectUtils.isNotNull(distributionStockupEntity)){
if(distributionStockupEntity.getTypeService().equals("3")){
if (ObjectUtils.isNotNull(distributionStockupEntity)) {
if (distributionStockupEntity.getTypeService().equals("3")) {
//自提
switch (stockupDTO.getScanType()) {
case 1:
@ -869,31 +867,28 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
List<DistributionParcelListEntity> list = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda()
.eq(DistributionParcelListEntity::getOrderPackageCode, stockupDTO.getPacketBarCode())
);
if(list.size() > 0){
if (!list.isEmpty()) {
Integer integer = baseMapper.selectPackageExistSelf(stockupDTO);
if(ObjectUtils.isNotNull(integer) && integer > 0){
if (ObjectUtils.isNotNull(integer) && integer > 0) {
//在 判断有没有扫过码
DistributionStockEntity one = distributionStockService.getOne(Wrappers.<DistributionStockEntity>query().lambda()
.eq(DistributionStockEntity::getBillLadingId, stockupDTO.getReservationId())
.eq(DistributionStockEntity::getCoding, stockupDTO.getPacketBarCode())
.eq(DistributionStockEntity::getStockupId, stockupDTO.getStockupId())
);
if(ObjectUtils.isNotNull(one)){
if (ObjectUtils.isNotNull(one)) {
//以扫
return 2;
}else{
//扫描操作
} else {
//扫描操作
distributionAsyncService.stockupSelfUpdateState(stockupDTO);
return 1;
}
}else{
} else {
//窜货
return 5;
}
}else{
} else {
//包件不存在
return 3;
}
@ -905,7 +900,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
.eq(DistributionStockEntity::getStockListId, stockupDTO.getStockListId())
.eq(DistributionStockEntity::getCoding, stockupDTO.getPacketBarCode())
);
if(ObjectUtils.isNotNull(one1)){
if (ObjectUtils.isNotNull(one1)) {
return 2;
}
//库存品
@ -914,38 +909,38 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
.eq(DistributionDeliveryDetailsEntity::getStockListId, stockupDTO.getStockListId())
.apply("inventory_status in (1,2)")
);
if(ObjectUtils.isNotNull(one)){
if(one.getConditions().equals("2")){
if (ObjectUtils.isNotNull(one)) {
if (one.getConditions().equals("2")) {
//已完成
return 6;
}else{
} else {
// 扫描操作
Integer realityQuantity = one.getRealityQuantity(); //以扫
Integer quantity = one.getQuantity(); //总数
int i = quantity - realityQuantity;
if(i > 0){
if (i > 0) {
//还有
DistributionDeliveryDetailsEntity deliveryDetails = new DistributionDeliveryDetailsEntity();
deliveryDetails.setId(one.getId());
deliveryDetails.setRealityQuantity(one.getRealityQuantity()+1);
deliveryDetails.setRealityQuantity(one.getRealityQuantity() + 1);
distributionDeliveryDetailsService.updateById(deliveryDetails);
//修改状态
distributionAsyncService.stockupSelfUpdateState(stockupDTO);
// distributionAsyncService.stockupStockSelfUpdateState(stockupDTO);
return 1;
}else{
} else {
//没有了
return 6;
return 6;
}
}
}else {
} else {
//不存在
return 3;
}
}
}else{
} else {
switch (stockupDTO.getScanType()) {
case 1:
//订单
@ -960,7 +955,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
.eq(DistributionStockEntity::getStockupId, stockupId)
.eq(DistributionStockEntity::getReservationId, reservationId)
);
if (list.size() > 0) {
if (!list.isEmpty()) {
//重复扫码
return 2;
} else {
@ -976,10 +971,10 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
}
} else {
List<DistributionParcelListEntity> list = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda().eq(DistributionParcelListEntity::getOrderPackageCode, packetBarCode));
if (list.size()>0){
if (!list.isEmpty()) {
return 5;
}
//不存在
//不存在
return 3;
}
@ -1000,7 +995,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
.eq(DistributionStockEntity::getStockListId, stockupDTO.getStockListId())
.eq(DistributionStockEntity::getCoding, stockupDTO.getPacketBarCode())
);
if(ObjectUtils.isNotNull(one1)){
if (ObjectUtils.isNotNull(one1)) {
return 2;
}
//输入的数量
@ -1060,7 +1055,6 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
}
/**
*
* @param reservationId
*/
@Override
@ -1070,6 +1064,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
/**
* 备货打印包件码绑定
*
* @param stockupDTO
* @return
*/
@ -1079,7 +1074,12 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
DisStockListDetailEntity disStockListDetail = new DisStockListDetailEntity();
DisStockOrdercodeRecoEntity ordercodeRecoEntity = new DisStockOrdercodeRecoEntity();
DisStockOrdercodeRecoEntity one = disStockOrdercodeRecoService.getOne(Wrappers.<DisStockOrdercodeRecoEntity>query().lambda()
.eq(DisStockOrdercodeRecoEntity::getCode, stockupDTO.getPacketBarCode())
);
if(ObjectUtils.isNotNull(one) && one.getCodeStatus().equals("1")){
return 8;
}
//查询仓库信息
DistributionStockListEntity byId = distributionStockListService.getById(stockupDTO.getStockListId());
//有 绑定 查询有没有库存品信息
@ -1089,7 +1089,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
.eq(DisStockListDetailEntity::getWarehouseId, byId.getWarehouseId())
.isNull(DisStockListDetailEntity::getStockPackageCode)
);
if (list1.size() > 0) {
if (!list1.isEmpty()) {
switch (stockupDTO.getStockPrint()) {
case 1:
//绑定码
@ -1102,14 +1102,14 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
.eq(DisStockOrdercodeRecoEntity::getCodeStatus, "0")
);
if (ObjectUtils.isNotNull(one1)) {
//绑定码
disStockListDetail.setStockPackageCode(stockupDTO.getPacketBarCode());
disStockListDetail.setId(list1.get(0).getId());
//修改包件码状态
ordercodeRecoEntity.setCodeStatus("1");
ordercodeRecoEntity.setId(one1.getId());
disStockOrdercodeRecoService.updateById(ordercodeRecoEntity);
break;
//绑定码
disStockListDetail.setStockPackageCode(stockupDTO.getPacketBarCode());
disStockListDetail.setId(list1.get(0).getId());
//修改包件码状态
ordercodeRecoEntity.setCodeStatus("1");
ordercodeRecoEntity.setId(one1.getId());
disStockOrdercodeRecoService.updateById(ordercodeRecoEntity);
break;
} else {
//包条码不存在
@ -1120,9 +1120,9 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
disStockListDetailService.updateById(disStockListDetail); //补充扫码数据
return 1;
}else{
} else {
//没有包件信息
return 7;
return 9;
}

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

@ -65,6 +65,7 @@ import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
/**
@ -534,10 +535,10 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
} else {
vo.setInventoryNum(0);
}
vo.setOrderNum(orderNum);
vo.setPlanNum(planNum);
vo.setSignedNum(signedNum);
vo.setInventoryNub(inventoryNub);
vo.setOrderNum(orderNum); //订单总数
vo.setPlanNum(planNum); //自提件数
vo.setSignedNum(signedNum); //签收总数
vo.setInventoryNub(inventoryNub); //库存品数
}
pageList.setRecords(records);
@ -1043,12 +1044,76 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
//查询订单数
List<DistrilbutionBillStockEntity> list = distrilbutionBillStockService.list(Wrappers.<DistrilbutionBillStockEntity>query().lambda()
.eq(DistrilbutionBillStockEntity::getBillLadingId, billLadingId)
.apply("order_status in (1,2)")
);
AtomicReference<Integer> pake = new AtomicReference<>(0); // 包件数量
AtomicReference<Integer> pakeys = new AtomicReference<>(0); // 包件以扫数量
boolean apj = false;
if(list.size() > 0){
//查询包件数量
list.forEach(i ->{
List<DistributionParcelListEntity> list1 = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda()
.eq(DistributionParcelListEntity::getStockArticleId, i.getStockArticleId())
);
int size = list1.size();
pake.set(pake.get() + size);
//查询扫码数量
List<DistributionBillLadingScanEntity> list2 = distributionBillLadingScanService.list(Wrappers.<DistributionBillLadingScanEntity>query().lambda()
.eq(DistributionBillLadingScanEntity::getBillLadingId, billLadingId)
.eq(DistributionBillLadingScanEntity::getStockArticleId, i.getStockArticleId())
);
int size2 = list2.size();
pakeys.set(pakeys.get() + size2);
});
if(pake.get().equals(pakeys.get()+1)){
//订单完成备货
apj = true;
}
}else{
//订单完成备货
apj = true;
}
//查询库存品数
List<DistributionDeliveryDetailsEntity> list1 = distributionDeliveryDetailsService.list(Wrappers.<DistributionDeliveryDetailsEntity>query().lambda()
.eq(DistributionDeliveryDetailsEntity::getBillLadingId, billLadingId)
);
long count = list.stream().filter(e -> e.getConditions().equals("2")).count(); // 订 已签收的数
//
AtomicReference<Integer> kcq = new AtomicReference<>(0); // 库存全部数量
AtomicReference<Integer> kcs = new AtomicReference<>(0); // 库存以扫数量
boolean kc = false;
if(list1.size() > 0){
list1.forEach( i -> {
//查询以扫数量
List<DistributionBillLadingScanEntity> list2 = distributionBillLadingScanService.list(Wrappers.<DistributionBillLadingScanEntity>query().lambda()
.eq(DistributionBillLadingScanEntity::getBillLadingId, billLadingId)
.eq(DistributionBillLadingScanEntity::getStockListId, i.getStockListId())
);
kcq.set(kcq.get()+i.getQuantity());//全部数量
int size = list2.size();
kcs.set(kcs.get()+size);//以扫数量
});
//多个
if(kcq.get() == (kcs.get()+1)){
kc=true;
}
}else{
kc = true;
}
if(apj && kc){
//完成
//已完成
//修改提货任务状态
DistrilbutionBillLadingEntity billLadingEntity = new DistrilbutionBillLadingEntity();
String bill = (String) billLadingId;
billLadingEntity.setId(Long.valueOf(bill));
billLadingEntity.setConditions("20");
baseMapper.updateById(billLadingEntity);
}
/*long count = list.stream().filter(e -> e.getConditions().equals("2")).count(); // 订 已签收的数
long count2 = list1.stream().filter(e -> e.getConditions().equals("2")).count(); // 库 已签收的数
if (Integer.parseInt(String.valueOf(count)) == list.size() && Integer.parseInt(String.valueOf(count2)) == list1.size()) {
//修改提货任务状态
@ -1057,7 +1122,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
billLadingEntity.setId(Long.valueOf(bill));
billLadingEntity.setConditions("20");
baseMapper.updateById(billLadingEntity);
}
}*/
return Resp.scanFail( "签收成功","签收成功");
}
}

18
blade-service/logpm-factory/src/main/java/com/logpm/factory/config/RabbitMqConfiguration.java

@ -230,6 +230,24 @@ public class RabbitMqConfiguration {
}
@Bean
public Queue oupaiSignQueue() {
return new Queue(RabbitConstant.OUPAI_SIGN_QUEUE, true);
}
@Bean
public CustomExchange oupaiSignExchange() {
Map<String, Object> args = Maps.newHashMap();
args.put("x-delayed-type", "direct");
return new CustomExchange(RabbitConstant.OUPAI_SIGN_EXCHANGE, "x-delayed-message", true, false, args);
}
@Bean
public Binding oupaiSignBinding(Queue oupaiSignQueue, CustomExchange oupaiSignExchange) {
return BindingBuilder.bind(oupaiSignQueue).to(oupaiSignExchange).with(RabbitConstant.OUPAI_SIGN_ROUTING).noargs();
}
}

12
blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/mapper/OpOutGoingOrderMapper.java

@ -0,0 +1,12 @@
package com.logpm.factory.oupai.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.factory.oupai.entity.OpOutGoingOrderEntity;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface OpOutGoingOrderMapper extends BaseMapper<OpOutGoingOrderEntity> {
}

5
blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/mapper/OpOutGoingOrderMapper.xml

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

9
blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/mapper/OpSignBillMapper.java

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

5
blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/mapper/OpSignBillMapper.xml

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

9
blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/mapper/OpSignPackageMapper.java

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

5
blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/mapper/OpSignPackageMapper.xml

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

7
blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/receiver/OpReceivingDataHandler.java

@ -7,7 +7,6 @@ import com.logpm.factory.pan.service.IPanFactoryDataService;
import com.rabbitmq.client.Channel;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.RabbitConstant;
import org.springblade.common.utils.CommonUtil;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
@ -15,8 +14,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.io.IOException;
import java.time.LocalTime;
import java.util.Date;
import java.util.Map;
@ -26,7 +23,7 @@ import java.util.Map;
* @author yangkai.shen
*/
@Slf4j
@RabbitListener(queues = RabbitConstant.RECEIVE_INFO_QUEUE)
@RabbitListener(queues = RabbitConstant.OUPAI_RECEIVING_QUEUE)
@Component
public class OpReceivingDataHandler {
@ -58,7 +55,7 @@ public class OpReceivingDataHandler {
log.info("##################opReceivingDataHandler: 处理欧派收货数据到新系统,packageStatus:{},orderPackageCode:{},receivingTime{}",
packageStatus,orderPackageCode,receivingTime);
//判断是否是已入库
if("已库".equals(packageStatus)){
if("已库".equals(packageStatus)){
//真正的处理需要的数据
try {
panFactoryDataService.handleDataToPlatform(orderPackageCode, receivingTime);

274
blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/receiver/OpSignDataHandler.java

@ -0,0 +1,274 @@
package com.logpm.factory.oupai.receiver;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.logpm.factory.oupai.entity.OpOrderStatusLogEntity;
import com.logpm.factory.oupai.entity.OpOutGoingOrderEntity;
import com.logpm.factory.oupai.entity.OpSignBillEntity;
import com.logpm.factory.oupai.entity.OpSignPackageEntity;
import com.logpm.factory.oupai.service.IOpOutGoingOrderService;
import com.logpm.factory.oupai.service.IOpSignBillService;
import com.logpm.factory.oupai.service.IOpSignPackageService;
import com.rabbitmq.client.Channel;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.RabbitConstant;
import org.springblade.common.utils.CommonUtil;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.io.IOException;
import java.util.Map;
import java.util.Objects;
/**
* 获取订单数据 处理器
*
* @author yangkai.shen
*/
@Slf4j
@RabbitListener(queues = RabbitConstant.OUPAI_SIGN_QUEUE)
@Component
public class OpSignDataHandler {
@Autowired
private IOpOutGoingOrderService opOutGoingOrderService;
@Autowired
private IOpSignBillService opSignBillService;
@Autowired
private IOpSignPackageService opSignPackageService;
@RabbitHandler
public void opSignDataHandler(Map map, Message message, Channel channel) throws IOException {
// 如果手动ACK,消息会被监听消费,但是消息在队列中依旧存在,如果 未配置 acknowledge-mode 默认是会在消费完毕后自动ACK掉
log.info("##################opSignDataHandler: 处理欧派收货数据到新系统");
OpOrderStatusLogEntity opOrderStatusLogEntity = (OpOrderStatusLogEntity) map.get("messageData");
String args = opOrderStatusLogEntity.getArgs();
JSONObject jsonObject = JSONObject.parseObject(args);
JSONArray jsonArray = jsonObject.getJSONArray("value");
for (int i = 0; i < jsonArray.size(); i++) {
JSONObject valueObject = jsonArray.getJSONObject(i);
JSONObject outGoingOrder = valueObject.getJSONObject("OutGoingOrder");
String outGoingOrderCode = outGoingOrder.getString("Code");
JSONObject store = valueObject.getJSONObject("Store");
JSONArray packages = valueObject.getJSONArray("Packages");
String status = outGoingOrder.getString("Status");
//先查询是否已经有数据存在系统中
OpOutGoingOrderEntity opOutGoingOrderEntity = opOutGoingOrderService.getEntityByCode(outGoingOrderCode);
Long outGoingOrderId = null;
if(Objects.isNull(opOutGoingOrderEntity)){
//如果是空则新增
opOutGoingOrderEntity = new OpOutGoingOrderEntity();
opOutGoingOrderEntity.setCode(outGoingOrderCode);
if("新建".equals(status)){
opOutGoingOrderEntity.setOutGoingOrderStatus(0);
}else if("已调度".equals(status)){
opOutGoingOrderEntity.setOutGoingOrderStatus(1);
}else if("已发运".equals(status)){
opOutGoingOrderEntity.setOutGoingOrderStatus(2);
}else if("已签收".equals(status)){
opOutGoingOrderEntity.setOutGoingOrderStatus(3);
}else if("部分签收".equals(status)){
opOutGoingOrderEntity.setOutGoingOrderStatus(4);
}else if("待处理".equals(status)){
opOutGoingOrderEntity.setOutGoingOrderStatus(5);
}
JSONObject warehouse = outGoingOrder.getJSONObject("Warehouse");
if(!Objects.isNull(warehouse)){
opOutGoingOrderEntity.setWarehouseCode(warehouse.getString("Code"));
opOutGoingOrderEntity.setWarehouseName(warehouse.getString("Name"));
opOutGoingOrderEntity.setWarehouseAddress(warehouse.getString("Address"));
}
JSONObject truck = outGoingOrder.getJSONObject("Truck");
if(!Objects.isNull(truck)){
opOutGoingOrderEntity.setTruckPlate(truck.getString("Plate"));
}
opOutGoingOrderEntity.setDeliveryDate(CommonUtil.StringToDate(outGoingOrder.getString("DeliveryDate")));
opOutGoingOrderEntity.setCreator(outGoingOrder.getString("Creator"));
opOutGoingOrderEntity.setCreateTime(CommonUtil.StringToDate(outGoingOrder.getString("CreateTime")));
if (!Objects.isNull(store)) {
JSONObject shop = store.getJSONObject("Shop");
if(!Objects.isNull(shop)){
opOutGoingOrderEntity.setShopCode(shop.getString("Code"));
opOutGoingOrderEntity.setShopName(shop.getString("Name"));
}
opOutGoingOrderEntity.setStoreCode(store.getString("Code"));
opOutGoingOrderEntity.setStoreName(store.getString("Name"));
}
opOutGoingOrderEntity.setSendTime(CommonUtil.StringToDate(outGoingOrder.getString("SendTime")));
opOutGoingOrderService.save(opOutGoingOrderEntity);
outGoingOrderId = opOutGoingOrderEntity.getId();
}else{
if("新建".equals(status)){
opOutGoingOrderEntity.setOutGoingOrderStatus(0);
}else if("已调度".equals(status)){
opOutGoingOrderEntity.setOutGoingOrderStatus(1);
}else if("已发运".equals(status)){
opOutGoingOrderEntity.setOutGoingOrderStatus(2);
}else if("已签收".equals(status)){
opOutGoingOrderEntity.setOutGoingOrderStatus(3);
}else if("部分签收".equals(status)){
opOutGoingOrderEntity.setOutGoingOrderStatus(4);
}else if("待处理".equals(status)){
opOutGoingOrderEntity.setOutGoingOrderStatus(5);
}
opOutGoingOrderService.updateById(opOutGoingOrderEntity);
outGoingOrderId = opOutGoingOrderEntity.getId();
}
//处理签收单数据
Long signBillId = null;
String recevierCode = valueObject.getString("Code");
String SignBillStatus = valueObject.getString("Status");
OpSignBillEntity signBillEntity = opSignBillService.findEntityByCode(recevierCode);
if(Objects.isNull(signBillEntity)){
signBillEntity = new OpSignBillEntity();
signBillEntity.setOutGoingOrderId(outGoingOrderId);
signBillEntity.setCode(recevierCode);
if("新建".equals(SignBillStatus)){
signBillEntity.setSignBillStatus(0);
}else if("已签收".equals(SignBillStatus)){
signBillEntity.setSignBillStatus(1);
}else if("部分签收".equals(SignBillStatus)){
signBillEntity.setSignBillStatus(2);
}
signBillEntity.setSignPerson(valueObject.getString("SignPerson"));
signBillEntity.setSignPhone(valueObject.getString("SignPhone"));
signBillEntity.setSignAddress(valueObject.getString("SignAddress"));
signBillEntity.setSignTime(CommonUtil.StringToDate(valueObject.getString("SignTime")));
signBillEntity.setRemark(valueObject.getString("Remark"));
signBillEntity.setOutGoingOrderCode(outGoingOrderCode);
signBillEntity.setAgainsendReason(valueObject.getString("AgainsendReason"));
signBillEntity.setDescription(valueObject.getString("Description"));
Boolean isAgainsend = valueObject.getBoolean("IsAgainsend");
if(isAgainsend){
signBillEntity.setIsAgainsend(1);
}else{
signBillEntity.setIsAgainsend(0);
}
signBillEntity.setCreator(valueObject.getString("Creator"));
signBillEntity.setCreateTime(CommonUtil.StringToDate(valueObject.getString("CreateTime")));
signBillEntity.setCustomerRate(valueObject.getBigDecimal("CustomerRate"));
signBillEntity.setCustomerFeedback(valueObject.getString("CustomerFeedback"));
if (!Objects.isNull(store)) {
JSONObject shop = store.getJSONObject("Shop");
if(!Objects.isNull(shop)){
signBillEntity.setShopCode(shop.getString("Code"));
signBillEntity.setShopName(shop.getString("Name"));
}
signBillEntity.setStoreCode(store.getString("Code"));
signBillEntity.setStoreName(store.getString("Name"));
}
signBillEntity.setDriverPhone(valueObject.getString("DriverPhone"));
signBillEntity.setDriverName(valueObject.getString("DriverName"));
signBillEntity.setDeliveryTime(CommonUtil.StringToDate(valueObject.getString("DeliveryTime")));
opSignBillService.save(signBillEntity);
signBillId = signBillEntity.getId();
}else{
if("新建".equals(SignBillStatus)){
signBillEntity.setSignBillStatus(0);
}else if("已签收".equals(SignBillStatus)){
signBillEntity.setSignBillStatus(1);
}else if("部分签收".equals(SignBillStatus)){
signBillEntity.setSignBillStatus(2);
}
opSignBillService.updateById(signBillEntity);
signBillId = signBillEntity.getId();
}
//存入包件数据
for (int j = 0; j <packages.size(); j++) {
JSONObject packagesJSONObject = packages.getJSONObject(j);
String code = packagesJSONObject.getString("Code");
String packageStatus = packagesJSONObject.getString("PackageStatus");
OpSignPackageEntity signPackageEntity = opSignPackageService.findEntityByOrderPackageCode(code);
if(Objects.isNull(signPackageEntity)){
signPackageEntity = new OpSignPackageEntity();
signPackageEntity.setSignBillId(signBillId);
signPackageEntity.setOrderPackageCode(code);
if ("已调度".equals(packageStatus)) {
signPackageEntity.setPackageStatus(1);
} else if ("已装车".equals(packageStatus)) {
signPackageEntity.setPackageStatus(2);
} else if ("待收货".equals(packageStatus)) {
signPackageEntity.setPackageStatus(3);
} else if ("已收货".equals(packageStatus)) {
signPackageEntity.setPackageStatus(4);
} else if ("已在库".equals(packageStatus)) {
signPackageEntity.setPackageStatus(5);
} else if ("待理货".equals(packageStatus)) {
signPackageEntity.setPackageStatus(6);
} else if ("待上架".equals(packageStatus)) {
signPackageEntity.setPackageStatus(7);
} else if ("已上架".equals(packageStatus)) {
signPackageEntity.setPackageStatus(8);
} else if ("已下架".equals(packageStatus)) {
signPackageEntity.setPackageStatus(9);
} else if ("已发运".equals(packageStatus)) {
signPackageEntity.setPackageStatus(10);
} else if ("已签收".equals(packageStatus)) {
signPackageEntity.setPackageStatus(11);
} else if ("待返货".equals(packageStatus)) {
signPackageEntity.setPackageStatus(12);
} else if ("已提件".equals(packageStatus)) {
signPackageEntity.setPackageStatus(13);
} else if ("已拒收".equals(packageStatus)) {
signPackageEntity.setPackageStatus(14);
} else if ("异常".equals(packageStatus)) {
signPackageEntity.setPackageStatus(-1);
} else {
signPackageEntity.setPackageStatus(0);
}
Boolean isInventory = packagesJSONObject.getBoolean("IsInventory");
if(isInventory){
signPackageEntity.setIsInventory(1);
}else{
signPackageEntity.setIsInventory(0);
}
opSignPackageService.save(signPackageEntity);
}else{
if ("已调度".equals(packageStatus)) {
signPackageEntity.setPackageStatus(1);
} else if ("已装车".equals(packageStatus)) {
signPackageEntity.setPackageStatus(2);
} else if ("待收货".equals(packageStatus)) {
signPackageEntity.setPackageStatus(3);
} else if ("已收货".equals(packageStatus)) {
signPackageEntity.setPackageStatus(4);
} else if ("已在库".equals(packageStatus)) {
signPackageEntity.setPackageStatus(5);
} else if ("待理货".equals(packageStatus)) {
signPackageEntity.setPackageStatus(6);
} else if ("待上架".equals(packageStatus)) {
signPackageEntity.setPackageStatus(7);
} else if ("已上架".equals(packageStatus)) {
signPackageEntity.setPackageStatus(8);
} else if ("已下架".equals(packageStatus)) {
signPackageEntity.setPackageStatus(9);
} else if ("已发运".equals(packageStatus)) {
signPackageEntity.setPackageStatus(10);
} else if ("已签收".equals(packageStatus)) {
signPackageEntity.setPackageStatus(11);
} else if ("待返货".equals(packageStatus)) {
signPackageEntity.setPackageStatus(12);
} else if ("已提件".equals(packageStatus)) {
signPackageEntity.setPackageStatus(13);
} else if ("已拒收".equals(packageStatus)) {
signPackageEntity.setPackageStatus(14);
} else if ("异常".equals(packageStatus)) {
signPackageEntity.setPackageStatus(-1);
} else {
signPackageEntity.setPackageStatus(0);
}
opSignPackageService.updateById(signPackageEntity);
}
}
}
}
}

9
blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/IOpOutGoingOrderService.java

@ -0,0 +1,9 @@
package com.logpm.factory.oupai.service;
import com.logpm.factory.oupai.entity.OpOutGoingOrderEntity;
import org.springblade.core.mp.base.BaseService;
public interface IOpOutGoingOrderService extends BaseService<OpOutGoingOrderEntity> {
OpOutGoingOrderEntity getEntityByCode(String outGoingOrderCode);
}

8
blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/IOpSignBillService.java

@ -0,0 +1,8 @@
package com.logpm.factory.oupai.service;
import com.logpm.factory.oupai.entity.OpSignBillEntity;
import org.springblade.core.mp.base.BaseService;
public interface IOpSignBillService extends BaseService<OpSignBillEntity> {
OpSignBillEntity findEntityByCode(String recevierCode);
}

8
blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/IOpSignPackageService.java

@ -0,0 +1,8 @@
package com.logpm.factory.oupai.service;
import com.logpm.factory.oupai.entity.OpSignPackageEntity;
import org.springblade.core.mp.base.BaseService;
public interface IOpSignPackageService extends BaseService<OpSignPackageEntity> {
OpSignPackageEntity findEntityByOrderPackageCode(String code);
}

21
blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OpOutGoingOrderServiceImpl.java

@ -0,0 +1,21 @@
package com.logpm.factory.oupai.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.logpm.factory.oupai.entity.OpOutGoingOrderEntity;
import com.logpm.factory.oupai.mapper.OpOutGoingOrderMapper;
import com.logpm.factory.oupai.service.IOpOutGoingOrderService;
import lombok.AllArgsConstructor;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
@Service
@AllArgsConstructor
public class OpOutGoingOrderServiceImpl extends BaseServiceImpl<OpOutGoingOrderMapper, OpOutGoingOrderEntity> implements IOpOutGoingOrderService {
@Override
public OpOutGoingOrderEntity getEntityByCode(String outGoingOrderCode) {
QueryWrapper<OpOutGoingOrderEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("code",outGoingOrderCode)
.eq("is_deleted",0);
return baseMapper.selectOne(queryWrapper);
}
}

21
blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OpSignBillServiceImpl.java

@ -0,0 +1,21 @@
package com.logpm.factory.oupai.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.logpm.factory.oupai.entity.OpSignBillEntity;
import com.logpm.factory.oupai.mapper.OpSignBillMapper;
import com.logpm.factory.oupai.service.IOpSignBillService;
import lombok.AllArgsConstructor;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
@Service
@AllArgsConstructor
public class OpSignBillServiceImpl extends BaseServiceImpl<OpSignBillMapper, OpSignBillEntity> implements IOpSignBillService {
@Override
public OpSignBillEntity findEntityByCode(String recevierCode) {
QueryWrapper<OpSignBillEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("code",recevierCode)
.eq("is_deleted",0);
return baseMapper.selectOne(queryWrapper);
}
}

21
blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OpSignPackageServiceImpl.java

@ -0,0 +1,21 @@
package com.logpm.factory.oupai.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.logpm.factory.oupai.entity.OpSignPackageEntity;
import com.logpm.factory.oupai.mapper.OpSignPackageMapper;
import com.logpm.factory.oupai.service.IOpSignPackageService;
import lombok.AllArgsConstructor;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
@Service
@AllArgsConstructor
public class OpSignPackageServiceImpl extends BaseServiceImpl<OpSignPackageMapper, OpSignPackageEntity> implements IOpSignPackageService {
@Override
public OpSignPackageEntity findEntityByOrderPackageCode(String code) {
QueryWrapper<OpSignPackageEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("order_package_code",code)
.eq("is_deleted",0);
return baseMapper.selectOne(queryWrapper);
}
}

44
blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryServiceImpl.java

@ -116,8 +116,9 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
public String savaOuPaiSignBillByCode(String orderCode, Integer event) {
//
String url = ouPaiProperties.getUri() + "tims_odata_api/api/odata/SignBill?$filter=Code eq '" + orderCode + "'" +
"&$select=Code,Status,SignPerson,SignPhone,SignAddress,SignTime,Remark," +
"&$expand=OutGoingOrder($select=Code,Status&$expand=OutGoingOrderDetails($select=))&$expand=Packages($select=Code,FirstClassName,PackageStatus)&$expand=SignPictures($select=)";
"&$expand=OutGoingOrder($expand=Warehouse&$expand=Truck)" +
"&$expand=Store($select=Code,Name;$expand=Shop($select=Code,Name))" +
"&$expand=Packages($select=Code,PackageStatus,IsInventory)";
handleSignBillData(url, event);
return orderCode;
@ -128,19 +129,30 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
// 保存需要解析的数据
// 获取返回内容
// try {
// JSONObject jsonObject = JSONObject.parseObject(opOrderStatusLogEntity.getArgs());
// JSONArray resultArray = jsonObject.getJSONArray("value");
// log.info("############handlePackageData: 数据处理开始");
//
// //TODO 这里需要添加处理签收单的逻辑
//
// opOrderStatusLogEntity.setDataStatus(1);
// } catch (Exception e) {
// log.error("############handlePackageData: {}", e.getMessage());
// opOrderStatusLogEntity.setDataStatus(2);
// }
// opOrderStatusLogService.saveOrUpdate(opOrderStatusLogEntity);
Map<String, Object> map = new HashMap<>();
map.put("messageId", CommonUtil.getUUID());
map.put("type", "Push");
map.put("messageData", opOrderStatusLogEntity);
map.put("createTime", new Date().getTime());
try {
JSONObject jsonObject = JSONObject.parseObject(opOrderStatusLogEntity.getArgs());
JSONArray resultArray = jsonObject.getJSONArray("value");
log.info("############handlePackageData: 数据处理开始");
//TODO 这里需要添加处理签收单的逻辑
opOrderStatusLogEntity.setDataStatus(1);
rabbitTemplate.convertAndSend(RabbitConstant.OUPAI_SIGN_EXCHANGE, RabbitConstant.OUPAI_SIGN_ROUTING, map);
} catch (Exception e) {
log.error("############handlePackageData: {}", e.getMessage());
opOrderStatusLogEntity.setDataStatus(2);
}
opOrderStatusLogService.saveOrUpdate(opOrderStatusLogEntity);
}
private void handleOutGoingOrderData(String url, Integer event) {
@ -178,7 +190,7 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
map.put("createTime", new Date().getTime());
try {
rabbitTemplate.convertAndSend(RabbitConstant.RECEIVE_INFO_EXCHANGE, RabbitConstant.RECEIVE_INFO_ROUTING, map);
rabbitTemplate.convertAndSend(RabbitConstant.OUPAI_RECEIVING_EXCHANGE, RabbitConstant.OUPAI_RECEIVING_ROUTING, map);
} catch (Exception e) {
log.error("############handlePackageData: {}", e.getMessage());
}
@ -366,6 +378,12 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
if (!Objects.isNull(store)) {
factoryOrderEntity.setStoreCode(store.getString("Code"));
factoryOrderEntity.setStoreName(store.getString("Name"));
JSONObject shop = store.getJSONObject("Shop");
if(!Objects.isNull(shop)){
factoryOrderEntity.setShopCode(shop.getString("Code"));
factoryOrderEntity.setShopName(shop.getString("Name"));
}
}
factoryOrderEntity.setMatingCode(orderEntity.getString("MatingCode"));
@ -543,7 +561,7 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
"Packages($select=Code,PdaNumber,FirstClassCode,FirstClassName,SecondClassCode,SecondClassName,ThirdClassCode,ThirdClassName,BuyIn,CosourcingCode,CosourcingUnit,SortingCenter,DistributionCenter,Length,Width,Height,Weight,OrderDetail,Order,PathIndex,PathDetail,DeliveryOrders,ReceivingOrders,LPN,LpnSerialNum,IsEntruck,ReservationOrder,OutGoingOrderDetail,SignBill,IsInventory,Inventories,InventoryInDetails,Freeze,OutGoingOrderDetailInventoryDetail,From,Creator,CreateTime,ShipTime,CarNumber,DeliveryMethod,DeliveryReceiver,DeliveryReceiverPhone,ReturnNumber,GroupType,CarrierCode,CarrierName,PackageDetailNames,ReceivingTime,SendTime,ExceptionSignRemark,Descript,SignTime,OutOrder,IsReceiveByHand,PackageStatus,PackageDetailNames;" +
"$expand=Order($select=" +
"Code,SelfCode,ContractNumber,ServiceNumber,OrderClass,OrderType,Status,FactoryShipStatus,FactorySendQty,WarehouseReceiveStatus,WarehouseReceiveQty,ReservationStatus,Store,MatingCode,IsMating,FirstClassCode,Leave,Customer,Province,City,CustomerAddress,CustomerPhone,ShopReceiver,BrandCode,BrandName,From,OutGoingTime,CreateTime,Freeze,FirstShipTime,MatingShipTime,FirstReceiveTime,MatingReceiveTime;\n" +
"$expand=Store($select=Name,Code))" +
"$expand=Store($select=Name,Code;$expand=Shop))" +
"&$expand=PackageDetails($select=Code,Name,Type,Unit,OrgCode)" +
"&$expand=CurrentWarehouse($select=Name,Code)" +
"&$expand=SendWarehouse($select=Name,Code)" +

51
blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java

@ -66,8 +66,6 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
private static final Logger logger = LoggerFactory.getLogger(PanFactoryDataServiceImpl.class);
// private final IFactoryAccountService factoryAccountService;
// private final IFactoryTokenService factoryTokenService;
private final IPanFactoryOrderService factoryOrderService;
private final IPanPackageInfoService packageInfoService;
@ -76,13 +74,10 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
private final PanFactoryProperties panFactoryProperties;
private final IOrderStatusLogService panOrderStatusLogService;
private final IPanPackageInfoService panPackageInfoService;
private final IPanFactoryOrderService panFactoryOrderService;
private final IAdvanceDetailClient advanceDetailClient;
private final IWarehouseClient warehouseClient;
private final IOrderClient orderClient;
private final IOrderDetailClient orderDetailClient;
private final IAdvanceClient advanceClient;
// private final IMainlineWaybillClient mainlineWaybillClient;
private final IWayBillClient wayBillClient;
private final IDistributionParcelListClient distributionParcelListClient;
@ -375,7 +370,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
//判断新系统是否有这条订单数据
DistributionStockArticleEntity distributionStockArticleEntity = distributionStockArticleClient.findByAdvanceId(advanceId);
Long id = null;
Long id;
String waybillNoNum = advanceEntity.getWaybillNo();
if (Objects.isNull(distributionStockArticleEntity)) {
@ -391,8 +386,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
// 其实是客户
distributionStockArticleEntity.setMallName(takeCompany);
distributionStockArticleEntity.setWarehouse(destinationWarehouse);
distributionStockArticleEntity.setWarehouseId(basicdataWarehouseEntity.getId());
distributionStockArticleEntity.setWarehouseEntryTime(date);
distributionStockArticleEntity.setTotalNumber(total);
@ -408,7 +402,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
} else {
distributionStockArticleEntity.setCompleteSet(0);
}
logger.info("############basicdataWarehouseEntity}", basicdataWarehouseEntity);
logger.info("############basicdataWarehouseEntity {}", basicdataWarehouseEntity);
if (!Objects.isNull(basicdataWarehouseEntity)) {
distributionStockArticleEntity.setCreateDept(basicdataWarehouseEntity.getDepartment());
}
@ -421,7 +415,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
distributionStockArticleEntity.setConsigneeAddress(wayBillEntity.getTakeAddress());//收货人地址
distributionStockArticleEntity.setConsigneeMobile(wayBillEntity.getTakePhone());//收货人电话
// 根据老运单上的仓库名称找寻新的仓库名称
// 根据老运单上的仓库名称找寻新的仓库名称
// 发站
String warehouseName = wayBillEntity.getStartSite();
@ -432,14 +426,16 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
}
//收货仓库
warehouseName = wayBillEntity.getArriveSite();
warehouseName = wayBillEntity.getWarehouseName();
t = basicdataWarehouseClient.findByName(warehouseName);
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();//客户名称
@ -455,9 +451,8 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
distributionStockArticleEntity.setMallCode(basicdataClientEntity.getClientCode());
// todo 这里需要去查询门店 和新系统的门店ID 进行绑定
String peisongType = getPeisongTypeByClientId(basicdataClientEntity.getId());
logger.info("订单同步peisongType{} ", peisongType);
logger.info("订单同步peisongType {} ", peisongType);
if (StringUtil.isNoneBlank(peisongType)) {
distributionStockArticleEntity.setTypeService(peisongType);
@ -507,7 +502,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
distributionStockArticleEntity.setWaybillNumber(waybillNumber);
// 修改入库状态
distributionStockArticleEntity.setHandQuantity(distributionStockArticleEntity.getHandQuantity().intValue()+1);
distributionStockArticleEntity.setHandQuantity(distributionStockArticleEntity.getHandQuantity() +1);
String orderStatus = checkDistributionStockArticleOrderStatus(distributionStockArticleEntity);
distributionStockArticleEntity.setOrderStatus(orderStatus);
@ -522,7 +517,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
distributionStockArticleEntity.setWarehouseEntryTimeEnd(new Date());
distributionStockArticleClient.saveOrUpdate(distributionStockArticleEntity);
// //包件保存成功去修改订单的数量
// 包件保存成功去修改订单的数量
// distributionStockArticleClient.addHandQuantity(id, 1);
logger.info("#################handleDataToPlatform: 数据处理完成");
} else {
@ -533,8 +528,8 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
/**
* 根据订单的在库数联返回订单的状态
* @param distributionStockArticleEntity
* @return
* @param distributionStockArticleEntity 订单对象
* @return String 状态码值
*/
private String checkDistributionStockArticleOrderStatus(DistributionStockArticleEntity distributionStockArticleEntity) {
@ -570,10 +565,9 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
/**
* 保存包件信息
*
* @param unitNo
* @param distributionStockArticleEntity
* @param id
* @param basicdataWarehouseEntity
* @param unitNo 包条码
* @param distributionStockArticleEntity 订单对象
* @param basicdataWarehouseEntity 仓库对象
*/
private void saveOrderPackage(String unitNo, DistributionStockArticleEntity distributionStockArticleEntity, BasicdataWarehouseEntity basicdataWarehouseEntity, String waybillNo) {
DistributionParcelListEntityVO vo = advanceDetailClient.getByUnitNo(unitNo);
@ -740,8 +734,8 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
/**
* 构建订单的经销商信息和门店信息
*
* @param distributionStockArticleEntity
* @param advanceEntity
* @param distributionStockArticleEntity 订单对象
* @param advanceEntity 老订单对象
*/
private void buildDealerAndStore(DistributionStockArticleEntity distributionStockArticleEntity, AdvanceEntity advanceEntity) {
@ -757,14 +751,15 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
distributionStockArticleEntity.setCustomerAddress(advanceEntity.getCustomerRoad());
distributionStockArticleEntity.setCustomerTelephone(advanceEntity.getCustomerPhone());
// 服务号
distributionStockArticleEntity.setServiceNumber(advanceEntity.getServiceNum());
distributionStockArticleEntity.setDescriptionGoods(advanceEntity.getFirstPackName());
// 品牌
distributionStockArticleEntity.setBrand(advanceEntity.getType());
distributionStockArticleEntity.setResource(advanceEntity.getType());
}
@ -793,7 +788,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
QueryWrapper<PanFactoryOrder> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("order_no", orderNo);
List<PanFactoryOrder> one = factoryOrderService.list(queryWrapper);
if (!Objects.isNull(one) && one.size() > 0) {
if (!Objects.isNull(one) && !one.isEmpty()) {
//如果订单已存在就去验证订单下面的包件信息
List<PanPackageInfoDTO> order_attributes = factoryOrderDTO.getORDER_ATTRIBUTES();
QueryWrapper<PanPackageInfo> qw = new QueryWrapper<>();
@ -811,7 +806,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
}
factoryOrderDTO.setORDER_ATTRIBUTES(order_attributes);
if (order_attributes.size() == 0) {
if (order_attributes.isEmpty()) {
logger.info("###########saveData: 没有新增包件,不保存信息");
return null;
}

1
blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/DealWithDataHandler.java

@ -38,7 +38,6 @@ public class DealWithDataHandler {
@RabbitHandler
public void dealWithDataHandler(Map map, Message message, Channel channel) throws IOException {
// 如果手动ACK,消息会被监听消费,但是消息在队列中依旧存在,如果 未配置 acknowledge-mode 默认是会在消费完毕后自动ACK掉
final long deliveryTag = message.getMessageProperties().getDeliveryTag();
log.info("##################dealWithDataHandler: 处理在库订单数据到新系统");
OrderStatusDTO orderStatusDTO = (OrderStatusDTO) map.get("messageData");
String status = orderStatusDTO.getStatus();

297
blade-service/logpm-factory/src/test/java/com/logpm/factory/TestService.java

@ -1,129 +1,168 @@
//package com.logpm.factory;
//
//import cn.hutool.http.HttpResponse;
//import cn.hutool.http.HttpUtil;
//import com.alibaba.excel.EasyExcel;
//import com.alibaba.excel.EasyExcelFactory;
//import com.alibaba.excel.annotation.ExcelProperty;
//import com.alibaba.excel.metadata.BaseRowModel;
//import com.alibaba.excel.metadata.Sheet;
//import com.alibaba.fastjson.JSON;
//import com.alibaba.fastjson.JSONArray;
//import com.alibaba.fastjson.JSONObject;
//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
//import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
//import com.baomidou.mybatisplus.extension.conditions.update.UpdateChainWrapper;
//import com.fasterxml.jackson.core.JsonProcessingException;
//import com.logpm.factory.comfac.controller.FactoryCommonController;
//import com.logpm.factory.comfac.dto.UnloadCarDTO;
//import com.logpm.factory.excel.ExcelMode;
//import com.logpm.factory.excel.JpDataMode;
//import com.logpm.factory.mt.entity.MtFactoryOrderMain;
//import com.logpm.factory.mt.entity.MtPushData;
//import com.logpm.factory.mt.service.IMtFactoryDataService;
//import com.logpm.factory.mt.service.IMtFactoryOrderMainService;
//import com.logpm.factory.mt.service.IMtPushDataService;
//import com.logpm.factory.mt.service.impl.MtFactoryDataServiceImpl;
//import com.logpm.factory.oupai.service.IOuPaiFactoryService;
//import com.logpm.factory.snm.vo.MTOrderPackageRelationVO;
//import com.logpm.oldproject.entity.AdvanceDetailEntity;
//import com.logpm.oldproject.feign.IAdvanceDetailClient;
//import com.rabbitmq.client.Channel;
//import lombok.Data;
//import org.junit.jupiter.api.Test;
//import org.junit.jupiter.api.extension.ExtendWith;
//import org.springblade.core.test.BladeBootTest;
//import org.springblade.core.test.BladeSpringExtension;
//import org.springblade.core.tool.api.R;
//import org.springblade.core.tool.api.ResultCode;
//import org.springblade.core.tool.utils.StringUtil;
//import org.springframework.amqp.core.Message;
//import org.springframework.amqp.rabbit.annotation.RabbitHandler;
//import org.springframework.beans.factory.annotation.Autowired;
//
//import java.io.*;
//import java.security.NoSuchAlgorithmException;
//import java.text.ParseException;
//import java.text.SimpleDateFormat;
//import java.util.*;
//import java.util.stream.Collectors;
//
//@ExtendWith(BladeSpringExtension.class)
//@BladeBootTest(appName = "logpm-factory-pref", enableLoader = true)
//public class TestService {
//
//
//// @Autowired
//// private IOuPaiFactoryService ouPaiFactoryService;
////
////
////
//
//
// @Test
// public void test2() {
//// ouPaiFactoryService.findOuPaiFactoryOrderDTOByCarCarNumber("LCD230505047");
//
// // 获取Excle
//
// try {
//
// File file = new File("F://response.json");
//
// BufferedReader reader = new BufferedReader(new FileReader(file));
//
// StringBuffer sb = new StringBuffer();
//
// while (true) {
// String ms = reader.readLine();
// if (StringUtil.isBlank(ms)) {
// break;
// }
// sb.append(ms);
// }
// JSONObject object = JSONObject.parseObject(sb.toString());
//
// JSONArray jsonArray = object.getJSONArray("rows");
//
// List<JpDataMode> ls = new ArrayList<>();
// for (int i = 0; i < jsonArray.size(); i++) {
// JpDataMode jpDataMode = new JpDataMode();
// JSONObject t = jsonArray.getJSONObject(i);
// String yjOrderNo =t.getString("yjOrderNo");
// String omsExtYsId =t.getString("omsExtYsId");
// String sendTime =t.getString("sendTime");
// String goodsNumber =t.getString("goodsNumber");
// String scanedNum =t.getString("scanedNum");
// String handedNum =t.getString("handedNum");
//
//
// jpDataMode.setOmsExtYsId(omsExtYsId);
// jpDataMode.setOrderId(yjOrderNo);
// jpDataMode.setGoodsNumber(goodsNumber);
// jpDataMode.setSendTime(sendTime);
// jpDataMode.setScanedNum(scanedNum);
// jpDataMode.setHandedNum(handedNum);
//
//
// ls.add(jpDataMode);
// }
//
//
//
//
// EasyExcel.write("F:\\11.xlsx").sheet("sheet1").doWrite(ls);
//
//
//
// } catch (FileNotFoundException e) {
// e.printStackTrace();
// } catch (IOException e) {
// e.printStackTrace();
// }
//
//
// }
//
//
//}
//
package com.logpm.factory;
import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.EasyExcelFactory;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.metadata.BaseRowModel;
import com.alibaba.excel.metadata.Sheet;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.extension.conditions.update.UpdateChainWrapper;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.logpm.factory.comfac.controller.FactoryCommonController;
import com.logpm.factory.comfac.dto.UnloadCarDTO;
import com.logpm.factory.excel.ExcelMode;
import com.logpm.factory.excel.JpDataMode;
import com.logpm.factory.mt.entity.MtFactoryOrderMain;
import com.logpm.factory.mt.entity.MtPushData;
import com.logpm.factory.mt.service.IMtFactoryDataService;
import com.logpm.factory.mt.service.IMtFactoryOrderMainService;
import com.logpm.factory.mt.service.IMtPushDataService;
import com.logpm.factory.mt.service.impl.MtFactoryDataServiceImpl;
import com.logpm.factory.oupai.entity.OpOrderStatusLogEntity;
import com.logpm.factory.oupai.service.IOuPaiFactoryService;
import com.logpm.factory.pan.service.IPanFactoryDataService;
import com.logpm.factory.snm.vo.MTOrderPackageRelationVO;
import com.logpm.oldproject.entity.AdvanceDetailEntity;
import com.logpm.oldproject.feign.IAdvanceDetailClient;
import com.rabbitmq.client.Channel;
import lombok.Data;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springblade.common.utils.CommonUtil;
import org.springblade.core.test.BladeBootTest;
import org.springblade.core.test.BladeSpringExtension;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.api.ResultCode;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.beans.factory.annotation.Autowired;
import java.io.*;
import java.security.NoSuchAlgorithmException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
@ExtendWith(BladeSpringExtension.class)
@BladeBootTest(appName = "logpm-factory-pref", enableLoader = true)
public class TestService {
@Autowired
private IPanFactoryDataService panFactoryDataService;
@Test
public void test2() {
// ouPaiFactoryService.findOuPaiFactoryOrderDTOByCarCarNumber("LCD230505047");
// 获取Excle
try {
File file = new File("F://response.json");
BufferedReader reader = new BufferedReader(new FileReader(file));
StringBuffer sb = new StringBuffer();
while (true) {
String ms = reader.readLine();
if (StringUtil.isBlank(ms)) {
break;
}
sb.append(ms);
}
JSONObject object = JSONObject.parseObject(sb.toString());
JSONArray jsonArray = object.getJSONArray("rows");
List<JpDataMode> ls = new ArrayList<>();
for (int i = 0; i < jsonArray.size(); i++) {
JpDataMode jpDataMode = new JpDataMode();
JSONObject t = jsonArray.getJSONObject(i);
String yjOrderNo = t.getString("yjOrderNo");
String omsExtYsId = t.getString("omsExtYsId");
String sendTime = t.getString("sendTime");
String goodsNumber = t.getString("goodsNumber");
String scanedNum = t.getString("scanedNum");
String handedNum = t.getString("handedNum");
jpDataMode.setOmsExtYsId(omsExtYsId);
jpDataMode.setOrderId(yjOrderNo);
jpDataMode.setGoodsNumber(goodsNumber);
jpDataMode.setSendTime(sendTime);
jpDataMode.setScanedNum(scanedNum);
jpDataMode.setHandedNum(handedNum);
ls.add(jpDataMode);
}
EasyExcel.write("F:\\11.xlsx").sheet("sheet1").doWrite(ls);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
@Test
public void test3() throws IOException {
// 如果手动ACK,消息会被监听消费,但是消息在队列中依旧存在,如果 未配置 acknowledge-mode 默认是会在消费完毕后自动ACK掉
StringBuffer sb = new StringBuffer();
BufferedReader reader = new BufferedReader(new FileReader("F:\\json.txt"));
while(reader.ready()) {
String te =reader.readLine();
if(StringUtil.isBlank(te)){
break;
}
sb.append(te);
}
JSONObject jsonObject = JSONObject.parseObject(sb.toString());
JSONArray jsonArray = jsonObject.getJSONArray("value");
for (int i = 0; i < jsonArray.size(); i++) {
JSONObject valueObject = jsonArray.getJSONObject(i);
JSONArray packages = valueObject.getJSONArray("Packages");
for (int j = 0; j < packages.size(); j++) {
JSONObject packageJSON = packages.getJSONObject(j);
String packageStatus = packageJSON.getString("PackageStatus");
String orderPackageCode = packageJSON.getString("Code");
String receivingTime = packageJSON.getString("CreateTime");
if ("已收货".equals(packageStatus)) {
//真正的处理需要的数据
try {
panFactoryDataService.handleDataToPlatform(orderPackageCode, receivingTime);
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
}
}

3
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/AdvanceDetailClient.java

@ -64,8 +64,7 @@ public class AdvanceDetailClient implements IAdvanceDetailClient {
@GetMapping(API_PREFIX + "/getSupplyData")
public Map<String, String> getSupplyData(String unitNo) {
//查询补充数据
Map<String,String> map = advanceDetailService.getSupplyData(unitNo);
return map;
return advanceDetailService.getSupplyData(unitNo);
}
@Override

3
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/AdvanceDetailServiceImpl.java

@ -54,8 +54,7 @@ public class AdvanceDetailServiceImpl implements IAdvanceDetailService {
public Map<String, String> getSupplyData(String unitNo) {
//查询补充数据
//unitNo
Map<String,String> map = advanceDetailMapper.getSupplyData(unitNo);
return map;
return advanceDetailMapper.getSupplyData(unitNo);
}
@Override

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

@ -0,0 +1,99 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.warehouse.feign;
import com.alibaba.fastjson.JSONObject;
import com.logpm.warehouse.dto.UpShelfPackageDTO;
import com.logpm.warehouse.dto.UpShelfStockDTO;
import com.logpm.warehouse.dto.UpShelfZeroOrderDTO;
import com.logpm.warehouse.service.IWarehouseUpdownTypeService;
import lombok.AllArgsConstructor;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import java.util.ArrayList;
import java.util.List;
/**
* 上下架记录表 Feign实现类
*
* @author lmy
* @since 2023-08-15
*/
@ApiIgnore()
@RestController
@AllArgsConstructor
public class WarehouseUpdownTypeClient implements IWarehouseUpdownTypeClient {
private final IWarehouseUpdownTypeService warehouseUpdownTypeService;
@Override
public R downPackage(String orderPackageCodes) {
List<UpShelfPackageDTO> upShelfPackageList = new ArrayList<>();
String[] split = orderPackageCodes.split(",");
for(String orderPackageCode:split){
UpShelfPackageDTO dto = new UpShelfPackageDTO();
dto.setOrderPackageCode(orderPackageCode);
upShelfPackageList.add(dto);
}
if(upShelfPackageList.size() > 0){
return warehouseUpdownTypeService.downPackage(upShelfPackageList);
}else{
return R.fail(403,"处理失败");
}
}
@Override
public R downZeroOrder(List<JSONObject> zeroOrders) {
List<UpShelfZeroOrderDTO> ls = new ArrayList<>();
for (JSONObject jsonObject:zeroOrders){
UpShelfZeroOrderDTO dto = new UpShelfZeroOrderDTO();
dto.setOrderCode(jsonObject.getString("orderCode"));//订单号
dto.setWaybillCode(jsonObject.getString("waybillCode"));//运单号
dto.setEnterNum(jsonObject.getInteger("enterNum"));//件数
dto.setAllocationId(jsonObject.getLong("allocationId"));//库位id
ls.add(dto);
}
if(ls.size() > 0){
return warehouseUpdownTypeService.downZeroOrder(ls);
}else{
return R.fail(403,"处理失败");
}
}
@Override
public R downStock(List<JSONObject> stockLists) {
List<UpShelfStockDTO> ls = new ArrayList<>();
for (JSONObject jsonObject:stockLists){
UpShelfStockDTO dto = new UpShelfStockDTO();
dto.setMarketId(jsonObject.getLong("marketId"));//商场id
dto.setMaterialCode(jsonObject.getString("materialCode"));//物料编码
dto.setIncomingBatch(jsonObject.getString("incomingBatch"));//批次号
dto.setEnterNum(jsonObject.getInteger("enterNum"));//件数
dto.setAllocationId(jsonObject.getLong("allocationId"));//库位id
ls.add(dto);
}
if(ls.size() > 0){
return warehouseUpdownTypeService.downStock(ls);
}else{
return R.fail(403,"处理失败");
}
}
}

4
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayGoodsServiceImpl.java

@ -148,7 +148,7 @@ public class WarehouseTrayGoodsServiceImpl extends BaseServiceImpl<WarehouseTray
//修改状态
basicdataTrayClient.updateTrayStatus(id,1);
}catch (Exception e){
log.error("删除托盘所有关联表>>>>>>>>>>{}",e);
log.error("删除托盘所有关联表>>>>>>>>>> {}",e.getMessage());
return false;
}
return true;
@ -266,7 +266,7 @@ public class WarehouseTrayGoodsServiceImpl extends BaseServiceImpl<WarehouseTray
int delete = baseMapper.delete(new QueryWrapper<WarehouseTrayGoodsEntity>().lambda()
.eq(WarehouseTrayGoodsEntity::getTrayId, masterId)
);
return delete>0?true:false;
return delete > 0;
}
@Override

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

@ -1257,7 +1257,7 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
int delete = baseMapper.delete(new QueryWrapper<WarehouseTrayTypeEntity>().lambda()
.eq(WarehouseTrayTypeEntity::getTrayId,id)
);
return delete>0?true:false;
return delete > 0;
}

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownGoodsServiceImpl.java

@ -153,7 +153,7 @@ public class WarehouseUpdownGoodsServiceImpl extends BaseServiceImpl<WarehouseUp
.eq(WarehouseUpdownGoodsEntity::getIsDeleted, 0)
.in(WarehouseUpdownGoodsEntity::getAreaId, ids)
).intValue();
log.info("i>>>>>",i);
log.info("i>>>>> {}",i);
return i;
}

Loading…
Cancel
Save