Browse Source

Merge branch 'dev' into test

test
pref_mail@163.com 2 years ago
parent
commit
d5b89cd17c
  1. 75
      blade-biz-common/src/main/java/org/springblade/common/constant/RabbitConstant.java
  2. 5
      blade-biz-common/src/main/java/org/springblade/common/utils/CommonUtil.java
  3. 10
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataStoreContactEntity.java
  4. 2
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataGoodsAreaClient.java
  5. 6
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionDeliveryInfoEntity.java
  6. 8
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionDeliveryListEntity.java
  7. 10
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionReservationEntity.java
  8. 2
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionSignforEntity.java
  9. 10
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java
  10. 6
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionStockArticleClient.java
  11. 162
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionDeliveryInfoVO.java
  12. 9
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionDeliveryListVO.java
  13. 62
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionPackadeliVO.java
  14. 84
      blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/snm/entity/MtFactoryOrder.java
  15. 57
      blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/snm/entity/MtFactoryOrderMain.java
  16. 57
      blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/snm/entity/MtPackageInfo.java
  17. 8
      blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/snm/entity/OrderStatusLog.java
  18. 13
      blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/snm/vo/ImagesVO.java
  19. 155
      blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/entity/OrderEntity.java
  20. 3
      blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IAdvanceClient.java
  21. 9
      blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IAdvanceDetailClient.java
  22. 43
      blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IOrderClient.java
  23. 67
      blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/vo/DistributionParcelListEntityVO.java
  24. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataClientController.java
  25. 11
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataStoreContactController.java
  26. 3
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataWarehouseController.java
  27. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataClientService.java
  28. 1
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataStoreContactService.java
  29. 16
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java
  30. 13
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataStoreBrandServiceImpl.java
  31. 25
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataStoreContactServiceImpl.java
  32. 25
      blade-service/logpm-distribution/pom.xml
  33. 16
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java
  34. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java
  35. 16
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java
  36. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java
  37. 33
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.java
  38. 83
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml
  39. 12
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml
  40. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml
  41. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryInfoService.java
  42. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryInfoServiceImpl.java
  43. 49
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  44. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  45. 14
      blade-service/logpm-factory/pom.xml
  46. 13
      blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/constant/FactoryConstant.java
  47. 7
      blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/controller/FactoryAuthController.java
  48. 149
      blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/controller/FactoryCommonController.java
  49. 2
      blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/dto/FactoryAccountDTO.java
  50. 5
      blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/dto/OrderInfoDTO.java
  51. 5
      blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/dto/OrderStatusDTO.java
  52. 19
      blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/dto/ReceiveBodyDTO.java
  53. 26
      blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/dto/ReceiveInfoDTO.java
  54. 12
      blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/dto/ReceivePhotoDTO.java
  55. 2
      blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/mapper/FactoryAccountMapper.java
  56. 20
      blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/mapper/FactoryAccountMapper.xml
  57. 2
      blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/mapper/FactoryTokenMapper.java
  58. 2
      blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/mapper/FactoryTokenMapper.xml
  59. 6
      blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/mapper/OrderStatusLogMapper.java
  60. 2
      blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/mapper/OrderStatusLogMapper.xml
  61. 4
      blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/IAsyncDataService.java
  62. 2
      blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/IFactoryAccountService.java
  63. 2
      blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/IFactoryAuthService.java
  64. 6
      blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/IFactoryCommonService.java
  65. 2
      blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/IFactoryTokenService.java
  66. 8
      blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/IOrderStatusLogService.java
  67. 191
      blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/AsyncDataServiceImpl.java
  68. 6
      blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/FactoryAccountServiceImpl.java
  69. 8
      blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/FactoryAuthServiceImpl.java
  70. 18
      blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/FactoryCommonServiceImpl.java
  71. 6
      blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/FactoryTokenServiceImpl.java
  72. 19
      blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/OrderStatusLogServiceImpl.java
  73. 27
      blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/utils/CommonUntis.java
  74. 5
      blade-service/logpm-factory/src/main/java/com/logpm/factory/config/InterceptorAdapterConfig.java
  75. 184
      blade-service/logpm-factory/src/main/java/com/logpm/factory/config/RabbitMqConfiguration.java
  76. 2
      blade-service/logpm-factory/src/main/java/com/logpm/factory/interceptor/FactoryAccountsInterceptor.java
  77. 102
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/controller/MtFactoryDataController.java
  78. 18
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/dto/MtFactoryDataDTO.java
  79. 18
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/dto/MtFactoryOrderDTO.java
  80. 10
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/dto/MtPackageInfoDTO.java
  81. 7
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/mapper/MtFactoryOrderMainMapper.java
  82. 20
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/mapper/MtFactoryOrderMainMapper.xml
  83. 7
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/mapper/MtFactoryOrderMapper.java
  84. 2
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/mapper/MtFactoryOrderMapper.xml
  85. 7
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/mapper/MtPackageInfoMapper.java
  86. 21
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/IMtFactoryDataService.java
  87. 8
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/IMtFactoryOrderMainService.java
  88. 11
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/IMtFactoryOrderService.java
  89. 7
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/IMtPackageInfoService.java
  90. 283
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtFactoryDataServiceImpl.java
  91. 15
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtFactoryOrderMainServiceImpl.java
  92. 13
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtFactoryOrderServiceImpl.java
  93. 13
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtPackageInfoServiceImpl.java
  94. 103
      blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/controller/PanFactoryDataController.java
  95. 2
      blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/dto/PanFactoryOrderDTO.java
  96. 2
      blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/dto/PanPackageInfoDTO.java
  97. 2
      blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/dto/PanPackageListDTO.java
  98. 2
      blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/mapper/PanFactoryOrderMapper.java
  99. 2
      blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/mapper/PanFactoryOrderMapper.xml
  100. 2
      blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/mapper/PanPackageInfoMapper.java
  101. Some files were not shown because too many files have changed in this diff Show More

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

@ -6,53 +6,30 @@ package org.springblade.common.constant;
* @author yangkai.shen
*/
public interface RabbitConstant {
/**
* 直接模式1
*/
String DIRECT_MODE_QUEUE_ONE = "queue.direct.1";
/**
* 队列2
*/
String QUEUE_TWO = "queue.2";
/**
* 队列3
*/
String QUEUE_THREE = "3.queue";
/**
* 分列模式
*/
String FANOUT_MODE_QUEUE = "fanout.mode";
/**
* 主题模式
*/
String TOPIC_MODE_QUEUE = "topic.mode";
/**
* 路由1
*/
String TOPIC_ROUTING_KEY_ONE = "queue.#";
/**
* 路由2
*/
String TOPIC_ROUTING_KEY_TWO = "*.queue";
/**
* 路由3
*/
String TOPIC_ROUTING_KEY_THREE = "3.queue";
/**
* 延迟队列
*/
String DELAY_QUEUE = "delay.queue";
/**
* 延迟队列交换器
*/
String DELAY_MODE_QUEUE = "delay.mode";
//消费失败队列
String ERROR_QUEUE = "error_queue";
String ERROR_EXCHANGE = "error_exchange";
String ERROR_ROUTING = "error_routing";
//订单状态消息队列配置
String ORDER_STATUS_QUEUE = "order_status_queue";
String ORDER_STATUS_EXCHANGE = "order_status_exchange";
String ORDER_STATUS_ROUTING = "order_status_routing";
String OPEN_ORDER_QUEUE = "open_order_queue";
String OPEN_ORDER_EXCHANGE = "open_order_exchange";
String OPEN_ORDER_ROUTING = "open_order_routing";
String DEAL_WITH_QUEUE = "deal_with_queue";
String DEAL_WITH_EXCHANGE = "deal_with_exchange";
String DEAL_WITH_ROUTING = "deal_with_routing";
String RECEIVE_INFO_QUEUE = "receive_info_queue";
String RECEIVE_INFO_EXCHANGE = "receive_info_exchange";
String RECEIVE_INFO_ROUTING = "receive_info_routing";
}

5
blade-biz-common/src/main/java/org/springblade/common/utils/CommonUtil.java

@ -25,6 +25,7 @@ import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.Random;
import java.util.TimeZone;
import java.util.UUID;
/**
* 通用工具类
@ -91,4 +92,8 @@ public class CommonUtil {
}
public static String getUUID(){
return UUID.randomUUID().toString().replace("-", "");
}
}

10
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataStoreContactEntity.java

@ -64,9 +64,9 @@ public class BasicdataStoreContactEntity extends TenantEntity {
@ApiModelProperty(value = "预留5")
private String reserve5;
/**
* 门店名称
* 客户ID
*/
@ApiModelProperty(value = "门店名称")
@ApiModelProperty(value = "客户ID")
private Long shopId;
/**
* 联系人
@ -84,5 +84,9 @@ public class BasicdataStoreContactEntity extends TenantEntity {
*/
@ApiModelProperty(value = "区分类型")
private Integer partitionType;
/**
* 默认联系人
*/
@ApiModelProperty(value = "默认联系人")
private Boolean defaultType;
}

2
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataGoodsAreaClient.java

@ -33,7 +33,7 @@ import org.springframework.web.bind.annotation.RequestParam;
)
public interface IBasicdataGoodsAreaClient {
String API_PREFIX = "/client";
String API_PREFIX = "goodsArea/client";
String TOP = API_PREFIX + "/top";
/**

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

@ -67,10 +67,10 @@ public class DistributionDeliveryInfoEntity extends TenantEntity {
@ApiModelProperty(value = "装车数量")
private Integer loadedNub;
/**
* 预留3
* 包条内数量
*/
@ApiModelProperty(value = "预留3")
private String reserve3;
@ApiModelProperty(value = "包条内数量")
private Integer packageNub;
/**
* 预留4
*/

8
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionDeliveryListEntity.java

@ -179,4 +179,12 @@ public class DistributionDeliveryListEntity extends TenantEntity {
@ApiModelProperty(value = "装车时间")
private String loadingTime;
/**
* 配送单号
*/
@ApiModelProperty(value = "配送单号")
private String noteNumber;
}

10
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionReservationEntity.java

@ -119,11 +119,11 @@ public class DistributionReservationEntity extends TenantEntity {
*/
@ApiModelProperty(value = "备注")
private String remarks;
/**
* 预约单编号系统构建生成
*/
@ApiModelProperty(value = "预约单编号")
private String reservationId;
// /**
// * 预约单编号,系统构建生成
// */
// @ApiModelProperty(value = "预约单编号")
// private String reservationId;
/**
* 时段
*/

2
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionSignforEntity.java

@ -100,7 +100,7 @@ public class DistributionSignforEntity extends TenantEntity {
/**
* 配送仓库(id)
*/
@ApiModelProperty(value = "配送仓库")
@ApiModelProperty(value = "配送仓库(id)")
private String warehouseId;
/**
* 配送仓库(名称)

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

@ -16,12 +16,15 @@
*/
package com.logpm.distribution.feign;
import org.springblade.core.mp.support.BladePage;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import org.springblade.core.mp.support.BladePage;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
/**
* 在库订单包件清单 Feign接口类
*
@ -46,4 +49,9 @@ public interface IDistributionParcelListClient {
@GetMapping(TOP)
BladePage<DistributionParcelListEntity> top(@RequestParam("current") Integer current, @RequestParam("size") Integer size);
@GetMapping(API_PREFIX+"/findByPacketBarCode")
DistributionParcelListEntity findByPacketBarCode(String unitNo);
@GetMapping(API_PREFIX+"/addBatch")
boolean addBatch(@RequestBody List<DistributionParcelListEntity> parcelListEntityList);
}

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

@ -16,10 +16,12 @@
*/
package com.logpm.distribution.feign;
import org.springblade.core.mp.support.BladePage;
import com.logpm.distribution.entity.DistributionStockArticleEntity;
import org.springblade.core.mp.support.BladePage;
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;
/**
@ -46,4 +48,6 @@ public interface IDistributionStockArticleClient {
@GetMapping(TOP)
BladePage<DistributionStockArticleEntity> top(@RequestParam("current") Integer current, @RequestParam("size") Integer size);
@PostMapping(API_PREFIX + "/addData")
Long addData(@RequestBody DistributionStockArticleEntity distributionStockArticleEntity);
}

162
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionDeliveryInfoVO.java

@ -16,11 +16,16 @@
*/
package com.logpm.distribution.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.logpm.distribution.entity.DistributionDeliveryInfoEntity;
import io.swagger.annotations.ApiModelProperty;
import org.springblade.core.tool.node.INode;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.util.Date;
/**
* 配送装车中间表 视图实体类
*
@ -32,4 +37,161 @@ import lombok.EqualsAndHashCode;
public class DistributionDeliveryInfoVO extends DistributionDeliveryInfoEntity {
private static final long serialVersionUID = 1L;
/**
* 仓库
*/
@ApiModelProperty(value = "仓库")
private String warehouse;
/**
* 状态
*/
@ApiModelProperty(value = "状态")
private Integer conditions;
/**
* 包条码
*/
@ApiModelProperty(value = "包条码")
private String packetBarCode;
/**
* 货位信息
*/
@ApiModelProperty(value = "货位信息")
private String goodsAllocation;
/**
* 所在托盘
*/
@ApiModelProperty(value = "所在托盘")
private String pallet;
/**
* 一级品
*/
@ApiModelProperty(value = "一级品")
private String firsts;
/**
* 二级品
*/
@ApiModelProperty(value = "二级品")
private String second;
/**
* 三级品
*/
@ApiModelProperty(value = "三级品")
private String thirdProduct;
/**
* 物料
*/
@ApiModelProperty(value = "物料")
private String material;
/**
* 数量
*/
@ApiModelProperty(value = "数量")
private Integer quantity;
/**
* 车次号
*/
@ApiModelProperty(value = "车次号")
private String trainNumber;
/**
* 在库订单ID
*/
@ApiModelProperty(value = "在库订单ID")
private String stockArticleId;
/**
* 订单自编号;展示使用
*/
@ApiModelProperty(value = "订单自编号;订单自编号,关联订单表")
private String orderIds;
/**
* 收货人
*/
@ApiModelProperty(value = "收货人")
private String consignee;
/**
* 收件地址
*/
@ApiModelProperty(value = "收件地址")
private String deliveryAddress;
/**
* 预约时间
*/
@ApiModelProperty(value = "预约时间")
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd")
private Date reservationDate;
/**
* 服务类型;预约服务类型1-上楼2-超区3-拆样4-平移5-分拣6-搬运7-返货
*/
@ApiModelProperty(value = "服务类型;预约服务类型;1-上楼、2-超区、3-拆样、4-平移、5-分拣、6-搬运、7-返货;")
private String serveType;
/**
* 配送类型;预约添加送货方式1-送货(商配的唯一方式)2-送货上楼3-送装一体4-
*/
@ApiModelProperty(value = "配送类型;预约添加送货方式;1-送货(商配的唯一方式)、2-送货上楼、3-送装一体、4-装")
private String deliveryType;
/**
* 配送方式;预约添加送货方式1-送货(商配的唯一方式)2-送货上楼3-送装一体4-
*/
@ApiModelProperty(value = "配送方式;1-商配、2-市配")
private String deliveryWay;
/**
* 到付运费
*/
@ApiModelProperty(value = "到付运费")
private BigDecimal collectFee;
/**
* 其他费用
*/
@ApiModelProperty(value = "其他费用")
private BigDecimal otherFee;
/**
* 代付运费
*/
@ApiModelProperty(value = "代付运费")
private BigDecimal replaceFee;
/**
* 收件人电话
*/
@ApiModelProperty(value = "收件人电话")
private String deliveryPhone;
/**
* 预约信息状态;预约列表信息状态1-待确认2-已确认
*/
@ApiModelProperty(value = "预约信息状态;预约列表信息状态;1-待确认、2-已确认")
private String reservationStatus;
/**
* 订单来源
*/
@ApiModelProperty(value = "订单来源")
private String orderSource;
/**
* 备货状态;备货状态1-未备货2-待备货3-已备货
*/
@ApiModelProperty(value = "备货状态;备货状态;1-未备货、2-待备货、3-已备货")
private String stockupStatus;
/**
* 备货区编号
*/
@ApiModelProperty(value = "备货区编号")
private String goodsAreaId;
/**
* 备注
*/
@ApiModelProperty(value = "备注")
private String remarks;
/**
* 预约单编号系统构建生成
*/
@ApiModelProperty(value = "预约单编号")
private String reservationIds;
/**
* 时段
*/
@ApiModelProperty(value = "时段;1-上午、2-下午、3-全天")
private String periodOfTime;
}

9
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionDeliveryListVO.java

@ -38,7 +38,14 @@ public class DistributionDeliveryListVO extends DistributionDeliveryListEntity {
* 包条数据
*/
@ApiModelProperty(value = "包条数据")
private List<DistributionPackadeliVO> packadeList;
private List<DistributionDeliveryInfoVO> packadeList;
/**
* 预约客户数据
*/
@ApiModelProperty(value = "预约客户数据")
private List<DistributionDeliveryInfoVO> reservationList;
}

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

@ -23,7 +23,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 配送包条中间表 视图实体类
* 签收包条中间表 视图实体类
*
* @author lmy
* @since 2023-06-17
@ -33,65 +33,5 @@ import lombok.EqualsAndHashCode;
public class DistributionPackadeliVO extends DistributionPackadeliEntity {
private static final long serialVersionUID = 1L;
/**
* 仓库
*/
@ApiModelProperty(value = "仓库")
private String warehouse;
/**
* 状态
*/
@ApiModelProperty(value = "状态")
private Integer conditions;
/**
* 包条码
*/
@ApiModelProperty(value = "包条码")
private String packetBarCode;
/**
* 货位信息
*/
@ApiModelProperty(value = "货位信息")
private String goodsAllocation;
/**
* 所在托盘
*/
@ApiModelProperty(value = "所在托盘")
private String pallet;
/**
* 一级品
*/
@ApiModelProperty(value = "一级品")
private String firsts;
/**
* 二级品
*/
@ApiModelProperty(value = "二级品")
private String second;
/**
* 三级品
*/
@ApiModelProperty(value = "三级品")
private String thirdProduct;
/**
* 物料
*/
@ApiModelProperty(value = "物料")
private String material;
/**
* 数量
*/
@ApiModelProperty(value = "数量")
private Integer quantity;
/**
* 车次号
*/
@ApiModelProperty(value = "车次号")
private String trainNumber;
/**
* 在库订单ID
*/
@ApiModelProperty(value = "在库订单ID")
private String stockArticleId;
}

84
blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/snm/entity/MtFactoryOrder.java

@ -0,0 +1,84 @@
package com.logpm.factory.snm.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonProperty;
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("mt_factory_order")
@ApiModel(value = "MtFactoryOrder对象", description = "梦天工厂订单")
@EqualsAndHashCode(callSuper = true)
public class MtFactoryOrder extends BaseEntity {
@JsonProperty("总单编号")
@ApiModelProperty(value = "总单编号")
private String mainOrderCode;
@JsonProperty("订单编号")
@ApiModelProperty(value = "订单编号")
private String orderCode;
@JsonProperty("客户姓名")
@ApiModelProperty(value = "客户姓名")
private String customName;
@JsonProperty("客户电话")
@ApiModelProperty(value = "客户电话")
private String customPhone;
@JsonProperty("客户地址")
@ApiModelProperty(value = "客户地址")
private String customAddress;
@JsonProperty("经销商编号")
@ApiModelProperty(value = "经销商编码")
private String dealerCode;
@JsonProperty("经销商名称")
@ApiModelProperty(value = "经销商名称")
private String dealerName;
@JsonProperty("专卖店编号")
@ApiModelProperty(value = "专卖店编号")
private String exclusiveCode;
@JsonProperty("专卖店名称")
@ApiModelProperty(value = "专卖店名称")
private String exclusiveName;
@JsonProperty("收货人")
@ApiModelProperty(value = "收货人")
private String consignee;
@JsonProperty("收货人电话")
@ApiModelProperty(value = "收货人电话")
private String consigneePhone;
@JsonProperty("收货地址")
@ApiModelProperty(value = "收货人地址")
private String consigneeAddress;
@JsonProperty("出库方式")
@ApiModelProperty(value = "出库方式")
private String outboundType;
@JsonProperty("品牌")
@ApiModelProperty(value = "品牌")
private String brand;
@JsonProperty("生产单号")
@ApiModelProperty(value = "生产单号")
private String produceOrderCode;
@JsonProperty("包件数")
@ApiModelProperty(value = "包件数")
private String quantity;
@ApiModelProperty(value = "发货单id")
private Long mainId;
}

57
blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/snm/entity/MtFactoryOrderMain.java

@ -0,0 +1,57 @@
package com.logpm.factory.snm.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonProperty;
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("mt_factory_order_main")
@ApiModel(value = "MtFactoryOrderMain对象", description = "梦天工厂订单主对象")
@EqualsAndHashCode(callSuper = true)
public class MtFactoryOrderMain extends BaseEntity {
@JsonProperty("发货单编号")
@ApiModelProperty(value = "发货单编号")
private String invoiceOrderCode;
@JsonProperty("中心仓编号")
@ApiModelProperty(value = "中心仓编号")
private String centerWarehouseCode;
@JsonProperty("中心仓")
@ApiModelProperty(value = "中心仓")
private String centerWarehouseName;
@JsonProperty("仓库类型")
@ApiModelProperty(value = "仓库类型")
private String warehouseType;
@JsonProperty("送货车号")
@ApiModelProperty(value = "送货车号")
private String sendCarNumber;
@JsonProperty("送货司机")
@ApiModelProperty(value = "送货车司机")
private String sendCarDriver;
@JsonProperty("送货司机电话")
@ApiModelProperty(value = "送货车司机电话")
private String sendCarDriverPhone;
@JsonProperty("确认发车人")
@ApiModelProperty(value = "确认发车人")
private String reallyMan;
@JsonProperty("确认发车时间")
@ApiModelProperty(value = "确认发车时间")
private String reallyDate;
@JsonProperty("备注")
@ApiModelProperty(value = "备注")
private String remark;
}

57
blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/snm/entity/MtPackageInfo.java

@ -0,0 +1,57 @@
package com.logpm.factory.snm.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonProperty;
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("mt_package_info")
@ApiModel(value = "MtPackageInfo对象", description = "梦天工厂包件信息")
@EqualsAndHashCode(callSuper = true)
public class MtPackageInfo extends BaseEntity {
@JsonProperty("出库人")
@ApiModelProperty(value = "出库人")
private String outboundMan;
@JsonProperty("出库时间")
@ApiModelProperty(value = "出库时间")
private String outboundDate;
@JsonProperty("包装编号")
@ApiModelProperty(value = "包装编号")
private String packageCode;
@JsonProperty("包装类型")
@ApiModelProperty(value = "包装类型")
private String packageType;
@JsonProperty("大类")
@ApiModelProperty(value = "大类")
private String bigType;
@JsonProperty("小类")
@ApiModelProperty(value = "小类")
private String smallType;
@JsonProperty("油漆颜色")
@ApiModelProperty(value = "油漆颜色")
private String color;
@JsonProperty("型号")
@ApiModelProperty(value = "型号")
private String model;
@JsonProperty("门扇尺寸")
@ApiModelProperty(value = "尺寸")
private String size;
@ApiModelProperty(value = "订单id")
private Long orderId;
}

8
blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/snm/entity/PanOrderStatusLog.java → blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/snm/entity/OrderStatusLog.java

@ -7,13 +7,15 @@ import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
@Data
@TableName("pan_order_status_log")
@ApiModel(value = "PanOrderStatusLog对象", description = "皮艾诺订单状态日志")
@TableName("order_status_log")
@ApiModel(value = "OrderStatusLog对象", description = "工厂订单状态日志")
@EqualsAndHashCode(callSuper = true)
public class PanOrderStatusLog extends BaseEntity {
public class OrderStatusLog extends BaseEntity {
private String args;
private Integer type;
private String brand;//品牌
}

13
blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/snm/vo/ImagesVO.java

@ -0,0 +1,13 @@
package com.logpm.factory.snm.vo;
import lombok.Data;
import java.io.Serializable;
@Data
public class ImagesVO implements Serializable {
private String suffix;//后缀
private byte[] imageBytes;//图片字节流
}

155
blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/entity/OrderEntity.java

@ -0,0 +1,155 @@
package com.logpm.oldproject.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@Data
@TableName("ht_order")
@ApiModel(value = "Order对象", description = "订单信息")
public class OrderEntity {
@TableId(
value = "id",
type = IdType.AUTO
)
private Integer id;
private Integer test;
@ApiModelProperty(value = "订单号")
@TableField("number")
private String number;
@ApiModelProperty(value = "服务号")
@TableField("servicenum")
private String servicenum;
@ApiModelProperty(value = "仓库id")
@TableField("warehouse_id")
private Integer warehouseId;
@ApiModelProperty(value = "货区id")
@TableField("cargo_id")
private Integer cargoId;
@ApiModelProperty(value = "货架id")
@TableField("shelf_id")
private Integer shelfId;
@ApiModelProperty(value = "货位id")
@TableField("location_id")
private String locationId;
@ApiModelProperty(value = "订单来源")
@TableField("source")
private String source;
@ApiModelProperty(value = "紧急程度:0=正常,1=加急")
@TableField("emergency")
private Integer emergency;
@ApiModelProperty(value = "订单自编号")
@TableField("selfnumber")
private String selfnumber;
@ApiModelProperty(value = "客户姓名")
@TableField("contact")
private String contact;
@ApiModelProperty(value = "联系方式")
@TableField("phone")
private String phone;
@ApiModelProperty(value = "收货地址")
@TableField("address")
private String address;
@ApiModelProperty(value = "上门提货:0=否,1=是")
@TableField("door")
private Integer door;
@ApiModelProperty(value = "总订单数量【未使用】")
@TableField("total")
private Integer total;
@ApiModelProperty(value = "付款方式")
@TableField("payment")
private String payment;
@ApiModelProperty(value = "入库状态")
@TableField("status")
private Integer status;
@ApiModelProperty(value = "入库数量【未使用】")
@TableField("in_num")
private Integer inNum;
@ApiModelProperty(value = "装车数量【未使用】")
@TableField("trans_num")
private Integer transNum;
@ApiModelProperty(value = "分拣数量【未使用】")
@TableField("sorting")
private Integer sorting;
@ApiModelProperty(value = "出库数量【未使用】")
@TableField("out_num")
private Integer outNum;
@ApiModelProperty(value = "配送数量【未使用】")
@TableField("delive_num")
private Integer deliveNum;
@ApiModelProperty(value = "签收数量【未使用】")
@TableField("sign_num")
private Integer signNum;
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
@ApiModelProperty(value = "修改时间")
@TableField("update_time")
private Date updateTime;
@ApiModelProperty(value = "删除时间")
@TableField("delete_time")
private Integer deleteTime;
@ApiModelProperty(value = "创建人")
@TableField("administrators_id")
private Integer administratorsId;
@ApiModelProperty(value = "是否异常")
@TableField("abnormal")
private Integer abnormal;
@ApiModelProperty(value = "寄件人")
@TableField("sender")
private String sender;
@ApiModelProperty(value = "寄件人电话")
@TableField("sender_tel")
private String senderTel;
@ApiModelProperty(value = "寄件人地址")
@TableField("sender_address")
private String senderAddress;
@ApiModelProperty(value = "上架状态:0未上架,1已上架,2部分上架,3已下架")
@TableField("on_shelf_type")
private Integer onShelfType;
@ApiModelProperty(value = "旧id")
@TableField("old_id")
private Integer oldId;
}

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

@ -23,6 +23,7 @@ import org.springframework.cloud.openfeign.SpringQueryMap;
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;
@ -75,7 +76,7 @@ public interface IAdvanceClient {
* @return
*/
@GetMapping(API_PREFIX + "/queryDataOne")
AdvanceEntity getQueryDataOne(String orderSelfNum);
AdvanceEntity getQueryDataOne(@RequestParam String orderSelfNum);
}

9
blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IAdvanceDetailClient.java

@ -17,12 +17,14 @@
package com.logpm.oldproject.feign;
import com.logpm.oldproject.entity.AdvanceDetailEntity;
import com.logpm.oldproject.vo.DistributionParcelListEntityVO;
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;
import java.util.Map;
/**
@ -66,4 +68,11 @@ public interface IAdvanceDetailClient {
*/
@GetMapping(API_PREFIX + "/getSupplyData")
Map<String, String> getSupplyData(@RequestParam String unitNo);
@GetMapping(API_PREFIX + "/getOneByUnitNo")
AdvanceDetailEntity getOneByUnitNo(@RequestParam String unitNo);
@GetMapping(API_PREFIX + "/getListByOrderSelfNum")
List<DistributionParcelListEntityVO> getListByOrderSelfNum(@RequestParam String orderSelfNum);
}

43
blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IOrderClient.java

@ -0,0 +1,43 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.oldproject.feign;
import com.logpm.oldproject.entity.OrderEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
/**
* 订单 Feign接口类
*
* @author zhy
* @since 2023-06-24
*/
@FeignClient(
value = "logpm-old-project"
)
public interface IOrderClient {
String API_PREFIX = "/client";
@GetMapping(API_PREFIX + "/getOrderByOrderSelfNum")
List<OrderEntity> getOrderByOrderSelfNum(@RequestParam String orderSelfNum);
}

67
blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/vo/DistributionParcelListEntityVO.java

@ -0,0 +1,67 @@
package com.logpm.oldproject.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class DistributionParcelListEntityVO {
@ApiModelProperty(value = "仓库")
private String warehouse;
/**
* 状态
*/
@ApiModelProperty(value = "状态")
private Integer conditions;
/**
* 包条码
*/
@ApiModelProperty(value = "包条码")
private String packetBarCode;
/**
* 货位信息
*/
@ApiModelProperty(value = "货位信息")
private String goodsAllocation;
/**
* 所在托盘
*/
@ApiModelProperty(value = "所在托盘")
private String pallet;
/**
* 一级品
*/
@ApiModelProperty(value = "一级品")
private String firsts;
/**
* 二级品
*/
@ApiModelProperty(value = "二级品")
private String second;
/**
* 三级品
*/
@ApiModelProperty(value = "三级品")
private String thirdProduct;
/**
* 物料
*/
@ApiModelProperty(value = "物料")
private String material;
/**
* 数量
*/
@ApiModelProperty(value = "数量")
private Integer quantity;
/**
* 车次号
*/
@ApiModelProperty(value = "车次号")
private String trainNumber;
/**
* 在库订单ID
*/
@ApiModelProperty(value = "在库订单ID")
private String stockArticleId;
}

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

@ -155,7 +155,7 @@ public class BasicdataClientController extends BladeController {
@ApiOperationSupport(order = 7)
@ApiOperation(value = "逻辑删除", notes = "传入ids")
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
return R.status(basicdataClientService.deleteLogic(Func.toLongList(ids)));
return R.status(basicdataClientService.ownDeleteLogic(Func.toLongList(ids)));
}

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

@ -16,6 +16,7 @@
*/
package com.logpm.basicdata.controller;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -97,6 +98,14 @@ public class BasicdataStoreContactController extends BladeController {
@ApiOperationSupport(order = 4)
@ApiOperation(value = "新增", notes = "传入basicdataStoreContact")
public R save(@Valid @RequestBody BasicdataStoreContactEntity basicdataStoreContact) {
List<BasicdataStoreContactEntity> storeContactEntities = basicdataStoreContactService.list(Wrappers.<BasicdataStoreContactEntity>query().lambda()
.eq(BasicdataStoreContactEntity::getShopId, basicdataStoreContact.getShopId())
);
if(storeContactEntities.size() > 0){
basicdataStoreContact.setDefaultType(false);
}else{
basicdataStoreContact.setDefaultType(true);
}
return R.status(basicdataStoreContactService.save(basicdataStoreContact));
}
@ -107,7 +116,7 @@ public class BasicdataStoreContactController extends BladeController {
@ApiOperationSupport(order = 5)
@ApiOperation(value = "修改", notes = "传入basicdataStoreContact")
public R update(@Valid @RequestBody BasicdataStoreContactEntity basicdataStoreContact) {
return R.status(basicdataStoreContactService.updateById(basicdataStoreContact));
return R.status(basicdataStoreContactService.ownUpdateById(basicdataStoreContact));
}
/**

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

@ -30,6 +30,7 @@ import javax.validation.Valid;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -84,6 +85,7 @@ public class BasicdataWarehouseController extends BladeController {
qw
.apply(startDate != null,"date_format (start_date,'%Y-%m-%d') >= date_format ({0},'%Y-%m-%d')",startDate)
.apply(endDate != null,"date_format (end_date,'%Y-%m-%d') <= date_format ({0},'%Y-%m-%d')",endDate);
qw.lambda().eq(BasicdataWarehouseEntity::getTenantId, AuthUtil.getTenantId());
IPage<BasicdataWarehouseEntity> page = warehouseService.page(Condition.getPage(query), qw);
// IPage<BasicdataWarehouseEntity> pages = warehouseService.page(Condition.getPage(query), Condition.getQueryWrapper(warehouseWarehouse, BasicdataWarehouseEntity.class));
return R.data(page);
@ -97,7 +99,6 @@ public class BasicdataWarehouseController extends BladeController {
@ApiOperation(value = "分页", notes = "传入warehouseWarehouse")
public R<List<BasicdataWarehouseEntity>> listName(String name) {
List<BasicdataWarehouseEntity> pages = warehouseService.pageListName(name);
return R.data(pages);
}

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

@ -57,4 +57,6 @@ public interface IBasicdataClientService extends BaseService<BasicdataClientEnti
boolean ownSaveOrUpdate(BasicdataClientEntity basicdataClient);
List<BasicdataClientEntity> listName(String name);
Boolean ownDeleteLogic(List<Long> toLongList);
}

1
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataStoreContactService.java

@ -49,4 +49,5 @@ public interface IBasicdataStoreContactService extends BaseService<BasicdataStor
*/
List<BasicdataStoreContactExcel> exportBasicdataStoreContact(Wrapper<BasicdataStoreContactEntity> queryWrapper);
Boolean ownUpdateById(BasicdataStoreContactEntity basicdataStoreContact);
}

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

@ -92,6 +92,7 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
basicdataStoreContactEntity.setPhone(phone);
basicdataStoreContactEntity.setPartitionType(2);
basicdataStoreContactEntity.setShopId(basicdataClient.getId());
basicdataStoreContactEntity.setDefaultType(true);
basicdataStoreContactService.save(basicdataStoreContactEntity);
//添加客户类型
if(basicdataClient.getTypeServiceList().size() > 0){
@ -141,4 +142,19 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
);
}
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean ownDeleteLogic(List<Long> toLongList) {
toLongList.forEach( i ->{
List<BasicdataClientEntity> basicdataClientEntities = baseMapper.selectList(Wrappers.<BasicdataClientEntity>query().lambda()
.eq(BasicdataClientEntity::getPid, i)
);
if(basicdataClientEntities.size() > 0){
baseMapper.deleteBatchIds(basicdataClientEntities);
}
});
return this.deleteLogic(toLongList);
}
}

13
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataStoreBrandServiceImpl.java

@ -72,18 +72,17 @@ public class BasicdataStoreBrandServiceImpl extends BaseServiceImpl<BasicdataSto
@Override
public Boolean submitSave(BasicdataStoreBrandEntity basicdataStoreBrand) {
//查询客户id
List<BasicdataShopEntity> list = basicdataShopService.list(Wrappers.<BasicdataShopEntity>query().lambda()
.eq(BasicdataShopEntity::getId, basicdataStoreBrand.getShopId())
);
// List<BasicdataShopEntity> list = basicdataShopService.list(Wrappers.<BasicdataShopEntity>query().lambda()
// .eq(BasicdataShopEntity::getId, basicdataStoreBrand.getShopId())
// );
List<BasicdataStoreBrandEntity> basicdataStoreBrandEntities = baseMapper.selectList(Wrappers.<BasicdataStoreBrandEntity>query().lambda()
.eq(BasicdataStoreBrandEntity::getShopId, basicdataStoreBrand.getShopId())
.eq(BasicdataStoreBrandEntity::getBrandId, basicdataStoreBrand.getBrandId())
.eq(BasicdataStoreBrandEntity::getClientId,list.get(0).getClientId())
.eq(BasicdataStoreBrandEntity::getClientId,basicdataStoreBrand.getShopId())
);
if(basicdataStoreBrandEntities.size() > 0){
throw new RuntimeException("当前门店已拥有该品牌!");
throw new RuntimeException("当前已拥有该品牌!");
}
basicdataStoreBrand.setClientId(list.get(0).getClientId());
basicdataStoreBrand.setClientId(Long.parseLong(basicdataStoreBrand.getShopId()));
return this.saveOrUpdate(basicdataStoreBrand);
}

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

@ -16,11 +16,13 @@
*/
package com.logpm.basicdata.service.impl;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.basicdata.entity.BasicdataStoreContactEntity;
import com.logpm.basicdata.vo.BasicdataStoreContactVO;
import com.logpm.basicdata.excel.BasicdataStoreContactExcel;
import com.logpm.basicdata.mapper.BasicdataStoreContactMapper;
import com.logpm.basicdata.service.IBasicdataStoreContactService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -34,6 +36,7 @@ import java.util.List;
* @since 2023-05-16
*/
@Service
@Slf4j
public class BasicdataStoreContactServiceImpl extends BaseServiceImpl<BasicdataStoreContactMapper, BasicdataStoreContactEntity> implements IBasicdataStoreContactService {
@Override
@ -51,4 +54,26 @@ public class BasicdataStoreContactServiceImpl extends BaseServiceImpl<BasicdataS
return basicdataStoreContactList;
}
@Override
public Boolean ownUpdateById(BasicdataStoreContactEntity basicdataStoreContact) {
try{
List<BasicdataStoreContactEntity> storeContactEntities = baseMapper.selectList(Wrappers.<BasicdataStoreContactEntity>query().lambda()
.eq(BasicdataStoreContactEntity::getShopId, basicdataStoreContact.getShopId())
);
storeContactEntities.forEach( i ->{
if(i.getShopId().equals(basicdataStoreContact.getShopId())){
this.updateById(basicdataStoreContact);
}else{
i.setDefaultType(false);
this.updateById(i);
}
});
return true;
}catch (Exception e){
log.info("报错信息:",e.getMessage());
return false;
}
}
}

25
blade-service/logpm-distribution/pom.xml

@ -53,4 +53,29 @@
<artifactId>aliyun-java-sdk-core</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<configuration>
<username>${docker.username}</username>
<password>${docker.password}</password>
<repository>${docker.registry.url}/${docker.namespace}/${project.artifactId}</repository>
<tag>${project.version}</tag>
<useMavenSettingsForAuth>true</useMavenSettingsForAuth>
<buildArgs>
<JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
</buildArgs>
<skip>false</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

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

@ -18,7 +18,10 @@ package com.logpm.distribution.controller;
import cn.hutool.core.util.BooleanUtil;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.logpm.distribution.dto.DistributionDeliveryInfoDTO;
import com.logpm.distribution.dto.DistributionDeliveryListDTO;
import com.logpm.distribution.service.IDistributionDeliveryInfoService;
import com.logpm.distribution.vo.DistributionDeliveryInfoVO;
import com.logpm.distribution.vo.DistributionstatisticsnmbVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -63,6 +66,8 @@ public class DistributionDeliveryListController extends BladeController {
private final IDistributionDeliveryListService distributionDeliveryListService;
private final IDistributionDeliveryInfoService distributionDeliveryInfoService;
/**
* 配送管理 详情
*/
@ -74,6 +79,17 @@ public class DistributionDeliveryListController extends BladeController {
DistributionDeliveryListVO distributionDeliveryListVO = distributionDeliveryListService.getdetailVO(detail);
return R.data(distributionDeliveryListVO);
}
/**
* 查看包间明细 详情
*/
@GetMapping("/wrapdetail")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "查看包间详情", notes = "传入distributionDeliveryList")
public R<IPage<DistributionDeliveryInfoVO>> wrapdetail(DistributionDeliveryInfoDTO distributionDeliveryInfoDTO, Query query) {
IPage<DistributionDeliveryInfoVO> pages = distributionDeliveryInfoService.selectDistributionDeliveryInfowrapPage(Condition.getPage(query), distributionDeliveryInfoDTO);
return R.data(pages);
}
/**
* 配送管理 分页
*/

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java

@ -100,7 +100,6 @@ public class DistributionReservationController extends BladeController {
@ApiOperationSupport(order = 4)
@ApiOperation(value = "新增", notes = "传入distrbutionReservation")
public R save(@Valid @RequestBody DistributionReservationDTO distributionReservationDTO) {
boolean result = reservationService.insertReservation(distributionReservationDTO);
return R.status(result);
}

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

@ -16,6 +16,7 @@
*/
package com.logpm.distribution.feign;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import lombok.AllArgsConstructor;
import org.springblade.core.mp.support.BladePage;
@ -27,6 +28,8 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
/**
* 在库订单包件清单 Feign实现类
*
@ -50,4 +53,17 @@ public class DistributionParcelListClient implements IDistributionParcelListClie
return BladePage.of(page);
}
@Override
@GetMapping(API_PREFIX+"/findByPacketBarCode")
public DistributionParcelListEntity findByPacketBarCode(String unitNo) {
QueryWrapper<DistributionParcelListEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("packet_bar_code",unitNo);
return distributionParcelListService.getOne(queryWrapper);
}
@Override
public boolean addBatch(List<DistributionParcelListEntity> parcelListEntityList) {
return distributionParcelListService.saveBatch(parcelListEntityList);
}
}

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

@ -50,4 +50,14 @@ public class DistributionStockArticleClient implements IDistributionStockArticle
return BladePage.of(page);
}
@Override
public Long addData(DistributionStockArticleEntity distributionStockArticleEntity) {
boolean saveFlag = distributionStockArticleService.save(distributionStockArticleEntity);
if(saveFlag){
return distributionStockArticleEntity.getId();
}else{
return 0L;
}
}
}

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

@ -16,6 +16,7 @@
*/
package com.logpm.distribution.mapper;
import com.logpm.distribution.dto.DistributionDeliveryInfoDTO;
import com.logpm.distribution.entity.DistributionDeliveryInfoEntity;
import com.logpm.distribution.vo.DistributionDeliveryInfoVO;
import com.logpm.distribution.excel.DistributionDeliveryInfoExcel;
@ -50,5 +51,35 @@ public interface DistributionDeliveryInfoMapper extends BaseMapper<DistributionD
* @return
*/
List<DistributionDeliveryInfoExcel> exportDistributionDeliveryInfo(@Param("ew") Wrapper<DistributionDeliveryInfoEntity> queryWrapper);
/**
* 通过客户查询已经上车的订单
*
* @return
*/
String selectorderIdList(Long id);
/**
* 通过配送查询包条
*
* @return
*/
List<DistributionDeliveryInfoVO> selectStripList(Long id);
/**
* 通过配送查询客户
*
* @return
*/
List<DistributionDeliveryInfoVO> selectcustomList(Long id);
/**
* 从预约客户查询包条自定义分页
* @param page
* @param distributionDeliveryInfoDTO
* @return
*/
List<DistributionDeliveryInfoVO> selectDistributionDeliverywrapInfoPage(IPage page,@Param("param") DistributionDeliveryInfoDTO distributionDeliveryInfoDTO);
/**
* 通过客户查询包条数量
* @param id
* @return
*/
Integer selectWrapCount(Long id);
}

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

@ -15,9 +15,9 @@
<result column="create_dept" property="createDept"/>
<result column="reservation_id" property="reservationId"/>
<result column="delivery_id" property="deliveryId"/>
<result column="reserve1" property="reserve1"/>
<result column="reserve2" property="reserve2"/>
<result column="reserve3" property="reserve3"/>
<result column="loaded_state" property="loadedState"/>
<result column="loaded_nub" property="loadedNub"/>
<result column="package_nub" property="packageNub"/>
<result column="reserve4" property="reserve4"/>
<result column="reserve5" property="reserve5"/>
</resultMap>
@ -31,5 +31,82 @@
<select id="exportDistributionDeliveryInfo" resultType="com.logpm.distribution.excel.DistributionDeliveryInfoExcel">
SELECT * FROM logpm_distribution_delivery_info ${ew.customSqlSegment}
</select>
<select id="selectorderIdList" resultType="java.lang.String">
select GROUP_CONCAT(order_id SEPARATOR ',') from logpm_distribution_delivery_info where is_deleted = 0 and reservation_id = #{id}
</select>
<select id="selectStripList" resultType="com.logpm.distribution.vo.DistributionDeliveryInfoVO">
SELECT
ldpl.warehouse warehouse,
ldpl.conditions conditions,
ldpl.packet_bar_code packetBarCode,
ldpl.goods_allocation goodsAllocation,
ldpl.pallet pallet,
ldpl.firsts firsts,
ldpl.second second,
ldpl.third_product thirdProduct,
ldpl.material material,
ldpl.quantity quantity,
ldpl.train_number trainNumber,
ldpl.stock_article_id stockArticleId,
lddi.loaded_state loadedState,
lddi.package_nub packageNub,
lddi.loaded_nub loadedNub
FROM
logpm_distribution_delivery_info lddi
JOIN logpm_distribution_parcel_list ldpl ON lddi.package_id = ldpl.id
<where>
lddi.is_deleted = 0 and lddi.delivery_id = #{id}
</where>
</select>
<select id="selectcustomList" resultType="com.logpm.distribution.vo.DistributionDeliveryInfoVO">
SELECT
ldr.consignee consignee,
ldr.delivery_address deliveryAddress,
ldr.delivery_phone deliveryPhone,
ldr.order_id orderIds,
COALESCE(COUNT(lddi.package_nub), 0) packageNub,
COALESCE(COUNT(lddi.loaded_nub), 0) loadedNub
FROM
logpm_distribution_delivery_info lddi
JOIN logpm_distribution_reservation ldr ON lddi.reservation_id = ldr.id
<where>
lddi.is_deleted = 0 and lddi.delivery_id = #{id}
</where>
GROUP BY lddi.reservation_id
</select>
<select id="selectDistributionDeliverywrapInfoPage" resultType="com.logpm.distribution.vo.DistributionDeliveryInfoVO">
SELECT
ldpl.warehouse warehouse,
ldpl.conditions conditions,
ldpl.packet_bar_code packetBarCode,
ldpl.goods_allocation goodsAllocation,
ldpl.pallet pallet,
ldpl.firsts firsts,
ldpl.second second,
ldpl.third_product thirdProduct,
ldpl.material material,
ldpl.quantity quantity,
ldpl.train_number trainNumber,
ldpl.stock_article_id stockArticleId,
lddi.loaded_state loadedState,
lddi.package_nub packageNub,
lddi.loaded_nub loadedNub
FROM
logpm_distribution_delivery_info lddi
JOIN logpm_distribution_parcel_list ldpl ON lddi.package_id = ldpl.id
<where>
lddi.is_deleted = 0 and lddi.reservation_id = #{param.reservationId}
</where>
</select>
<select id="selectWrapCount" resultType="java.lang.Integer">
SELECT
count(*)
FROM
logpm_distribution_delivery_info lddi
<where>
lddi.is_deleted = 0 and lddi.reservation_id = #{id}
</where>
</select>
</mapper>

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

@ -19,11 +19,14 @@
<result column="reserve4" property="reserve4"/>
<result column="reserve5" property="reserve5"/>
<result column="train_number" property="trainNumber"/>
<result column="warehouse" property="warehouse"/>
<result column="warehouse_id" property="warehouseId"/>
<result column="warehouse_name" property="warehouseName"/>
<result column="type" property="type"/>
<result column="kind" property="kind"/>
<result column="vehicle" property="vehicle"/>
<result column="driver" property="driver"/>
<result column="vehicle_name" property="vehicleName"/>
<result column="vehicle_id" property="vehicleId"/>
<result column="driver_id" property="driverId"/>
<result column="driver_name" property="driverName"/>
<result column="distribution_company" property="distributionCompany"/>
<result column="state" property="state"/>
<result column="customers_number" property="customersNumber"/>
@ -32,7 +35,8 @@
<result column="order_number" property="orderNumber"/>
<result column="delivery_number" property="deliveryNumber"/>
<result column="scanned_number" property="scannedNumber"/>
<result column="loading_team" property="loadingTeam"/>
<result column="loading_team_id" property="loadingTeamId"/>
<result column="loading_team_name" property="loadingTeamName"/>
<result column="reservation_id" property="reservationId"/>
</resultMap>

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

@ -28,7 +28,7 @@
<result column="order_source" property="orderSource"/>
<result column="stockup_status" property="stockupStatus"/>
<result column="goods_shelf_id" property="goodsAreaId"/>
<result column="reservation_id" property="reservationId"/>
<!-- <result column="reservation_id" property="reservationId"/>-->
<result column="period_of_time" property="periodOfTime"/>
<result column="reserve1" property="reserve1"/>
<result column="reserve2" property="reserve2"/>

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

@ -17,6 +17,7 @@
package com.logpm.distribution.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.logpm.distribution.dto.DistributionDeliveryInfoDTO;
import com.logpm.distribution.entity.DistributionDeliveryInfoEntity;
import com.logpm.distribution.vo.DistributionDeliveryInfoVO;
import com.logpm.distribution.excel.DistributionDeliveryInfoExcel;
@ -48,5 +49,12 @@ public interface IDistributionDeliveryInfoService extends BaseService<Distributi
* @return
*/
List<DistributionDeliveryInfoExcel> exportDistributionDeliveryInfo(Wrapper<DistributionDeliveryInfoEntity> queryWrapper);
/**
* 从预约客户查询包条自定义分页
*
* @param page
* @param distributionDeliveryInfoDTO
* @return
*/
IPage<DistributionDeliveryInfoVO> selectDistributionDeliveryInfowrapPage(IPage<DistributionDeliveryInfoVO> page, DistributionDeliveryInfoDTO distributionDeliveryInfoDTO);
}

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

@ -16,6 +16,7 @@
*/
package com.logpm.distribution.service.impl;
import com.logpm.distribution.dto.DistributionDeliveryInfoDTO;
import com.logpm.distribution.entity.DistributionDeliveryInfoEntity;
import com.logpm.distribution.vo.DistributionDeliveryInfoVO;
import com.logpm.distribution.excel.DistributionDeliveryInfoExcel;
@ -38,7 +39,8 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl<Distrib
@Override
public IPage<DistributionDeliveryInfoVO> selectDistributionDeliveryInfoPage(IPage<DistributionDeliveryInfoVO> page, DistributionDeliveryInfoVO distributionDeliveryInfo) {
return page.setRecords(baseMapper.selectDistributionDeliveryInfoPage(page, distributionDeliveryInfo));
List<DistributionDeliveryInfoVO> distributionDeliveryInfoVOS = baseMapper.selectDistributionDeliveryInfoPage(page, distributionDeliveryInfo);
return page.setRecords(distributionDeliveryInfoVOS);
}
@ -51,4 +53,10 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl<Distrib
return distributionDeliveryInfoList;
}
@Override
public IPage<DistributionDeliveryInfoVO> selectDistributionDeliveryInfowrapPage(IPage<DistributionDeliveryInfoVO> page, DistributionDeliveryInfoDTO distributionDeliveryInfoDTO) {
List<DistributionDeliveryInfoVO> distributionDeliveryInfoVOS = baseMapper.selectDistributionDeliverywrapInfoPage(page, distributionDeliveryInfoDTO);
return page.setRecords(distributionDeliveryInfoVOS);
}
}

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

@ -21,14 +21,12 @@ import com.logpm.distribution.dto.DistributionDeliveryListDTO;
import com.logpm.distribution.dto.DistributionSignforDTO;
import com.logpm.distribution.entity.*;
import com.logpm.distribution.mapper.*;
import com.logpm.distribution.vo.DistributionDeliveryListVO;
import com.logpm.distribution.vo.*;
import com.logpm.distribution.excel.DistributionDeliveryListExcel;
import com.logpm.distribution.service.IDistributionDeliveryListService;
import com.logpm.distribution.vo.DistributionPackadeliVO;
import com.logpm.distribution.vo.DistributionSignforVO;
import com.logpm.distribution.vo.DistributionstatisticsnmbVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
@ -41,6 +39,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.math.BigInteger;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@ -80,8 +79,13 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//转移数据到VO上
BeanUtils.copyProperties(detail, distributionDeliveryListVO);
//查询包条数据
List<DistributionPackadeliVO> list = distributionPackadeliMapper.selectjointList(detail.getId());
distributionDeliveryListVO.setPackadeList(list);
List<DistributionDeliveryInfoVO> stripList = distributionDeliveryInfoMapper.selectStripList(detail.getId());
//查询客户信息
List<DistributionDeliveryInfoVO> customList = distributionDeliveryInfoMapper.selectcustomList(detail.getId());
distributionDeliveryListVO.setPackadeList(stripList);
distributionDeliveryListVO.setReservationList(customList);
// List<DistributionPackadeliVO> list = distributionPackadeliMapper.selectjointList(detail.getId());
// distributionDeliveryListVO.setPackadeList(list);
return distributionDeliveryListVO;
}
@ -120,19 +124,42 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
String reservationId = distributionDeliveryList.getReservationId();
List<Long> reservationIds = Arrays.asList(Long.valueOf(String.valueOf(reservationId.split(","))));
//查询客户信息,装车情况
List<DistributionDeliveryInfoEntity> distributionDeliveryInfoEntities = distributionDeliveryInfoMapper.selectList(new QueryWrapper<DistributionDeliveryInfoEntity>().lambda()
.eq(DistributionDeliveryInfoEntity::getLoadedState, "2")
.in(null != reservationIds && reservationIds.size() > 0, DistributionDeliveryInfoEntity::getReservationId, reservationIds)
);
// List<DistributionDeliveryInfoEntity> distributionDeliveryInfoEntities = distributionDeliveryInfoMapper.selectList(new QueryWrapper<DistributionDeliveryInfoEntity>().lambda()
// .eq(DistributionDeliveryInfoEntity::getLoadedState, "2")
// .in(null != reservationIds && reservationIds.size() > 0, DistributionDeliveryInfoEntity::getReservationId, reservationIds)
// );
//统计客户的配送数量,加入签收表(通过预约单查询总数量)
List<DistributionReservationEntity> distributionReservationEntities = distributionReservationMapper.selectBatchIds(reservationIds);
DistributionSignforVO distributionSignforVO = new DistributionSignforVO();
ArrayList<DistributionSignforEntity> distributionSignforEntities = new ArrayList<DistributionSignforEntity>();
//TODO 冗余加入签收表
distributionReservationEntities.forEach(e->{
DistributionSignforEntity distributionSignforEntity = new DistributionSignforEntity();
BeanUtils.copyProperties(e,distributionSignforEntity);
distributionSignforEntity.setReservationId(e.getId());
distributionSignforEntity.setConsigneeName(e.getConsignee());
distributionSignforEntity.setWarehouseId(distributionDeliveryList.getWarehouseId());
distributionSignforEntity.setWarehouseName(distributionDeliveryList.getWarehouseName());
distributionSignforEntity.setTrainNumber(distributionDeliveryList.getTrainNumber());
//通过客户查询已经上车的订单
String orderIds = distributionDeliveryInfoMapper.selectorderIdList(e.getId());
distributionSignforEntity.setOrderId(orderIds);
//查询订单总数
Integer i = StringUtils.countMatches(e.getOrderId(), ",")+1;
distributionSignforEntity.setOrderTotal(i);
//该客户总件数
Integer i1 =distributionDeliveryInfoMapper.selectWrapCount(e.getId());
distributionSignforEntity.setTotal(i1);
//装车件数
distributionSignforEntities.add(distributionSignforEntity);
});
//插入配送管理表
//获取关联订单
String orderId = distributionDeliveryList.getOrderId();
List<Long> orderIds = Arrays.asList(Long.valueOf(String.valueOf(orderId.split(","))));
//TODO 修改配送表id
return null;
}

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

@ -205,6 +205,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
}
//修改预约备货状态
reservationEntity.setStockupStatus("2");
reservationEntity.setGoodsAreaId(goddsAreaId);
result = SqlHelper.retBool(distributionReservationMapper.updateById(reservationEntity));
//构建中间表信息
DistributionStockupInfoEntity reservationStockupEntity = new DistributionStockupInfoEntity();

14
blade-service/logpm-factory/pom.xml

@ -76,10 +76,16 @@
<artifactId>xxl-job-core</artifactId>
</dependency>
<!--mq-->
<!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-starter-amqp</artifactId>-->
<!-- </dependency>-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>logpm-distribution-api</artifactId>
<version>3.1.0.RELEASE</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>

13
blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/constant/FactoryConstant.java

@ -0,0 +1,13 @@
package com.logpm.factory.comfac.constant;
/**
* 工厂名称常量池
*
* @author zhy
*/
public class FactoryConstant {
public static final String PIANO = "皮阿诺";
public static final String MENGT = "梦天";
}

7
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/controller/FactoryAuthController.java → blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/controller/FactoryAuthController.java

@ -14,12 +14,11 @@
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.factory.snm.controller;
package com.logpm.factory.comfac.controller;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.factory.snm.dto.FactoryAccountDTO;
import com.logpm.factory.snm.service.IFactoryAuthService;
import com.logpm.factory.snm.service.IPanFactoryDataService;
import com.logpm.factory.comfac.dto.FactoryAccountDTO;
import com.logpm.factory.comfac.service.IFactoryAuthService;
import com.logpm.factory.snm.vo.FactoryTokenVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

149
blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/controller/FactoryCommonController.java

@ -0,0 +1,149 @@
package com.logpm.factory.comfac.controller;
import com.alibaba.fastjson.JSONObject;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.factory.comfac.dto.OrderInfoDTO;
import com.logpm.factory.comfac.dto.OrderStatusDTO;
import com.logpm.factory.comfac.dto.ReceiveInfoDTO;
import com.logpm.factory.comfac.service.IFactoryCommonService;
import com.logpm.factory.comfac.service.IOrderStatusLogService;
import com.logpm.factory.snm.entity.OrderStatusLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.constant.RabbitConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.utils.CommonUtil;
import org.springblade.core.tool.api.R;
import org.springframework.amqp.rabbit.connection.CorrelationData;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
@Log4j2
@RestController
@AllArgsConstructor
@RequestMapping("/factory/common")
@Api(value = "工厂通用数据", tags = "工厂通用接口")
public class FactoryCommonController {
private final RabbitTemplate rabbitTemplate;
private final IOrderStatusLogService orderStatusLogService;
private final IFactoryCommonService factoryCommonService;
@ResponseBody
@PostMapping("/sendOrders")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "订单数据推送", notes = "传入orderInfoDTO")
public R sendOrders(@Validated @RequestBody OrderInfoDTO orderInfoDTO) {
log.info("############sendOrders: 请求参数{}",orderInfoDTO);
try{
//先保存原始请求数据
OrderStatusLog orderStatusLog = new OrderStatusLog();
orderStatusLog.setArgs(JSONObject.toJSONString(orderInfoDTO));
orderStatusLog.setStatus(1);
orderStatusLog.setType(1);
orderStatusLogService.save(orderStatusLog);
Map<String,Object> map=new HashMap<>();
map.put("messageId", CommonUtil.getUUID());
map.put("logId", orderStatusLog.getId());
map.put("messageData",orderInfoDTO);
map.put("createTime",new Date().getTime());
//将消息携带绑定键值
rabbitTemplate.convertAndSend(RabbitConstant.OPEN_ORDER_EXCHANGE, RabbitConstant.OPEN_ORDER_ROUTING, map,new CorrelationData(String.valueOf(orderStatusLog.getId())));
// R r = factoryDataService.handleData(orderInfoDTO);
return R.success("调用成功");
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error("############sendOrders: 系统异常",e);
return R.fail(500,"############sendOrders: 系统异常");
}
}
@ResponseBody
@PostMapping("/sendOrderStatus")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "订单状态推送", notes = "传入orderInfoDTO")
public R sendOrderStatus(@RequestBody OrderStatusDTO orderStatusDTO) {
log.info("############sendOrderStatus: 请求参数{}",orderStatusDTO);
try{
//先保存原始请求数据
OrderStatusLog orderStatusLog = new OrderStatusLog();
orderStatusLog.setArgs(JSONObject.toJSONString(orderStatusDTO));
orderStatusLog.setStatus(1);
orderStatusLog.setType(2);
orderStatusLogService.save(orderStatusLog);
Map<String,Object> map=new HashMap<>();
map.put("messageId", CommonUtil.getUUID());
map.put("logId", orderStatusLog.getId());
map.put("type", "Push");
map.put("messageData",orderStatusDTO);
map.put("createTime",new Date().getTime());
//将消息携带绑定键值
rabbitTemplate.convertAndSend(RabbitConstant.ORDER_STATUS_EXCHANGE, RabbitConstant.ORDER_STATUS_ROUTING, map);
map.put("type", "DealWith");
rabbitTemplate.convertAndSend(RabbitConstant.DEAL_WITH_EXCHANGE, RabbitConstant.DEAL_WITH_ROUTING,map);
// R r = factoryDataService.handleStatusData(orderStatusDTO);
return R.success("调用成功");
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error("############sendOrderStatus: 系统异常",e);
return R.fail(500,"############sendOrderStatus: 系统异常");
}
}
@ResponseBody
@PostMapping("/sendReceiveInfo")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "订单状态推送", notes = "传入orderInfoDTO")
public R sendReceiveInfo(@RequestBody ReceiveInfoDTO receiveInfoDTO) {
log.info("############sendReceiveInfo: 请求参数{}", receiveInfoDTO);
//处理数据
// R r = factoryCommonService.sendReceiveInfo(receiveInfoDTO);
try{
//先保存原始请求数据
OrderStatusLog orderStatusLog = new OrderStatusLog();
orderStatusLog.setArgs(JSONObject.toJSONString(receiveInfoDTO));
orderStatusLog.setStatus(1);
orderStatusLog.setType(4);
orderStatusLogService.save(orderStatusLog);
Map<String,Object> map=new HashMap<>();
map.put("messageId", CommonUtil.getUUID());
map.put("logId", orderStatusLog.getId());
map.put("messageData",receiveInfoDTO);
map.put("createTime",new Date().getTime());
//将消息携带绑定键值
rabbitTemplate.convertAndSend(RabbitConstant.RECEIVE_INFO_EXCHANGE, RabbitConstant.RECEIVE_INFO_ROUTING, map);
return R.success("调用成功");
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error("############sendReceiveInfo: 系统异常",e);
return R.fail(500,"############sendReceiveInfo: 系统异常");
}
}
}

2
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/dto/FactoryAccountDTO.java → blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/dto/FactoryAccountDTO.java

@ -1,4 +1,4 @@
package com.logpm.factory.snm.dto;
package com.logpm.factory.comfac.dto;
import com.logpm.factory.snm.entity.FactoryAccount;
import lombok.Data;

5
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/dto/OrderInfoDTO.java → blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/dto/OrderInfoDTO.java

@ -14,12 +14,13 @@
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.factory.snm.dto;
package com.logpm.factory.comfac.dto;
import lombok.Data;
import org.springblade.core.tool.utils.StringUtil;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
/**
* PHP传过来的OrderInfo
@ -28,7 +29,7 @@ import javax.validation.constraints.NotEmpty;
* @since 2023-06-12
*/
@Data
public class OrderInfoDTO {
public class OrderInfoDTO implements Serializable {
private static final long serialVersionUID = 1L;
@NotEmpty(message = "客户订单号不能为空")

5
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/dto/OrderStatusDTO.java → blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/dto/OrderStatusDTO.java

@ -14,12 +14,13 @@
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.factory.snm.dto;
package com.logpm.factory.comfac.dto;
import lombok.Data;
import org.springblade.core.tool.utils.StringUtil;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
/**
* OrderStatus
@ -28,7 +29,7 @@ import javax.validation.constraints.NotEmpty;
* @since 2023-06-12
*/
@Data
public class OrderStatusDTO {
public class OrderStatusDTO implements Serializable {
private static final long serialVersionUID = 1L;
@NotEmpty(message = "派车单号不能为空")

19
blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/dto/ReceiveBodyDTO.java

@ -0,0 +1,19 @@
package com.logpm.factory.comfac.dto;
import lombok.Data;
import java.io.Serializable;
@Data
public class ReceiveBodyDTO implements Serializable {
private String produceOrderCode;//生产单号
private String orderCode;//订单自编码
private String unitNo;//包条码
private String operateDate;//签收时间
}

26
blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/dto/ReceiveInfoDTO.java

@ -0,0 +1,26 @@
package com.logpm.factory.comfac.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
@Data
public class ReceiveInfoDTO implements Serializable {
private String invoiceOrderCode;//发运单编号
private String sendTaskId;//送货任务ID
private String warehouse;//仓库
private String warehouseCode;//仓库编码
private String receiver;//收货人
private List<ReceiveBodyDTO> receiveBodyList = new ArrayList<>();
private List<ReceivePhotoDTO> receivePhotoList = new ArrayList<>();
}

12
blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/dto/ReceivePhotoDTO.java

@ -0,0 +1,12 @@
package com.logpm.factory.comfac.dto;
import lombok.Data;
import java.io.Serializable;
@Data
public class ReceivePhotoDTO implements Serializable {
private String url;//图片地址
}

2
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/FactoryAccountMapper.java → blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/mapper/FactoryAccountMapper.java

@ -14,7 +14,7 @@
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.factory.snm.mapper;
package com.logpm.factory.comfac.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.factory.snm.entity.FactoryAccount;

20
blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/mapper/FactoryAccountMapper.xml

@ -0,0 +1,20 @@
<?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.comfac.mapper.FactoryAccountMapper">
<!-- 通用查询映射结果 -->
<!-- <resultMap id="orderLogResultMap" type="com.logpm.factory.snm.entity.FactoryOrder">-->
<!-- <result column="id" property="id"/>-->
<!-- <result column="req_args" property="reqArgs"/>-->
<!-- <result column="res_body" property="resBody"/>-->
<!-- <result column="type" property="type"/>-->
<!-- <result column="create_user" property="createUser"/>-->
<!-- <result column="create_time" property="createTime"/>-->
<!-- <result column="update_user" property="updateUser"/>-->
<!-- <result column="update_time" property="updateTime"/>-->
<!-- <result column="status" property="status"/>-->
<!-- <result column="is_deleted" property="isDeleted"/>-->
<!-- <result column="create_dept" property="createDept"/>-->
<!-- </resultMap>-->
</mapper>

2
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/FactoryTokenMapper.java → blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/mapper/FactoryTokenMapper.java

@ -14,7 +14,7 @@
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.factory.snm.mapper;
package com.logpm.factory.comfac.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.factory.snm.entity.FactoryToken;

2
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/FactoryAccountMapper.xml → blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/mapper/FactoryTokenMapper.xml

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.logpm.factory.snm.mapper.FactoryAccountMapper">
<mapper namespace="com.logpm.factory.comfac.mapper.FactoryTokenMapper">
<!-- 通用查询映射结果 -->
<!-- <resultMap id="orderLogResultMap" type="com.logpm.factory.snm.entity.FactoryOrder">-->

6
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/PanOrderStatusLogMapper.java → blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/mapper/OrderStatusLogMapper.java

@ -14,10 +14,10 @@
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.factory.snm.mapper;
package com.logpm.factory.comfac.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.factory.snm.entity.PanOrderStatusLog;
import com.logpm.factory.snm.entity.OrderStatusLog;
/**
* 工厂推送数据接口日志 Mapper 接口
@ -25,7 +25,7 @@ import com.logpm.factory.snm.entity.PanOrderStatusLog;
* @author zhy
* @since 2023-03-28
*/
public interface PanOrderStatusLogMapper extends BaseMapper<PanOrderStatusLog> {
public interface OrderStatusLogMapper extends BaseMapper<OrderStatusLog> {
}

2
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/PanOrderStatusLogMapper.xml → blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/mapper/OrderStatusLogMapper.xml

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.logpm.factory.snm.mapper.PanOrderStatusLogMapper">
<mapper namespace="com.logpm.factory.comfac.mapper.OrderStatusLogMapper">
<!-- 通用查询映射结果 -->
<!-- <resultMap id="orderLogResultMap" type="com.logpm.factory.snm.entity.FactoryOrder">-->

4
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IAsyncDataService.java → blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/IAsyncDataService.java

@ -1,4 +1,4 @@
package com.logpm.factory.snm.service;
package com.logpm.factory.comfac.service;
public interface IAsyncDataService {
@ -6,4 +6,6 @@ public interface IAsyncDataService {
void handlerPanDataToHt();
void handlerMtDataToHt();
}

2
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IFactoryAccountService.java → blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/IFactoryAccountService.java

@ -1,4 +1,4 @@
package com.logpm.factory.snm.service;
package com.logpm.factory.comfac.service;
import com.logpm.factory.snm.entity.FactoryAccount;
import org.springblade.core.mp.base.BaseService;

2
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IFactoryAuthService.java → blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/IFactoryAuthService.java

@ -1,4 +1,4 @@
package com.logpm.factory.snm.service;
package com.logpm.factory.comfac.service;
import com.logpm.factory.snm.vo.FactoryTokenVO;

6
blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/IFactoryCommonService.java

@ -0,0 +1,6 @@
package com.logpm.factory.comfac.service;
public interface IFactoryCommonService {
}

2
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IFactoryTokenService.java → blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/IFactoryTokenService.java

@ -1,4 +1,4 @@
package com.logpm.factory.snm.service;
package com.logpm.factory.comfac.service;
import com.logpm.factory.snm.entity.FactoryToken;
import org.springblade.core.mp.base.BaseService;

8
blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/IOrderStatusLogService.java

@ -0,0 +1,8 @@
package com.logpm.factory.comfac.service;
import com.logpm.factory.snm.entity.OrderStatusLog;
import org.springblade.core.mp.base.BaseService;
public interface IOrderStatusLogService extends BaseService<OrderStatusLog> {
}

191
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/AsyncDataServiceImpl.java → blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/AsyncDataServiceImpl.java

@ -1,20 +1,25 @@
package com.logpm.factory.snm.service.impl;
package com.logpm.factory.comfac.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.logpm.factory.comfac.constant.FactoryConstant;
import com.logpm.factory.comfac.service.IAsyncDataService;
import com.logpm.factory.mt.service.IMtFactoryOrderMainService;
import com.logpm.factory.mt.service.IMtFactoryOrderService;
import com.logpm.factory.mt.service.IMtPackageInfoService;
import com.logpm.factory.pan.service.IPanFactoryOrderService;
import com.logpm.factory.pan.service.IPanPackageInfoService;
import com.logpm.factory.pan.service.IPanPackageListService;
import com.logpm.factory.snm.constant.PanFactoryEnum;
import com.logpm.factory.snm.entity.PanFactoryOrder;
import com.logpm.factory.snm.entity.PanPackageInfo;
import com.logpm.factory.snm.entity.PanPackageList;
import com.logpm.factory.snm.service.IAsyncDataService;
import com.logpm.factory.snm.service.IPanFactoryOrderService;
import com.logpm.factory.snm.service.IPanPackageInfoService;
import com.logpm.factory.snm.service.IPanPackageListService;
import com.logpm.factory.snm.entity.*;
import com.logpm.oldproject.entity.AdvanceDetailEntity;
import com.logpm.oldproject.entity.AdvanceEntity;
import com.logpm.oldproject.entity.DetailProductEntity;
import com.logpm.oldproject.entity.ServiceNumEntity;
import com.logpm.oldproject.feign.*;
import com.logpm.oldproject.feign.IAdvanceClient;
import com.logpm.oldproject.feign.IAdvanceDetailClient;
import com.logpm.oldproject.feign.IDetailProductClient;
import com.logpm.oldproject.feign.IServiceNumClient;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.core.tool.utils.StringUtil;
@ -42,6 +47,10 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
private final IPanPackageInfoService panPackageInfoService;
private final IPanPackageListService panPackageListService;
private final IMtFactoryOrderService mtFactoryOrderService;
private final IMtFactoryOrderMainService mtFactoryOrderMainService;
private final IMtPackageInfoService mtPackageInfoService;
/**
* 处理皮阿诺数据推送到汇通老库
@ -68,7 +77,7 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
advanceEntity.setArea(StringUtil.isBlank(panFactoryOrder.getReceiverArea())?"":panFactoryOrder.getReceiverArea()); // 区域
advanceEntity.setOrderTypeName(""); //订单类型名称 可以为空
advanceEntity.setOrderClassName("工厂"); //订单类型 可以为空
advanceEntity.setType("皮阿诺");
advanceEntity.setType(FactoryConstant.PIANO);
advanceEntity.setTotal(panFactoryOrder.getServiceCount()); //订单总数据
advanceEntity.setMctsTruck(StringUtil.isBlank(panFactoryOrder.getDeliveryNumber())?"":panFactoryOrder.getDeliveryNumber()); //车次
advanceEntity.setMtdsNo("");// MTDS单号 可以为空
@ -133,7 +142,7 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
advanceDetailEntity.setSerialKey("");//序列号 可以为空
advanceDetailEntity.setArea("");//区域
advanceDetailEntity.setOrderSelfNum(panFactoryOrder.getOrderNo());//订单自编号
advanceDetailEntity.setType("皮阿诺");//订单来源
advanceDetailEntity.setType(FactoryConstant.PIANO);//订单来源
advanceDetailEntity.setSystemType("线上");//订单类型
advanceDetailEntity.setOrderNum("");//MSCS单号 可以为空
advanceDetailEntity.setIsOpai(0);//是否干仓配:1=是,0=否
@ -231,4 +240,164 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
serviceNumClient.addServiceNum(serviceNumEntityList);
log.info("##############handlerDataToHt: 处理数据完成");
}
@Override
@Async
public void handlerMtDataToHt() {
log.info("################handlerMtDataToHt: 处理梦天订单数据到");
//查询需要同步的订单
QueryWrapper<MtFactoryOrder> orderQueryWrapper = new QueryWrapper<>();
orderQueryWrapper.eq("status",1)
.eq("is_deleted",0);
List<MtFactoryOrder> mtFactoryOrders = mtFactoryOrderService.list(orderQueryWrapper);
List<ServiceNumEntity> serviceNumEntityList = new ArrayList<>();
log.info("#########handlerMtDataToHt: 待处理的订单数量为{}",mtFactoryOrders.size());
for (MtFactoryOrder mtFactoryOrder:mtFactoryOrders){
Long orderId = mtFactoryOrder.getId();
Long mainId = mtFactoryOrder.getMainId();
MtFactoryOrderMain mtFactoryOrderMain = mtFactoryOrderMainService.getById(mainId);
log.info("#########handlerMtDataToHt: 当前处理的订单id={}",orderId);
//添加订单信息
AdvanceEntity advanceEntity = new AdvanceEntity();
advanceEntity.setOrderSelfNum(StringUtil.isBlank(mtFactoryOrder.getOrderCode())?"":mtFactoryOrder.getOrderCode()); //订单自编号
advanceEntity.setSiteName(""); // 基地 TODO 需要映射
advanceEntity.setArea(""); // 区域
advanceEntity.setOrderTypeName(""); //订单类型名称 可以为空
advanceEntity.setOrderClassName("工厂"); //订单类型 可以为空
advanceEntity.setType(FactoryConstant.MENGT);
advanceEntity.setTotal(Integer.parseInt(mtFactoryOrder.getQuantity())); //订单总数据
advanceEntity.setMctsTruck(""); //车次
advanceEntity.setMtdsNo("");// MTDS单号 可以为空
advanceEntity.setFirstPackName(""); //一级品类
advanceEntity.setFirstPackCode(""); //一级品类
advanceEntity.setDealerName(""); //商场名称
advanceEntity.setDealerCode(StringUtil.isBlank(mtFactoryOrder.getDealerCode())?"":mtFactoryOrder.getDealerCode()); //商场编码
advanceEntity.setDueDate(""); // 交期
advanceEntity.setIsOpai(0); //是否干仓配
advanceEntity.setOrderNum("");//MSCS订单号 可以为空
advanceEntity.setCarrierName("汇通");//承运商 可以为空
advanceEntity.setCustomerName(StringUtil.isBlank(mtFactoryOrder.getCustomName())?"":mtFactoryOrder.getCustomName()); //顾客名称
advanceEntity.setCustomerPhone(StringUtil.isBlank(mtFactoryOrder.getCustomPhone())?"":mtFactoryOrder.getCustomPhone()); // 顾客电话
advanceEntity.setCustomerRoad(StringUtil.isBlank(mtFactoryOrder.getCustomAddress())?"":mtFactoryOrder.getCustomAddress());//顾客地址
advanceEntity.setSystemType("线上"); //订单类型
advanceEntity.setStoreNo(""); //门店编码
advanceEntity.setStoreName(""); //门店名称
advanceEntity.setSerialKey(""); //序列号
advanceEntity.setServiceNum(StringUtil.isBlank(mtFactoryOrderMain.getInvoiceOrderCode())?"":mtFactoryOrderMain.getInvoiceOrderCode()); //服务号
advanceEntity.setMatingCode("");//齐套模式 可以为空
advanceEntity.setContractNum("");//合同号 可以为空
advanceEntity.setLeaveBehind("");//遗留:Y=是,N=否
advanceEntity.setSenderMobile("");//发货人电话 可以为空
advanceEntity.setSenderAddress(""); //发货地址 可以为空
advanceEntity.setSenderName(""); //发货工厂名称 可以为空
advanceEntity.setAdministratorsId(1078);// 导入人
advanceEntity.setCreateTime(LocalDate.now()); //添加时间
advanceEntity.setCarsNum(StringUtil.isBlank(mtFactoryOrderMain.getInvoiceOrderCode())?"":mtFactoryOrderMain.getInvoiceOrderCode()); //派车单--snm 可以为空
advanceEntity.setDeleteTime(0); // 删除时间
advanceEntity.setWaybillNo("");//运单号 可以为空
// Integer id = PanFactoryEnum.getId(panFactoryOrder.getPlantId());
advanceEntity.setWarehouseId(0); //导入人仓库id TODO 需要提供映射
advanceEntity.setWaybillStatus(Byte.parseByte("1"));//开单状态:1=未开单,2=已开单
advanceEntity.setOldId(0);//
advanceEntity.setFreeze(Byte.parseByte("1"));//冻结状态:1=正常,2=冻结
advanceEntity.setDeleteReason("");//删除原因
advanceEntity.setDeleteAdministratorsId(0);//删除用户
Integer advanceId = iAdvanceClient.addAdvanceClient(advanceEntity);
if(advanceId > 0){
//更改订单状态
mtFactoryOrder.setStatus(0);
mtFactoryOrderService.saveOrUpdate(mtFactoryOrder);
}else{
//修改订单状态为失败
mtFactoryOrder.setStatus(2);
mtFactoryOrderService.saveOrUpdate(mtFactoryOrder);
continue;
}
//通过订单id查询对应的包件
QueryWrapper<MtPackageInfo> packageQueryWrapper = new QueryWrapper<>();
packageQueryWrapper.eq("order_id",orderId)
.eq("is_deleted",0);
List<MtPackageInfo> packages = mtPackageInfoService.list(packageQueryWrapper);
for(MtPackageInfo mtPackageInfo:packages){
//添加订单明细
AdvanceDetailEntity advanceDetailEntity = new AdvanceDetailEntity();
advanceDetailEntity.setAdvanceId(advanceId);//预仓id
advanceDetailEntity.setIsPay(Byte.parseByte("0"));//
advanceDetailEntity.setLineID("");//线下订单明细标时 可以为空
advanceDetailEntity.setSerialKey("");//序列号 可以为空
advanceDetailEntity.setArea("");//区域
advanceDetailEntity.setOrderSelfNum(mtFactoryOrder.getOrderCode());//订单自编号
advanceDetailEntity.setType(FactoryConstant.MENGT);//订单来源
advanceDetailEntity.setSystemType("线上");//订单类型
advanceDetailEntity.setOrderNum("");//MSCS单号 可以为空
advanceDetailEntity.setIsOpai(0);//是否干仓配:1=是,0=否
advanceDetailEntity.setMtdsNo("");//MTDS单号 可以为空
advanceDetailEntity.setFirstPackName(StringUtil.isBlank(mtPackageInfo.getBigType())?"":mtPackageInfo.getBigType());//一级品类
advanceDetailEntity.setFirstPackCode(StringUtil.isBlank(mtPackageInfo.getSmallType())?"":mtPackageInfo.getSmallType());//二级品类
advanceDetailEntity.setSiteName("");//基地名称 基地 TODO 需要映射
advanceDetailEntity.setSiteCode("");//基地编码
advanceDetailEntity.setProductCode(StringUtil.isBlank(mtPackageInfo.getPackageType())?"":mtPackageInfo.getPackageType());//货品名称 可以为空
advanceDetailEntity.setSecondPackName("");//二级品类名称
advanceDetailEntity.setSecondPackCode("");//二级品类
advanceDetailEntity.setThirdPackName("");//三级品类名称
advanceDetailEntity.setThirdPackCode("");//三级品类
advanceDetailEntity.setGoodName("");//v产品类型 可以为空
advanceDetailEntity.setIsAddin("Y");//例放:N=正常,Y=例放
advanceDetailEntity.setIsThirdAddin("N");//三级例放:N=正常,Y=例放
advanceDetailEntity.setIsSuppin("N");//补进:N=正常,Y=例放
advanceDetailEntity.setMscsNum("1");//发货数量
advanceDetailEntity.setMtdsNum(0);//销售数量
advanceDetailEntity.setVolume("");//体积
advanceDetailEntity.setUnitNo(StringUtil.isBlank(mtPackageInfo.getPackageCode())?"":mtPackageInfo.getPackageCode());//包条码
advanceDetailEntity.setMctsTruck("");//车次号
advanceDetailEntity.setMctsTruckNo("");//车牌号
advanceDetailEntity.setDate100(null);//基地发货日期
advanceDetailEntity.setDate2("");//预约到厂时间
advanceDetailEntity.setDate3("");//实际到厂时间
advanceDetailEntity.setDate4("");//开始装车时间
advanceDetailEntity.setDate5("");//完成装车时间
advanceDetailEntity.setDate6("");//车辆离厂时间
advanceDetailEntity.setCreateTime(LocalDate.now());//创建时间
advanceDetailEntity.setDeleteTime(0);//删除时间
advanceDetailEntity.setServiceNum("");//服务号
advanceDetailEntity.setAdmin("");//
advanceDetailEntity.setAdministratorsId(0);//导入人
// advanceDetailEntity.setDueDate(0);//交期
advanceDetailEntity.setRemark("");//备注
advanceDetailEntity.setOldId(0);//
Integer detailId = advanceDetailClient.addAdvanceDetail(advanceDetailEntity);
if(detailId > 0){
//修改数据状态
mtPackageInfo.setStatus(0);
mtPackageInfoService.saveOrUpdate(mtPackageInfo);
}else{
mtPackageInfo.setStatus(2);
mtPackageInfoService.saveOrUpdate(mtPackageInfo);
}
}
ServiceNumEntity serviceNum = new ServiceNumEntity();
serviceNum.setServiceNum(StringUtil.isBlank(mtFactoryOrderMain.getInvoiceOrderCode())?"":mtFactoryOrderMain.getInvoiceOrderCode()); //服务号
serviceNum.setTotal("1"); //订单数量
serviceNum.setDetailTotal(Objects.isNull(mtFactoryOrder.getQuantity())?"":mtFactoryOrder.getQuantity()+""); // 包数量
serviceNum.setStoreName(StringUtil.isBlank(mtFactoryOrder.getExclusiveName())?"":mtFactoryOrder.getExclusiveName()); //商场名
serviceNum.setStoreNo(StringUtil.isBlank(mtFactoryOrder.getExclusiveCode())?"":mtFactoryOrder.getExclusiveCode()); // 商场编号
serviceNum.setCustomerName(StringUtil.isBlank(mtFactoryOrder.getCustomName())?"":mtFactoryOrder.getCustomName());//顾客姓名
serviceNum.setCustomerPhone(StringUtil.isBlank(mtFactoryOrder.getCustomPhone())?"":mtFactoryOrder.getCustomPhone()); //顾客电话
serviceNum.setCustomerRoad(StringUtil.isBlank(mtFactoryOrder.getCustomAddress())?"":mtFactoryOrder.getCustomAddress()); //顾客地址
serviceNum.setIsOpai(1); //是否干仓配
serviceNum.setCompleteSet("V"); //齐套标识:Y=齐套,N=未齐套,V=未知
// serviceNum.setCreateTime(LocalDate.now());
serviceNum.setDeleteTime(0);
serviceNumEntityList.add(serviceNum);
}
serviceNumClient.addServiceNum(serviceNumEntityList);
log.info("##############handlerMtDataToHt: 处理数据完成");
}
}

6
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/FactoryAccountServiceImpl.java → blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/FactoryAccountServiceImpl.java

@ -1,8 +1,8 @@
package com.logpm.factory.snm.service.impl;
package com.logpm.factory.comfac.service.impl;
import com.logpm.factory.snm.entity.FactoryAccount;
import com.logpm.factory.snm.mapper.FactoryAccountMapper;
import com.logpm.factory.snm.service.IFactoryAccountService;
import com.logpm.factory.comfac.mapper.FactoryAccountMapper;
import com.logpm.factory.comfac.service.IFactoryAccountService;
import lombok.AllArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

8
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/FactoryAuthServiceImpl.java → blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/FactoryAuthServiceImpl.java

@ -1,12 +1,12 @@
package com.logpm.factory.snm.service.impl;
package com.logpm.factory.comfac.service.impl;
import com.alibaba.nacos.common.utils.MD5Utils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.logpm.factory.snm.entity.FactoryAccount;
import com.logpm.factory.snm.entity.FactoryToken;
import com.logpm.factory.snm.service.IFactoryAccountService;
import com.logpm.factory.snm.service.IFactoryAuthService;
import com.logpm.factory.snm.service.IFactoryTokenService;
import com.logpm.factory.comfac.service.IFactoryAccountService;
import com.logpm.factory.comfac.service.IFactoryAuthService;
import com.logpm.factory.comfac.service.IFactoryTokenService;
import com.logpm.factory.snm.vo.FactoryTokenVO;
import lombok.AllArgsConstructor;
import org.slf4j.Logger;

18
blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/FactoryCommonServiceImpl.java

@ -0,0 +1,18 @@
package com.logpm.factory.comfac.service.impl;
import com.logpm.factory.comfac.service.IFactoryCommonService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@Slf4j
@Service
@AllArgsConstructor
public class FactoryCommonServiceImpl implements IFactoryCommonService {
}

6
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/FactoryTokenServiceImpl.java → blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/FactoryTokenServiceImpl.java

@ -1,10 +1,10 @@
package com.logpm.factory.snm.service.impl;
package com.logpm.factory.comfac.service.impl;
import com.alibaba.nacos.common.utils.MD5Utils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.logpm.factory.snm.entity.FactoryToken;
import com.logpm.factory.snm.mapper.FactoryTokenMapper;
import com.logpm.factory.snm.service.IFactoryTokenService;
import com.logpm.factory.comfac.mapper.FactoryTokenMapper;
import com.logpm.factory.comfac.service.IFactoryTokenService;
import lombok.AllArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

19
blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/OrderStatusLogServiceImpl.java

@ -0,0 +1,19 @@
package com.logpm.factory.comfac.service.impl;
import com.logpm.factory.snm.entity.OrderStatusLog;
import com.logpm.factory.comfac.mapper.OrderStatusLogMapper;
import com.logpm.factory.comfac.service.IOrderStatusLogService;
import lombok.AllArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
@AllArgsConstructor
@Service
public class OrderStatusLogServiceImpl extends BaseServiceImpl<OrderStatusLogMapper, OrderStatusLog> implements IOrderStatusLogService {
private static final Logger logger = LoggerFactory.getLogger(OrderStatusLogServiceImpl.class);
}

27
blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/utils/CommonUntis.java

@ -0,0 +1,27 @@
package com.logpm.factory.comfac.utils;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
public class CommonUntis {
public static byte[] imageUrlToByte(String url) throws IOException {
URL urlImg = new URL(url);
HttpURLConnection httpcon =(HttpURLConnection)urlImg.openConnection();
httpcon.addRequestProperty("User-Agent","Mozilla / 4.76");
InputStream is = httpcon.getInputStream();
//定义字节数组大小
byte[] buffer = new byte[1024];
ByteArrayOutputStream swapStream = new ByteArrayOutputStream();
int rc = 0;
while ((rc = is.read(buffer, 0, 100)) > 0) {
swapStream.write(buffer, 0, rc);
}
return buffer;
}
}

5
blade-service/logpm-factory/src/main/java/com/logpm/factory/config/InterceptorAdapterConfig.java

@ -1,7 +1,7 @@
package com.logpm.factory.config;
import com.logpm.factory.interceptor.FactoryAccountsInterceptor;
import com.logpm.factory.snm.service.IFactoryTokenService;
import com.logpm.factory.comfac.service.IFactoryTokenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
@ -19,7 +19,6 @@ public class InterceptorAdapterConfig implements WebMvcConfigurer {
InterceptorRegistration registry = interceptorRegistry.addInterceptor(new FactoryAccountsInterceptor(factoryTokenService));
registry.addPathPatterns("/factory/**").
excludePathPatterns("/factory/auth/token")
.excludePathPatterns("/factory/**/sendOrders")
.excludePathPatterns("/factory/**/sendOrderStatus");
.excludePathPatterns("/factory/common/**");
}
}

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

@ -1,53 +1,179 @@
package com.logpm.factory.config;
import com.alibaba.nacos.shaded.com.google.common.collect.Maps;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.RabbitConstant;
import org.springframework.amqp.core.*;
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
import org.springframework.amqp.rabbit.connection.CorrelationData;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.amqp.rabbit.retry.MessageRecoverer;
import org.springframework.amqp.rabbit.retry.RepublishMessageRecoverer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.Map;
/**
* RabbitMQ配置主要是配置队列如果提前存在该队列可以省略本配置类
*
* @author yangkai.shen
*/
//@Slf4j
//@Configuration(proxyBeanMethods = false)
@Slf4j
@Configuration
public class RabbitMqConfiguration {
// @Bean
// public RabbitTemplate rabbitTemplate() {
// CachingConnectionFactory connectionFactory = new CachingConnectionFactory();
// connectionFactory.setPublisherConfirms(true);
// connectionFactory.setPublisherReturns(true);
// RabbitTemplate rabbitTemplate = new RabbitTemplate(connectionFactory);
// rabbitTemplate.setMandatory(true);
// rabbitTemplate.setConfirmCallback((correlationData, ack, cause) -> log.info("消息发送成功:correlationData({}),ack({}),cause({})", correlationData, ack, cause));
// rabbitTemplate.setReturnCallback((message, replyCode, replyText, exchange, routingKey) -> log.info("消息丢失:exchange({}),route({}),replyCode({}),replyText({}),message:{}", exchange, routingKey, replyCode, replyText, message));
// return rabbitTemplate;
// }
@Bean
public RabbitTemplate createRabbitTemplate(ConnectionFactory connectionFactory){
RabbitTemplate template = new RabbitTemplate();
template.setConnectionFactory(connectionFactory);
template.setMandatory(true);
template.setConfirmCallback(new RabbitTemplate.ConfirmCallback() {
@Override
public void confirm(CorrelationData correlationData, boolean b, String s) {
System.out.println("确认回调-相关数据:"+correlationData);
System.out.println("确认回调-确认情况:"+b);
System.out.println("确认回调-原因:"+s);
// Long id = Long.parseLong(correlationData.getId());
// UpdateWrapper<PanOrderStatusLog> updateWrapper = new UpdateWrapper<>();
// if(b){
// //修改处理日志为已处理
// updateWrapper.set("status",0)
// .eq("id",id);
//
// }else{
// //修改处理日志为已处理
// updateWrapper.set("status",2)
// .eq("id",id);
// }
// panOrderStatusLogService.update(updateWrapper);
}
});
template.setReturnsCallback(new RabbitTemplate.ReturnsCallback() {
@Override
public void returnedMessage(ReturnedMessage returnedMessage) {
System.out.println("返回回调-消息:"+returnedMessage.getMessage());
System.out.println("返回回调-回应码:"+returnedMessage.getReplyCode());
System.out.println("返回回调-回应信息:"+returnedMessage.getReplyText());
System.out.println("返回回调-交换机:"+returnedMessage.getExchange());
System.out.println("返回回调-路由键:"+returnedMessage.getRoutingKey());
}
});
return template;
}
@Bean
public DirectExchange errorMessageExchange(){
return new DirectExchange(RabbitConstant.ERROR_EXCHANGE);
}
@Bean
public Queue errorQueue(){
return new Queue(RabbitConstant.ERROR_QUEUE, true);
}
@Bean
public Binding errorBinding(Queue errorQueue, DirectExchange errorMessageExchange){
return BindingBuilder.bind(errorQueue).to(errorMessageExchange).with(RabbitConstant.ERROR_ROUTING);
}
/**
* 消费失败队列
* @param rabbitTemplate
* @return
*/
@Bean
public MessageRecoverer republishMessageRecoverer(RabbitTemplate rabbitTemplate){
return new RepublishMessageRecoverer(rabbitTemplate, RabbitConstant.ERROR_EXCHANGE, RabbitConstant.ERROR_ROUTING);
}
/**
* 延迟队列
*/
// @Bean
// public Queue delayQueue() {
// return new Queue(RabbitConstant.DIRECT_MODE_QUEUE_ONE, true);
// }
@Bean
public Queue orderStatusQueue() {
return new Queue(RabbitConstant.ORDER_STATUS_QUEUE, true);
}
/**
* 延迟队列交换器, x-delayed-type x-delayed-message 固定
*/
// @Bean
// public CustomExchange delayExchange() {
// Map<String, Object> args = Maps.newHashMap();
// args.put("x-delayed-type", "direct");
// return new CustomExchange("TestDirectExchange", "x-delayed-message", true, false, args);
// }
@Bean
public CustomExchange orderStatusExchange() {
Map<String, Object> args = Maps.newHashMap();
args.put("x-delayed-type", "direct");
return new CustomExchange(RabbitConstant.ORDER_STATUS_EXCHANGE, "x-delayed-message", true, false, args);
}
/**
* 延迟队列绑定自定义交换器
*
* @param delayQueue 队列
* @param delayExchange 延迟交换器
* @param orderStatusQueue 队列
* @param orderStatusExchange 延迟交换器
*/
// @Bean
// public Binding delayBinding(Queue delayQueue, CustomExchange delayExchange) {
// return BindingBuilder.bind(delayQueue).to(delayExchange).with("TestDirectRouting").noargs();
// }
@Bean
public Binding orderStatusBinding(Queue orderStatusQueue, CustomExchange orderStatusExchange) {
return BindingBuilder.bind(orderStatusQueue).to(orderStatusExchange).with(RabbitConstant.ORDER_STATUS_ROUTING).noargs();
}
@Bean
DirectExchange lonelyDirectExchange() {
return new DirectExchange("lonelyDirectExchange");
}
@Bean
public Queue openOrderQueue() {
return new Queue(RabbitConstant.OPEN_ORDER_QUEUE, true);
}
@Bean
public CustomExchange openOrderExchange() {
Map<String, Object> args = Maps.newHashMap();
args.put("x-delayed-type", "direct");
return new CustomExchange(RabbitConstant.OPEN_ORDER_EXCHANGE, "x-delayed-message", true, false, args);
}
@Bean
public Binding openOrderBinding(Queue openOrderQueue, CustomExchange openOrderExchange) {
return BindingBuilder.bind(openOrderQueue).to(openOrderExchange).with(RabbitConstant.OPEN_ORDER_ROUTING).noargs();
}
@Bean
public Queue dealWithQueue() {
return new Queue(RabbitConstant.DEAL_WITH_QUEUE, true);
}
@Bean
public CustomExchange dealWithExchange() {
Map<String, Object> args = Maps.newHashMap();
args.put("x-delayed-type", "direct");
return new CustomExchange(RabbitConstant.DEAL_WITH_EXCHANGE, "x-delayed-message", true, false, args);
}
@Bean
public Binding dealWithBinding(Queue dealWithQueue, CustomExchange dealWithExchange) {
return BindingBuilder.bind(dealWithQueue).to(dealWithExchange).with(RabbitConstant.DEAL_WITH_ROUTING).noargs();
}
@Bean
public Queue receiveInfoQueue() {
return new Queue(RabbitConstant.RECEIVE_INFO_QUEUE, true);
}
@Bean
public CustomExchange receiveInfoExchange() {
Map<String, Object> args = Maps.newHashMap();
args.put("x-delayed-type", "direct");
return new CustomExchange(RabbitConstant.RECEIVE_INFO_EXCHANGE, "x-delayed-message", true, false, args);
}
@Bean
public Binding receiveInfoBinding(Queue receiveInfoQueue, CustomExchange receiveInfoExchange) {
return BindingBuilder.bind(receiveInfoQueue).to(receiveInfoExchange).with(RabbitConstant.RECEIVE_INFO_ROUTING).noargs();
}
}

2
blade-service/logpm-factory/src/main/java/com/logpm/factory/interceptor/FactoryAccountsInterceptor.java

@ -2,7 +2,7 @@ package com.logpm.factory.interceptor;
import com.alibaba.fastjson.JSONObject;
import com.logpm.factory.config.RequestWrapper;
import com.logpm.factory.snm.service.IFactoryTokenService;
import com.logpm.factory.comfac.service.IFactoryTokenService;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.exception.CustomerException;

102
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/controller/MtFactoryDataController.java

@ -0,0 +1,102 @@
/*
* 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.factory.mt.controller;
import com.alibaba.fastjson.JSONObject;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.factory.comfac.service.IAsyncDataService;
import com.logpm.factory.comfac.service.IOrderStatusLogService;
import com.logpm.factory.mt.dto.MtFactoryDataDTO;
import com.logpm.factory.mt.service.IMtFactoryDataService;
import com.logpm.factory.snm.entity.OrderStatusLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.tool.api.R;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
/**
* 梦天数据 控制器
*
* @author zhy
* @since 2023-06-06
*/
@Log4j2
@RestController
@AllArgsConstructor
@RequestMapping("/factory/mt")
@Api(value = "工厂数据", tags = "工厂数据接口")
public class MtFactoryDataController extends BladeController {
private final IOrderStatusLogService orderStatusLogService;
private final IMtFactoryDataService mtFactoryDataService;
private final IAsyncDataService asyncDataService;
/**
* 工厂数据推送接口
*/
@ResponseBody
@PostMapping("/data")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "通常数据推送", notes = "传入factoryOrderDTO")
public R data(@Validated @RequestBody MtFactoryDataDTO mtFactoryDataDTO, HttpServletRequest request) {
log.info("############data: ");
String corpId = request.getHeader("corpId");
//先保存原始请求数据
OrderStatusLog orderStatusLog = new OrderStatusLog();
orderStatusLog.setArgs(JSONObject.toJSONString(mtFactoryDataDTO));
orderStatusLog.setStatus(1);
orderStatusLog.setType(3);
orderStatusLog.setBrand("梦天");
orderStatusLogService.save(orderStatusLog);
try{
//数据存入数据库
R r = mtFactoryDataService.dealWithData(mtFactoryDataDTO);
int code = r.getCode();
if(code == 200){
orderStatusLog.setStatus(0);
//开启异步线程处理数据
asyncDataService.handlerMtDataToHt();
}else{
orderStatusLog.setStatus(2);
}
orderStatusLogService.saveOrUpdate(orderStatusLog);
return r;
}catch (CustomerException e){
orderStatusLog.setStatus(2);
orderStatusLogService.saveOrUpdate(orderStatusLog);
log.error("#################data: "+e.message);
return R.fail(e.code, e.message);
}catch (Exception e){
orderStatusLog.setStatus(2);
orderStatusLogService.saveOrUpdate(orderStatusLog);
log.error("#################data: 保存数据失败",e);
return R.fail(405, "保存数据失败");
}
}
}

18
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/dto/MtFactoryDataDTO.java

@ -0,0 +1,18 @@
package com.logpm.factory.mt.dto;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.logpm.factory.snm.entity.MtFactoryOrderMain;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.ArrayList;
import java.util.List;
@Data
@EqualsAndHashCode(callSuper = true)
public class MtFactoryDataDTO extends MtFactoryOrderMain {
@JsonProperty("发货单明细")
private List<MtFactoryOrderDTO> orderList = new ArrayList<>();
}

18
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/dto/MtFactoryOrderDTO.java

@ -0,0 +1,18 @@
package com.logpm.factory.mt.dto;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.logpm.factory.snm.entity.MtFactoryOrder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.ArrayList;
import java.util.List;
@Data
@EqualsAndHashCode(callSuper = true)
public class MtFactoryOrderDTO extends MtFactoryOrder {
@JsonProperty("包装明细")
private List<MtPackageInfoDTO> packageInfos = new ArrayList<>();
}

10
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/dto/MtPackageInfoDTO.java

@ -0,0 +1,10 @@
package com.logpm.factory.mt.dto;
import com.logpm.factory.snm.entity.MtPackageInfo;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = true)
public class MtPackageInfoDTO extends MtPackageInfo {
}

7
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/mapper/MtFactoryOrderMainMapper.java

@ -0,0 +1,7 @@
package com.logpm.factory.mt.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.factory.snm.entity.MtFactoryOrderMain;
public interface MtFactoryOrderMainMapper extends BaseMapper<MtFactoryOrderMain> {
}

20
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/mapper/MtFactoryOrderMainMapper.xml

@ -0,0 +1,20 @@
<?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.mt.mapper.MtFactoryOrderMainMapper">
<!-- 通用查询映射结果 -->
<!-- <resultMap id="orderLogResultMap" type="com.logpm.factory.snm.entity.FactoryOrder">-->
<!-- <result column="id" property="id"/>-->
<!-- <result column="req_args" property="reqArgs"/>-->
<!-- <result column="res_body" property="resBody"/>-->
<!-- <result column="type" property="type"/>-->
<!-- <result column="create_user" property="createUser"/>-->
<!-- <result column="create_time" property="createTime"/>-->
<!-- <result column="update_user" property="updateUser"/>-->
<!-- <result column="update_time" property="updateTime"/>-->
<!-- <result column="status" property="status"/>-->
<!-- <result column="is_deleted" property="isDeleted"/>-->
<!-- <result column="create_dept" property="createDept"/>-->
<!-- </resultMap>-->
</mapper>

7
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/mapper/MtFactoryOrderMapper.java

@ -0,0 +1,7 @@
package com.logpm.factory.mt.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.factory.snm.entity.MtFactoryOrder;
public interface MtFactoryOrderMapper extends BaseMapper<MtFactoryOrder> {
}

2
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/FactoryTokenMapper.xml → blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/mapper/MtFactoryOrderMapper.xml

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.logpm.factory.snm.mapper.FactoryTokenMapper">
<mapper namespace="com.logpm.factory.mt.mapper.MtFactoryOrderMapper">
<!-- 通用查询映射结果 -->
<!-- <resultMap id="orderLogResultMap" type="com.logpm.factory.snm.entity.FactoryOrder">-->

7
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/mapper/MtPackageInfoMapper.java

@ -0,0 +1,7 @@
package com.logpm.factory.mt.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.factory.snm.entity.MtPackageInfo;
public interface MtPackageInfoMapper extends BaseMapper<MtPackageInfo> {
}

21
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/IMtFactoryDataService.java

@ -0,0 +1,21 @@
package com.logpm.factory.mt.service;
import com.logpm.factory.comfac.dto.OrderInfoDTO;
import com.logpm.factory.comfac.dto.OrderStatusDTO;
import com.logpm.factory.comfac.dto.ReceiveInfoDTO;
import com.logpm.factory.mt.dto.MtFactoryDataDTO;
import org.springblade.core.tool.api.R;
/**
* 工厂推送数据接口
*/
public interface IMtFactoryDataService {
R dealWithData(MtFactoryDataDTO mtFactoryDataDTO);
R handleData(OrderInfoDTO orderInfoDTO);
R handleStatusData(OrderStatusDTO orderStatusDTO);
R sendReceiveInfo(ReceiveInfoDTO receiveInfoDTO);
}

8
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/IMtFactoryOrderMainService.java

@ -0,0 +1,8 @@
package com.logpm.factory.mt.service;
import com.logpm.factory.snm.entity.MtFactoryOrderMain;
import org.springblade.core.mp.base.BaseService;
public interface IMtFactoryOrderMainService extends BaseService<MtFactoryOrderMain> {
}

11
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/IMtFactoryOrderService.java

@ -0,0 +1,11 @@
package com.logpm.factory.mt.service;
import com.logpm.factory.snm.entity.MtFactoryOrder;
import org.springblade.core.mp.base.BaseService;
public interface IMtFactoryOrderService extends BaseService<MtFactoryOrder> {
}

7
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/IMtPackageInfoService.java

@ -0,0 +1,7 @@
package com.logpm.factory.mt.service;
import com.logpm.factory.snm.entity.MtPackageInfo;
import org.springblade.core.mp.base.BaseService;
public interface IMtPackageInfoService extends BaseService<MtPackageInfo> {
}

283
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtFactoryDataServiceImpl.java

@ -0,0 +1,283 @@
package com.logpm.factory.mt.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.nacos.shaded.com.google.gson.Gson;
import com.alibaba.nacos.shaded.com.google.gson.GsonBuilder;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.logpm.factory.comfac.dto.OrderInfoDTO;
import com.logpm.factory.comfac.dto.OrderStatusDTO;
import com.logpm.factory.comfac.dto.ReceiveBodyDTO;
import com.logpm.factory.comfac.dto.ReceiveInfoDTO;
import com.logpm.factory.mt.dto.MtFactoryDataDTO;
import com.logpm.factory.mt.dto.MtFactoryOrderDTO;
import com.logpm.factory.mt.dto.MtPackageInfoDTO;
import com.logpm.factory.mt.service.IMtFactoryDataService;
import com.logpm.factory.mt.service.IMtFactoryOrderMainService;
import com.logpm.factory.mt.service.IMtFactoryOrderService;
import com.logpm.factory.mt.service.IMtPackageInfoService;
import com.logpm.factory.snm.bean.Resp;
import com.logpm.factory.snm.entity.MtFactoryOrder;
import com.logpm.factory.snm.entity.MtFactoryOrderMain;
import com.logpm.factory.snm.entity.MtPackageInfo;
import com.logpm.oldproject.feign.IAdvanceDetailClient;
import com.logpm.oldproject.feign.IWarehouseClient;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.tool.api.R;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
@Slf4j
@Service
@AllArgsConstructor
public class MtFactoryDataServiceImpl implements IMtFactoryDataService {
private static final Logger logger = LoggerFactory.getLogger(MtFactoryDataServiceImpl.class);
private final IMtFactoryOrderMainService mtFactoryOrderMainService;
private final IMtFactoryOrderService mtFactoryOrderService;
private final IMtPackageInfoService mtPackageInfoService;
private final IAdvanceDetailClient advanceDetailClient;
private final IWarehouseClient warehouseClient;
@Transactional
@Override
public R dealWithData(MtFactoryDataDTO mtFactoryDataDTO) {
log.info("#############dealWithData: 处理梦天工厂数据 开始");
String invoiceOrderCode = mtFactoryDataDTO.getInvoiceOrderCode();//发货单编码
//先判断该发货单编码是否已经存在
QueryWrapper<MtFactoryOrderMain> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("invoice_order_code",invoiceOrderCode);
MtFactoryOrderMain mtFactoryOrderMain = mtFactoryOrderMainService.getOne(queryWrapper);
if(!Objects.isNull(mtFactoryOrderMain)){
log.warn("#############dealWithData: 数据已存在 invoiceOrderCode={}",invoiceOrderCode);
return R.fail(405,"发货单已存在");
}
mtFactoryOrderMain = new MtFactoryOrderMain();
BeanUtil.copyProperties(mtFactoryDataDTO,mtFactoryOrderMain);
boolean saveMain = mtFactoryOrderMainService.save(mtFactoryOrderMain);
if(saveMain){
Long mainId = mtFactoryOrderMain.getId();//发货单id
List<MtFactoryOrderDTO> orderList = mtFactoryDataDTO.getOrderList();//所有订单数据
for(MtFactoryOrderDTO mtFactoryOrderDTO:orderList){
String orderCode = mtFactoryOrderDTO.getOrderCode();
MtFactoryOrder mtFactoryOrder = new MtFactoryOrder();
BeanUtil.copyProperties(mtFactoryOrderDTO,mtFactoryOrder);
mtFactoryOrder.setMainId(mainId);
boolean saveOrder = mtFactoryOrderService.save(mtFactoryOrder);
if(saveOrder){
Long orderId = mtFactoryOrder.getId();
List<MtPackageInfoDTO> packageInfos = mtFactoryOrderDTO.getPackageInfos();
List<MtPackageInfo> list = new ArrayList<>();
for(MtPackageInfoDTO mtPackageInfoDTO:packageInfos){
MtPackageInfo mtPackageInfo = new MtPackageInfo();
BeanUtil.copyProperties(mtPackageInfoDTO,mtPackageInfo);
mtPackageInfo.setOrderId(orderId);
list.add(mtPackageInfo);
}
//保存包件信息
boolean b = mtPackageInfoService.saveBatch(list);
if(b){
log.info("#############dealWithData: 保存数据成功");
}else{
log.warn("#############dealWithData: 保存数据失败 orderCode={}",orderCode);
throw new CustomerException(405,"保存数据失败");
}
}else{
log.warn("#############dealWithData: 保存订单失败 orderCode={}",orderCode);
throw new CustomerException(405,"保存订单失败");
}
}
}else{
log.warn("#############dealWithData: 保存发货单失败 invoiceOrderCode={}",invoiceOrderCode);
throw new CustomerException(405,"保存发货单失败");
}
return R.success("接收成功");
}
@Override
public R handleData(OrderInfoDTO orderInfoDTO) {
String orderNo = orderInfoDTO.getOrderNo();//订单自编号
//根据客户订单号去查询WMS装车清单号
QueryWrapper<MtFactoryOrder> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("order_code",orderNo);
MtFactoryOrder mtFactoryOrder = mtFactoryOrderService.getOne(queryWrapper);
if(Objects.isNull(mtFactoryOrder)){
logger.info("#############handleData: 未找到订单数据 合同自编码orderNo={}",orderNo);
return R.fail(400,"未找到订单数据");
}
//TODO 组装数据
//判断数据是都已存在
if(!orderInfoDTO.verifyData()){
logger.info("#############handleData: 数据不齐全 orderInfoDTO={}",orderInfoDTO);
return R.fail(405,"数据不齐全");
}
//拼接参数
Map<String,Object> map = new HashMap<>();
map.put("payload", JSONObject.toJSONString(orderInfoDTO));
Gson gson = new GsonBuilder().setPrettyPrinting().create();
String s = gson.toJson(map);
//先获取token
String panToken = "getPanToken()";
//请求参数
logger.info("##############handleData: 推送包件状态请求参数 {}",s);
//处理逻辑
String result = HttpRequest.post("URL"+"/hitf/v1/rest/invoke?namespace=HZERO&serverCode=OPEN&interfaceCode=HUITONG_MID_RECEIVE")
.header("Authorization","Bearer "+panToken)
.header("Content-Type","application/json")
.body(s).timeout(5 * 1000)
.execute().body();
logger.info("##############handleData: 推送包件状态返回参数 {}",result);
//把结果字符串转为json对象
JSONObject jsonObject = JSONObject.parseObject(result);
JSONObject payload = jsonObject.getJSONObject("payload");
if(!Objects.isNull(payload)){
Integer code = payload.getInteger("code");
String message = payload.getString("data");
if(code.equals(1)){
logger.info("##########handleData: 物流状态传递成功");
}else{
return R.fail(405,message);
}
}else{
return R.fail(405,"返回格式有误:"+result);
}
return Resp.success("SUCCESS");
}
@Override
public R handleStatusData(OrderStatusDTO orderStatusDTO) throws CustomerException {
String status = orderStatusDTO.getStatus();
String orderNo = orderStatusDTO.getOrderNo();
if("1".equals(status)||"2".equals(status)||"3".equals(status)||"6".equals(status)||"7".equals(status)||"8".equals(status)||"9".equals(status)){
logger.info("#############handleStatusData: 当前数据的状态不推送 status={}",status);
return Resp.fail(400,"当前数据的状态不推送");
}
//通过包件码查询是否是要推送的订单
String unitNo = orderStatusDTO.getUnitNo();//包件码
String currentWarehouse = orderStatusDTO.getCurrentWarehouse();
QueryWrapper<MtPackageInfo> packageInfoQueryWrapper = new QueryWrapper<>();
packageInfoQueryWrapper.eq("package_code",unitNo);
MtPackageInfo one = mtPackageInfoService.getOne(packageInfoQueryWrapper);
if(Objects.isNull(one)){
logger.info("#############handleStatusData: 当前包条码未找到对应数据unitNo={}",unitNo);
return Resp.fail(400,"未找到包件数据");
}
Long orderId = one.getOrderId();
MtFactoryOrder mtFactoryOrder = mtFactoryOrderService.getById(orderId);
if(Objects.isNull(mtFactoryOrder)){
logger.info("#############handleStatusData: 未找到对应订单orderId={}",orderId);
return Resp.fail(400,"未找到对应订单");
}
Long mainId = mtFactoryOrder.getMainId();
MtFactoryOrderMain mtFactoryOrderMain = mtFactoryOrderMainService.getById(mainId);
if(Objects.isNull(mtFactoryOrderMain)){
logger.info("#############handleStatusData: 未找到对应订单mainId={}",mainId);
return Resp.fail(400,"未找到对应订单");
}
//根据仓库ID查询仓库名字
currentWarehouse = warehouseClient.selectNameById(Integer.parseInt(currentWarehouse));
//拼接参数
Map<String,Object> map = new HashMap<>();
map.put("发运单编号", mtFactoryOrderMain.getInvoiceOrderCode());
map.put("订单编号", orderNo);
map.put("包条码", unitNo);
map.put("操作时间", orderStatusDTO.getOperationTime());
map.put("仓库", currentWarehouse);
map.put("生产单号", mtFactoryOrder.getProduceOrderCode());
map.put("经销商名称", mtFactoryOrder.getDealerName());
map.put("状态", orderStatusDTO.getStatus());
Gson gson = new GsonBuilder().setPrettyPrinting().create();
String s = gson.toJson(map);
//先获取token
String panToken = "getPanToken()";
//请求参数
logger.info("##############handleStatusData: 推送包件状态请求参数 {}",s);
//处理逻辑
String result = HttpRequest.post("URL"+"/hitf/v1/rest/invoke?namespace=HZERO&serverCode=OPEN&interfaceCode=HUITONG_RECEIVE")
.header("Authorization","Bearer "+panToken)
.header("Content-Type","application/json")
.body(s).timeout(5 * 1000)
.execute().body();
logger.info("##############handleStatusData: 推送包件状态返回参数 {}",result);
//把结果字符串转为json对象
JSONObject jsonObject = JSONObject.parseObject(result);
JSONObject payload = jsonObject.getJSONObject("payload");
if(!Objects.isNull(payload)){
Integer code = payload.getInteger("code");
String message = payload.getString("data");
if(code.equals(1)){
logger.info("##########handleStatusData: 物流状态传递成功");
}else{
return Resp.fail(405,message);
}
}else{
return Resp.fail(405,"返回格式有误:"+result);
}
return Resp.success("SUCCESS");
}
@Override
public R sendReceiveInfo(ReceiveInfoDTO receiveInfoDTO) {
log.info("###########sendReceiveInfo: 处理签收图片数据开始");
List<ReceiveBodyDTO> receiveBodyList = receiveInfoDTO.getReceiveBodyList();
Long mainId = null;
for(ReceiveBodyDTO receiveBodyDTO:receiveBodyList){
String orderCode = receiveBodyDTO.getOrderCode();//订单自编号
QueryWrapper<MtFactoryOrder> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("order_code",orderCode);
MtFactoryOrder one = mtFactoryOrderService.getOne(queryWrapper);
if(Objects.isNull(one)){
log.warn("################sendReceiveInfo: 订单数据不存在 orderCode={}",orderCode);
return R.fail(400,"订单数据不存在");
}
receiveBodyDTO.setProduceOrderCode(one.getProduceOrderCode());
mainId = one.getMainId();
}
MtFactoryOrderMain mtFactoryOrderMain = mtFactoryOrderMainService.getById(mainId);
if(Objects.isNull(mtFactoryOrderMain)){
log.warn("################sendReceiveInfo: 主订单数据不存在 mainId={}",mainId);
return R.fail(400,"主订单数据不存在");
}
receiveInfoDTO.setInvoiceOrderCode(mtFactoryOrderMain.getInvoiceOrderCode());
receiveInfoDTO.setWarehouse(mtFactoryOrderMain.getCenterWarehouseName());
receiveInfoDTO.setWarehouseCode(mtFactoryOrderMain.getCenterWarehouseCode());
receiveInfoDTO.setReceiveBodyList(receiveBodyList);
//拼装参数 ,推送数据到梦天
return R.success("处理签收数据完成");
}
}

15
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtFactoryOrderMainServiceImpl.java

@ -0,0 +1,15 @@
package com.logpm.factory.mt.service.impl;
import com.logpm.factory.snm.entity.MtFactoryOrderMain;
import com.logpm.factory.mt.mapper.MtFactoryOrderMainMapper;
import com.logpm.factory.mt.service.IMtFactoryOrderMainService;
import lombok.AllArgsConstructor;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
@AllArgsConstructor
@Service
public class MtFactoryOrderMainServiceImpl extends BaseServiceImpl<MtFactoryOrderMainMapper, MtFactoryOrderMain> implements IMtFactoryOrderMainService {
}

13
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtFactoryOrderServiceImpl.java

@ -0,0 +1,13 @@
package com.logpm.factory.mt.service.impl;
import com.logpm.factory.mt.mapper.MtFactoryOrderMapper;
import com.logpm.factory.mt.service.IMtFactoryOrderService;
import com.logpm.factory.snm.entity.MtFactoryOrder;
import lombok.AllArgsConstructor;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
@AllArgsConstructor
@Service
public class MtFactoryOrderServiceImpl extends BaseServiceImpl<MtFactoryOrderMapper, MtFactoryOrder> implements IMtFactoryOrderService {
}

13
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtPackageInfoServiceImpl.java

@ -0,0 +1,13 @@
package com.logpm.factory.mt.service.impl;
import com.logpm.factory.mt.mapper.MtPackageInfoMapper;
import com.logpm.factory.mt.service.IMtPackageInfoService;
import com.logpm.factory.snm.entity.MtPackageInfo;
import lombok.AllArgsConstructor;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
@AllArgsConstructor
@Service
public class MtPackageInfoServiceImpl extends BaseServiceImpl<MtPackageInfoMapper,MtPackageInfo> implements IMtPackageInfoService {
}

103
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/controller/PanFactoryDataController.java → blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/controller/PanFactoryDataController.java

@ -14,32 +14,31 @@
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.factory.snm.controller;
package com.logpm.factory.pan.controller;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.factory.comfac.service.IAsyncDataService;
import com.logpm.factory.comfac.service.IOrderStatusLogService;
import com.logpm.factory.pan.dto.PanFactoryOrderDTO;
import com.logpm.factory.pan.service.IPanFactoryDataService;
import com.logpm.factory.pan.service.IPanFactoryOrderService;
import com.logpm.factory.pan.service.IPanPackageInfoService;
import com.logpm.factory.pan.service.IPanPackageListService;
import com.logpm.factory.snm.bean.Resp;
import com.logpm.factory.snm.dto.*;
import com.logpm.factory.snm.entity.OrderStatusLog;
import com.logpm.factory.snm.entity.PanFactoryOrder;
import com.logpm.factory.snm.entity.PanOrderStatusLog;
import com.logpm.factory.snm.entity.PanPackageInfo;
import com.logpm.factory.snm.entity.PanPackageList;
import com.logpm.factory.snm.service.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.tool.api.R;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
@ -58,9 +57,10 @@ public class PanFactoryDataController extends BladeController {
private final IPanFactoryOrderService factoryOrderService;
private final IPanPackageInfoService packageInfoService;
private final IPanPackageListService packageListService;
private final IPanFactoryDataService factoryDataService;
private final IPanFactoryDataService panFactoryDataService;
private final IAsyncDataService syncDataService;
private final IPanOrderStatusLogService panOrderStatusLogService;
private RabbitTemplate rabbitTemplate;
private final IOrderStatusLogService panOrderStatusLogService;
// @ResponseBody
// @PostMapping("/token")
@ -100,12 +100,14 @@ public class PanFactoryDataController extends BladeController {
public Resp data(@Validated @RequestBody PanFactoryOrderDTO factoryOrderDTO, HttpServletRequest request) {
log.info("############data: ");
String corpId = request.getHeader("corpId");
factoryOrderDTO.setCorpid(corpId);
//先保存原始请求数据
PanOrderStatusLog panOrderStatusLog = new PanOrderStatusLog();
OrderStatusLog panOrderStatusLog = new OrderStatusLog();
panOrderStatusLog.setArgs(JSONObject.toJSONString(factoryOrderDTO));
panOrderStatusLog.setStatus(1);
panOrderStatusLog.setType(3);
panOrderStatusLog.setBrand("皮阿诺");
panOrderStatusLogService.save(panOrderStatusLog);
//判断数据是否已存入
@ -118,81 +120,24 @@ public class PanFactoryDataController extends BladeController {
return Resp.fail(400,"订单数据已存在");
}
PanFactoryOrder factoryOrder = new PanFactoryOrder();
BeanUtil.copyProperties(factoryOrderDTO,factoryOrder);
factoryOrder.setCorpid(corpId);
//保存订单数据
factoryOrderService.save(factoryOrder);
List<PanPackageInfoDTO> packageInfos = factoryOrderDTO.getORDER_ATTRIBUTES();
for (PanPackageInfoDTO dto:packageInfos){
PanPackageInfo packageInfo = new PanPackageInfo();
BeanUtil.copyProperties(dto,packageInfo);
packageInfo.setOrderId(factoryOrder.getId());
//保存包件信息数据
//因为需要先保存包件明细需要包件的id
packageInfoService.save(packageInfo);
//再存入包件明细
List<PanPackageList> PanPackagelist = new ArrayList<>();
List<PanPackageListDTO> order_attributes_line = dto.getORDER_ATTRIBUTES_LINE();
for (PanPackageListDTO panPackageListDTO:order_attributes_line){
PanPackageList panPackageList = new PanPackageList();
BeanUtil.copyProperties(panPackageListDTO,panPackageList);
panPackageList.setPackageId(packageInfo.getId());
PanPackagelist.add(panPackageList);
}
packageListService.saveBatch(PanPackagelist);
try{
panFactoryDataService.saveData(factoryOrderDTO);
panOrderStatusLog.setStatus(0);
}catch (Exception e){
log.warn("############data: 保存数据失败 orderNo={}",orderNo);
//修改保存数据的状态
panOrderStatusLog.setStatus(2);
}
//修改保存数据的状态
panOrderStatusLog.setStatus(0);
panOrderStatusLogService.saveOrUpdate(panOrderStatusLog);
//开启异步线程处理数据
syncDataService.handlerPanDataToHt();
return Resp.successOrderNo(factoryOrder.getOrderNo(),factoryOrder.getDeliveryNumber(),"SUCCESS");
return Resp.successOrderNo(factoryOrderDTO.getOrderNo(),factoryOrderDTO.getDeliveryNumber(),"SUCCESS");
}
@ResponseBody
@PostMapping("/sendOrders")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "订单数据推送", notes = "传入orderInfoDTO")
public R sendOrders(@Validated @RequestBody OrderInfoDTO orderInfoDTO) {
log.info("############sendOrders: 请求参数{}",orderInfoDTO);
try{
R r = factoryDataService.handleData(orderInfoDTO);
return r;
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error("############sendOrders: 系统异常",e);
return R.fail(500,"############sendOrders: 系统异常");
}
}
@ResponseBody
@PostMapping("/sendOrderStatus")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "订单状态推送", notes = "传入orderInfoDTO")
public R sendOrderStatus(@RequestBody OrderStatusDTO orderStatusDTO) {
log.info("############sendOrderStatus: 请求参数{}",orderStatusDTO);
try{
R r = factoryDataService.handleStatusData(orderStatusDTO);
return r;
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error("############sendOrderStatus: 系统异常",e);
return R.fail(500,"############sendOrderStatus: 系统异常");
}
}
}

2
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/dto/PanFactoryOrderDTO.java → blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/dto/PanFactoryOrderDTO.java

@ -1,4 +1,4 @@
package com.logpm.factory.snm.dto;
package com.logpm.factory.pan.dto;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.logpm.factory.snm.entity.PanFactoryOrder;

2
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/dto/PanPackageInfoDTO.java → blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/dto/PanPackageInfoDTO.java

@ -1,4 +1,4 @@
package com.logpm.factory.snm.dto;
package com.logpm.factory.pan.dto;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.logpm.factory.snm.entity.PanPackageInfo;

2
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/dto/PanPackageListDTO.java → blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/dto/PanPackageListDTO.java

@ -1,4 +1,4 @@
package com.logpm.factory.snm.dto;
package com.logpm.factory.pan.dto;
import com.logpm.factory.snm.entity.PanPackageList;

2
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/PanFactoryOrderMapper.java → blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/mapper/PanFactoryOrderMapper.java

@ -14,7 +14,7 @@
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.factory.snm.mapper;
package com.logpm.factory.pan.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.factory.snm.entity.PanFactoryOrder;

2
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/PanFactoryOrderMapper.xml → blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/mapper/PanFactoryOrderMapper.xml

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.logpm.factory.snm.mapper.PanFactoryOrderMapper">
<mapper namespace="com.logpm.factory.pan.mapper.PanFactoryOrderMapper">
<!-- 通用查询映射结果 -->
<!-- <resultMap id="orderLogResultMap" type="com.logpm.factory.snm.entity.FactoryOrder">-->

2
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/PanPackageInfoMapper.java → blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/mapper/PanPackageInfoMapper.java

@ -14,7 +14,7 @@
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.factory.snm.mapper;
package com.logpm.factory.pan.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.factory.snm.entity.PanPackageInfo;

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save