Browse Source

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

training
汤建军 1 year ago
parent
commit
e61b74cb85
  1. 7
      blade-biz-common/src/main/java/org/springblade/common/constant/DictBizConstant.java
  2. 7
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataCategoryClient.java
  3. 5
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataClientClient.java
  4. 4
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataStorageServicesClient.java
  5. 4
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataTripartiteMallClient.java
  6. 7
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionStockArticleClient.java
  7. 8
      blade-service-api/logpm-trunkline-api/pom.xml
  8. 27
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/AdvanceDTO.java
  9. 12
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/AdvanceDetailDTO.java
  10. 12
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/DetailProductDTO.java
  11. 4
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/InComingDTO.java
  12. 73
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/OpenOrderDTO.java
  13. 21
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/WaybillDetailDTO.java
  14. 12
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/WaybillOrderDTO.java
  15. 11
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineAdvanceDetailEntity.java
  16. 8
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineAdvanceEntity.java
  17. 2
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineWaybillOrderEntity.java
  18. 57
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineWaybillTrackEntity.java
  19. 20
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/AdvanceDetailGoodsVO.java
  20. 15
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/AdvanceDetailStockNumVO.java
  21. 14
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/BillladingPackageVO.java
  22. 42
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/OpenOrderVO.java
  23. 6
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineAdvanceDetailVO.java
  24. 3
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineAdvanceVO.java
  25. 9
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineWaybillTrackVO.java
  26. 26
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseWayBillDetail.java
  27. 116
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseWaybillEntity.java
  28. 19
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataCategoryClient.java
  29. 10
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataClientClient.java
  30. 13
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataStorageServicesClient.java
  31. 5
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataTripartiteMallClient.java
  32. 1
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataTripartiteMallMapper.java
  33. 10
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataTripartiteMallMapper.xml
  34. 1
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataTripartiteMallService.java
  35. 5
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTripartiteMallServiceImpl.java
  36. 17
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java
  37. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java
  38. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml
  39. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java
  40. 14
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml
  41. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java
  42. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java
  43. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java
  44. 12
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java
  45. 22
      blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncOrderInfoServiceImpl.java
  46. 60
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/AdvanceDetailController.java
  47. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/BillladingController.java
  48. 52
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/DetailProductController.java
  49. 616
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/OpenOrderController.java
  50. 56
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/WaybillOrderController.java
  51. 17
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.java
  52. 104
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml
  53. 12
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.java
  54. 48
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.xml
  55. 6
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineWaybillOrderMapper.java
  56. 15
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineWaybillOrderMapper.xml
  57. 12
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineWaybillTrackMapper.java
  58. 6
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineWaybillTrackMapper.xml
  59. 31
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IOpenOrderService.java
  60. 18
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceDetailService.java
  61. 12
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceService.java
  62. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineBillladingWaybillService.java
  63. 5
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineDetailProductService.java
  64. 7
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineWaybillOrderService.java
  65. 7
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineWaybillTrackService.java
  66. 17
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java
  67. 745
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java
  68. 38
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java
  69. 33
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java
  70. 23
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingPackageServiceImpl.java
  71. 39
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingServiceImpl.java
  72. 8
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingWaybillServiceImpl.java
  73. 14
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineDetailProductServiceImpl.java
  74. 13
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineWaybillOrderServiceImpl.java
  75. 15
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineWaybillTrackServiceImpl.java
  76. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java

7
blade-biz-common/src/main/java/org/springblade/common/constant/DictBizConstant.java

@ -111,4 +111,11 @@ public class DictBizConstant {
//---------------2023-11-07---------------------
public static final String BILLLADING_CHARGE_TYPE = "billlading_charge_type"; //提货单计费方式
//---------------2023-11-18
public static final String OPEN_ORDER_PAY_TYPE = "open_order_pay_type";
public static final String OPEN_ORDER_PAY_WAY = "open_order_pay_way";
public static final String OPEN_ORDER_DELIVERY_WAY = "open_order_delivery_way";
public static final String OPEN_ORDER_URGENCY = "open_order_urgency";
public static final String OPEN_ORDER_RECEIPT = "open_order_receipt";
public static final String OPEN_ORDER_TRANSPORT_TYPE = "open_order_transport_type";
}

7
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataCategoryClient.java

@ -21,6 +21,8 @@ import org.springblade.common.constant.ModuleNameConstant;
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;
/**
@ -47,4 +49,9 @@ public interface IBasicdataCategoryClient {
@GetMapping(TOP)
BladePage<BasicdataCategoryEntity> top(@RequestParam("current") Integer current, @RequestParam("size") Integer size);
@GetMapping(API_PREFIX+"/findByName")
BasicdataCategoryEntity findByName(@RequestParam String goodsName);
@PostMapping(API_PREFIX+"/addReturnId")
Long addReturnId(@RequestBody BasicdataCategoryEntity basicdataCategoryEntity);
}

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

@ -22,6 +22,8 @@ import org.springblade.common.constant.ModuleNameConstant;
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;
import java.util.List;
@ -70,4 +72,7 @@ public interface IBasicdataClientClient {
@GetMapping(API_PREFIX+"/findEntityById")
BasicdataClientEntity findEntityById(@RequestParam Long id);
@PostMapping(API_PREFIX+"/addReturnId")
Long addReturnId(@RequestBody BasicdataClientEntity basicdataClientEntity);
}

4
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataStorageServicesClient.java

@ -23,6 +23,8 @@ 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接口类
*
@ -47,4 +49,6 @@ public interface IBasicdataStorageServicesClient {
@GetMapping(TOP)
BladePage<BasicdataStorageServicesEntity> top(@RequestParam("current") Integer current, @RequestParam("size") Integer size);
@GetMapping(API_PREFIX+"/findBySendWarehouseIdAndClientId")
List<BasicdataStorageServicesEntity> findBySendWarehouseIdAndClientId(@RequestParam Long warehouseId, @RequestParam Long clientId);
}

4
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataTripartiteMallClient.java

@ -47,4 +47,8 @@ public interface IBasicdataTripartiteMallClient {
@GetMapping(TOP)
BladePage<BasicdataTripartiteMallEntity> top(@RequestParam("current") Integer current, @RequestParam("size") Integer size);
@GetMapping(TOP)
Long getClientIdByNameAndBrand(@RequestParam String name, @RequestParam String brand);
}

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

@ -112,4 +112,11 @@ public interface IDistributionStockArticleClient {
*/
@PostMapping(GETSTOCKARTICLEINFO)
List<DistributionStockArticleEntity> getStockArticleInfo(@RequestBody DistributionStockArticleEntity distributionStockArticleEntity);
@GetMapping(API_PREFIX + "/updateCustomerInfoByOrderCode")
void updateCustomerInfoByOrderCode(@RequestParam String customerName, @RequestParam String customerPhone, @RequestParam String customerRoad, @RequestParam String orderCode);
@GetMapping(API_PREFIX + "/freezeByOrderCode")
void freezeByOrderCode(@RequestParam String orderCode,@RequestParam String freezeStatus);
}

8
blade-service-api/logpm-trunkline-api/pom.xml

@ -3,6 +3,14 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<dependencies>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-dict-api</artifactId>
<version>3.2.0.RELEASE</version>
<scope>compile</scope>
</dependency>
</dependencies>
<parent>
<groupId>org.springblade</groupId>

27
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/AdvanceDTO.java

@ -0,0 +1,27 @@
package com.logpm.trunkline.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
@Data
public class AdvanceDTO implements Serializable {
private Integer pageNum;
private Integer pageSize;
private Long warehouseId;
private Long advanceId;
private List<Long> advanceIds = new ArrayList<>();
private String customerName;
private String customerPhone;
private String customerRoad;
private String freezeStatus;
}

12
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/AdvanceDetailDTO.java

@ -0,0 +1,12 @@
package com.logpm.trunkline.dto;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import lombok.Data;
@Data
public class AdvanceDetailDTO extends TrunklineAdvanceDetailEntity {
private Integer pageNum;
private Integer pageSize;
}

12
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/DetailProductDTO.java

@ -0,0 +1,12 @@
package com.logpm.trunkline.dto;
import lombok.Data;
import java.io.Serializable;
@Data
public class DetailProductDTO implements Serializable {
private String orderPackageCode;
}

4
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/InComingDTO.java

@ -15,4 +15,8 @@ public class InComingDTO implements Serializable {
private Integer incomingType;//入库类型
private String trayCode;//托盘码
private String trayType;//打托方式
}

73
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/OpenOrderDTO.java

@ -0,0 +1,73 @@
package com.logpm.trunkline.dto;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
@Data
public class OpenOrderDTO implements Serializable {
private String brand;//品牌
private String customerTrain;//客户车次号
private String waybillNo;//运单号
private Long departureWarehouseId;//发站仓id
private String departureWarehouseName;//发站仓名称
private String destination;//到站
private String destinationWarehouseName;//目的仓名称
private Long destinationWarehouseId;//目的仓Id
private String goodsCode;//货号
private List<Long> advanceIds;//暂存单ids
private String orderNo;//订单号
private Long shipperId;//发货单位id
private String shipper;//发货单位
private String shipperName;//发货人
private String shipperMobile;//发货人电话
private String shipperAddress;//发货地址
private Long consigneeId;//收货单位id
private String consignee;//收货单位
private String consigneeName;//收货人
private String consigneeMobile;//收货人电话
private String consigneeAddress;//收货地址
private String goodsName;//货物名称
private List<WaybillDetailDTO> waybillDetailList = new ArrayList<>();
private Integer totalCount;
private BigDecimal totalWeghit;
private BigDecimal totalVolume;
private BigDecimal totalFreight = BigDecimal.ZERO;//运费
private BigDecimal deliveryFee = BigDecimal.ZERO;//送货费
private BigDecimal pickupFee = BigDecimal.ZERO;//提货费
private BigDecimal warehouseManagementFee = BigDecimal.ZERO;//仓库管理费
private BigDecimal storageFee = BigDecimal.ZERO;//仓储费
private BigDecimal handlingFee = BigDecimal.ZERO;//装卸费
private BigDecimal otherFee = BigDecimal.ZERO;//其他费
private BigDecimal insuranceFee = BigDecimal.ZERO;//保价费
private BigDecimal claimingValue;//申明价值
private String payType;//支付方式
private String payWay;//付款方式
private BigDecimal xPay = BigDecimal.ZERO;//现付
private BigDecimal dPay = BigDecimal.ZERO;//到付
private BigDecimal yPay = BigDecimal.ZERO;//月结
private BigDecimal hPay = BigDecimal.ZERO;//回付
private BigDecimal thirdOperationFee = BigDecimal.ZERO;//三方操作费
private String deliveryWay;//送货方式
private String urgency;//紧急度
private String receipt;//回单方式(多选)
private String transportType;//运输方式
private String remark;//备注
private Integer waybillType;
private Long warehouseId;//仓库id
}

21
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/WaybillDetailDTO.java

@ -0,0 +1,21 @@
package com.logpm.trunkline.dto;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
@Data
public class WaybillDetailDTO implements Serializable {
private Integer chargeType;//计价方式 1件 2方 3公斤
private Long goodsId;//品类id
private String goodsName;//货物名称
private Integer num;//件数
private BigDecimal weight;//重量
private BigDecimal volume;//体积
private BigDecimal price ;//单价
private BigDecimal subtotalFreight;//小计运费
}

12
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/WaybillOrderDTO.java

@ -0,0 +1,12 @@
package com.logpm.trunkline.dto;
import lombok.Data;
import java.io.Serializable;
@Data
public class WaybillOrderDTO implements Serializable {
private Long waybillId;
}

11
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineAdvanceDetailEntity.java

@ -7,6 +7,8 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.math.BigDecimal;
@Data
@TableName("logpm_trunkline_advance_detail")
@ApiModel(value = "TrunklineAdvanceDetail对象", description = "暂存单包件数据表")
@ -98,6 +100,15 @@ public class TrunklineAdvanceDetailEntity extends TenantEntity {
/** 物料名称 */
@ApiModelProperty(name = "物料名称",notes = "")
private String materialName ;
/** 重量 */
@ApiModelProperty(name = "重量",notes = "")
private BigDecimal weight ;
/** 体积 */
@ApiModelProperty(name = "体积",notes = "")
private BigDecimal volume ;
/** 计价方式 1件 2方 3公斤 */
@ApiModelProperty(name = "计价方式 1件 2方 3公斤",notes = "")
private Integer chargeType ;
}

8
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineAdvanceEntity.java

@ -7,6 +7,8 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.util.Date;
@Data
@TableName("logpm_trunkline_advance")
@ApiModel(value = "TrunklineAdvance对象", description = "暂存单数据表")
@ -112,5 +114,11 @@ public class TrunklineAdvanceEntity extends TenantEntity {
/** 冻结状态 0未冻结 1已冻结 */
@ApiModelProperty(name = "冻结状态 0未冻结 1已冻结",notes = "")
private String freezeStatus ;
/** 遗留状态 0否 1是 */
@ApiModelProperty(name = "遗留状态 0否 1是",notes = "")
private String legacyStatus ;
/** 交期 */
@ApiModelProperty(name = "交期",notes = "")
private Date deliveryDate ;
}

2
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineWaybillOrderEntity.java

@ -11,7 +11,7 @@ import org.springblade.core.tenant.mp.TenantEntity;
@TableName("logpm_trunkline_waybill_order")
@ApiModel(value = "TrunklineWaybillOrder对象", description = "运单订单关联表")
@EqualsAndHashCode(callSuper = true)
public class TrunklineWaybillOrderEntity extends TenantEntity {
public class TrunklineWaybillOrderEntity extends TenantEntity {
/** 预留1 */
@ApiModelProperty(name = "预留1",notes = "")

57
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineWaybillTrackEntity.java

@ -0,0 +1,57 @@
package com.logpm.trunkline.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
@Data
@TableName("logpm_trunkline_waybill_track")
@ApiModel(value = "TrunklineWaybillTrack对象", description = "运单跟踪记录表")
@EqualsAndHashCode(callSuper = true)
public class TrunklineWaybillTrackEntity extends TenantEntity {
/** 预留1 */
@ApiModelProperty(name = "预留1",notes = "")
private String reserve1 ;
/** 预留2 */
@ApiModelProperty(name = "预留2",notes = "")
private String reserve2 ;
/** 预留3 */
@ApiModelProperty(name = "预留3",notes = "")
private String reserve3 ;
/** 预留4 */
@ApiModelProperty(name = "预留4",notes = "")
private String reserve4 ;
/** 预留5 */
@ApiModelProperty(name = "预留5",notes = "")
private String reserve5 ;
/** 仓库id */
@ApiModelProperty(name = "仓库id",notes = "")
private Long warehouseId ;
/** 仓库名称 */
@ApiModelProperty(name = "仓库名称",notes = "")
private String warehouseName ;
/** 运单id */
@ApiModelProperty(name = "运单id",notes = "")
private Long waybillId ;
/** 运单号 */
@ApiModelProperty(name = "运单号",notes = "")
private String waybillNo ;
/** 跟踪类型 10创建运单 */
@ApiModelProperty(name = "跟踪类型 10创建运单",notes = "")
private String trackType ;
/** 描述 */
@ApiModelProperty(name = "描述",notes = "")
private String describe ;
/** 操作备注 */
@ApiModelProperty(name = "操作备注",notes = "")
private String operationRemark ;
/** 操作人名称 */
@ApiModelProperty(name = "操作人名称",notes = "")
private String createUserName ;
}

20
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/AdvanceDetailGoodsVO.java

@ -0,0 +1,20 @@
package com.logpm.trunkline.vo;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
@Data
public class AdvanceDetailGoodsVO implements Serializable {
private Integer chargeType;//计价方式 1件 2方 3公斤
private Long goodsId;//品类id
private String goodsName;//货物名称
private Integer num;//件数
private BigDecimal weight;//重量
private BigDecimal volume;//体积
private BigDecimal price = BigDecimal.ZERO;//单价
}

15
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/AdvanceDetailStockNumVO.java

@ -0,0 +1,15 @@
package com.logpm.trunkline.vo;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
@Data
public class AdvanceDetailStockNumVO implements Serializable {
private Integer stockNum = 0;
private BigDecimal stockVolume = BigDecimal.ZERO;
private BigDecimal stockWeight = BigDecimal.ZERO;
}

14
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/BillladingPackageVO.java

@ -0,0 +1,14 @@
package com.logpm.trunkline.vo;
import lombok.Data;
import java.io.Serializable;
@Data
public class BillladingPackageVO implements Serializable {
private Long billladingId;
private Integer num;
}

42
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/OpenOrderVO.java

@ -0,0 +1,42 @@
package com.logpm.trunkline.vo;
import lombok.Data;
import org.springblade.system.entity.DictBiz;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
@Data
public class OpenOrderVO implements Serializable {
private String brand;
private String trainNumber;
private String orderCode;
private List<Long> advanceIds = new ArrayList<>();
private String departureWarehouseName;//发展仓名称
private Long departureWarehouseId;//发展仓Id
private String destinationWarehouseName;//目的仓名称
private Long destinationWarehouseId;//目的仓Id
private Long consigneeClientId;//收货单位clientId
private String consignee;//收货单位
private String consigneeName;//收货人
private String consigneeMobile;//收货人电话
private String consigneeAddress;//收货单位地址
private List<AdvanceDetailGoodsVO> goodsList = new ArrayList<>();
private List<DictBiz> payTypeList;//支付方式
private List<DictBiz> payWayList;//付款方式
private List<DictBiz> deliveryWayList;//送货方式
private List<DictBiz> urgencyList;//紧急度
private List<DictBiz> receiptList;//回单方式
private List<DictBiz> transportTypeList;//运输方式
private String openOrderUserName;//开单人
}

6
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineAdvanceDetailVO.java

@ -5,4 +5,10 @@ import lombok.Data;
@Data
public class TrunklineAdvanceDetailVO extends TrunklineAdvanceDetailEntity {
private String trainNumber;
private String trayCode;
private String trayName;
}

3
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineAdvanceVO.java

@ -5,4 +5,7 @@ import lombok.Data;
@Data
public class TrunklineAdvanceVO extends TrunklineAdvanceEntity {
private String htMallName;
}

9
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineWaybillTrackVO.java

@ -0,0 +1,9 @@
package com.logpm.trunkline.vo;
import com.logpm.trunkline.entity.TrunklineWaybillTrackEntity;
import lombok.Data;
@Data
public class TrunklineWaybillTrackVO extends TrunklineWaybillTrackEntity {
}

26
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseWayBillDetail.java

@ -6,6 +6,8 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springblade.core.mp.base.BaseEntity;
import java.math.BigDecimal;
@Data
@ApiModel(value = "运单明细",description = "")
@TableName("logpm_warehouse_waybill_detail")
@ -23,8 +25,32 @@ public class WarehouseWayBillDetail extends BaseEntity {
@ApiModelProperty(name = "品名",notes = "")
private String productName;
/** 品名id */
@ApiModelProperty(name = "品名id",notes = "")
private Long productId;
/** 数量 */
@ApiModelProperty(name = "数量",notes = "")
private Integer num;
/** 体积 */
@ApiModelProperty(name = "体积",notes = "")
private BigDecimal volume;
/** 重量 */
@ApiModelProperty(name = "重量",notes = "")
private BigDecimal weight;
/** 单价 */
@ApiModelProperty(name = "单价",notes = "")
private BigDecimal price;
/** 小计运费 */
@ApiModelProperty(name = "小计运费",notes = "")
private BigDecimal subtotalFreight;
/** 计价方式 1件 2方 3公斤 */
@ApiModelProperty(name = "计价方式 1件 2方 3公斤",notes = "")
private Integer chargeType;
}

116
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseWaybillEntity.java

@ -158,12 +158,6 @@ public class WarehouseWaybillEntity extends TenantEntity {
@TableField(exist = false)
private String deliveryMethodStr;
/**
* 紧急度
*/
@ApiModelProperty(value = "紧急度")
private Integer urgency;
@TableField(exist = false)
private String urgencyStr;
@ -300,4 +294,114 @@ public class WarehouseWaybillEntity extends TenantEntity {
@ApiModelProperty(value = "金额是否收齐")
private Integer receivedStatus;//收款状态 0未签收 1已签收
//--------------2023-11-18 干线新增字段
/**
* 运费
*/
@ApiModelProperty(value = "运费")
private BigDecimal totalFreight;//运费
/**
* 送货费
*/
@ApiModelProperty(value = "送货费")
private BigDecimal deliveryFee;//送货费
/**
* 提货费
*/
@ApiModelProperty(value = "提货费")
private BigDecimal pickupFee;//提货费
/**
* 仓库管理费
*/
@ApiModelProperty(value = "仓库管理费")
private BigDecimal warehouseManagementFee;//仓库管理费
/**
* 仓储费
*/
@ApiModelProperty(value = "仓储费")
private BigDecimal storageFee;//仓储费
/**
* 装卸费
*/
@ApiModelProperty(value = "装卸费")
private BigDecimal handlingFee;//装卸费
/**
* 其他费
*/
@ApiModelProperty(value = "其他费")
private BigDecimal otherFee;//其他费
/**
* 保价费
*/
@ApiModelProperty(value = "保价费")
private BigDecimal insuranceFee;//保价费
/**
* 申明价值
*/
@ApiModelProperty(value = "申明价值")
private BigDecimal claimingValue;//申明价值
/**
* 支付方式 1现金 2银行卡 3微信 4支付宝 5支票 6账本
*/
@ApiModelProperty(value = "支付方式 1现金 2银行卡 3微信 4支付宝 5支票 6账本")
private String payType;//支付方式 1现金 2银行卡 3微信 4支付宝 5支票 6账本
/**
* 付款方式 1现付 2到付 3月结 4回付 5内部结算 6多笔付
*/
@ApiModelProperty(value = "付款方式 1现付 2到付 3月结 4回付 5内部结算 6多笔付")
private String payWay;//付款方式
/**
* 现付金额
*/
@ApiModelProperty(value = "现付金额")
private BigDecimal xPay;//现付金额
/**
* 到付
*/
@ApiModelProperty(value = "到付")
private BigDecimal dPay;//到付
/**
* 月结
*/
@ApiModelProperty(value = "月结")
private BigDecimal yPay;//月结
/**
* 回付
*/
@ApiModelProperty(value = "回付")
private BigDecimal hPay;//回付
/**
* 三方操作费
*/
@ApiModelProperty(value = "三方操作费")
private BigDecimal thirdOperationFee;//三方操作费
/**
* 送货方式 1自提 2送货 3送货上门 4送货上门(有电梯) 5送货上门(无电梯) 6送货卸货 7送货安装
*/
@ApiModelProperty(value = "送货方式 1自提 2送货 3送货上门 4送货上门(有电梯) 5送货上门(无电梯) 6送货卸货 7送货安装")
private String deliveryWay;//送货方式 1自提 2送货 3送货上门 4送货上门(有电梯) 5送货上门(无电梯) 6送货卸货 7送货安装
/**
* 紧急度 1正常 2急 3加急 4特急
*/
@ApiModelProperty(value = "紧急度 1正常 2急 3加急 4特急")
private String urgency;//紧急度 1正常 2急 3加急 4特急
/**
* 回单方式 1签回单 2签原单 3打收条 4签信封 5签回单盖章 6 1份回单 7 2份回单 8 3份回单 9 4份回单 10 5份回单
*/
@ApiModelProperty(value = "回单方式 1签回单 2签原单 3打收条 4签信封 5签回单盖章 6 1份回单 7 2份回单 8 3份回单 9 4份回单 10 5份回单")
private String receipt;//回单方式(多选)
/**
* 运输方式 1公路快运 2海运 3卡车航班 4空运 5普通汽班 6快递
*/
@ApiModelProperty(value = "运输方式 1公路快运 2海运 3卡车航班 4空运 5普通汽班 6快递")
private String transportType;//运输方式 1公路快运 2海运 3卡车航班 4空运 5普通汽班 6快递
/**
* 运单状态 0未入库 10部分入库 20已入库
*/
@ApiModelProperty(value = "运单状态")
private String waybillStatus;//运单状态 0未入库 10部分入库 20已入库
}

19
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataCategoryClient.java

@ -16,6 +16,7 @@
*/
package com.logpm.basicdata.feign;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.basicdata.entity.BasicdataCategoryEntity;
import com.logpm.basicdata.service.IBasicdataCategoryService;
@ -50,4 +51,22 @@ public class BasicdataCategoryClient implements IBasicdataCategoryClient {
return BladePage.of(page);
}
@Override
public BasicdataCategoryEntity findByName(String goodsName) {
QueryWrapper<BasicdataCategoryEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("name",goodsName)
.eq("is_deleted",0);
return basicdataCategoryService.getOne(queryWrapper);
}
@Override
public Long addReturnId(BasicdataCategoryEntity basicdataCategoryEntity) {
boolean save = basicdataCategoryService.save(basicdataCategoryEntity);
if(save){
return basicdataCategoryEntity.getId();
}else{
return null;
}
}
}

10
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataClientClient.java

@ -90,4 +90,14 @@ public class BasicdataClientClient implements IBasicdataClientClient {
return basicdataClientService.getById(id);
}
@Override
public Long addReturnId(BasicdataClientEntity basicdataClientEntity) {
boolean save = basicdataClientService.save(basicdataClientEntity);
if(save){
return basicdataClientEntity.getId();
}else{
return null;
}
}
}

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

@ -16,6 +16,7 @@
*/
package com.logpm.basicdata.feign;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.basicdata.entity.BasicdataStorageServicesEntity;
import com.logpm.basicdata.service.IBasicdataStorageServicesService;
@ -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,14 @@ public class BasicdataStorageServicesClient implements IBasicdataStorageServices
return BladePage.of(page);
}
@Override
public List<BasicdataStorageServicesEntity> findBySendWarehouseIdAndClientId(Long warehouseId, Long clientId) {
QueryWrapper<BasicdataStorageServicesEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("send_warehouse_id",warehouseId)
.eq("client_id",clientId)
.eq("is_deleted",0);
return basicdataStorageServicesService.list(queryWrapper);
}
}

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

@ -50,4 +50,9 @@ public class BasicdataTripartiteMallClient implements IBasicdataTripartiteMallCl
return BladePage.of(page);
}
@Override
public Long getClientIdByNameAndBrand(String name, String brand) {
return basicdataTripartiteMallService.getClientIdByNameAndBrand(name,brand);
}
}

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

@ -52,4 +52,5 @@ public interface BasicdataTripartiteMallMapper extends BaseMapper<BasicdataTripa
*/
List<BasicdataTripartiteMallExcel> exportBasicdataTripartiteMall(@Param("ew") Wrapper<BasicdataTripartiteMallEntity> queryWrapper);
Long getClientIdByNameAndBrand(@Param("name") String name, @Param("brand") String brand);
}

10
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataTripartiteMallMapper.xml

@ -33,4 +33,14 @@
SELECT * FROM logpm_basicdata_tripartite_mall ${ew.customSqlSegment}
</select>
<select id="getClientIdByNameAndBrand" resultType="Long">
select client_id
from logpm_basicdata_tripartite_mall
where tripartite_mall = #{name}
and brand_name = #{brand}
limit 1
</select>
</mapper>

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

@ -50,4 +50,5 @@ public interface IBasicdataTripartiteMallService extends BaseService<BasicdataTr
*/
List<BasicdataTripartiteMallExcel> exportBasicdataTripartiteMall(Wrapper<BasicdataTripartiteMallEntity> queryWrapper);
Long getClientIdByNameAndBrand(String name, String brand);
}

5
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTripartiteMallServiceImpl.java

@ -52,4 +52,9 @@ public class BasicdataTripartiteMallServiceImpl extends BaseServiceImpl<Basicdat
return basicdataTripartiteMallList;
}
@Override
public Long getClientIdByNameAndBrand(String name, String brand) {
return baseMapper.getClientIdByNameAndBrand(name,brand);
}
}

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

@ -16,7 +16,6 @@
*/
package com.logpm.distribution.feign;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
@ -211,4 +210,20 @@ public class DistributionStockArticleClient implements IDistributionStockArticle
}
@Override
public void updateCustomerInfoByOrderCode(String customerName, String customerPhone, String customerRoad, String orderCode) {
distributionStockArticleService.updateCustomerInfoByOrderCode(customerName,customerPhone,customerRoad,orderCode);
}
@Override
public void freezeByOrderCode(String orderCode,String freezeStatus) {
if("0".equals(freezeStatus)){
freezeStatus = "10";
}else if("1".equals(freezeStatus)){
freezeStatus = "20";
}
distributionStockArticleService.freezeByOrderCode(orderCode,freezeStatus);
distributionParcelListService.freezeByOrderCode(orderCode,freezeStatus);
}
}

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

@ -16,10 +16,9 @@
*/
package com.logpm.distribution.mapper;
import com.logpm.distribution.dto.DistributionParcelListDTO;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.distribution.dto.DistributionParcelListDTO;
import com.logpm.distribution.dto.app.StockupDTO;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.excel.DistributionParcelListExcel;
@ -112,4 +111,6 @@ public interface DistributionParcelListMapper extends BaseMapper<DistributionPar
List<DistributionParcelListEntity> getParcelListInfo(@Param("param")DistributionParcelListVO parcelListVO);
List<DistributionParcelListExcel> exportDistributionParcelList(@Param("paramMap")Map<String, Object> paramMap, @Param("idArr") List<String> idArr);
void freezeByOrderCode(@Param("orderCode") String orderCode,@Param("freezeStatus") String freezeStatus);
}

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

@ -831,4 +831,10 @@
</where>
</select>
<update id="freezeByOrderCode" >
update logpm_distribution_parcel_list
set order_package_freeze_status = #{freezeStatus}
where order_code = #{orderCode}
</update>
</mapper>

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java

@ -16,7 +16,6 @@
*/
package com.logpm.distribution.mapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.distribution.dto.DistributionStockArticleOweDTO;
@ -117,4 +116,8 @@ public interface DistributionStockArticleMapper extends BaseMapper<DistributionS
Map findShelfNumByOrderCodeAndWarehouseId(@Param("orderCode")String orderCode, @Param("warehouseId")Long warehouseId);
void submitHandleNumByOrderId(@Param("subNum") Integer subNum, @Param("articleId") Long articleId);
void updateCustomerInfoByOrderCode(@Param("customerName") String customerName, @Param("customerPhone") String customerPhone, @Param("customerRoad") String customerRoad, @Param("orderCode") String orderCode);
void freezeByOrderCode(@Param("orderCode") String orderCode,@Param("freezeStatus") String freezeStatus);
}

14
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml

@ -771,4 +771,18 @@
and hand_quantity - #{subNum} &gt;= 0
</update>
<update id="updateCustomerInfoByOrderCode">
update logpm_distribution_stock_article
set customer_name = #{customerName},
customer_telephone = #{customerPhone},
customer_address = #{customerRoad}
where order_code = #{orderCode}
</update>
<update id="freezeByOrderCode" >
update logpm_distribution_stock_article
set freeze_status = #{freezeStatus}
where order_code = #{orderCode}
</update>
</mapper>

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

@ -155,4 +155,7 @@ public interface IDistributionParcelListService extends BaseService<Distribution
List<DistributionParcelListEntity> getParcelListInfo(DistributionParcelListVO parcelListVO);
List<DistributionParcelListExcel> exportDistributionParcelList(Map<String, Object> paramMap);
void freezeByOrderCode(String orderCode,String freezeStatus);
}

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

@ -184,4 +184,8 @@ public interface IDistributionStockArticleService extends BaseService<Distributi
Map findShelfNumByOrderCodeAndWarehouseId(String orderCode, Long warehouseId);
void submitHandleNumByOrderId(Integer subNum, Long articleId);
void updateCustomerInfoByOrderCode(String customerName, String customerPhone, String customerRoad, String orderCode);
void freezeByOrderCode(String orderCode,String freezeStatus);
}

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

@ -594,6 +594,11 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
return list;
}
@Override
public void freezeByOrderCode(String orderCode,String freezeStatus) {
baseMapper.freezeByOrderCode(orderCode,freezeStatus);
}
/**
* @param distributionParcelList 包件信息
* @return

12
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java

@ -20,7 +20,6 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.BeanUtils;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@ -64,7 +63,6 @@ import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.constant.BladeConstant;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.ObjectUtil;
@ -1248,6 +1246,16 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
baseMapper.submitHandleNumByOrderId(subNum,articleId);
}
@Override
public void updateCustomerInfoByOrderCode(String customerName, String customerPhone, String customerRoad, String orderCode) {
baseMapper.updateCustomerInfoByOrderCode(customerName,customerPhone,customerRoad,orderCode);
}
@Override
public void freezeByOrderCode(String orderCode,String freezeStatus) {
baseMapper.freezeByOrderCode(orderCode,freezeStatus);
}
@Override
public DistributionStockArticleEntity findZeroByOrderCodeAndWarehouseId(String orderCode, Long warehouseId) {

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

@ -921,7 +921,7 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
distributionStockArticleEntity.setOrderCode(orderCode);
// 其实是客户
distributionStockArticleEntity.setMallName(advanceEntity.getDealerName());
// distributionStockArticleEntity.setMallName(advanceEntity.getDealerName());
@ -991,8 +991,8 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
distributionStockArticleEntity.setMallName(basicdataClientEntity.getClientName());
distributionStockArticleEntity.setMallCode(basicdataClientEntity.getClientCode());
distributionStockArticleEntity.setDealerCode(basicdataClientEntity.getClientCode());
distributionStockArticleEntity.setDealerName(basicdataClientEntity.getClientName());
// distributionStockArticleEntity.setDealerCode(basicdataClientEntity.getClientCode());
// distributionStockArticleEntity.setDealerName(basicdataClientEntity.getClientName());
// todo 这里需要去查询门店 和新系统的门店ID 进行绑定
@ -1152,13 +1152,15 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
entity.setAcceptWarehouseId(distributionStockArticleEntity.getAcceptWarehouseId());
//进销售
if(Objects.isNull(waybillEntity)){
entity.setDealerCode(distributionStockArticleEntity.getDealerCode());
entity.setDealerName(distributionStockArticleEntity.getDealerName());
}else{
entity.setDealerCode(distributionStockArticleEntity.getDealerCode());
entity.setDealerName(waybillEntity.getTakeCompany());
}
entity.setDealerCode(distributionStockArticleEntity.getDealerCode());
entity.setDealerName(distributionStockArticleEntity.getDealerName());
// if(Objects.isNull(waybillEntity)){
// entity.setDealerCode(distributionStockArticleEntity.getDealerCode());
// entity.setDealerName(distributionStockArticleEntity.getDealerName());
// }else{
// entity.setDealerCode(distributionStockArticleEntity.getDealerCode());
// entity.setDealerName(waybillEntity.getTakeCompany());
// }
entity.setWarehouseEntryTimeEnd(CommonUtil.StringToDate(operationTime));
// 绑定部门--仓库

60
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/AdvanceDetailController.java

@ -0,0 +1,60 @@
package com.logpm.trunkline.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.trunkline.dto.AdvanceDetailDTO;
import com.logpm.trunkline.service.ITrunklineAdvanceDetailService;
import com.logpm.trunkline.vo.TrunklineAdvanceDetailVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.*;
import java.util.Objects;
@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping("/advanceDetail")
@Api(value = "暂存单包件控制类", tags = "暂存单包件接口")
public class AdvanceDetailController {
private final IBasicdataWarehouseClient warehouseClient;
private final ITrunklineAdvanceDetailService advanceDetailService;
@ResponseBody
@PostMapping("/advanceDetailPageList")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "暂存单分页列表", notes = "传入waybillDTO")
public R advanceDetailPageList(@RequestBody AdvanceDetailDTO advanceDetailDTO) {
String method = "############advanceDetailPageList: ";
log.info(method+"请求参数{}",advanceDetailDTO);
try{
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(!Objects.isNull(myCurrentWarehouse)){
advanceDetailDTO.setWarehouseId(myCurrentWarehouse.getId());
}
IPage<TrunklineAdvanceDetailVO> pages = advanceDetailService.advanceDetailPageList(advanceDetailDTO);
return R.data(pages);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常",e);
return R.fail(500,"系统异常");
}
}
}

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/BillladingController.java

@ -167,7 +167,7 @@ public class BillladingController {
@ResponseBody
@PostMapping("/updateBilllading")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "新提货单", notes = "传入waybillDTO")
@ApiOperation(value = "新提货单", notes = "传入waybillDTO")
public R updateBilllading(@RequestBody BillladingDTO billladingDTO) {
String method = "############updateBilllading: ";
log.info(method + "请求参数{}", billladingDTO);

52
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/DetailProductController.java

@ -0,0 +1,52 @@
package com.logpm.trunkline.controller;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.trunkline.dto.DetailProductDTO;
import com.logpm.trunkline.entity.TrunklineDetailProductEntity;
import com.logpm.trunkline.service.ITrunklineDetailProductService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping("/detailProduct")
@Api(value = "包内详情控制类", tags = "包内详情接口")
public class DetailProductController {
private final ITrunklineDetailProductService detailProductService;
@ResponseBody
@PostMapping("/findListByOrderPackageCode")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "查询包内产品明细", notes = "传入detailProductDTO")
public R findListByOrderPackageCode(@RequestBody DetailProductDTO detailProductDTO) {
String method = "############findListByOrderPackageCode: ";
log.info(method+"请求参数{}",detailProductDTO);
String orderPackageCode = detailProductDTO.getOrderPackageCode();
try{
if(StringUtil.isBlank(orderPackageCode)){
log.warn(method+"包件码不能为空 orderPackageCode={}",orderPackageCode);
return R.fail(405,"包件码不能为空");
}
List<TrunklineDetailProductEntity> ls = detailProductService.findListByOrderPackageCode(orderPackageCode);
return R.data(ls);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常",e);
return R.fail(500,"系统异常");
}
}
}

616
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/OpenOrderController.java

@ -0,0 +1,616 @@
package com.logpm.trunkline.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.trunkline.dto.AdvanceDTO;
import com.logpm.trunkline.dto.OpenOrderDTO;
import com.logpm.trunkline.dto.WaybillDetailDTO;
import com.logpm.trunkline.service.IOpenOrderService;
import com.logpm.trunkline.vo.TrunklineAdvanceDetailVO;
import com.logpm.trunkline.vo.TrunklineAdvanceVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
import java.util.List;
import java.util.Objects;
@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping("/openOrder")
@Api(value = "开单控制类", tags = "开单接口")
public class OpenOrderController {
private final IBasicdataWarehouseClient warehouseClient;
private final IOpenOrderService openOrderService;
@ResponseBody
@PostMapping("/advancePageList")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "暂存单分页列表", notes = "传入waybillDTO")
public R advancePageList(@RequestBody AdvanceDTO advanceDTO) {
String method = "############advancePageList: ";
log.info(method+"请求参数{}",advanceDTO);
try{
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(403,"仓库信息为空");
}
advanceDTO.setWarehouseId(myCurrentWarehouse.getId());
IPage<TrunklineAdvanceVO> pages = openOrderService.advancePageList(advanceDTO);
return R.data(pages);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常",e);
return R.fail(500,"系统异常");
}
}
@ResponseBody
@PostMapping("/updateCustomerInfo")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "修改客户信息", notes = "传入waybillDTO")
public R updateCustomerInfo(@RequestBody AdvanceDTO advanceDTO) {
String method = "############updateCustomerInfo: ";
log.info(method+"请求参数{}",advanceDTO);
List<Long> advanceIds = advanceDTO.getAdvanceIds();
String customerName = advanceDTO.getCustomerName();
try{
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(405,"仓库信息为空");
}
advanceDTO.setWarehouseId(myCurrentWarehouse.getId());
if(advanceIds.isEmpty()){
log.warn(method+"请选择暂存单 advanceIds={}",advanceIds);
return R.fail(405,"请选择暂存单");
}
if(StringUtil.isBlank(customerName)){
log.warn(method+"客户名称不能为空 customerName={}",customerName);
return R.fail(405,"客户名称不能为空");
}
openOrderService.updateCustomerInfo(advanceDTO);
return R.success("修改成功");
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常",e);
return R.fail(500,"系统异常");
}
}
@ResponseBody
@PostMapping("/freezeByAdvanceIds")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "通过暂存单id冻结", notes = "传入waybillDTO")
public R freezeByAdvanceIds(@RequestBody AdvanceDTO advanceDTO) {
String method = "############freezeByAdvanceIds: ";
log.info(method+"请求参数{}",advanceDTO);
List<Long> advanceIds = advanceDTO.getAdvanceIds();
String freezeStatus = advanceDTO.getFreezeStatus();
try{
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(405,"仓库信息为空");
}
advanceDTO.setWarehouseId(myCurrentWarehouse.getId());
if(advanceIds.isEmpty()){
log.warn(method+"请选择暂存单 advanceIds={}",advanceIds);
return R.fail(405,"请选择暂存单");
}
if (StringUtil.isBlank(freezeStatus)){
log.warn(method+"冻结状态不能为空 freezeStatus={}",freezeStatus);
return R.fail(405,"冻结状态不能为空");
}
openOrderService.freezeByAdvanceIds(advanceDTO);
return R.success("修改成功");
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常",e);
return R.fail(500,"系统异常");
}
}
@ResponseBody
@PostMapping("/deletedAdvance")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "删除暂存单", notes = "传入waybillDTO")
public R deletedAdvance(@RequestBody AdvanceDTO advanceDTO) {
String method = "############deletedAdvance: ";
log.info(method+"请求参数{}",advanceDTO);
List<Long> advanceIds = advanceDTO.getAdvanceIds();
try{
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(405,"仓库信息为空");
}
advanceDTO.setWarehouseId(myCurrentWarehouse.getId());
if(advanceIds.isEmpty()){
log.warn(method+"请选择暂存单 advanceIds={}",advanceIds);
return R.fail(405,"请选择暂存单");
}
openOrderService.deletedAdvance(advanceDTO);
return R.success("修改成功");
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常",e);
return R.fail(500,"系统异常");
}
}
@ResponseBody
@PostMapping("/findAdvanceDetailList")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "暂存单包件列表", notes = "传入waybillDTO")
public R findAdvanceDetailList(@RequestBody AdvanceDTO advanceDTO) {
String method = "############findAdvanceDetailList: ";
log.info(method+"请求参数{}",advanceDTO);
Long advanceId = advanceDTO.getAdvanceId();
try{
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(403,"仓库信息为空");
}
advanceDTO.setWarehouseId(myCurrentWarehouse.getId());
if(Objects.isNull(advanceId)){
log.warn(method+"暂存单id为空 advanceId={}",advanceId);
return R.fail(403,"暂存单id为空");
}
List<TrunklineAdvanceDetailVO> ls = openOrderService.findAdvanceDetailList(advanceId);
return R.data(ls);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常",e);
return R.fail(500,"系统异常");
}
}
@ResponseBody
@PostMapping("/advanceToWaybillBefore")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "暂存单转运单之前验证", notes = "传入waybillDTO")
public R advanceToWaybillBefore(@RequestBody AdvanceDTO advanceDTO) {
String method = "############advanceToWaybillBefore: ";
log.info(method + "请求参数{}", advanceDTO);
List<Long> advanceIds = advanceDTO.getAdvanceIds();
try{
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(403,"仓库信息为空");
}
if(advanceIds.isEmpty()){
log.warn(method+"未选择暂存单 advanceIds={}",advanceIds);
return R.fail(403,"未选择暂存单");
}
return openOrderService.advanceToWaybillBefore(advanceIds,myCurrentWarehouse.getId());
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常",e);
return R.fail(500,"系统异常");
}
}
@ResponseBody
@PostMapping("/advanceToWaybillInfo")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "暂存单转运单", notes = "传入waybillDTO")
public R advanceToWaybillInfo(@RequestBody AdvanceDTO advanceDTO) {
String method = "############advanceToWaybillInfo: ";
log.info(method + "请求参数{}", advanceDTO);
List<Long> advanceIds = advanceDTO.getAdvanceIds();
try{
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(403,"仓库信息为空");
}
if(advanceIds.isEmpty()){
log.warn(method+"未选择暂存单 advanceIds={}",advanceIds);
return R.fail(403,"未选择暂存单");
}
return openOrderService.advanceToWaybillInfo(advanceIds,myCurrentWarehouse.getId());
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常",e);
return R.fail(500,"系统异常");
}
}
@ResponseBody
@PostMapping("/openWaybill")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "开单数据保存", notes = "传入openOrderDTO")
public R openWaybill(@RequestBody OpenOrderDTO openOrderDTO) {
String method = "############openWaybill: ";
log.info(method + "请求参数{}", openOrderDTO);
try{
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(403,"仓库信息为空");
}
openOrderDTO.setWarehouseId(myCurrentWarehouse.getId());
//验证开单参数是否正确
openOrderParamVerify(openOrderDTO);
return openOrderService.openWaybill(openOrderDTO);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常",e);
return R.fail(500,"系统异常");
}
}
@ResponseBody
@PostMapping("/openZeroWaybill")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "开零担单数据保存", notes = "传入openOrderDTO")
public R openZeroWaybill(@RequestBody OpenOrderDTO openOrderDTO) {
String method = "############openZeroWaybill: ";
log.info(method + "请求参数{}", openOrderDTO);
try{
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(403,"仓库信息为空");
}
openOrderDTO.setWarehouseId(myCurrentWarehouse.getId());
//验证开单参数是否正确
openZeroOrderParamVerify(openOrderDTO);
return openOrderService.openZeroWaybill(openOrderDTO);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常",e);
return R.fail(500,"系统异常");
}
}
private void openZeroOrderParamVerify(OpenOrderDTO openOrderDTO) {
log.info("#################openZeroOrderParamVerify: 验证开零担单参数开始");
Long departureWarehouseId = openOrderDTO.getDepartureWarehouseId();
String departureWarehouseName = openOrderDTO.getDepartureWarehouseName();
if(Objects.isNull(departureWarehouseId) && StringUtil.isBlank(departureWarehouseName)){
log.warn("#################openZeroOrderParamVerify: 发站仓不能为空 departureWarehouseId={} departureWarehouseName={}",departureWarehouseId,departureWarehouseName);
throw new CustomerException(405,"发站仓不能为空");
}
Long warehouseId = openOrderDTO.getWarehouseId();
if(!departureWarehouseId.equals(warehouseId)){
log.warn("#################openZeroOrderParamVerify: 发站仓不属于当前仓 departureWarehouseId={} warehouseId={}",departureWarehouseId,warehouseId);
throw new CustomerException(405,"发站仓不属于当前仓");
}
Long destinationWarehouseId = openOrderDTO.getDestinationWarehouseId();
String destinationWarehouseName = openOrderDTO.getDestinationWarehouseName();
if(Objects.isNull(destinationWarehouseId) && StringUtil.isBlank(destinationWarehouseName)){
log.warn("#################openZeroOrderParamVerify: 目的仓不能为空 destinationWarehouseId={} destinationWarehouseName={}",destinationWarehouseId,destinationWarehouseName);
throw new CustomerException(405,"目的仓不能为空");
}
String destination = openOrderDTO.getDestination();
if(StringUtil.isBlank(destination)){
log.warn("#################openZeroOrderParamVerify: 到站不能为空 destination={} ",destination);
throw new CustomerException(405,"到站不能为空");
}
String shipper = openOrderDTO.getShipper();
if(StringUtil.isBlank(shipper)){
log.warn("#################openZeroOrderParamVerify: 发货单位不能为空 shipper={} ",shipper);
throw new CustomerException(405,"发货单位不能为空");
}
String consignee = openOrderDTO.getConsignee();
if(StringUtil.isBlank(consignee)){
log.warn("#################openZeroOrderParamVerify: 收货单位不能为空 consignee={} ",consignee);
throw new CustomerException(405,"收货单位不能为空");
}
Integer waybillType = openOrderDTO.getWaybillType();
if(Objects.isNull(waybillType)){
log.warn("#################openZeroOrderParamVerify: 运单类型不能为空 waybillType={} ",waybillType);
throw new CustomerException(405,"运单类型不能为空");
}
List<WaybillDetailDTO> waybillDetailList = openOrderDTO.getWaybillDetailList();
for(WaybillDetailDTO waybillDetailDTO:waybillDetailList){
String goodsName = waybillDetailDTO.getGoodsName();
if(StringUtil.isBlank(goodsName)){
log.warn("#################openZeroOrderParamVerify: 货物名称不能为空 goodsName={} ",goodsName);
throw new CustomerException(405,"货物名称不能为空");
}
Integer chargeType = waybillDetailDTO.getChargeType();//1件 2方 3公斤
Integer num = waybillDetailDTO.getNum();
BigDecimal weight = waybillDetailDTO.getWeight();
BigDecimal volume = waybillDetailDTO.getVolume();
if(1 == chargeType){
if(num <= 0){
log.warn("#################openZeroOrderParamVerify: 货物数量不正确 num={} ",num);
throw new CustomerException(405,"货物数量不正确");
}
}else if(2 == chargeType){
if(volume.compareTo(BigDecimal.ZERO) <= 0){
log.warn("#################openZeroOrderParamVerify: 货物体积不正确 volume={} ",volume);
throw new CustomerException(405,"货物体积不正确");
}
}else if(3 == chargeType){
if(weight.compareTo(BigDecimal.ZERO) <= 0){
log.warn("#################openZeroOrderParamVerify: 货物重量不正确 weight={} ",weight);
throw new CustomerException(405,"货物重量不正确");
}
}
BigDecimal price = waybillDetailDTO.getPrice();
if(price.compareTo(BigDecimal.ZERO) <= 0){
log.warn("#################openZeroOrderParamVerify: 货物单价不正确 price={} ",price);
throw new CustomerException(405,"货物单价不正确");
}
BigDecimal subtotalFreight = waybillDetailDTO.getSubtotalFreight();
if(subtotalFreight.compareTo(BigDecimal.ZERO) <= 0){
log.warn("#################openZeroOrderParamVerify: 货物运费小计不正确 subtotalFreight={} ",subtotalFreight);
throw new CustomerException(405,"货物运费小计不正确");
}
}
BigDecimal totalFreight = openOrderDTO.getTotalFreight();
if(totalFreight.compareTo(BigDecimal.ZERO) <= 0){
log.warn("#################openZeroOrderParamVerify: 运费不正确 totalFreight={} ",totalFreight);
throw new CustomerException(405,"运费不正确");
}
String payWay = openOrderDTO.getPayWay();
if(StringUtil.isBlank(payWay)){
log.warn("#################openZeroOrderParamVerify: 付款方式不能为空 payWay={} ",payWay);
throw new CustomerException(405,"付款方式不能为空");
}
BigDecimal xPay = openOrderDTO.getXPay();
BigDecimal dPay = openOrderDTO.getDPay();
BigDecimal yPay = openOrderDTO.getYPay();
BigDecimal hPay = openOrderDTO.getHPay();
if("1".equals(payWay)){
if(xPay.compareTo(BigDecimal.ZERO) <= 0){
log.warn("#################openZeroOrderParamVerify: 现付运费不正确 xPay={} ",xPay);
throw new CustomerException(405,"现付运费不正确");
}
}else if("2".equals(payWay)){
if(dPay.compareTo(BigDecimal.ZERO) <= 0){
log.warn("#################openZeroOrderParamVerify: 到付运费不正确 dPay={} ",dPay);
throw new CustomerException(405,"到付运费不正确");
}
}else if("3".equals(payWay)){
if(yPay.compareTo(BigDecimal.ZERO) <= 0){
log.warn("#################openZeroOrderParamVerify: 月结运费不正确 yPay={} ",yPay);
throw new CustomerException(405,"月结运费不正确");
}
}else if("4".equals(payWay)){
if(hPay.compareTo(BigDecimal.ZERO) <= 0){
log.warn("#################openZeroOrderParamVerify: 回付运费不正确 hPay={} ",hPay);
throw new CustomerException(405,"回付运费不正确");
}
}
}
private void openOrderParamVerify(OpenOrderDTO openOrderDTO) {
log.info("#################openOrderParamVerify: 验证开单参数开始");
String brand = openOrderDTO.getBrand();
if(StringUtil.isBlank(brand)){
log.warn("#################openOrderParamVerify: 品牌不能为空 brand={}",brand);
throw new CustomerException(405,"品牌不能为空");
}
Long departureWarehouseId = openOrderDTO.getDepartureWarehouseId();
String departureWarehouseName = openOrderDTO.getDepartureWarehouseName();
if(Objects.isNull(departureWarehouseId) && StringUtil.isBlank(departureWarehouseName)){
log.warn("#################openOrderParamVerify: 发站仓不能为空 departureWarehouseId={} departureWarehouseName={}",departureWarehouseId,departureWarehouseName);
throw new CustomerException(405,"发站仓不能为空");
}
Long warehouseId = openOrderDTO.getWarehouseId();
if(!departureWarehouseId.equals(warehouseId)){
log.warn("#################openOrderParamVerify: 发站仓不属于当前仓 departureWarehouseId={} warehouseId={}",departureWarehouseId,warehouseId);
throw new CustomerException(405,"发站仓不属于当前仓");
}
Long destinationWarehouseId = openOrderDTO.getDestinationWarehouseId();
String destinationWarehouseName = openOrderDTO.getDestinationWarehouseName();
if(Objects.isNull(destinationWarehouseId) && StringUtil.isBlank(destinationWarehouseName)){
log.warn("#################openOrderParamVerify: 目的仓不能为空 destinationWarehouseId={} destinationWarehouseName={}",destinationWarehouseId,destinationWarehouseName);
throw new CustomerException(405,"目的仓不能为空");
}
String destination = openOrderDTO.getDestination();
if(StringUtil.isBlank(destination)){
log.warn("#################openOrderParamVerify: 到站不能为空 destination={} ",destination);
throw new CustomerException(405,"到站不能为空");
}
String orderNo = openOrderDTO.getOrderNo();
if(StringUtil.isBlank(orderNo)){
log.warn("#################openOrderParamVerify: 订单号不能为空 orderNo={} ",orderNo);
throw new CustomerException(405,"订单号不能为空");
}
List<Long> advanceIds = openOrderDTO.getAdvanceIds();
if(advanceIds.isEmpty()){
log.warn("#################openOrderParamVerify: 订单号不能为空 advanceIds={} ",advanceIds);
throw new CustomerException(405,"订单号不能为空");
}
String shipper = openOrderDTO.getShipper();
if(StringUtil.isBlank(shipper)){
log.warn("#################openOrderParamVerify: 发货单位不能为空 shipper={} ",shipper);
throw new CustomerException(405,"发货单位不能为空");
}
String consignee = openOrderDTO.getConsignee();
if(StringUtil.isBlank(consignee)){
log.warn("#################openOrderParamVerify: 收货单位不能为空 consignee={} ",consignee);
throw new CustomerException(405,"收货单位不能为空");
}
Integer waybillType = openOrderDTO.getWaybillType();
if(Objects.isNull(waybillType)){
log.warn("#################openOrderParamVerify: 运单类型不能为空 waybillType={} ",waybillType);
throw new CustomerException(405,"运单类型不能为空");
}
List<WaybillDetailDTO> waybillDetailList = openOrderDTO.getWaybillDetailList();
for(WaybillDetailDTO waybillDetailDTO:waybillDetailList){
String goodsName = waybillDetailDTO.getGoodsName();
if(StringUtil.isBlank(goodsName)){
log.warn("#################openOrderParamVerify: 货物名称不能为空 goodsName={} ",goodsName);
throw new CustomerException(405,"货物名称不能为空");
}
Integer chargeType = waybillDetailDTO.getChargeType();//1件 2方 3公斤
Integer num = waybillDetailDTO.getNum();
BigDecimal weight = waybillDetailDTO.getWeight();
BigDecimal volume = waybillDetailDTO.getVolume();
if(1 == chargeType){
if(num <= 0){
log.warn("#################openOrderParamVerify: 货物数量不正确 num={} ",num);
throw new CustomerException(405,"货物数量不正确");
}
}else if(2 == chargeType){
if(volume.compareTo(BigDecimal.ZERO) <= 0){
log.warn("#################openOrderParamVerify: 货物体积不正确 volume={} ",volume);
throw new CustomerException(405,"货物体积不正确");
}
}else if(3 == chargeType){
if(weight.compareTo(BigDecimal.ZERO) <= 0){
log.warn("#################openOrderParamVerify: 货物重量不正确 weight={} ",weight);
throw new CustomerException(405,"货物重量不正确");
}
}
BigDecimal price = waybillDetailDTO.getPrice();
if(price.compareTo(BigDecimal.ZERO) <= 0){
log.warn("#################openOrderParamVerify: 货物单价不正确 price={} ",price);
throw new CustomerException(405,"货物单价不正确");
}
BigDecimal subtotalFreight = waybillDetailDTO.getSubtotalFreight();
if(subtotalFreight.compareTo(BigDecimal.ZERO) <= 0){
log.warn("#################openOrderParamVerify: 货物运费小计不正确 subtotalFreight={} ",subtotalFreight);
throw new CustomerException(405,"货物运费小计不正确");
}
}
BigDecimal totalFreight = openOrderDTO.getTotalFreight();
if(totalFreight.compareTo(BigDecimal.ZERO) <= 0){
log.warn("#################openOrderParamVerify: 运费不正确 totalFreight={} ",totalFreight);
throw new CustomerException(405,"运费不正确");
}
String payWay = openOrderDTO.getPayWay();
if(StringUtil.isBlank(payWay)){
log.warn("#################openOrderParamVerify: 付款方式不能为空 payWay={} ",payWay);
throw new CustomerException(405,"付款方式不能为空");
}
BigDecimal xPay = openOrderDTO.getXPay();
BigDecimal dPay = openOrderDTO.getDPay();
BigDecimal yPay = openOrderDTO.getYPay();
BigDecimal hPay = openOrderDTO.getHPay();
if("1".equals(payWay)){
if(xPay.compareTo(BigDecimal.ZERO) <= 0){
log.warn("#################openOrderParamVerify: 现付运费不正确 xPay={} ",xPay);
throw new CustomerException(405,"现付运费不正确");
}
}else if("2".equals(payWay)){
if(dPay.compareTo(BigDecimal.ZERO) <= 0){
log.warn("#################openOrderParamVerify: 到付运费不正确 dPay={} ",dPay);
throw new CustomerException(405,"到付运费不正确");
}
}else if("3".equals(payWay)){
if(yPay.compareTo(BigDecimal.ZERO) <= 0){
log.warn("#################openOrderParamVerify: 月结运费不正确 yPay={} ",yPay);
throw new CustomerException(405,"月结运费不正确");
}
}else if("4".equals(payWay)){
if(hPay.compareTo(BigDecimal.ZERO) <= 0){
log.warn("#################openOrderParamVerify: 回付运费不正确 hPay={} ",hPay);
throw new CustomerException(405,"回付运费不正确");
}
}
}
}

56
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/WaybillOrderController.java

@ -0,0 +1,56 @@
package com.logpm.trunkline.controller;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.trunkline.dto.WaybillOrderDTO;
import com.logpm.trunkline.entity.TrunklineAdvanceEntity;
import com.logpm.trunkline.service.ITrunklineWaybillOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Objects;
@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping("/waybillOrder")
@Api(value = "运单订单控制类", tags = "运单订单接口")
public class WaybillOrderController {
private final ITrunklineWaybillOrderService waybillOrderService;
@ResponseBody
@PostMapping("/findListByWaybillId")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "暂存单分页列表", notes = "传入waybillOrderDTO")
public R findListByWaybillId(@RequestBody WaybillOrderDTO waybillOrderDTO) {
String method = "############findListByWaybillId: ";
log.info(method+"请求参数{}",waybillOrderDTO);
Long waybillId = waybillOrderDTO.getWaybillId();
try{
if(Objects.isNull(waybillId)){
log.warn(method+"运单不能为空 waybillId={}",waybillId);
return R.fail(405,"运单不能为空");
}
List<TrunklineAdvanceEntity> ls = waybillOrderService.findListByWaybillId(waybillId);
return R.data(ls);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常",e);
return R.fail(500,"系统异常");
}
}
}

17
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.java

@ -1,13 +1,30 @@
package com.logpm.trunkline.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.trunkline.dto.AdvanceDetailDTO;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.vo.AdvanceDetailGoodsVO;
import com.logpm.trunkline.vo.AdvanceDetailStockNumVO;
import com.logpm.trunkline.vo.BillladingPackageVO;
import com.logpm.trunkline.vo.TrunklineAdvanceDetailVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface TrunklineAdvanceDetailMapper extends BaseMapper<TrunklineAdvanceDetailEntity> {
void updatePackageStatusById(@Param("packageStatus") String packageStatus, @Param("advanceDetailId") Long advanceDetailId);
List<TrunklineAdvanceDetailVO> findList(@Param("advanceId") Long advanceId);
List<AdvanceDetailGoodsVO> findGoodsListByAdvanceIds(@Param("list") List<Long> advanceIds);
AdvanceDetailStockNumVO findStockNumByAdvanceIds(@Param("list") List<Long> advanceIds);
List<BillladingPackageVO> findBillladingPackageByAdvanceIdsAnd(@Param("list") List<Long> advanceIds);
IPage<TrunklineAdvanceDetailVO> advanceDetailPageList(IPage<Object> page, @Param("param") AdvanceDetailDTO advanceDetailDTO);
}

104
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml

@ -9,5 +9,109 @@
where id = #{advanceDetailId}
</update>
<select id="findList" resultType="com.logpm.trunkline.vo.TrunklineAdvanceDetailVO">
select ltad.waybill_no waybillNo,
ltad.order_code orderCode,
lta.train_number trainNumber,
ltad.package_status packageStatus,
ltad.first_pack_name firstPackName,
ltad.second_pack_name secondPackName,
ltad.third_pack_name thirdPackName,
ltad.material_code materialCode,
ltad.material_name materialName,
ltad.order_package_code orderPackageCode,
ltad.brand brand,
ltad.service_num serviceNum,
ltad.quantity quantity,
lwtg.tray_code trayCode,
lwt.pallet_name trayName
from logpm_trunkline_advance_detail ltad
left join logpm_trunkline_advance lta on lta.id = ltad.advance_id
left join logpm_warehouse_tray_goods lwtg on lwtg.association_value = ltad.order_package_code
left join logpm_warehouse_tray lwt on lwt.id = lwtg.tray_id
where advance_id = #{advanceId}
</select>
<select id="findGoodsListByAdvanceIds" resultType="com.logpm.trunkline.vo.AdvanceDetailGoodsVO">
select ltad.first_pack_name goodsName,
ltad.charge_type chargeType,
count(ltad.id) num,
sum(ltad.weight) weight,
sum(ltad.volume) volume
from logpm_trunkline_advance_detail ltad
where ltad.is_deleted = 0
and ltad.advance_id in
<foreach collection="list" item="item" open="(" separator="," close=")">
#{item}
</foreach>
group by ltad.first_pack_name,
ltad.charge_type
</select>
<select id="findStockNumByAdvanceIds" resultType="com.logpm.trunkline.vo.AdvanceDetailStockNumVO">
select count(ltad.id) stockNum,
sum(ltad.weight) stockWeight,
sum(ltad.volume) stockVolume
from logpm_trunkline_advance_detail ltad
where ltad.is_deleted = 0
and ltad.package_status = '1'
and ltad.advance_id in
<foreach collection="list" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<select id="findBillladingPackageByAdvanceIdsAnd" resultType="com.logpm.trunkline.vo.BillladingPackageVO">
select ltbp.billlading_id billladingId,
count(ltbp.id) num
from logpm_trunkline_advance_detail ltad
left join logpm_trunkline_billlading_package ltbp on ltbp.order_package_code = ltad.order_package_code
where ltad.is_deleted = 0
and ltad.advance_id in
<foreach collection="list" item="item" open="(" separator="," close=")">
#{item}
</foreach>
and ltad.package_status = '1'
and ltbp.id is not null
group by ltbp.billlading_id
</select>
<select id="advanceDetailPageList" resultType="com.logpm.trunkline.vo.TrunklineAdvanceDetailVO">
select *
from logpm_trunkline_advance_detail ltad
where ltad.is_deleted = 0
<if test="param.warehouseId != null">
and ltad.warehouse_id = #{param.warehouseId}
</if>
<if test="param.packageStatus != null and param.packageStatus != '' ">
and ltad.package_status = #{param.packageStatus}
</if>
<if test="param.waybillNo != null and param.waybillNo != '' ">
and ltad.waybill_no = #{param.waybillNo}
</if>
<if test="param.orderCode != null and param.orderCode != '' ">
and ltad.order_code like concat(${param.orderCode},'%')
</if>
<if test="param.brand != null and param.brand != '' ">
and ltad.brand = #{param.brand}
</if>
<if test="param.secondPackName != null and param.secondPackName != '' ">
and ltad.second_pack_name = #{param.secondPackName}
</if>
<if test="param.thirdPackName != null and param.thirdPackName != '' ">
and ltad.third_pack_name = #{param.thirdPackName}
</if>
<if test="param.orderPackageCode != null and param.orderPackageCode != '' ">
and ltad.order_package_code = #{param.orderPackageCode}
</if>
<if test="param.trainNumber != null and param.trainNumber != '' ">
and ltad.train_number = #{param.trainNumber}
</if>
<if test="param.serviceNum != null and param.serviceNum != '' ">
and ltad.service_num = #{param.serviceNum}
</if>
order by ltad.create_time desc
</select>
</mapper>

12
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.java

@ -1,12 +1,24 @@
package com.logpm.trunkline.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.trunkline.dto.AdvanceDTO;
import com.logpm.trunkline.entity.TrunklineAdvanceEntity;
import com.logpm.trunkline.vo.OpenOrderVO;
import com.logpm.trunkline.vo.TrunklineAdvanceVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface TrunklineAdvanceMapper extends BaseMapper<TrunklineAdvanceEntity> {
int getAllTotalNum(@Param("orderCode") String orderCode);
IPage<TrunklineAdvanceVO> advancePageList(IPage<Object> page, @Param("param") AdvanceDTO advanceDTO);
List<TrunklineAdvanceEntity> findListByIds(@Param("list") List<Long> advanceIds);
OpenOrderVO selectInfoByIds(@Param("list") List<Long> advanceIds);
}

48
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.xml

@ -11,4 +11,52 @@
</select>
<select id="advancePageList" resultType="com.logpm.trunkline.vo.TrunklineAdvanceVO">
select lta.order_code orderCode,
lta.dealer_code dealerCode,
lta.dealer_name dealerName,
lta.service_num serviceNum,
lta.store_code storeCode,
lta.store_name storeName,
lta.site_name siteName,
lta.total_num totalNum,
lta.train_number trainNumber,
lta.legacy_status legacyStatus,
lta.customer_name customerName,
lta.customer_phone customerPhone,
lta.customer_address customerAddress,
lta.delivery_date deliveryDate,
lta.system_type systemType,
lta.brand brand,
lta.create_time createTime,
lta.mating_type matingType
from logpm_trunkline_advance lta
where lta.is_deleted = 0
and lta.freeze_status = #{param.freezeStatus}
and lta.warehouse_id = #{param.warehouseId}
</select>
<select id="findListByIds" resultType="com.logpm.trunkline.entity.TrunklineAdvanceEntity">
select *
from logpm_trunkline_advance
where is_deleted = 0
and id in
<foreach collection="list" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<select id="selectInfoByIds" resultType="com.logpm.trunkline.vo.OpenOrderVO">
select GROUP_CONCAT(DISTINCT brand) brand,
GROUP_CONCAT(DISTINCT train_number) trainNumber,
GROUP_CONCAT(DISTINCT order_code) orderCode
from logpm_trunkline_advance
where is_deleted = 0
and id in
<foreach collection="list" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
</mapper>

6
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineWaybillOrderMapper.java

@ -1,13 +1,19 @@
package com.logpm.trunkline.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.trunkline.entity.TrunklineAdvanceEntity;
import com.logpm.trunkline.entity.TrunklineWaybillOrderEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface TrunklineWaybillOrderMapper extends BaseMapper<TrunklineWaybillOrderEntity> {
Integer getTotalNumByWaybillId(@Param("waybillId") Long waybillId);
Integer getOrderPackageNumByWaybillId(@Param("waybillId") Long waybillId);
List<TrunklineAdvanceEntity> findListByWaybillId(@Param("waybillId") Long waybillId);
}

15
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineWaybillOrderMapper.xml

@ -8,4 +8,19 @@
where ltwo.waybill_id = #{waybillId}
</select>
<select id="getOrderPackageNumByWaybillId" resultType="int">
select count(*)
from logpm_trunkline_waybill_order ltwo
left join logpm_trunkline_advance_detail ltad on ltad.advance_id = ltwo.advance_id
where ltwo.waybill_id = #{waybillId}
</select>
<select id="findListByWaybillId" resultType="com.logpm.trunkline.entity.TrunklineAdvanceEntity">
select lta.*
from logpm_trunkline_waybill_order ltwo
left join logpm_trunkline_advance lta on lta.id = ltwo.advance_id
where ltwo.is_deleted = 0
and ltwo.id = #{waybillId}
</select>
</mapper>

12
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineWaybillTrackMapper.java

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

6
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineWaybillTrackMapper.xml

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

31
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IOpenOrderService.java

@ -0,0 +1,31 @@
package com.logpm.trunkline.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.trunkline.dto.AdvanceDTO;
import com.logpm.trunkline.dto.OpenOrderDTO;
import com.logpm.trunkline.vo.TrunklineAdvanceDetailVO;
import com.logpm.trunkline.vo.TrunklineAdvanceVO;
import org.springblade.core.tool.api.R;
import java.util.List;
public interface IOpenOrderService {
IPage<TrunklineAdvanceVO> advancePageList(AdvanceDTO advanceDTO);
List<TrunklineAdvanceDetailVO> findAdvanceDetailList(Long advanceId);
R advanceToWaybillInfo(List<Long> advanceIds, Long warehouseId);
R advanceToWaybillBefore(List<Long> advanceIds, Long warehouseId);
R openWaybill(OpenOrderDTO openOrderDTO);
R openZeroWaybill(OpenOrderDTO openOrderDTO);
void updateCustomerInfo(AdvanceDTO advanceDTO);
void freezeByAdvanceIds(AdvanceDTO advanceDTO);
void deletedAdvance(AdvanceDTO advanceDTO);
}

18
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceDetailService.java

@ -1,12 +1,30 @@
package com.logpm.trunkline.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.trunkline.dto.AdvanceDetailDTO;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.vo.AdvanceDetailGoodsVO;
import com.logpm.trunkline.vo.AdvanceDetailStockNumVO;
import com.logpm.trunkline.vo.BillladingPackageVO;
import com.logpm.trunkline.vo.TrunklineAdvanceDetailVO;
import org.springblade.core.mp.base.BaseService;
import java.util.List;
public interface ITrunklineAdvanceDetailService extends BaseService<TrunklineAdvanceDetailEntity> {
void updatePackageStatusById(String packageStatus, Long advanceDetailId);
TrunklineAdvanceDetailEntity findEntityByOrderPackageCodeAndWarehouseId(String orderPackageCode, Long warehouseId);
List<TrunklineAdvanceDetailVO> findList(Long advanceId);
List<AdvanceDetailGoodsVO> findGoodsListByAdvanceIds(List<Long> advanceIds);
AdvanceDetailStockNumVO findStockNumByAdvanceIds(List<Long> advanceIds);
List<BillladingPackageVO> findBillladingPackageByAdvanceIdsAnd(List<Long> advanceIds);
IPage<TrunklineAdvanceDetailVO> advanceDetailPageList(AdvanceDetailDTO advanceDetailDTO);
}

12
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceService.java

@ -1,10 +1,22 @@
package com.logpm.trunkline.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.trunkline.dto.AdvanceDTO;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.entity.TrunklineAdvanceEntity;
import com.logpm.trunkline.vo.OpenOrderVO;
import com.logpm.trunkline.vo.TrunklineAdvanceVO;
import org.springblade.core.mp.base.BaseService;
import java.util.List;
public interface ITrunklineAdvanceService extends BaseService<TrunklineAdvanceEntity> {
void saveOrderAndPackage(TrunklineAdvanceDetailEntity advanceDetailEntity, Long warehouseId);
IPage<TrunklineAdvanceVO> advancePageList(IPage<Object> page, AdvanceDTO advanceDTO);
List<TrunklineAdvanceEntity> findListByIds(List<Long> advanceIds);
OpenOrderVO selectInfoByIds(List<Long> advanceIds);
}

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineBillladingWaybillService.java

@ -28,4 +28,6 @@ public interface ITrunklineBillladingWaybillService extends BaseService<Trunklin
void updateDataByBillladingWaybillId(Long billladingWaybillId, Integer enterNum, BigDecimal enterWeight, BigDecimal enterVolume);
Integer getFinishNumByWaybillIdNotBillladingWaybillId(Long waybillId, Long billladingWaybillId);
TrunklineBillladingWaybillEntity getNoDataWaybillByBillladingId(Long billladingId);
}

5
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineDetailProductService.java

@ -3,5 +3,10 @@ package com.logpm.trunkline.service;
import com.logpm.trunkline.entity.TrunklineDetailProductEntity;
import org.springblade.core.mp.base.BaseService;
import java.util.List;
public interface ITrunklineDetailProductService extends BaseService<TrunklineDetailProductEntity> {
List<TrunklineDetailProductEntity> findListByOrderPackageCode(String orderPackageCode);
}

7
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineWaybillOrderService.java

@ -1,11 +1,18 @@
package com.logpm.trunkline.service;
import com.logpm.trunkline.entity.TrunklineAdvanceEntity;
import com.logpm.trunkline.entity.TrunklineWaybillOrderEntity;
import org.springblade.core.mp.base.BaseService;
import java.util.List;
public interface ITrunklineWaybillOrderService extends BaseService<TrunklineWaybillOrderEntity> {
Integer getTotalNumByWaybillId(Long waybillId);
Integer getOrderPackageNumByWaybillId(Long waybillId);
List<TrunklineAdvanceEntity> findListByWaybillId(Long waybillId);
}

7
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineWaybillTrackService.java

@ -0,0 +1,7 @@
package com.logpm.trunkline.service;
import com.logpm.trunkline.entity.TrunklineWaybillTrackEntity;
import org.springblade.core.mp.base.BaseService;
public interface ITrunklineWaybillTrackService extends BaseService<TrunklineWaybillTrackEntity> {
}

17
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java

@ -8,11 +8,15 @@ import com.logpm.trunkline.service.IInComingService;
import com.logpm.trunkline.service.ITrunklineAdvanceDetailService;
import com.logpm.trunkline.service.ITrunklineAdvanceService;
import com.logpm.trunkline.service.ITrunklineBillladingPackageServicie;
import com.logpm.warehouse.feign.IWarehouseTrayTypeClient;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
@Slf4j
@ -23,6 +27,7 @@ public class InComingServiceImpl implements IInComingService {
private final ITrunklineBillladingPackageServicie billladingPackageServicie;
private final ITrunklineAdvanceDetailService advanceDetailService;
private final ITrunklineAdvanceService advanceService;
private final IWarehouseTrayTypeClient warehouseTrayTypeClient;
@Override
public R incomingPackage(InComingDTO inComingDTO) {
@ -30,6 +35,8 @@ public class InComingServiceImpl implements IInComingService {
Long warehouseId = inComingDTO.getWarehouseId();//仓库id
Long billladingId = inComingDTO.getBillladingId();//提货单id
Integer incomingType = inComingDTO.getIncomingType();//入库类型
String trayCode = inComingDTO.getTrayCode();//托盘码
String trayType = inComingDTO.getTrayType();//打托方式
log.info("############incomingPackage: 包件入库开始 orderPackageCode={} billladingId={} warehouseId={}",orderPackageCode,billladingId,warehouseId);
//包件入库开始
@ -60,6 +67,16 @@ public class InComingServiceImpl implements IInComingService {
billladingPackageServicie.saveEntity(orderPackageCode,billladingId,warehouseId,incomingType);
}
//4.如果有托盘码
if(StringUtil.isNotBlank(trayCode) && StringUtil.isNotBlank(trayType)){
Map<String,Object> map = new HashMap<>();
map.put("trayType",trayType);
map.put("trayCode",trayCode);
map.put("warehouseId",warehouseId);
map.put("orderPackageCode",orderPackageCode);
warehouseTrayTypeClient.orderScanOrderPackageCode(map);
}
return R.success("入库成功");
}
}

745
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java

@ -0,0 +1,745 @@
package com.logpm.trunkline.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.logpm.basicdata.entity.*;
import com.logpm.basicdata.feign.*;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.entity.DistributionParcelNumberEntity;
import com.logpm.distribution.entity.DistributionStockArticleEntity;
import com.logpm.distribution.feign.IDistributionParcelListClient;
import com.logpm.distribution.feign.IDistributionParcelNumberClient;
import com.logpm.distribution.feign.IDistributionStockArticleClient;
import com.logpm.trunkline.dto.AdvanceDTO;
import com.logpm.trunkline.dto.OpenOrderDTO;
import com.logpm.trunkline.dto.WaybillDetailDTO;
import com.logpm.trunkline.entity.*;
import com.logpm.trunkline.service.*;
import com.logpm.trunkline.vo.*;
import com.logpm.warehouse.entity.WarehouseWayBillDetail;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.feign.IWarehouseWaybillClient;
import com.logpm.warehouse.feign.IWarehouseWaybillDetailClient;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.CodeNumConstant;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.order.*;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.utils.CommonUtil;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.system.cache.DictBizCache;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
@Slf4j
@AllArgsConstructor
@Service
public class OpenOrderServiceImpl implements IOpenOrderService {
private final ITrunklineAdvanceService advanceService;
private final ITrunklineAdvanceDetailService advanceDetailService;
private final IBasicdataWarehouseClient basicdataWarehouseClient;
private final IBasicdataTripartiteMallClient basicdataTripartiteMallClient;
private final IBasicdataClientClient basicdataClientClient;
private final IBasicdataStorageServicesClient basicdataStorageServicesClient;
private final IBasicdataCodeClient basicdataCodeClient;
private final IWarehouseWaybillClient warehouseWaybillClient;
private final IWarehouseWaybillDetailClient warehouseWaybillDetailClient;
private final IBasicdataCategoryClient basicdataCategoryClient;
private final ITrunklineWaybillOrderService trunklineWaybillOrderService;
private final ITrunklineBillladingWaybillService trunklineBillladingWaybillService;
private final ITrunklineBillladingService trunklineBillladingService;
private final ITrunklineWaybillTrackService trunklineWaybillTrackService;
private final IBasicdataStoreBusinessClient basicdataStoreBusinessClient;
private final IDistributionStockArticleClient distributionStockArticleClient;
private final IDistributionParcelListClient distributionParcelListClient;
private final IDistributionParcelNumberClient distributionParcelNumberClient;
@Override
public IPage<TrunklineAdvanceVO> advancePageList(AdvanceDTO advanceDTO) {
IPage<Object> page = new Page<>();
page.setCurrent(advanceDTO.getPageNum());
page.setSize(advanceDTO.getPageSize());
IPage<TrunklineAdvanceVO> pageList = advanceService.advancePageList(page,advanceDTO);
return pageList;
}
@Override
public List<TrunklineAdvanceDetailVO> findAdvanceDetailList(Long advanceId) {
return advanceDetailService.findList(advanceId);
}
@Override
public R advanceToWaybillInfo(List<Long> advanceIds, Long warehouseId) {
log.info("##################advanceToWaybill: 暂存单转运单");
BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(warehouseId);
if(Objects.isNull(basicdataWarehouseEntity)){
log.warn("##############advanceToWaybill: 仓库信息不存在 warehouseId={}",warehouseId);
return R.fail(405,"仓库信息不存在");
}
//先查询出所有的暂存单
List<TrunklineAdvanceEntity> list = advanceService.findListByIds(advanceIds);
if(list.isEmpty()){
log.warn("##############advanceToWaybill: 暂存单数据不存在 advanceIds={}",advanceIds);
return R.fail(405,"暂存单数据不存在");
}
String dealerName = null;
String brand = null;
for (TrunklineAdvanceEntity advanceEntity:list){
if(StringUtil.isBlank(dealerName)){
dealerName = advanceEntity.getDealerName();
}
if(StringUtil.isBlank(brand)){
brand = advanceEntity.getBrand();
}
}
OpenOrderVO openOrderVO = new OpenOrderVO();
//查询品牌 客户车次号 订单自编码
OpenOrderVO infoByIds = advanceService.selectInfoByIds(advanceIds);
BeanUtil.copy(infoByIds,openOrderVO);
openOrderVO.setAdvanceIds(advanceIds);
//发站仓-----目前登录人的仓库
openOrderVO.setDepartureWarehouseName(basicdataWarehouseEntity.getName());
openOrderVO.setDepartureWarehouseId(warehouseId);
//收货单位-----根据三方商场找到对应的clientId
Long clientId = basicdataTripartiteMallClient.getClientIdByNameAndBrand(dealerName, brand);
BasicdataClientEntity basicdataClientEntity = basicdataClientClient.findEntityById(clientId);
if(!Objects.isNull(basicdataClientEntity)){
openOrderVO.setConsigneeClientId(clientId);
openOrderVO.setConsignee(basicdataClientEntity.getClientName());
openOrderVO.setConsigneeName(basicdataClientEntity.getLinkman());
openOrderVO.setConsigneeMobile(basicdataClientEntity.getPhone());
openOrderVO.setConsigneeAddress(basicdataClientEntity.getDetailedly());
//查询目的仓数据
List<BasicdataStorageServicesEntity> storageServicesEntities = basicdataStorageServicesClient.findBySendWarehouseIdAndClientId(warehouseId,clientId);
if(!storageServicesEntities.isEmpty()){
BasicdataStorageServicesEntity basicdataStorageServicesEntity = storageServicesEntities.get(0);
openOrderVO.setDestinationWarehouseId(basicdataStorageServicesEntity.getServeWarehouseId());
openOrderVO.setDestinationWarehouseName(basicdataStorageServicesEntity.getServeWarehouseName());
}
}
//组装货物数据
List<AdvanceDetailGoodsVO> goodsList = advanceDetailService.findGoodsListByAdvanceIds(advanceIds);
//因为这个时候还没有到站信息,所有无法去匹配一个该商场的货物单价
// for (AdvanceDetailGoodsVO advanceDetailGoodsVO:goodsList){
// String goodsName = advanceDetailGoodsVO.getGoodsName();
// if(!Objects.isNull(basicdataClientEntity)){
// //TODO 这里要根据商场信息和物品名称去匹配一个预设单价
// advanceDetailGoodsVO.setPrice(BigDecimal.ZERO);
// }else{
// //因为没有
// }
// }
openOrderVO.setGoodsList(goodsList);
//查询支付方式
openOrderVO.setPayTypeList(DictBizCache.getList(DictBizConstant.OPEN_ORDER_PAY_TYPE));
//查询付款方式
openOrderVO.setPayWayList(DictBizCache.getList(DictBizConstant.OPEN_ORDER_PAY_WAY));
//查询送货方式
openOrderVO.setDeliveryWayList(DictBizCache.getList(DictBizConstant.OPEN_ORDER_DELIVERY_WAY));
//查询紧急度
openOrderVO.setUrgencyList(DictBizCache.getList(DictBizConstant.OPEN_ORDER_URGENCY));
//查询回单方式
openOrderVO.setReceiptList(DictBizCache.getList(DictBizConstant.OPEN_ORDER_RECEIPT));
//查询回单方式
openOrderVO.setTransportTypeList(DictBizCache.getList(DictBizConstant.OPEN_ORDER_TRANSPORT_TYPE));
openOrderVO.setOpenOrderUserName(AuthUtil.getUserName());
return R.data(openOrderVO);
}
@Override
public R advanceToWaybillBefore(List<Long> advanceIds, Long warehouseId) {
log.info("##################advanceToWaybillBefore: 判断暂存单是否能转运单");
//先查询出所有的暂存单
List<TrunklineAdvanceEntity> list = advanceService.findListByIds(advanceIds);
String dealerName = null;
String brand = null;
for (TrunklineAdvanceEntity advanceEntity:list){
if(StringUtil.isBlank(dealerName)){
dealerName = advanceEntity.getDealerName();
}else{
String dealer = advanceEntity.getDealerName();
if(!dealerName.equals(dealer)){
log.info("###########advanceToWaybillBefore: 商场不同 dealerName={} dealer={}",dealerName,dealer);
return R.fail(405,"请选择同一商场开单");
}
}
if(StringUtil.isBlank(brand)){
brand = advanceEntity.getBrand();
}else{
String brand1 = advanceEntity.getBrand();
if(!brand.equals(brand1)){
log.info("###########advanceToWaybillBefore: 品牌不同 brand={} brand1={}",brand,brand1);
return R.fail(405,"请选择同一品牌开单");
}
}
}
return R.success("验证成功");
}
@Transactional(rollbackFor = Exception.class)
@Override
public R openWaybill(OpenOrderDTO openOrderDTO) {
log.info("############openWaybill: 开单开始 openOrderDTO={}",openOrderDTO);
String waybillNo = openOrderDTO.getWaybillNo();//运单号
Long warehouseId = openOrderDTO.getWarehouseId();
BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(warehouseId);
if(Objects.isNull(basicdataWarehouseEntity)){
log.warn("#############openWaybill: 仓库信息不存在 warehouseId={}",warehouseId);
return R.fail(405,"仓库信息不存在");
}
String warehouseCode = basicdataWarehouseEntity.getCode();
//如果运单号为空则自动生成运单号
if(StringUtil.isBlank(waybillNo)){
waybillNo = basicdataCodeClient.getCodeByType(CodeNumConstant.WAYBILL, warehouseCode, null);
}
WarehouseWaybillEntity waybillEntity = new WarehouseWaybillEntity();
waybillEntity.setWaybillNo(waybillNo);
waybillEntity.setBrand(openOrderDTO.getBrand());
waybillEntity.setOrderNo(openOrderDTO.getOrderNo());
waybillEntity.setDepartureWarehouseId(openOrderDTO.getDepartureWarehouseId());
waybillEntity.setDepartureWarehouseName(openOrderDTO.getDepartureWarehouseName());
waybillEntity.setCustomerTrain(openOrderDTO.getCustomerTrain());
Long shipperId = openOrderDTO.getShipperId();
if(Objects.isNull(shipperId)){
//如果发货单位没有id值,则把发货单位信息自动添加到client中
shipperId = saveNewClient(openOrderDTO.getShipper(),openOrderDTO.getShipperName(),openOrderDTO.getShipperMobile(),openOrderDTO.getShipperAddress(),"6");
}
waybillEntity.setShipperId(shipperId);
waybillEntity.setShipper(openOrderDTO.getShipper());
waybillEntity.setShipperName(openOrderDTO.getShipperName());
waybillEntity.setShipperMobile(openOrderDTO.getShipperMobile());
waybillEntity.setShipperAddress(openOrderDTO.getShipperAddress());
Long consigneeId = openOrderDTO.getConsigneeId();//收货单位id
if(Objects.isNull(consigneeId)){
//如果收货单位没有id值,则把收货单位信息自动添加到client中
consigneeId = saveNewClient(openOrderDTO.getConsignee(),openOrderDTO.getConsigneeName(),openOrderDTO.getConsigneeMobile(),openOrderDTO.getConsigneeAddress(),"2");
}
waybillEntity.setConsigneeId(consigneeId);
waybillEntity.setConsignee(openOrderDTO.getConsignee());
waybillEntity.setConsigneeName(openOrderDTO.getConsigneeName());
waybillEntity.setConsigneeMobile(openOrderDTO.getConsigneeMobile());
waybillEntity.setConsigneeAddress(openOrderDTO.getConsigneeAddress());
waybillEntity.setDestination(openOrderDTO.getDestination());
waybillEntity.setGoodsName(openOrderDTO.getGoodsName());
waybillEntity.setTotalCount(openOrderDTO.getTotalCount());
waybillEntity.setTotalVolume(openOrderDTO.getTotalVolume());
waybillEntity.setTotalWeight(openOrderDTO.getTotalWeghit());
//统计当前订单的在库数
List<Long> advanceIds = openOrderDTO.getAdvanceIds();
AdvanceDetailStockNumVO advanceDetailStockNumVO = advanceDetailService.findStockNumByAdvanceIds(advanceIds);
waybillEntity.setStockCount(advanceDetailStockNumVO.getStockNum());
waybillEntity.setStockWeight(advanceDetailStockNumVO.getStockWeight());
waybillEntity.setStockVolume(advanceDetailStockNumVO.getStockVolume());
waybillEntity.setTotalFreight(openOrderDTO.getTotalFreight());
waybillEntity.setDeliveryFee(openOrderDTO.getDeliveryFee());
waybillEntity.setPickupFee(openOrderDTO.getPickupFee());
waybillEntity.setWarehouseManagementFee(openOrderDTO.getWarehouseManagementFee());
waybillEntity.setStorageFee(openOrderDTO.getStorageFee());
waybillEntity.setHandlingFee(openOrderDTO.getHandlingFee());
waybillEntity.setOtherFee(openOrderDTO.getOtherFee());
waybillEntity.setInsuranceFee(openOrderDTO.getInsuranceFee());
waybillEntity.setClaimingValue(openOrderDTO.getClaimingValue());
waybillEntity.setPayType(openOrderDTO.getPayType());
waybillEntity.setPayWay(openOrderDTO.getPayWay());
waybillEntity.setXPay(openOrderDTO.getXPay());
waybillEntity.setDPay(openOrderDTO.getDPay());
waybillEntity.setYPay(openOrderDTO.getYPay());
waybillEntity.setHPay(openOrderDTO.getHPay());
waybillEntity.setThirdOperationFee(openOrderDTO.getThirdOperationFee());
waybillEntity.setDeliveryWay(openOrderDTO.getDeliveryWay());
waybillEntity.setUrgency(openOrderDTO.getUrgency());
waybillEntity.setReceipt(openOrderDTO.getReceipt());
waybillEntity.setRemark(openOrderDTO.getRemark());
waybillEntity.setWaybillType(openOrderDTO.getWaybillType());
Long waybillId = warehouseWaybillClient.addEnntity(waybillEntity);
if(!Objects.isNull(waybillId)){
log.info("#################openWaybill: 运单保存成功");
//保存运单货物明细
List<WaybillDetailDTO> waybillDetailList = openOrderDTO.getWaybillDetailList();
List<WarehouseWayBillDetail> details = new ArrayList<>();
for (WaybillDetailDTO waybillDetailDTO:waybillDetailList){
WarehouseWayBillDetail warehouseWayBillDetail = new WarehouseWayBillDetail();
warehouseWayBillDetail.setWaybillId(waybillId);
warehouseWayBillDetail.setWaybillNo(waybillEntity.getWaybillNo());
Long goodsId = waybillDetailDTO.getGoodsId();
String goodsName = waybillDetailDTO.getGoodsName();
if(Objects.isNull(goodsId)){
//如果品名id没有就先通过goodsName查寻,没有就新增
BasicdataCategoryEntity basicdataCategoryEntity = basicdataCategoryClient.findByName(goodsName);
if(Objects.isNull(basicdataCategoryEntity)){
basicdataCategoryEntity = new BasicdataCategoryEntity();
basicdataCategoryEntity.setName(goodsName);
basicdataCategoryEntity.setType(1);
goodsId = basicdataCategoryClient.addReturnId(basicdataCategoryEntity);
}else{
goodsId = basicdataCategoryEntity.getId();
}
}
warehouseWayBillDetail.setProductId(goodsId);
warehouseWayBillDetail.setProductName(goodsName);
warehouseWayBillDetail.setNum(waybillDetailDTO.getNum());
warehouseWayBillDetail.setVolume(waybillDetailDTO.getVolume());
warehouseWayBillDetail.setWeight(waybillDetailDTO.getWeight());
warehouseWayBillDetail.setPrice(waybillDetailDTO.getPrice());
warehouseWayBillDetail.setSubtotalFreight(waybillDetailDTO.getSubtotalFreight());
warehouseWayBillDetail.setChargeType(waybillDetailDTO.getChargeType());
details.add(warehouseWayBillDetail);
}
warehouseWaybillDetailClient.addList(details);
}else{
log.info("#################openWaybill: 运单保存失败");
return R.fail(405,"运单保存失败");
}
//绑定订单和运单的关系
List<TrunklineAdvanceEntity> advanceEntityList = advanceService.findListByIds(advanceIds);
List<TrunklineWaybillOrderEntity> waybillOrderEntities = new ArrayList<>();
for (TrunklineAdvanceEntity advanceEntity:advanceEntityList){
TrunklineWaybillOrderEntity waybillOrderEntity = new TrunklineWaybillOrderEntity();
waybillOrderEntity.setWarehouseId(warehouseId);
waybillOrderEntity.setWarehouseName(basicdataWarehouseEntity.getName());
waybillOrderEntity.setWaybillId(waybillId);
waybillOrderEntity.setWaybillNo(waybillNo);
waybillOrderEntity.setAdvanceId(advanceEntity.getId());
waybillOrderEntity.setOrderCode(advanceEntity.getOrderCode());
waybillOrderEntity.setTotalNumber(advanceEntity.getTotalNum());
waybillOrderEntities.add(waybillOrderEntity);
advanceEntity.setWaybillStatus("1");
}
trunklineWaybillOrderService.saveBatch(waybillOrderEntities);
//修改暂存单的状态为已开单
advanceService.updateBatchById(advanceEntityList);
//计算扫码入库的包件是否需要把运单和提货单挂上
List<BillladingPackageVO> billladingPackageList = advanceDetailService.findBillladingPackageByAdvanceIdsAnd(advanceIds);
List<TrunklineBillladingWaybillEntity> billladingWaybillEntities = new ArrayList<>();
List<TrunklineBillladingEntity> updateFeeBilllading = new ArrayList<>();
for (BillladingPackageVO billladingPackageVO:billladingPackageList){
Long billladingId = billladingPackageVO.getBillladingId();
QueryWrapper<TrunklineBillladingEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("id",billladingId)
.eq("is_deleted",0)
.eq("billlading_status","2");
TrunklineBillladingEntity billladingEntity = trunklineBillladingService.getOne(queryWrapper);
if(Objects.isNull(billladingEntity)){
log.info("#################openWaybill: 提货单信息不存在 billladingId={}",billladingId);
continue;
}
Integer num = billladingPackageVO.getNum();
TrunklineBillladingWaybillEntity trunklineBillladingWaybillEntity = trunklineBillladingWaybillService.getNoDataWaybillByBillladingId(billladingId);
if(!Objects.isNull(trunklineBillladingWaybillEntity)){
Integer realNum = trunklineBillladingWaybillEntity.getRealNum();
if(realNum > num){
trunklineBillladingWaybillEntity.setRealNum(realNum-num);
}else if(realNum == num){
trunklineBillladingWaybillEntity.setRealNum(0);
trunklineBillladingWaybillEntity.setIsDeleted(1);
}
trunklineBillladingWaybillService.updateById(trunklineBillladingWaybillEntity);
TrunklineBillladingWaybillEntity billladingWaybillEntity = new TrunklineBillladingWaybillEntity();
billladingWaybillEntity.setWarehouseId(warehouseId);
billladingWaybillEntity.setWarehouseName(basicdataWarehouseEntity.getName());
billladingWaybillEntity.setBillladingId(billladingId);
billladingWaybillEntity.setBilladingCode(billladingEntity.getBillladingCode());
billladingWaybillEntity.setWaybillId(waybillId);
billladingWaybillEntity.setWaybillNo(waybillNo);
billladingWaybillEntity.setRealNum(num);
billladingWaybillEntities.add(billladingWaybillEntity);
updateFeeBilllading.add(billladingEntity);
}
}
trunklineBillladingWaybillService.saveBatch(billladingWaybillEntities);
//更新提货单对应的运单的提货费用
for (TrunklineBillladingEntity billladingEntity:updateFeeBilllading){
trunklineBillladingWaybillService.updateBillladingFeeByBillladingId(billladingEntity);
}
try{
TrunklineWaybillTrackEntity waybillTrackEntity = new TrunklineWaybillTrackEntity();
waybillTrackEntity.setWarehouseId(warehouseId);
waybillTrackEntity.setWarehouseName(basicdataWarehouseEntity.getName());
waybillTrackEntity.setWaybillId(waybillId);
waybillTrackEntity.setWaybillNo(waybillNo);
waybillTrackEntity.setTrackType("10");
waybillTrackEntity.setDescribe("创建运单");
waybillTrackEntity.setOperationRemark("创建运单"+waybillNo+",时间:"+ CommonUtil.dateToString(waybillEntity.getCreateTime()));
trunklineWaybillTrackService.save(waybillTrackEntity);
Integer totalCount = waybillEntity.getTotalCount();
Integer stockCount = waybillEntity.getStockCount();
if(totalCount.equals(stockCount)){
waybillTrackEntity.setId(null);
waybillTrackEntity.setTrackType("20");
waybillTrackEntity.setDescribe("已入库");
waybillTrackEntity.setOperationRemark("运单入库:"+stockCount+"/"+totalCount+",入库类型:【批量入库】,入库时间:"+ CommonUtil.dateToString(waybillEntity.getCreateTime()));
trunklineWaybillTrackService.save(waybillTrackEntity);
}
}catch (Exception e){
log.warn("###############openWaybill: 存入日志失败");
}
return R.success("开单成功");
}
@Override
public R openZeroWaybill(OpenOrderDTO openOrderDTO) {
log.info("############openZeroWaybill: 开零担单开始 openOrderDTO={}",openOrderDTO);
String waybillNo = openOrderDTO.getWaybillNo();//运单号
Long warehouseId = openOrderDTO.getWarehouseId();
BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(warehouseId);
if(Objects.isNull(basicdataWarehouseEntity)){
log.warn("#############openZeroWaybill: 仓库信息不存在 warehouseId={}",warehouseId);
return R.fail(405,"仓库信息不存在");
}
String warehouseCode = basicdataWarehouseEntity.getCode();
//如果运单号为空则自动生成运单号
if(StringUtil.isBlank(waybillNo)){
waybillNo = basicdataCodeClient.getCodeByType(CodeNumConstant.WAYBILL, warehouseCode, null);
}
WarehouseWaybillEntity waybillEntity = new WarehouseWaybillEntity();
waybillEntity.setWaybillNo(waybillNo);
waybillEntity.setDepartureWarehouseId(openOrderDTO.getDepartureWarehouseId());
waybillEntity.setDepartureWarehouseName(openOrderDTO.getDepartureWarehouseName());
waybillEntity.setCustomerTrain(openOrderDTO.getCustomerTrain());
Long shipperId = openOrderDTO.getShipperId();
if(Objects.isNull(shipperId)){
//如果发货单位没有id值,则把发货单位信息自动添加到client中
shipperId = saveNewClient(openOrderDTO.getShipper(),openOrderDTO.getShipperName(),openOrderDTO.getShipperMobile(),openOrderDTO.getShipperAddress(),"6");
}
waybillEntity.setShipperId(shipperId);
waybillEntity.setShipper(openOrderDTO.getShipper());
waybillEntity.setShipperName(openOrderDTO.getShipperName());
waybillEntity.setShipperMobile(openOrderDTO.getShipperMobile());
waybillEntity.setShipperAddress(openOrderDTO.getShipperAddress());
Long consigneeId = openOrderDTO.getConsigneeId();//收货单位id
if(Objects.isNull(consigneeId)){
//如果收货单位没有id值,则把收货单位信息自动添加到client中
consigneeId = saveNewClient(openOrderDTO.getConsignee(),openOrderDTO.getConsigneeName(),openOrderDTO.getConsigneeMobile(),openOrderDTO.getConsigneeAddress(),"2");
}
waybillEntity.setConsigneeId(consigneeId);
waybillEntity.setConsignee(openOrderDTO.getConsignee());
waybillEntity.setConsigneeName(openOrderDTO.getConsigneeName());
waybillEntity.setConsigneeMobile(openOrderDTO.getConsigneeMobile());
waybillEntity.setConsigneeAddress(openOrderDTO.getConsigneeAddress());
waybillEntity.setDestination(openOrderDTO.getDestination());
waybillEntity.setGoodsName(openOrderDTO.getGoodsName());
waybillEntity.setTotalCount(openOrderDTO.getTotalCount());
waybillEntity.setTotalVolume(openOrderDTO.getTotalVolume());
waybillEntity.setTotalWeight(openOrderDTO.getTotalWeghit());
//零担单开单即入库
waybillEntity.setStockCount(openOrderDTO.getTotalCount());
waybillEntity.setStockWeight(openOrderDTO.getTotalWeghit());
waybillEntity.setStockVolume(openOrderDTO.getTotalVolume());
waybillEntity.setTotalFreight(openOrderDTO.getTotalFreight());
waybillEntity.setDeliveryFee(openOrderDTO.getDeliveryFee());
waybillEntity.setPickupFee(openOrderDTO.getPickupFee());
waybillEntity.setWarehouseManagementFee(openOrderDTO.getWarehouseManagementFee());
waybillEntity.setStorageFee(openOrderDTO.getStorageFee());
waybillEntity.setHandlingFee(openOrderDTO.getHandlingFee());
waybillEntity.setOtherFee(openOrderDTO.getOtherFee());
waybillEntity.setInsuranceFee(openOrderDTO.getInsuranceFee());
waybillEntity.setClaimingValue(openOrderDTO.getClaimingValue());
waybillEntity.setPayType(openOrderDTO.getPayType());
waybillEntity.setPayWay(openOrderDTO.getPayWay());
waybillEntity.setXPay(openOrderDTO.getXPay());
waybillEntity.setDPay(openOrderDTO.getDPay());
waybillEntity.setYPay(openOrderDTO.getYPay());
waybillEntity.setHPay(openOrderDTO.getHPay());
waybillEntity.setThirdOperationFee(openOrderDTO.getThirdOperationFee());
waybillEntity.setDeliveryWay(openOrderDTO.getDeliveryWay());
waybillEntity.setUrgency(openOrderDTO.getUrgency());
waybillEntity.setReceipt(openOrderDTO.getReceipt());
waybillEntity.setRemark(openOrderDTO.getRemark());
waybillEntity.setWaybillType(openOrderDTO.getWaybillType());
waybillEntity.setWaybillStatus("20");
Long waybillId = warehouseWaybillClient.addEnntity(waybillEntity);
if(!Objects.isNull(waybillId)){
log.info("#################openZeroWaybill: 运单保存成功");
//保存运单货物明细
List<WaybillDetailDTO> waybillDetailList = openOrderDTO.getWaybillDetailList();
List<WarehouseWayBillDetail> details = new ArrayList<>();
for (WaybillDetailDTO waybillDetailDTO:waybillDetailList){
WarehouseWayBillDetail warehouseWayBillDetail = new WarehouseWayBillDetail();
warehouseWayBillDetail.setWaybillId(waybillId);
warehouseWayBillDetail.setWaybillNo(waybillEntity.getWaybillNo());
Long goodsId = waybillDetailDTO.getGoodsId();
String goodsName = waybillDetailDTO.getGoodsName();
if(Objects.isNull(goodsId)){
//如果品名id没有就先通过goodsName查寻,没有就新增
BasicdataCategoryEntity basicdataCategoryEntity = basicdataCategoryClient.findByName(goodsName);
if(Objects.isNull(basicdataCategoryEntity)){
basicdataCategoryEntity = new BasicdataCategoryEntity();
basicdataCategoryEntity.setName(goodsName);
basicdataCategoryEntity.setType(1);
goodsId = basicdataCategoryClient.addReturnId(basicdataCategoryEntity);
}else{
goodsId = basicdataCategoryEntity.getId();
}
}
warehouseWayBillDetail.setProductId(goodsId);
warehouseWayBillDetail.setProductName(goodsName);
warehouseWayBillDetail.setNum(waybillDetailDTO.getNum());
warehouseWayBillDetail.setVolume(waybillDetailDTO.getVolume());
warehouseWayBillDetail.setWeight(waybillDetailDTO.getWeight());
warehouseWayBillDetail.setPrice(waybillDetailDTO.getPrice());
warehouseWayBillDetail.setSubtotalFreight(waybillDetailDTO.getSubtotalFreight());
warehouseWayBillDetail.setChargeType(waybillDetailDTO.getChargeType());
details.add(warehouseWayBillDetail);
}
warehouseWaybillDetailClient.addList(details);
}else{
log.info("#################openZeroWaybill: 运单保存失败");
return R.fail(405,"运单保存失败");
}
try{
TrunklineWaybillTrackEntity waybillTrackEntity = new TrunklineWaybillTrackEntity();
waybillTrackEntity.setWarehouseId(warehouseId);
waybillTrackEntity.setWarehouseName(basicdataWarehouseEntity.getName());
waybillTrackEntity.setWaybillId(waybillId);
waybillTrackEntity.setWaybillNo(waybillNo);
waybillTrackEntity.setTrackType("10");
waybillTrackEntity.setDescribe("创建运单");
waybillTrackEntity.setOperationRemark("创建运单"+waybillNo+",时间:"+ CommonUtil.dateToString(waybillEntity.getCreateTime()));
trunklineWaybillTrackService.save(waybillTrackEntity);
Integer totalCount = waybillEntity.getTotalCount();
Integer stockCount = waybillEntity.getStockCount();
if(totalCount.equals(stockCount)){
waybillTrackEntity.setId(null);
waybillTrackEntity.setTrackType("20");
waybillTrackEntity.setDescribe("已入库");
waybillTrackEntity.setOperationRemark("运单入库:"+stockCount+"/"+totalCount+",入库类型:【批量入库】,入库时间:"+ CommonUtil.dateToString(waybillEntity.getCreateTime()));
trunklineWaybillTrackService.save(waybillTrackEntity);
}
}catch (Exception e){
log.warn("###############openZeroWaybill: 存入日志失败");
}
//创建零担订单
createStockArticle(waybillEntity);
return R.success("开单成功");
}
@Override
public void updateCustomerInfo(AdvanceDTO advanceDTO) {
List<Long> advanceIds = advanceDTO.getAdvanceIds();
String customerName = advanceDTO.getCustomerName();
String customerPhone = advanceDTO.getCustomerPhone();
String customerRoad = advanceDTO.getCustomerRoad();
List<TrunklineAdvanceEntity> listByIds = advanceService.findListByIds(advanceIds);
for (TrunklineAdvanceEntity advanceEntity:listByIds){
String orderCode = advanceEntity.getOrderCode();
advanceEntity.setCustomerName(customerName);
advanceEntity.setCustomerPhone(customerPhone);
advanceEntity.setCustomerAddress(customerRoad);
distributionStockArticleClient.updateCustomerInfoByOrderCode(customerName,customerPhone,customerRoad,orderCode);
}
advanceService.updateBatchById(listByIds);
}
@Override
public void freezeByAdvanceIds(AdvanceDTO advanceDTO) {
List<Long> advanceIds = advanceDTO.getAdvanceIds();
String freezeStatus = advanceDTO.getFreezeStatus();
List<TrunklineAdvanceEntity> listByIds = advanceService.findListByIds(advanceIds);
for (TrunklineAdvanceEntity advanceEntity:listByIds){
String orderCode = advanceEntity.getOrderCode();
advanceEntity.setFreezeStatus(freezeStatus);
distributionStockArticleClient.freezeByOrderCode(orderCode,freezeStatus);
}
advanceService.updateBatchById(listByIds);
}
@Override
public void deletedAdvance(AdvanceDTO advanceDTO) {
List<Long> advanceIds = advanceDTO.getAdvanceIds();
List<TrunklineAdvanceEntity> listByIds = advanceService.findListByIds(advanceIds);
for (TrunklineAdvanceEntity advanceEntity:listByIds){
advanceEntity.setIsDeleted(1);
}
advanceService.updateBatchById(listByIds);
}
private void createStockArticle(WarehouseWaybillEntity warehouseWaybill) {
Date date = new Date();
DistributionStockArticleEntity distributionStockArticleEntity = new DistributionStockArticleEntity();
distributionStockArticleEntity.setOrderCode(warehouseWaybill.getWaybillNo());
distributionStockArticleEntity.setServiceNumber(warehouseWaybill.getServiceNo());
distributionStockArticleEntity.setWaybillNumber(warehouseWaybill.getWaybillNo());
distributionStockArticleEntity.setWaybillId(warehouseWaybill.getId());
distributionStockArticleEntity.setWarehouseId(warehouseWaybill.getDepartureWarehouseId());
distributionStockArticleEntity.setMallName(warehouseWaybill.getConsignee());
Long consigneeId = warehouseWaybill.getConsigneeId();
BasicdataClientEntity basicdataClientEntity = basicdataClientClient.findEntityById(consigneeId);
distributionStockArticleEntity.setMallCode(basicdataClientEntity.getClientCode());
distributionStockArticleEntity.setMallId(warehouseWaybill.getConsigneeId());
distributionStockArticleEntity.setDescriptionGoods(warehouseWaybill.getGoodsName());
distributionStockArticleEntity.setWarehouse(warehouseWaybill.getDepartureWarehouseName());
distributionStockArticleEntity.setWarehouseEntryTime(date);
distributionStockArticleEntity.setTotalNumber(warehouseWaybill.getTotalCount());
distributionStockArticleEntity.setHandQuantity(warehouseWaybill.getStockCount());
//零担订单默认齐套
distributionStockArticleEntity.setCompleteSet(1);
distributionStockArticleEntity.setBrand(warehouseWaybill.getBrand());
distributionStockArticleEntity.setResource("零担");
String customerName = warehouseWaybill.getConsignee();//客户名称
//通过客户名称去查询客户的服务类型、
distributionStockArticleEntity.setTypeService("1");//默认商配
if (!Objects.isNull(basicdataClientEntity)) {
Long clientEntityId = basicdataClientEntity.getId();//基础客户
BasicdataStoreBusinessEntity basicdataStoreBusinessEntity = basicdataStoreBusinessClient.findByClientIdAndTypeService(clientEntityId, 3);
if (!Objects.isNull(basicdataStoreBusinessEntity)) {
distributionStockArticleEntity.setTypeService(basicdataStoreBusinessEntity.getMold());
}
}
distributionStockArticleEntity.setCustomerName(warehouseWaybill.getConsigneeName());
distributionStockArticleEntity.setCustomerTelephone(warehouseWaybill.getConsigneeMobile());
distributionStockArticleEntity.setCustomerAddress(warehouseWaybill.getConsigneeAddress());
distributionStockArticleEntity.setGenre(1);
distributionStockArticleEntity.setSortingQuantity(0); //分拣件数
distributionStockArticleEntity.setDeliveryQuantity(0); //配送件数
distributionStockArticleEntity.setTransferQuantity(0); //中转件数
distributionStockArticleEntity.setSigninQuantity(0); //签收件数
distributionStockArticleEntity.setFreezeStatus(OrderFreezeStatusConstant.weidongjie.getValue()); //冻结状态
distributionStockArticleEntity.setReservationStatus(OrderReservationStatusConstant.daiyuyue.getValue()); //预约状态
distributionStockArticleEntity.setStockupStatus(OrderStockupStatusConstant.daibeihuo.getValue()); //备货状态
distributionStockArticleEntity.setGroundingStatus(OrderGroundingStatusConstant.daishangjia.getValue()); //上架状态
distributionStockArticleEntity.setOrderStatus(OrderStatusConstant.ruku.getValue());
distributionStockArticleEntity.setOrderReceiveStatus(OrderReceiveStatusConstant.yishouhuo.getValue());
distributionStockArticleEntity.setConsigneeUnit(customerName);//收货单位(经销商)
distributionStockArticleEntity.setConsigneePerson(warehouseWaybill.getConsigneeName());//收货人
distributionStockArticleEntity.setConsigneeMobile(warehouseWaybill.getConsigneeMobile());
distributionStockArticleEntity.setConsigneeAddress(warehouseWaybill.getConsigneeAddress());
distributionStockArticleEntity.setWarehouseEntryTimeEnd(date);
distributionStockArticleEntity.setSendWarehouseId(warehouseWaybill.getDepartureWarehouseId());
distributionStockArticleEntity.setSendWarehouseName(warehouseWaybill.getDepartureWarehouseName());
distributionStockArticleEntity.setAcceptWarehouseId(warehouseWaybill.getDestinationWarehouseId());
distributionStockArticleEntity.setAcceptWarehouseName(warehouseWaybill.getDestinationWarehouseName());
distributionStockArticleEntity.setIsZero("1");
Long orderId = distributionStockArticleClient.addData(distributionStockArticleEntity);
if (orderId == 0) {
log.warn("#################createStockArticle: 保存订单信息失败 orderCode={}", distributionStockArticleEntity.getOrderCode());
throw new CustomerException(405, "保存订单信息失败");
}
List<WarehouseWayBillDetail> wayBillDetailList = warehouseWaybillDetailClient.findByWaybillId(warehouseWaybill.getId());
//第一次生成订单也要生成包件信息
List<DistributionParcelNumberEntity> parcelNumberList = new ArrayList<>();
for (WarehouseWayBillDetail warehouseWayBillDetail : wayBillDetailList) {
DistributionParcelListEntity entity = new DistributionParcelListEntity();
entity.setFirsts(warehouseWayBillDetail.getProductName());
entity.setWarehouseId(distributionStockArticleEntity.getWarehouseId());
entity.setWarehouse(distributionStockArticleEntity.getWarehouse());
entity.setQuantity(warehouseWayBillDetail.getNum());
entity.setConditions(1);
entity.setStockArticleId(orderId);
entity.setOrderCode(distributionStockArticleEntity.getOrderCode());
entity.setOrderPackageStatus("20");
entity.setOrderPackageFreezeStatus("10");
entity.setOrderPackageGroundingStatus("10");
entity.setOrderPackageStockupStatus("10");
entity.setOrderPackageReservationStatus("10");
entity.setOrderPackageLoadingStatus("10");
entity.setWaybillNumber(distributionStockArticleEntity.getWaybillNumber());
entity.setWarehouseEntryTimeEnd(date);
entity.setSendWarehouseId(warehouseWaybill.getDepartureWarehouseId());
entity.setSendWarehouseName(warehouseWaybill.getDepartureWarehouseName());
entity.setAcceptWarehouseId(warehouseWaybill.getDestinationWarehouseId());
entity.setAcceptWarehouseName(warehouseWaybill.getDestinationWarehouseName());
Long aLong = distributionParcelListClient.addReturnId(entity);
DistributionParcelNumberEntity parcelNumberEntity = new DistributionParcelNumberEntity();
parcelNumberEntity.setStockArticleId(orderId);
parcelNumberEntity.setWarehouseId(entity.getWarehouseId());
parcelNumberEntity.setParcelListId(aLong);
parcelNumberEntity.setHandQuantity(entity.getQuantity());
parcelNumberEntity.setQuantity(entity.getQuantity());
parcelNumberEntity.setDeliveryQuantity(0);
parcelNumberEntity.setSigninQuantity(0);
parcelNumberEntity.setOutboundQuantity(0);
parcelNumberList.add(parcelNumberEntity);
}
//存入零担订单包件数量
distributionParcelNumberClient.addBatch(parcelNumberList);
}
private Long saveNewClient(String unit, String linkman, String linkPhone, String linkAddress, String type) {
BasicdataClientEntity basicdataClientEntity = new BasicdataClientEntity();
basicdataClientEntity.setClientName(unit);
basicdataClientEntity.setTypeService(2);
basicdataClientEntity.setCargoControl(false);
basicdataClientEntity.setClientType(type);//1 工厂 2 商场 3装饰 4个人 5门店 6发货单位
basicdataClientEntity.setLinkman(linkman);
basicdataClientEntity.setPhone(linkPhone);
basicdataClientEntity.setDetailedly(linkAddress);
return basicdataClientClient.addReturnId(basicdataClientEntity);
}
}

38
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java

@ -1,14 +1,20 @@
package com.logpm.trunkline.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.logpm.trunkline.dto.AdvanceDetailDTO;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.mapper.TrunklineAdvanceDetailMapper;
import com.logpm.trunkline.service.ITrunklineAdvanceDetailService;
import com.logpm.trunkline.vo.*;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
import java.util.List;
@Slf4j
@Service
@AllArgsConstructor
@ -26,4 +32,36 @@ public class TrunklineAdvanceDetailServiceImpl extends BaseServiceImpl<Trunkline
.eq("is_deleted",0);
return baseMapper.selectOne(queryWrapper);
}
@Override
public List<TrunklineAdvanceDetailVO> findList(Long advanceId) {
return baseMapper.findList(advanceId);
}
@Override
public List<AdvanceDetailGoodsVO> findGoodsListByAdvanceIds(List<Long> advanceIds) {
return baseMapper.findGoodsListByAdvanceIds(advanceIds);
}
@Override
public AdvanceDetailStockNumVO findStockNumByAdvanceIds(List<Long> advanceIds) {
return baseMapper.findStockNumByAdvanceIds(advanceIds);
}
@Override
public List<BillladingPackageVO> findBillladingPackageByAdvanceIdsAnd(List<Long> advanceIds) {
return baseMapper.findBillladingPackageByAdvanceIdsAnd(advanceIds);
}
@Override
public IPage<TrunklineAdvanceDetailVO> advanceDetailPageList(AdvanceDetailDTO advanceDetailDTO) {
IPage<Object> page = new Page<>();
page.setCurrent(advanceDetailDTO.getPageNum());
page.setSize(advanceDetailDTO.getPageSize());
IPage<TrunklineAdvanceDetailVO> pageList = baseMapper.advanceDetailPageList(page,advanceDetailDTO);
return pageList;
}
}

33
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java

@ -1,19 +1,25 @@
package com.logpm.trunkline.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.basic.entity.BasicMaterialEntity;
import com.logpm.basic.feign.IBasicMaterialClient;
import com.logpm.basicdata.entity.BasicdataClientEntity;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataClientClient;
import com.logpm.basicdata.feign.IBasicdataStoreBusinessClient;
import com.logpm.basicdata.feign.IBasicdataTripartiteMallClient;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.entity.DistributionStockArticleEntity;
import com.logpm.distribution.feign.IDistributionParcelListClient;
import com.logpm.distribution.feign.IDistributionStockArticleClient;
import com.logpm.trunkline.dto.AdvanceDTO;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.entity.TrunklineAdvanceEntity;
import com.logpm.trunkline.mapper.TrunklineAdvanceMapper;
import com.logpm.trunkline.service.ITrunklineAdvanceService;
import com.logpm.trunkline.vo.OpenOrderVO;
import com.logpm.trunkline.vo.TrunklineAdvanceVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.TenantNum;
@ -37,6 +43,7 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
private final IBasicdataClientClient basicdataClientClient;
private final IBasicdataStoreBusinessClient basicdataStoreBusinessClient;
private final IBasicMaterialClient basicMaterialClient;
private final IBasicdataTripartiteMallClient tripartiteMallClient;
@Override
@ -227,4 +234,30 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
log.info("#############saveOrderAndPackage: 订单包件信息保存完成 OrderPackageCode={}",advanceDetailEntity.getOrderPackageCode());
}
@Override
public IPage<TrunklineAdvanceVO> advancePageList(IPage<Object> page, AdvanceDTO advanceDTO) {
IPage<TrunklineAdvanceVO> trunklineAdvanceVOIPage = baseMapper.advancePageList(page, advanceDTO);
List<TrunklineAdvanceVO> records = trunklineAdvanceVOIPage.getRecords();
for (TrunklineAdvanceVO trunklineAdvanceVO:records){
String dealerName = trunklineAdvanceVO.getDealerName();
String brand = trunklineAdvanceVO.getBrand();
Long clientId = tripartiteMallClient.getClientIdByNameAndBrand(dealerName, brand);
BasicdataClientEntity basicdataClientEntity = basicdataClientClient.findEntityById(clientId);
trunklineAdvanceVO.setHtMallName(basicdataClientEntity.getClientName());
}
trunklineAdvanceVOIPage.setRecords(records);
return trunklineAdvanceVOIPage;
}
@Override
public List<TrunklineAdvanceEntity> findListByIds(List<Long> advanceIds) {
return baseMapper.findListByIds(advanceIds);
}
@Override
public OpenOrderVO selectInfoByIds(List<Long> advanceIds) {
return baseMapper.selectInfoByIds(advanceIds);
}
}

23
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingPackageServiceImpl.java

@ -14,11 +14,13 @@ import com.logpm.warehouse.feign.IWarehouseWaybillClient;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.utils.CommonUtil;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.secure.utils.AuthUtil;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Objects;
@ -33,6 +35,7 @@ public class TrunklineBillladingPackageServiceImpl extends BaseServiceImpl<Trunk
private final ITrunklineAdvanceDetailService trunklineAdvanceDetailService;
private final ITrunklineWaybillOrderService trunklineWaybillOrderService;
private final IWarehouseWaybillClient warehouseWaybillClient;
private final ITrunklineWaybillTrackService trunklineWaybillTrackService;
@Override
public void saveEntity(String orderPackageCode, Long billladingId,Long warehouseId,Integer incomingType) {
@ -103,6 +106,26 @@ public class TrunklineBillladingPackageServiceImpl extends BaseServiceImpl<Trunk
billladingWaybillEntity.setRealNum(realNum+1);
trunklineBillladingWaybillService.updateById(billladingWaybillEntity);
waybillEntity.setStockCount(finishNum+1);
if(allTotalNum.equals(waybillEntity.getStockCount())){
waybillEntity.setWaybillStatus("20");
try{
TrunklineWaybillTrackEntity waybillTrackEntity = new TrunklineWaybillTrackEntity();
waybillTrackEntity.setWarehouseId(warehouseId);
waybillTrackEntity.setWarehouseName(warehouseEntity.getName());
waybillTrackEntity.setWaybillId(waybillId);
waybillTrackEntity.setWaybillNo(waybillEntity.getWaybillNo());
waybillTrackEntity.setTrackType("20");
waybillTrackEntity.setDescribe("已入库");
waybillTrackEntity.setOperationRemark("运单入库:"+waybillEntity.getStockCount()+"/"+allTotalNum+",入库类型:【批量入库】,入库时间:"+ CommonUtil.dateToString(new Date()));
trunklineWaybillTrackService.save(waybillTrackEntity);
}catch (Exception e){
log.warn("#################updateBillladingWaybillNum: 存入日志失败");
}
}else{
waybillEntity.setWaybillStatus("10");
}
warehouseWaybillClient.updateEntity(waybillEntity);
}else{

39
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingServiceImpl.java

@ -8,10 +8,7 @@ import com.logpm.basicdata.feign.IBasicdataCodeClient;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.trunkline.dto.BillladingDTO;
import com.logpm.trunkline.dto.BillladingWaybillDTO;
import com.logpm.trunkline.entity.TrunklineBillladingEntity;
import com.logpm.trunkline.entity.TrunklineBillladingLineEntity;
import com.logpm.trunkline.entity.TrunklineBillladingLogEntity;
import com.logpm.trunkline.entity.TrunklineBillladingWaybillEntity;
import com.logpm.trunkline.entity.*;
import com.logpm.trunkline.mapper.TrunklineBillladingMapper;
import com.logpm.trunkline.service.*;
import com.logpm.trunkline.vo.TrunklineBillladingLineVO;
@ -54,6 +51,7 @@ public class TrunklineBillladingServiceImpl extends BaseServiceImpl<TrunklineBil
private final IBasicdataWarehouseClient basicdataWarehouseClient;
private final IBasicdataCodeClient basicdataCodeClient;
private final ITrunklineBillladingLogService trunklineBillladingLogService;
private final ITrunklineWaybillTrackService trunklineWaybillTrackService;
@Override
public IPage<TrunklineBillladingVO> pageList(BillladingDTO billladingDTO) {
@ -388,12 +386,9 @@ public class TrunklineBillladingServiceImpl extends BaseServiceImpl<TrunklineBil
Integer tNum = billladingWaybillService.getFinishNumByWaybillIdNotBillladingWaybillId(waybillId,billladingWaybillId);
WarehouseWaybillEntity warehouseWaybillEntity = warehouseWaybillClient.findByWaybillId(waybillId);
if(Objects.isNull(warehouseWaybillEntity)){
log.warn("###############updateBillladingWaybillNum: 运单不存在 waybillId={}",waybillId);
return R.fail(405,"运单不存在");
}
Integer totalCount = warehouseWaybillEntity.getTotalCount();
//这个运单总件数不应该查询运单上的总件数,应该取统计运单下暂存单的包件数量,因为运单可能会涉及到改单 总数会变
Integer totalCount = trunklineWaybillOrderService.getOrderPackageNumByWaybillId(waybillId);
Integer enterNum = billladingWaybillDTO.getEnterNum();
if(tNum+enterNum > totalCount){
@ -408,6 +403,30 @@ public class TrunklineBillladingServiceImpl extends BaseServiceImpl<TrunklineBil
stockWeight = stockWeight.add(enterWeight);
stockVolume = stockVolume.add(enterVolume);
billladingWaybillService.updateDataByBillladingWaybillId(billladingWaybillId,enterNum,enterWeight,enterVolume);
WarehouseWaybillEntity waybillEntity = warehouseWaybillClient.findByWaybillId(waybillId);
waybillEntity.setStockCount(enterNum);
waybillEntity.setStockWeight(enterWeight);
waybillEntity.setStockVolume(enterVolume);
if(totalCount.equals(enterNum)){
waybillEntity.setWaybillStatus("10");
try{
TrunklineWaybillTrackEntity waybillTrackEntity = new TrunklineWaybillTrackEntity();
waybillTrackEntity.setWarehouseId(billladingEntity.getWarehouseId());
waybillTrackEntity.setWarehouseName(billladingEntity.getWarehouseName());
waybillTrackEntity.setWaybillId(waybillId);
waybillTrackEntity.setWaybillNo(waybillNo);
waybillTrackEntity.setTrackType("20");
waybillTrackEntity.setDescribe("已入库");
waybillTrackEntity.setOperationRemark("运单入库:"+enterNum+"/"+totalCount+",入库类型:【批量入库】,入库时间:"+ CommonUtil.dateToString(new Date()));
trunklineWaybillTrackService.save(waybillTrackEntity);
}catch (Exception e){
log.warn("#################updateBillladingWaybillNum: 存入日志失败");
}
}
warehouseWaybillClient.updateEntity(waybillEntity);
}
billladingEntity.setRealNum(stockNum);

8
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingWaybillServiceImpl.java

@ -113,4 +113,12 @@ public class TrunklineBillladingWaybillServiceImpl extends BaseServiceImpl<Trunk
return baseMapper.getFinishNumByWaybillIdNotBillladingWaybillId(waybillId,billladingWaybillId);
}
@Override
public TrunklineBillladingWaybillEntity getNoDataWaybillByBillladingId(Long billladingId) {
QueryWrapper<TrunklineBillladingWaybillEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("waybill_no","————")
.eq("is_deleted",0);
return baseMapper.selectOne(queryWrapper);
}
}

14
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineDetailProductServiceImpl.java

@ -1,5 +1,6 @@
package com.logpm.trunkline.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.logpm.trunkline.entity.TrunklineDetailProductEntity;
import com.logpm.trunkline.mapper.TrunklineDetailProductMapper;
import com.logpm.trunkline.service.ITrunklineDetailProductService;
@ -8,8 +9,21 @@ import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
import java.util.List;
@Slf4j
@Service
@AllArgsConstructor
public class TrunklineDetailProductServiceImpl extends BaseServiceImpl<TrunklineDetailProductMapper, TrunklineDetailProductEntity> implements ITrunklineDetailProductService {
@Override
public List<TrunklineDetailProductEntity> findListByOrderPackageCode(String orderPackageCode) {
QueryWrapper<TrunklineDetailProductEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("unit_no",orderPackageCode);
return baseMapper.selectList(queryWrapper);
}
}

13
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineWaybillOrderServiceImpl.java

@ -1,5 +1,6 @@
package com.logpm.trunkline.service.impl;
import com.logpm.trunkline.entity.TrunklineAdvanceEntity;
import com.logpm.trunkline.entity.TrunklineWaybillOrderEntity;
import com.logpm.trunkline.mapper.TrunklineWaybillOrderMapper;
import com.logpm.trunkline.service.ITrunklineWaybillOrderService;
@ -8,6 +9,8 @@ import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
import java.util.List;
@Slf4j
@Service
@AllArgsConstructor
@ -16,4 +19,14 @@ public class TrunklineWaybillOrderServiceImpl extends BaseServiceImpl<TrunklineW
public Integer getTotalNumByWaybillId(Long waybillId) {
return baseMapper.getTotalNumByWaybillId(waybillId);
}
@Override
public Integer getOrderPackageNumByWaybillId(Long waybillId) {
return baseMapper.getOrderPackageNumByWaybillId(waybillId);
}
@Override
public List<TrunklineAdvanceEntity> findListByWaybillId(Long waybillId) {
return baseMapper.findListByWaybillId(waybillId);
}
}

15
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineWaybillTrackServiceImpl.java

@ -0,0 +1,15 @@
package com.logpm.trunkline.service.impl;
import com.logpm.trunkline.entity.TrunklineWaybillTrackEntity;
import com.logpm.trunkline.mapper.TrunklineWaybillTrackMapper;
import com.logpm.trunkline.service.ITrunklineWaybillTrackService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
@Slf4j
@Service
@AllArgsConstructor
public class TrunklineWaybillTrackServiceImpl extends BaseServiceImpl<TrunklineWaybillTrackMapper, TrunklineWaybillTrackEntity> implements ITrunklineWaybillTrackService {
}

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

@ -575,7 +575,7 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl<WarehouseWaybil
warehouseWaybill.setTotalWeight(wayBillEntity.getWeight());
warehouseWaybill.setTotalVolume(wayBillEntity.getVolume());
warehouseWaybill.setDeliveryMethod(wayBillEntity.getSendType());
warehouseWaybill.setUrgency(wayBillEntity.getUrgency());
warehouseWaybill.setUrgency(wayBillEntity.getUrgency()+"");
warehouseWaybill.setReceiptCount(wayBillEntity.getReceiptNum());
warehouseWaybill.setReceiptRequirement(wayBillEntity.getReceiptAsk());
//--------------2023-07-28-------------

Loading…
Cancel
Save