From 40eeddb50cfd83e4965dee5af186a3c86c205859 Mon Sep 17 00:00:00 2001 From: zhaoqiaobo Date: Thu, 18 Apr 2024 15:12:38 +0800 Subject: [PATCH] =?UTF-8?q?feat(all)=EF=BC=9A=E4=BC=98=E5=8C=96=E4=BB=B7?= =?UTF-8?q?=E6=A0=BC=E4=BD=93=E7=B3=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../springblade/common/model/dto/NameDTO.java | 18 ++ .../BasicdataPriceCategoryBasicEntity.java | 2 +- .../BasicdataPriceFullVehicleEntity.java | 2 +- .../entity/BasicdataPriceGeneralEntity.java | 2 +- .../entity/BasicdataPriceTemplateEntity.java | 2 + .../basicdata/enums/PriceBizTypeApiEnums.java | 28 ++ .../feign/IBasicdataPriceClient.java | 8 +- .../basicdata/vo/BasicdatPriceApiVO.java | 59 ++++ .../vo/BasicdataPriceFullVehicleVO.java | 3 - .../basicdata/vo/BasicdataPricePageVO.java | 14 +- .../vo/BasicdataPriceTemplateVO.java | 3 - .../com/logpm/basicdata/vo/PriceBasicVO.java | 3 - .../com/logpm/basicdata/vo/PriceClientVO.java | 31 ++ .../vo/PriceDispatchAdditionalVO.java | 3 - .../basicdata/vo/PriceDispatchBasicVO.java | 3 - .../com/logpm/basicdata/vo/PriceRouteVO.java | 4 +- .../vo/PriceWarehouseAdditionalVO.java | 3 - .../basicdata/vo/PriceWarehouseBasicVO.java | 3 - .../controller/BasicdataPriceController.java | 3 +- .../BasicdataPriceRouteController.java | 2 +- .../BasicdataPriceTemplateController.java | 27 -- .../basicdata/enums/FullVehicleTypeEnums.java | 8 +- .../enums/GeneralServiceTypeEnums.java | 8 +- .../basicdata/feign/BasicdataPriceClient.java | 44 +++ .../feign/BasicdataWarehouseClient.java | 1 - .../mapper/BasicdataClientMapper.java | 3 + .../mapper/BasicdataClientMapper.xml | 6 + .../BasicdataPriceCategoryBasicMapper.java | 4 +- .../BasicdataPriceCategoryDispatchMapper.java | 3 + ...BasicdataPriceCategoryWarehouseMapper.java | 2 + .../BasicdataPriceFullVehicleMapper.java | 3 + .../mapper/BasicdataPriceGeneralMapper.java | 3 + .../mapper/BasicdataPriceMapper.java | 6 +- .../basicdata/mapper/BasicdataPriceMapper.xml | 47 +++- .../mapper/BasicdataPriceRouteMapper.java | 5 +- .../mapper/BasicdataPriceRouteMapper.xml | 20 +- .../mapper/BasicdataPriceTemplateMapper.java | 2 + .../mapper/BasicdataPriceTemplateMapper.xml | 22 +- .../service/IBasicdataClientService.java | 4 + .../IBasicdataPriceCategoryBasicService.java | 2 + ...BasicdataPriceCategoryDispatchService.java | 1 + ...asicdataPriceCategoryWarehouseService.java | 1 + .../IBasicdataPriceFullVehicleService.java | 5 +- .../IBasicdataPriceGeneralService.java | 1 + .../service/IBasicdataPriceRouteService.java | 2 + .../service/IBasicdataPriceService.java | 14 +- .../impl/BasicdataClientServiceImpl.java | 47 +++- ...asicdataPriceCategoryBasicServiceImpl.java | 7 + ...cdataPriceCategoryDispatchServiceImpl.java | 7 + ...dataPriceCategoryWarehouseServiceImpl.java | 13 +- .../BasicdataPriceFullVehicleServiceImpl.java | 7 + .../BasicdataPriceGeneralServiceImpl.java | 18 +- .../impl/BasicdataPriceRouteServiceImpl.java | 91 ++++-- .../impl/BasicdataPriceServiceImpl.java | 266 +++++++++++++----- .../BasicdataPriceTemplateServiceImpl.java | 124 ++++---- .../impl/BasicdataWarehouseServiceImpl.java | 3 - .../controller/MerchantController.java | 6 +- .../datasharing/mapper/MerchantMapper.xml | 2 +- .../datasharing/service/MerchantService.java | 4 +- .../service/impl/MerchantServiceImpl.java | 19 +- .../mapper/DistributionParcelListMapper.java | 10 + .../mapper/DistributionParcelListMapper.xml | 7 + .../IDistributionParcelListService.java | 10 + .../DistributionParcelListServiceImpl.java | 55 ++-- .../DistrilbutionBillLadingServiceImpl.java | 49 ++++ 65 files changed, 862 insertions(+), 323 deletions(-) create mode 100644 blade-biz-common/src/main/java/org/springblade/common/model/dto/NameDTO.java create mode 100644 blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/enums/PriceBizTypeApiEnums.java create mode 100644 blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdatPriceApiVO.java create mode 100644 blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/PriceClientVO.java create mode 100644 blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataPriceClient.java diff --git a/blade-biz-common/src/main/java/org/springblade/common/model/dto/NameDTO.java b/blade-biz-common/src/main/java/org/springblade/common/model/dto/NameDTO.java new file mode 100644 index 000000000..b8eca8999 --- /dev/null +++ b/blade-biz-common/src/main/java/org/springblade/common/model/dto/NameDTO.java @@ -0,0 +1,18 @@ +package org.springblade.common.model.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 远程调用获取name DTO + * @author zhaoqiaobo + * @create 2024-04-17 + */ +@Data +public class NameDTO implements Serializable { + + private String id; + private String name; + +} diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataPriceCategoryBasicEntity.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataPriceCategoryBasicEntity.java index 26a50d26d..055aee6be 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataPriceCategoryBasicEntity.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataPriceCategoryBasicEntity.java @@ -52,7 +52,7 @@ public class BasicdataPriceCategoryBasicEntity extends TenantEntity { private Long categoryId; @ApiModelProperty(value = "计费类型(1:按件,3:按方,4:按重量)") private Integer type; - @ApiModelProperty(value = "服务类型(1:提货,2:提货路径,3:干线,4:干线路径)") + @ApiModelProperty(value = "服务类型(1:提货,2:干线)") private Integer serviceType; @ApiModelProperty(value = "单价") private Double price; diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataPriceFullVehicleEntity.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataPriceFullVehicleEntity.java index c3633394c..5262a9d35 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataPriceFullVehicleEntity.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataPriceFullVehicleEntity.java @@ -49,7 +49,7 @@ public class BasicdataPriceFullVehicleEntity extends TenantEntity { private Long boId; @ApiModelProperty(value = "基础价格id") private Long priceId; - @ApiModelProperty(value = "类型(1:整车提货,2:干线整车运输,3:整车配送,4:提货路径,5:干线路径)") + @ApiModelProperty(value = "类型(1:提货整车,2:干线整车,4:配送整车)") private Integer type; @ApiModelProperty(value = "车型") private Integer vehicleType; diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataPriceGeneralEntity.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataPriceGeneralEntity.java index 82654948f..b2b8e9a28 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataPriceGeneralEntity.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataPriceGeneralEntity.java @@ -48,7 +48,7 @@ public class BasicdataPriceGeneralEntity extends TenantEntity { private Long boId; @ApiModelProperty(value = "基础价格id") private Long priceId; - @ApiModelProperty(value = "服务类型(1:提货,2:提货路径,3:干线,4:干线路径,5:配送,6:配送遗留)") + @ApiModelProperty(value = "服务类型(1:提货,2:干线,4:配送,5:配送遗留)") private Integer serviceType; @ApiModelProperty(value = "最低计费") private Double minCost; diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataPriceTemplateEntity.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataPriceTemplateEntity.java index 52d192196..9ebdc8120 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataPriceTemplateEntity.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataPriceTemplateEntity.java @@ -47,6 +47,8 @@ public class BasicdataPriceTemplateEntity extends TenantEntity { private String reserve4; @ApiModelProperty(value = "预留5") private String reserve5; + @ApiModelProperty(value = "模版类型") + private String templateType; @ApiModelProperty(value = "模板名称") @NotEmpty(message = "模板名称不能为空") private String name; diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/enums/PriceBizTypeApiEnums.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/enums/PriceBizTypeApiEnums.java new file mode 100644 index 000000000..fd11a494d --- /dev/null +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/enums/PriceBizTypeApiEnums.java @@ -0,0 +1,28 @@ +package com.logpm.basicdata.enums; + +import org.springblade.common.model.IDict; + +/** + * 价格业务类型 + * + * @author zhaoqiaobo + * @create 2024-04-14 + */ +public enum PriceBizTypeApiEnums implements IDict { + /** + * 1- 全部费用 开单时调用,除仓储费 + */ + ALL(1, "全部费用"), + /** + * 2- 仓储费, 文员复核的时候调用 + */ + WAREHOUSE(2, "仓储费"), + /** + * 3- 配送费, 司机签收时调用 + */ + DISPATCH(3, "配送费"), + ; + PriceBizTypeApiEnums (Integer code, String name){ + init(code, name); + } +} diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataPriceClient.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataPriceClient.java index 7f870ea29..59b753f90 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataPriceClient.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataPriceClient.java @@ -16,15 +16,13 @@ */ package com.logpm.basicdata.feign; -import com.logpm.basicdata.entity.BasicdataFreightDetailEntity; -import com.logpm.basicdata.vo.BasicdataFreightApiVO; +import com.logpm.basicdata.vo.BasicdatPriceApiVO; +import com.logpm.basicdata.vo.PriceClientVO; import org.springblade.common.constant.ModuleNameConstant; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; -import java.util.List; - /** * 基础价格体系 Feign接口类 * @@ -40,6 +38,6 @@ public interface IBasicdataPriceClient { String PRICE = API_PREFIX + "/pirce"; @PostMapping(PRICE) - List pirce(@RequestBody BasicdataFreightApiVO param); + PriceClientVO pirce(@RequestBody BasicdatPriceApiVO param); } diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdatPriceApiVO.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdatPriceApiVO.java new file mode 100644 index 000000000..d77bc9443 --- /dev/null +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdatPriceApiVO.java @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.basicdata.vo; + +import com.logpm.basicdata.enums.PriceBizTypeApiEnums; +import lombok.Data; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * 基础价格体系 视图实体类 + * + * @author cyz + * @since 2023-06-08 + */ +@Data +public class BasicdatPriceApiVO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + @NotEmpty(message = "客户id不能为空") + private String clientId; + /** + * 品牌id + */ + @NotEmpty(message = "品牌id不能为空") + private String brandId; + /** + * 发货单位id + */ + private String sendOrgId; + /** + * 始发地 + */ + private String startAreaId; + /** + * 目的地 + */ + private String endAreaId; + +} diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataPriceFullVehicleVO.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataPriceFullVehicleVO.java index 729fa52b6..9c3556190 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataPriceFullVehicleVO.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataPriceFullVehicleVO.java @@ -31,9 +31,6 @@ import java.io.Serializable; public class BasicdataPriceFullVehicleVO implements Serializable { private static final long serialVersionUID = 1L; - @ApiModelProperty(value = "主键") - private Long id; - @ApiModelProperty(value = "车型") private Integer vehicleType; diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataPricePageVO.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataPricePageVO.java index 184118540..3ce265f24 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataPricePageVO.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataPricePageVO.java @@ -16,10 +16,12 @@ */ package com.logpm.basicdata.vo; +import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.io.Serializable; +import java.util.Date; /** * 基础价格表 视图实体类 @@ -40,6 +42,12 @@ public class BasicdataPricePageVO implements Serializable { @ApiModelProperty(value = "品牌名称") private String brandName; + @ApiModelProperty(value = "品牌id") + private String brandId; + + @ApiModelProperty(value = "价格模板id") + private String templateId; + @ApiModelProperty(value = "模板服务类型") private String serviceType; @@ -50,9 +58,11 @@ public class BasicdataPricePageVO implements Serializable { private String updateTime; @ApiModelProperty(value = "生效时间") - private String effectiveTime; + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date effectiveTime; @ApiModelProperty(value = "过期时间") - private String expiryTime; + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date expiryTime; } diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataPriceTemplateVO.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataPriceTemplateVO.java index 7d5cd257c..4cb16cef4 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataPriceTemplateVO.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataPriceTemplateVO.java @@ -37,9 +37,6 @@ public class BasicdataPriceTemplateVO extends BasicdataPriceTemplateEntity { @ApiModelProperty(value = "当前选择的服务类型") private Integer checkType; - @ApiModelProperty(value = "模版类型") - private String templateType; - @ApiModelProperty(value = "用户名称") private String userName; diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/PriceBasicVO.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/PriceBasicVO.java index 6863e4d9b..d9661a59f 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/PriceBasicVO.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/PriceBasicVO.java @@ -32,9 +32,6 @@ public class PriceBasicVO implements Serializable { private static final long serialVersionUID = 1L; - @ApiModelProperty(value = "主键") - private Long id; - @ApiModelProperty(value = "品类id") private Long categoryId; @ApiModelProperty(value = "单价") diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/PriceClientVO.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/PriceClientVO.java new file mode 100644 index 000000000..1a87a16ab --- /dev/null +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/PriceClientVO.java @@ -0,0 +1,31 @@ +package com.logpm.basicdata.vo; + +import com.logpm.basicdata.entity.BasicdataPriceTemplateEntity; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +/** + * 价格vo + * + * @author zhaoqiaobo + * @create 2024-04-03 + */ +@Data +public class PriceClientVO implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "提货") + private PricePickupVO pickup; + @ApiModelProperty(value = "干线") + private PriceTrunkLineVO trunkLine; + @ApiModelProperty(value = "仓储") + private PriceWarehouseVO warehouse; + @ApiModelProperty(value = "配送") + private PriceDispatchVO dispatch; + @ApiModelProperty(value = "模板") + private BasicdataPriceTemplateEntity template; + +} diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/PriceDispatchAdditionalVO.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/PriceDispatchAdditionalVO.java index d029f78f4..ca83bc075 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/PriceDispatchAdditionalVO.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/PriceDispatchAdditionalVO.java @@ -32,9 +32,6 @@ public class PriceDispatchAdditionalVO implements Serializable { private static final long serialVersionUID = 1L; - @ApiModelProperty(value = "主键") - private Long id; - @ApiModelProperty(value = "品类id") private Long categoryId; @ApiModelProperty(value = "分货费") diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/PriceDispatchBasicVO.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/PriceDispatchBasicVO.java index ead48dfb4..df2641af0 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/PriceDispatchBasicVO.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/PriceDispatchBasicVO.java @@ -32,9 +32,6 @@ public class PriceDispatchBasicVO implements Serializable { private static final long serialVersionUID = 1L; - @ApiModelProperty(value = "主键") - private Long id; - @ApiModelProperty(value = "品类id") private Long categoryId; @ApiModelProperty(value = "单价") diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/PriceRouteVO.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/PriceRouteVO.java index fcd3e8937..63a10fa7e 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/PriceRouteVO.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/PriceRouteVO.java @@ -36,8 +36,10 @@ public class PriceRouteVO implements Serializable { private Long endCityId; @ApiModelProperty(value = "目的地区县id") private Long endCountyId; - @ApiModelProperty(value = "发货单位") + @ApiModelProperty(value = "发货单位id") private Long sendOrgId; + @ApiModelProperty(value = "发货单位名称") + private String sendOrgName; @ApiModelProperty(value = "整车计费") private List fullVehicle; diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/PriceWarehouseAdditionalVO.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/PriceWarehouseAdditionalVO.java index 9511abf98..e2c59d206 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/PriceWarehouseAdditionalVO.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/PriceWarehouseAdditionalVO.java @@ -32,9 +32,6 @@ public class PriceWarehouseAdditionalVO implements Serializable { private static final long serialVersionUID = 1L; - @ApiModelProperty(value = "主键") - private Long id; - @ApiModelProperty(value = "品类id") private Long categoryId; @ApiModelProperty(value = "操作/装卸费") diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/PriceWarehouseBasicVO.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/PriceWarehouseBasicVO.java index ea7e4e4d6..baccf6292 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/PriceWarehouseBasicVO.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/PriceWarehouseBasicVO.java @@ -32,9 +32,6 @@ public class PriceWarehouseBasicVO implements Serializable { private static final long serialVersionUID = 1L; - @ApiModelProperty(value = "主键") - private Long id; - @ApiModelProperty(value = "品类id") private Long categoryId; @ApiModelProperty(value = "30天内") diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataPriceController.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataPriceController.java index 98182005a..eb4c2d601 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataPriceController.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataPriceController.java @@ -21,7 +21,6 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.logpm.basicdata.service.IBasicdataPriceService; import com.logpm.basicdata.vo.BasicdataPriceBasicUpdateVO; import com.logpm.basicdata.vo.BasicdataPricePageVO; -import com.logpm.basicdata.vo.BasicdataPriceVO; import com.logpm.basicdata.vo.PriceVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -72,7 +71,7 @@ public class BasicdataPriceController extends BladeController { @GetMapping @ApiOperationSupport(order = 2) @ApiOperation(value = "基础价格分页", notes = "传入basicdataPrice") - public R> page(BasicdataPriceVO basicdataPrice, Query query) { + public R> page(BasicdataPricePageVO basicdataPrice, Query query) { IPage pages = basicdataPriceService.selectBasicdataPricePage(Condition.getPage(query), basicdataPrice); return R.data(pages); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataPriceRouteController.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataPriceRouteController.java index 3c582d535..0bbe33f96 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataPriceRouteController.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataPriceRouteController.java @@ -85,7 +85,7 @@ public class BasicdataPriceRouteController extends BladeController { @ApiOperation(value = "新增/修改", notes = "传入basicdataPriceRoute") public R save(@Valid @RequestBody PriceRouteVO vo) { Long id = basicdataPriceRouteService.saveRoute(vo); - return R.success(StrUtil.toString(id)); + return R.data(StrUtil.toString(id)); } /** diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataPriceTemplateController.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataPriceTemplateController.java index 4462ff8ad..75c62d666 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataPriceTemplateController.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataPriceTemplateController.java @@ -16,11 +16,9 @@ */ package com.logpm.basicdata.controller; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.logpm.basicdata.entity.BasicdataPriceTemplateEntity; -import com.logpm.basicdata.excel.BasicdataPriceTemplateExcel; import com.logpm.basicdata.service.IBasicdataPriceTemplateService; import com.logpm.basicdata.vo.BasicdataPriceTemplateVO; import io.swagger.annotations.Api; @@ -28,13 +26,9 @@ import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import lombok.AllArgsConstructor; import org.springblade.core.boot.ctrl.BladeController; -import org.springblade.core.excel.util.ExcelUtil; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; -import org.springblade.core.secure.BladeUser; import org.springblade.core.tool.api.R; -import org.springblade.core.tool.constant.BladeConstant; -import org.springblade.core.tool.utils.DateUtil; import org.springblade.core.tool.utils.Func; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; @@ -46,12 +40,8 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; -import springfox.documentation.annotations.ApiIgnore; -import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; -import java.util.List; -import java.util.Map; /** * 基础价格模板表 控制器 @@ -130,21 +120,4 @@ public class BasicdataPriceTemplateController extends BladeController { return R.status(basicdataPriceTemplateService.deleteLogic(Func.toLongList(ids))); } - - /** - * 导出数据 - */ - @GetMapping("/export-basicdataPriceTemplate") - @ApiOperationSupport(order = 9) - @ApiOperation(value = "导出数据", notes = "传入basicdataPriceTemplate") - public void exportBasicdataPriceTemplate(@ApiIgnore @RequestParam Map basicdataPriceTemplate, BladeUser bladeUser, HttpServletResponse response) { - QueryWrapper queryWrapper = Condition.getQueryWrapper(basicdataPriceTemplate, BasicdataPriceTemplateEntity.class); - //if (!AuthUtil.isAdministrator()) { - // queryWrapper.lambda().eq(BasicdataPriceTemplate::getTenantId, bladeUser.getTenantId()); - //} - queryWrapper.lambda().eq(BasicdataPriceTemplateEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED); - List list = basicdataPriceTemplateService.exportBasicdataPriceTemplate(queryWrapper); - ExcelUtil.export(response, "基础价格模板表数据" + DateUtil.time(), "基础价格模板表数据表", list, BasicdataPriceTemplateExcel.class); - } - } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/enums/FullVehicleTypeEnums.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/enums/FullVehicleTypeEnums.java index c09020f87..38f7f7a0a 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/enums/FullVehicleTypeEnums.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/enums/FullVehicleTypeEnums.java @@ -10,11 +10,9 @@ import org.springblade.common.model.IDict; */ public enum FullVehicleTypeEnums implements IDict { - PICK_UP(1, "整车提货"), - TRUNK_LINE(2, "干线整车运输"), - DISPATCH(3, "整车配送"), - TRUNK_LINE_ROUTE(4, "干线路径整车运输"), - PICK_UP_ROUTE(5, "提货路径整车运输"), + PICK_UP(1, "提货整车"), + TRUNK_LINE(2, "配送干线整车"), + DISPATCH(4, "整车"), ; FullVehicleTypeEnums(Integer code, String text) { diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/enums/GeneralServiceTypeEnums.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/enums/GeneralServiceTypeEnums.java index 96763b6f9..a759f08b3 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/enums/GeneralServiceTypeEnums.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/enums/GeneralServiceTypeEnums.java @@ -10,11 +10,9 @@ import org.springblade.common.model.IDict; */ public enum GeneralServiceTypeEnums implements IDict { PICK_UP(1, "提货"), - PICK_UP_ROUTE(2, "提货路径"), - TRUNK_LINE(3, "干线"), - TRUNK_LINE_ROUTE(4, "干线路径"), - DISPATCH(5, "配送"), - DISPATCH_LEAVE_BEHIND(6, "配送遗留"), + TRUNK_LINE(2, "干线"), + DISPATCH(4, "配送"), + DISPATCH_LEAVE_BEHIND(5, "配送遗留"), ; GeneralServiceTypeEnums(Integer code, String text) { diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataPriceClient.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataPriceClient.java new file mode 100644 index 000000000..2a415a4ca --- /dev/null +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataPriceClient.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.basicdata.feign; + +import com.logpm.basicdata.service.IBasicdataPriceService; +import com.logpm.basicdata.vo.BasicdatPriceApiVO; +import com.logpm.basicdata.vo.PriceClientVO; +import lombok.AllArgsConstructor; +import org.springframework.web.bind.annotation.RestController; +import springfox.documentation.annotations.ApiIgnore; + +/** + * 基础价格 Feign实现类 + * + * @author zqb + * @since 2024-04-15 + */ +@ApiIgnore() +@RestController +@AllArgsConstructor +public class BasicdataPriceClient implements IBasicdataPriceClient { + + private final IBasicdataPriceService basicdataPriceService; + + @Override + public PriceClientVO pirce(BasicdatPriceApiVO param) { + return basicdataPriceService.price(param); + } + +} diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataWarehouseClient.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataWarehouseClient.java index ab0872439..5d5044525 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataWarehouseClient.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataWarehouseClient.java @@ -31,7 +31,6 @@ import org.springblade.core.mp.support.BladePage; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; import org.springblade.core.redis.cache.BladeRedis; -import org.springblade.core.redis.cache.CacheKey; import org.springblade.core.tool.api.R; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.java index 451f457e9..a49dbb91c 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.java @@ -24,6 +24,7 @@ import com.logpm.basicdata.excel.BasicdataClientExcel; import com.logpm.basicdata.vo.BasicdataClientVO; import com.logpm.basicdata.vo.ClientInfoVO; import org.apache.ibatis.annotations.Param; +import org.springblade.common.model.dto.NameDTO; import java.util.List; @@ -56,4 +57,6 @@ public interface BasicdataClientMapper extends BaseMapper List selectListDict(@Param("id") Long id); List findListByClientName(@Param("clientName") String clientName,@Param("linkMan") String linkMan,@Param("linkPhone") String linkPhone); + + List findNameByIds(@Param("sendOrgIds") List sendOrgIds); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.xml b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.xml index b14242367..4d373699e 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.xml +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.xml @@ -74,5 +74,11 @@ limit 10 + diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceCategoryBasicMapper.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceCategoryBasicMapper.java index 347953556..af0184c4d 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceCategoryBasicMapper.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceCategoryBasicMapper.java @@ -29,6 +29,8 @@ import org.apache.ibatis.annotations.Delete; public interface BasicdataPriceCategoryBasicMapper extends BaseMapper { @Delete("delete from logpm_basicdata_price_category_basic where price_id = #{priceId}") - void removeByPriceId(Long priceId); + void removeByPriceId(Long priceId); + @Delete("delete from logpm_basicdata_price_category_basic where bo_id = #{priceId} and service_type = #{serviceType}") + void removeByPriceIdAndServiceType(Long priceId, Integer serviceType); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceCategoryDispatchMapper.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceCategoryDispatchMapper.java index ea058a90c..5cc87ee92 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceCategoryDispatchMapper.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceCategoryDispatchMapper.java @@ -31,4 +31,7 @@ public interface BasicdataPriceCategoryDispatchMapper extends BaseMapper { * @param basicdataPrice * @return */ - List selectBasicdataPricePage(IPage page, BasicdataPriceVO basicdataPrice); + List selectBasicdataPricePage(IPage page, BasicdataPricePageVO basicdataPrice); /** @@ -53,4 +53,6 @@ public interface BasicdataPriceMapper extends BaseMapper { */ List exportBasicdataPrice(@Param("ew") Wrapper queryWrapper); + @Delete("delete from logpm_basicdata_price_route where price_id = #{id}") + void removeRouteByPriceId(Long id); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceMapper.xml b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceMapper.xml index 8d0733875..fd6f171f3 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceMapper.xml +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceMapper.xml @@ -9,27 +9,44 @@ diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceRouteMapper.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceRouteMapper.java index e9d2c969d..0c7b61ffb 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceRouteMapper.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceRouteMapper.java @@ -22,6 +22,7 @@ import com.logpm.basicdata.excel.BasicdataPriceRouteExcel; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -40,7 +41,7 @@ public interface BasicdataPriceRouteMapper extends BaseMapper selectBasicdataPriceRoutePage(IPage page, BasicdataPriceRouteVO basicdataPriceRoute); + List selectBasicdataPriceRoutePage(@Param("page") IPage page, @Param("basicdataPriceRoute") BasicdataPriceRouteVO basicdataPriceRoute); /** @@ -51,4 +52,6 @@ public interface BasicdataPriceRouteMapper extends BaseMapper exportBasicdataPriceRoute(@Param("ew") Wrapper queryWrapper); + @Delete("delete from logpm_basicdata_price_route where price_id = #{id}") + void removeByPriceId(Long id); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceRouteMapper.xml b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceRouteMapper.xml index 0d06caa9d..21980840b 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceRouteMapper.xml +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceRouteMapper.xml @@ -6,14 +6,20 @@ - - - - + diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceTemplateMapper.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceTemplateMapper.java index 79062a7b5..37606796a 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceTemplateMapper.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceTemplateMapper.java @@ -22,6 +22,7 @@ import com.logpm.basicdata.excel.BasicdataPriceTemplateExcel; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -31,6 +32,7 @@ import java.util.List; * @author zqb * @since 2024-04-01 */ +@Mapper public interface BasicdataPriceTemplateMapper extends BaseMapper { /** diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceTemplateMapper.xml b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceTemplateMapper.xml index 46b89da33..800b51cd7 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceTemplateMapper.xml +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceTemplateMapper.xml @@ -6,14 +6,28 @@ - - diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataClientService.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataClientService.java index c5048f262..a56b0478b 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataClientService.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataClientService.java @@ -23,6 +23,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.logpm.basicdata.entity.BasicdataClientEntity; import com.logpm.basicdata.excel.BasicdataClientExcel; import com.logpm.basicdata.vo.BasicdataClientVO; +import org.springblade.common.model.dto.NameDTO; import org.springblade.core.mp.base.BaseService; import java.security.NoSuchAlgorithmException; @@ -95,4 +96,7 @@ public interface IBasicdataClientService extends BaseService data, Boolean isCovered); List findListByClientName(String clientName,String linkMan,String linkPhone); + + List findNameByIds(List sendOrgIds); + } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataPriceCategoryBasicService.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataPriceCategoryBasicService.java index 76ed4e6b4..5f8811a7e 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataPriceCategoryBasicService.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataPriceCategoryBasicService.java @@ -36,4 +36,6 @@ public interface IBasicdataPriceCategoryBasicService extends BaseService selectBasicdataPricePage(IPage page, BasicdataPriceVO basicdataPrice); + IPage selectBasicdataPricePage(IPage page, BasicdataPricePageVO basicdataPrice); /** @@ -57,5 +58,14 @@ public interface IBasicdataPriceService extends BaseService>>>>> basicdataClient.getClientCode() {}",basicdataClient.getClientCode()); + log.info(">>>>>> basicdataClient.getClientCode() {}", basicdataClient.getClientCode()); //查询客户编码和客户名称是否存在 boolean b = basicdataClients.stream().anyMatch(ii -> ii.getClientCode().equals(basicdataClient.getClientCode()) || ii.getClientName().equals(basicdataClient.getClientName().trim())); @@ -396,7 +419,7 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl findNameByIds(List sendOrgIds) { + if (CollUtil.isNotEmpty(sendOrgIds)) { + return this.baseMapper.findNameByIds(sendOrgIds); + } + return null; + } + } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceCategoryBasicServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceCategoryBasicServiceImpl.java index 2e53f9d2f..732bff502 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceCategoryBasicServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceCategoryBasicServiceImpl.java @@ -38,4 +38,11 @@ public class BasicdataPriceCategoryBasicServiceImpl extends BaseServiceImpl implements IBasicdataPriceCategoryWarehouseService { - @Override - public void removeByPriceId(Long priceId) { + @Override + public void removeByPriceId(Long priceId) { if (ObjectUtil.isNotEmpty(priceId)) { baseMapper.removeByPriceId(priceId); } - } + } + + @Override + public void removeByPriceIdAndServiceType(Long priceId, Integer serviceType) { + if (!ObjectUtil.hasEmpty(priceId, serviceType)) { + baseMapper.removeByPriceIdAndServiceType(priceId, serviceType); + } + } } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceFullVehicleServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceFullVehicleServiceImpl.java index 8bb24ff0e..62c32edbb 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceFullVehicleServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceFullVehicleServiceImpl.java @@ -38,4 +38,11 @@ public class BasicdataPriceFullVehicleServiceImpl extends BaseServiceImpl implements IBasicdataPriceGeneralService { - @Override - public void removeByPriceId(Long priceId) { + @Override + public void removeByPriceId(Long priceId) { if (ObjectUtil.isNotEmpty(priceId)) { baseMapper.removeByPriceId(priceId); } - } + } + + @Override + public void removeByPriceIdAndServiceType(Long priceId, Integer serviceType) { + if (!ObjectUtil.hasEmpty(priceId, serviceType)) { + if (ObjectUtil.equal(serviceType, ServiceTypeEnums.DISPATCH.getCode())) { + // 配送遗留 + baseMapper.removeByPriceIdAndServiceType(priceId, 5); + } + baseMapper.removeByPriceIdAndServiceType(priceId, serviceType); + } + } } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceRouteServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceRouteServiceImpl.java index 851c42c73..469c224f7 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceRouteServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceRouteServiceImpl.java @@ -22,6 +22,7 @@ import cn.hutool.core.util.ObjectUtil; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.logpm.basicdata.entity.BasicdataClientEntity; import com.logpm.basicdata.entity.BasicdataPriceCategoryBasicEntity; import com.logpm.basicdata.entity.BasicdataPriceFullVehicleEntity; import com.logpm.basicdata.entity.BasicdataPriceGeneralEntity; @@ -32,6 +33,7 @@ import com.logpm.basicdata.enums.PickupPricingTypeEnums; import com.logpm.basicdata.enums.ServiceTypeEnums; import com.logpm.basicdata.excel.BasicdataPriceRouteExcel; import com.logpm.basicdata.mapper.BasicdataPriceRouteMapper; +import com.logpm.basicdata.service.IBasicdataClientService; import com.logpm.basicdata.service.IBasicdataPriceCategoryBasicService; import com.logpm.basicdata.service.IBasicdataPriceFullVehicleService; import com.logpm.basicdata.service.IBasicdataPriceGeneralService; @@ -44,6 +46,7 @@ import lombok.RequiredArgsConstructor; import org.springblade.core.log.exception.ServiceException; import org.springblade.core.mp.base.BaseServiceImpl; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.List; @@ -63,23 +66,23 @@ public class BasicdataPriceRouteServiceImpl extends BaseServiceImpl selectBasicdataPriceRoutePage(IPage page, BasicdataPriceRouteVO basicdataPriceRoute) { - return page.setRecords(baseMapper.selectBasicdataPriceRoutePage(page, basicdataPriceRoute)); + List basicdataPriceRouteVOS = baseMapper.selectBasicdataPriceRoutePage(page, basicdataPriceRoute); + return page.setRecords(basicdataPriceRouteVOS); } @Override public List exportBasicdataPriceRoute(Wrapper queryWrapper) { List basicdataPriceRouteList = baseMapper.exportBasicdataPriceRoute(queryWrapper); - //basicdataPriceRouteList.forEach(basicdataPriceRoute -> { - // basicdataPriceRoute.setTypeName(DictCache.getValue(DictEnum.YES_NO, BasicdataPriceRoute.getType())); - //}); return basicdataPriceRouteList; } @Override + @Transactional public Long saveRoute(PriceRouteVO vo) { // 处理基础数据 BasicdataPriceRouteEntity route = new BasicdataPriceRouteEntity(); @@ -98,17 +101,22 @@ public class BasicdataPriceRouteServiceImpl extends BaseServiceImpl { - buildFullVehicle(route.getId(), fullVehicleEntities, fullVehicle, finalFullVehicleTypeEnums.getCode()); + buildFullVehicle(route, fullVehicleEntities, fullVehicle, finalFullVehicleTypeEnums.getCode()); }); if (CollUtil.isNotEmpty(fullVehicleEntities)) { fullVehicleService.saveOrUpdateBatch(fullVehicleEntities); @@ -118,19 +126,19 @@ public class BasicdataPriceRouteServiceImpl extends BaseServiceImpl categoryEntities = new ArrayList<>(); if (CollUtil.isNotEmpty(vo.getPieceCategory())) { vo.getPieceCategory().forEach(pieceCategory -> { - buildCategory(route.getId(), categoryEntities, pieceCategory, PickupPricingTypeEnums.PIECE.getCode()); + buildCategory(route, categoryEntities, pieceCategory, PickupPricingTypeEnums.PIECE.getCode(), vo.getServiceType()); }); } // 按方 if (CollUtil.isNotEmpty(vo.getCubeCategory())) { vo.getCubeCategory().forEach(cubeCategory -> { - buildCategory(route.getId(), categoryEntities, cubeCategory, PickupPricingTypeEnums.CUBE.getCode()); + buildCategory(route, categoryEntities, cubeCategory, PickupPricingTypeEnums.CUBE.getCode(), vo.getServiceType()); }); } // 按重量 if (CollUtil.isNotEmpty(vo.getWeightCategory())) { vo.getWeightCategory().forEach(weightCategory -> { - buildCategory(route.getId(), categoryEntities, weightCategory, PickupPricingTypeEnums.WEIGHT.getCode()); + buildCategory(route, categoryEntities, weightCategory, PickupPricingTypeEnums.WEIGHT.getCode(), vo.getServiceType()); }); } if (CollUtil.isNotEmpty(categoryEntities)) { @@ -145,6 +153,23 @@ public class BasicdataPriceRouteServiceImpl extends BaseServiceImpl fullVehicleEntities = fullVehicleService.list(Wrappers.lambdaQuery() .eq(BasicdataPriceFullVehicleEntity::getBoId, route.getId()) @@ -207,6 +236,7 @@ public class BasicdataPriceRouteServiceImpl extends BaseServiceImpl { PriceBasicVO basicdataPriceCategoryBasicVO = new PriceBasicVO(); BeanUtil.copyProperties(weight, basicdataPriceCategoryBasicVO); + weightCategoryVO.add(basicdataPriceCategoryBasicVO); }); vo.setWeightCategory(weightCategoryVO); } @@ -225,6 +255,14 @@ public class BasicdataPriceRouteServiceImpl extends BaseServiceImpl generalList) { // 1 最低计费一个价格体系一个服务类型只存在一条 BasicdataPriceGeneralEntity generalEntity = generalService.getOne(Wrappers.lambdaQuery() @@ -234,6 +272,7 @@ public class BasicdataPriceRouteServiceImpl extends BaseServiceImpl cubeCategoryEntities, PriceBasicVO cubeCategory, Integer type) { + private void buildCategory(BasicdataPriceRouteEntity route, List cubeCategoryEntities, PriceBasicVO cubeCategory, Integer type, Integer serviceType) { BasicdataPriceCategoryBasicEntity categoryEntity = new BasicdataPriceCategoryBasicEntity(); - Long id = cubeCategory.getId(); - if (ObjectUtil.isEmpty(id)) { - categoryEntity.setBoId(priceId); - categoryEntity.setType(type); - } else { - categoryEntity.setId(id); - } + categoryEntity.setBoId(route.getId()); + categoryEntity.setPriceId(route.getPriceId()); + categoryEntity.setType(type); + categoryEntity.setServiceType(serviceType); categoryEntity.setPrice(cubeCategory.getPrice()); categoryEntity.setCategoryId(cubeCategory.getCategoryId()); cubeCategoryEntities.add(categoryEntity); } - private void buildFullVehicle(Long priceId, List fullVehicleEntities, BasicdataPriceFullVehicleVO fullVehicle, Integer type) { + private void buildFullVehicle(BasicdataPriceRouteEntity route, List fullVehicleEntities, BasicdataPriceFullVehicleVO fullVehicle, Integer type) { BasicdataPriceFullVehicleEntity basicdataPriceFullVehicleEntity = new BasicdataPriceFullVehicleEntity(); basicdataPriceFullVehicleEntity.setPrice(fullVehicle.getPrice()); basicdataPriceFullVehicleEntity.setVehicleType(fullVehicle.getVehicleType()); - if (ObjectUtil.isEmpty(fullVehicle.getId())) { - basicdataPriceFullVehicleEntity.setBoId(priceId); - basicdataPriceFullVehicleEntity.setType(type); - } else { - basicdataPriceFullVehicleEntity.setId(fullVehicle.getId()); - } + basicdataPriceFullVehicleEntity.setBoId(route.getId()); + basicdataPriceFullVehicleEntity.setType(type); + basicdataPriceFullVehicleEntity.setPriceId(route.getPriceId()); fullVehicleEntities.add(basicdataPriceFullVehicleEntity); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceServiceImpl.java index 81b245754..55c2729e4 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceServiceImpl.java @@ -32,6 +32,7 @@ import com.logpm.basicdata.entity.BasicdataPriceCategoryWarehouseEntity; import com.logpm.basicdata.entity.BasicdataPriceEntity; import com.logpm.basicdata.entity.BasicdataPriceFullVehicleEntity; import com.logpm.basicdata.entity.BasicdataPriceGeneralEntity; +import com.logpm.basicdata.entity.BasicdataPriceRouteEntity; import com.logpm.basicdata.entity.BasicdataPriceTemplateEntity; import com.logpm.basicdata.enums.CostTypeEnums; import com.logpm.basicdata.enums.DispatchPricingTypeEnums; @@ -48,17 +49,20 @@ import com.logpm.basicdata.service.IBasicdataPriceCategoryDispatchService; import com.logpm.basicdata.service.IBasicdataPriceCategoryWarehouseService; import com.logpm.basicdata.service.IBasicdataPriceFullVehicleService; import com.logpm.basicdata.service.IBasicdataPriceGeneralService; +import com.logpm.basicdata.service.IBasicdataPriceRouteService; import com.logpm.basicdata.service.IBasicdataPriceService; import com.logpm.basicdata.service.IBasicdataPriceTemplateService; +import com.logpm.basicdata.vo.BasicdatPriceApiVO; import com.logpm.basicdata.vo.BasicdataPriceBasicUpdateVO; import com.logpm.basicdata.vo.BasicdataPriceFullVehicleVO; import com.logpm.basicdata.vo.BasicdataPricePageVO; -import com.logpm.basicdata.vo.BasicdataPriceVO; import com.logpm.basicdata.vo.PriceBasicVO; +import com.logpm.basicdata.vo.PriceClientVO; import com.logpm.basicdata.vo.PriceDispatchAdditionalVO; import com.logpm.basicdata.vo.PriceDispatchBasicVO; import com.logpm.basicdata.vo.PriceDispatchVO; import com.logpm.basicdata.vo.PricePickupVO; +import com.logpm.basicdata.vo.PriceRouteVO; import com.logpm.basicdata.vo.PriceTrunkLineVO; import com.logpm.basicdata.vo.PriceVO; import com.logpm.basicdata.vo.PriceWarehouseAdditionalVO; @@ -74,6 +78,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; +import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -98,16 +103,17 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl selectBasicdataPricePage(IPage page, BasicdataPriceVO basicdataPrice) { + public IPage selectBasicdataPricePage(IPage page, BasicdataPricePageVO basicdataPrice) { List basicdataPriceVOS = baseMapper.selectBasicdataPricePage(page, basicdataPrice); if (CollUtil.isNotEmpty(basicdataPriceVOS)) { for (BasicdataPricePageVO basicdataPriceVO : basicdataPriceVOS) { // 维护状态 - if (StrUtil.isNotEmpty(basicdataPriceVO.getExpiryTime())) { + if (ObjectUtil.isNotEmpty(basicdataPriceVO.getExpiryTime())) { DateTime now = DateUtil.date(); - DateTime dateTime = DateUtil.parseDate(basicdataPriceVO.getExpiryTime()); - if (now.isAfter(dateTime)) { + if (now.isAfter(basicdataPriceVO.getExpiryTime())) { // 已到期 basicdataPriceVO.setMaintenanceStatus("已过期"); } @@ -165,6 +171,7 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl> fullMap = new HashMap<>(); + Map> basicMap = new HashMap<>(); + Map> warehouseMap = new HashMap<>(); + Map> dispatchMap = new HashMap<>(); + Map> generalMap = new HashMap<>(); + // 初始化数据 + buildDetailMap(priceEntity, fullMap, basicMap, warehouseMap, dispatchMap, generalMap); + + if (serviceType.contains(ServiceTypeEnums.PICK_UP.getCode().toString())) { + vo.setPickup(initPickUp(priceEntity, templateEntity, fullMap.get(ServiceTypeEnums.PICK_UP.getCode()), basicMap.get(ServiceTypeEnums.PICK_UP.getCode()), generalMap.get(ServiceTypeEnums.PICK_UP.getCode()))); + } + if (serviceType.contains(ServiceTypeEnums.TRUNK_LINE.getCode().toString())) { + vo.setTrunkLine(initTrunkLine(priceEntity, templateEntity, fullMap.get(ServiceTypeEnums.TRUNK_LINE.getCode()), basicMap.get(ServiceTypeEnums.TRUNK_LINE.getCode()), generalMap.get(ServiceTypeEnums.TRUNK_LINE.getCode()))); + } + if (serviceType.contains(ServiceTypeEnums.WAREHOUSE.getCode().toString())) { + vo.setWarehouse(initWarehouse(priceEntity, templateEntity, warehouseMap)); + } + if (serviceType.contains(ServiceTypeEnums.DISPATCH.getCode().toString())) { + vo.setDispatch(initDispatch(priceEntity, templateEntity, fullMap.get(ServiceTypeEnums.DISPATCH.getCode()), dispatchMap, generalMap.get(ServiceTypeEnums.DISPATCH.getCode()), generalMap.get(GeneralServiceTypeEnums.DISPATCH_LEAVE_BEHIND.getCode()))); + } + return vo; + } + + @Override + public PriceClientVO price(BasicdatPriceApiVO param) { + PriceClientVO priceClientVO = new PriceClientVO(); + // 根据客户信息查找价格 + String clientId = param.getClientId(); + String brandId = param.getBrandId(); + BasicdataPriceEntity priceEntity = null; + List priceEntities = this.list(Wrappers.lambdaQuery() + .eq(BasicdataPriceEntity::getClientId, clientId) + .eq(BasicdataPriceEntity::getBrandId, brandId) + .ge(BasicdataPriceEntity::getExpiryTime, new Date()) + ); + if (CollUtil.isNotEmpty(priceEntities)) { + priceEntity = priceEntities.get(0); + } + if (ObjectUtil.isEmpty(priceEntity)) { + return priceClientVO; + } + // 根据价格获取模板 + Long templateId = priceEntity.getTemplateId(); + BasicdataPriceTemplateEntity templateEntity = null; + if (ObjectUtil.isNotEmpty(templateId)) { + templateEntity = templateService.getById(templateId); + } + if (ObjectUtil.isEmpty(templateEntity)) { + return priceClientVO; + } + Map> fullMap = new HashMap<>(); + Map> basicMap = new HashMap<>(); + Map> warehouseMap = new HashMap<>(); + Map> dispatchMap = new HashMap<>(); + Map> generalMap = new HashMap<>(); + buildDetailMap(priceEntity, fullMap, basicMap, warehouseMap, dispatchMap, generalMap); + String serviceType = templateEntity.getServiceType(); + // 提货费 + if (StrUtil.contains(serviceType, ServiceTypeEnums.PICK_UP.getCode().toString())) { + // 提货不按区域计费 + Integer pickupIsUnifyAreaBill = templateEntity.getPickupIsUnifyAreaBill(); + if (ObjectUtil.equal(pickupIsUnifyAreaBill, BooleanZeroOneEnums.NO.getCode())) { + priceClientVO.setPickup(initPickUp(priceEntity, templateEntity, fullMap.get(1), basicMap.get(1), generalMap.get(1))); + } else { + // 按区域计费,查询路径,返回价格 + List routeEntities = basicdataPriceRouteService.list(Wrappers.lambdaQuery() + .eq(BasicdataPriceRouteEntity::getPriceId, priceEntity.getId()) + .eq(BasicdataPriceRouteEntity::getSendOrgId, param.getSendOrgId()) + .eq(BasicdataPriceRouteEntity::getStartCountyId, param.getStartAreaId()) + .eq(BasicdataPriceRouteEntity::getEndCountyId, param.getEndAreaId()) + .eq(BasicdataPriceRouteEntity::getServiceType, ServiceTypeEnums.PICK_UP.getCode()) + ); + if (CollUtil.isNotEmpty(routeEntities)) { + PriceRouteVO detail = basicdataPriceRouteService.detail(routeEntities.get(0).getId()); + PricePickupVO pickup = new PricePickupVO(); + pickup.setFullVehicle(detail.getFullVehicle()); + pickup.setPieceCategory(detail.getPieceCategory()); + pickup.setCubeCategory(detail.getCubeCategory()); + pickup.setWeightCategory(detail.getWeightCategory()); + pickup.setMinCost(detail.getMinCost()); + pickup.setAdditionalCost(detail.getAdditionalCost()); + priceClientVO.setPickup(pickup); + } + } + } + // 干线费 + if (StrUtil.contains(serviceType, ServiceTypeEnums.TRUNK_LINE.getCode().toString())) { + Integer trunklineIsUnifyAreaBill = templateEntity.getTrunklineIsUnifyAreaBill(); + // 干线不按区域计费 + if (ObjectUtil.equal(trunklineIsUnifyAreaBill, BooleanZeroOneEnums.NO.getCode())) { + priceClientVO.setTrunkLine(initTrunkLine(priceEntity, templateEntity, fullMap.get(2), basicMap.get(3), generalMap.get(3))); + } else { + // 按区域计费,查询路径,返回价格 + List routeEntities = basicdataPriceRouteService.list(Wrappers.lambdaQuery() + .eq(BasicdataPriceRouteEntity::getPriceId, priceEntity.getId()) + .eq(BasicdataPriceRouteEntity::getSendOrgId, param.getSendOrgId()) + .eq(BasicdataPriceRouteEntity::getStartCountyId, param.getStartAreaId()) + .eq(BasicdataPriceRouteEntity::getEndCountyId, param.getEndAreaId()) + .eq(BasicdataPriceRouteEntity::getServiceType, ServiceTypeEnums.TRUNK_LINE.getCode()) + ); + if (CollUtil.isNotEmpty(routeEntities)) { + PriceRouteVO detail = basicdataPriceRouteService.detail(routeEntities.get(0).getId()); + PriceTrunkLineVO trunkLineVO = new PriceTrunkLineVO(); + trunkLineVO.setFullVehicle(detail.getFullVehicle()); + trunkLineVO.setPieceCategory(detail.getPieceCategory()); + trunkLineVO.setCubeCategory(detail.getCubeCategory()); + trunkLineVO.setWeightCategory(detail.getWeightCategory()); + trunkLineVO.setMinCost(detail.getMinCost()); + trunkLineVO.setAdditionalCost(detail.getAdditionalCost()); + priceClientVO.setTrunkLine(trunkLineVO); + } + } + } + // 仓储价格 + if (StrUtil.contains(serviceType, ServiceTypeEnums.WAREHOUSE.getCode().toString())) { + priceClientVO.setWarehouse(initWarehouse(priceEntity, templateEntity, warehouseMap)); + } + // 配送费 + if (StrUtil.contains(serviceType, ServiceTypeEnums.DISPATCH.getCode().toString())) { + priceClientVO.setDispatch(initDispatch(priceEntity, templateEntity, fullMap.get(3), dispatchMap, generalMap.get(5), generalMap.get(6))); + } + priceClientVO.setTemplate(templateEntity); + return priceClientVO; + } + + private void buildDetailMap(BasicdataPriceEntity priceEntity, Map> fullMap, Map> basicMap, Map> warehouseMap, Map> dispatchMap, Map> generalMap) { + // 获取整车数据 List list = fullVehicleService.list(Wrappers.lambdaQuery() .eq(BasicdataPriceFullVehicleEntity::getBoId, priceEntity.getId())); if (CollUtil.isNotEmpty(list)) { @@ -251,7 +388,6 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl> basicMap = new HashMap<>(); List basicList = categoryBasicService.list(Wrappers.lambdaQuery() .eq(BasicdataPriceCategoryBasicEntity::getBoId, priceEntity.getId())); if (CollUtil.isNotEmpty(basicList)) { @@ -266,7 +402,7 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl> warehouseMap = new HashMap<>(); + List warehouseList = categoryWarehouseService.list(Wrappers.lambdaQuery() .eq(BasicdataPriceCategoryWarehouseEntity::getBoId, priceEntity.getId())); if (CollUtil.isNotEmpty(warehouseList)) { @@ -281,7 +417,7 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl> dispatchMap = new HashMap<>(); + List dispatchList = categoryDispatchService.list(Wrappers.lambdaQuery() .eq(BasicdataPriceCategoryDispatchEntity::getBoId, priceEntity.getId())); if (CollUtil.isNotEmpty(dispatchList)) { @@ -297,7 +433,7 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl> generalMap = new HashMap<>(); + List generalList = generalService.list(Wrappers.lambdaQuery() .eq(BasicdataPriceGeneralEntity::getBoId, priceEntity.getId())); if (CollUtil.isNotEmpty(generalList)) { @@ -312,19 +448,6 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl fullVehicleEntities, Map> dispatchMap, List generalEntities, List generalEntities1) { @@ -472,7 +595,7 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl warehouseEntities = warehouseMap.get(1); if (CollUtil.isNotEmpty(warehouseEntities)) { warehouseEntities.forEach(item -> { - Integer type = item.getCostType(); + Integer type = item.getType(); List collect = categoryBasicMap.get(type); if (ObjectUtil.isEmpty(collect)) { collect = new ArrayList<>(); @@ -612,12 +735,14 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl fullVehicleVOS = fullVehicleEntities.stream().map(item -> { - BasicdataPriceFullVehicleVO basicdataPriceFullVehicleVO = new BasicdataPriceFullVehicleVO(); - BeanUtil.copyProperties(item, basicdataPriceFullVehicleVO); - return basicdataPriceFullVehicleVO; - }).collect(Collectors.toList()); - pricePickupVO.setFullVehicle(fullVehicleVOS); + if(CollUtil.isNotEmpty(fullVehicleEntities)){ + List fullVehicleVOS = fullVehicleEntities.stream().map(item -> { + BasicdataPriceFullVehicleVO basicdataPriceFullVehicleVO = new BasicdataPriceFullVehicleVO(); + BeanUtil.copyProperties(item, basicdataPriceFullVehicleVO); + return basicdataPriceFullVehicleVO; + }).collect(Collectors.toList()); + pricePickupVO.setFullVehicle(fullVehicleVOS); + } } // 按件 if (pickupPricingType.contains(PickupPricingTypeEnums.PIECE.getCode().toString())) { @@ -697,7 +822,7 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl categoryEntities = new ArrayList<>(); @@ -883,7 +996,7 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl { - buildCategory(priceId, categoryEntities, pieceCategory, TrunkLinePricingTypeEnums.PIECE.getCode(), 3); + buildCategory(priceId, categoryEntities, pieceCategory, TrunkLinePricingTypeEnums.PIECE.getCode(), ServiceTypeEnums.TRUNK_LINE.getCode()); }); } @@ -891,18 +1004,18 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl { - buildCategory(priceId, categoryEntities, cubeCategory, TrunkLinePricingTypeEnums.CUBE.getCode(), 3); + buildCategory(priceId, categoryEntities, cubeCategory, TrunkLinePricingTypeEnums.CUBE.getCode(), ServiceTypeEnums.TRUNK_LINE.getCode()); }); } // 按重量品类计费 if (trunkLinePricingType.contains(TrunkLinePricingTypeEnums.WEIGHT.getCode().toString()) && CollUtil.isNotEmpty(trunkLine.getWeightCategory())) { trunkLine.getWeightCategory().forEach(cubeCategory -> { - buildCategory(priceId, categoryEntities, cubeCategory, TrunkLinePricingTypeEnums.WEIGHT.getCode(), 3); + buildCategory(priceId, categoryEntities, cubeCategory, TrunkLinePricingTypeEnums.WEIGHT.getCode(), ServiceTypeEnums.TRUNK_LINE.getCode()); }); } if (CollUtil.isNotEmpty(categoryEntities)) { - categoryBasicService.saveOrUpdateBatch(categoryEntities); + categoryBasicService.saveBatch(categoryEntities); } if (ObjectUtil.equal(templateEntity.getTrunklineIsMinCost(), BooleanZeroOneEnums.YES.getCode()) && ObjectUtil.isNotEmpty(trunkLine.getMinCost())) { List priceGeneralEntities = new ArrayList<>(); @@ -947,7 +1060,7 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl categoryEntities = new ArrayList<>(); @@ -955,7 +1068,7 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl { - buildCategory(priceId, categoryEntities, pieceCategory, PickupPricingTypeEnums.PIECE.getCode(), 1); + buildCategory(priceId, categoryEntities, pieceCategory, PickupPricingTypeEnums.PIECE.getCode(), ServiceTypeEnums.PICK_UP.getCode()); }); } @@ -963,25 +1076,47 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl { - buildCategory(priceId, categoryEntities, cubeCategory, PickupPricingTypeEnums.CUBE.getCode(), 1); + buildCategory(priceId, categoryEntities, cubeCategory, PickupPricingTypeEnums.CUBE.getCode(), ServiceTypeEnums.PICK_UP.getCode()); }); } // 按重量品类计费 if (pickupPricingType.contains(PickupPricingTypeEnums.WEIGHT.getCode().toString()) && CollUtil.isNotEmpty(pickup.getWeightCategory())) { pickup.getWeightCategory().forEach(cubeCategory -> { - buildCategory(priceId, categoryEntities, cubeCategory, PickupPricingTypeEnums.WEIGHT.getCode(), 1); + buildCategory(priceId, categoryEntities, cubeCategory, PickupPricingTypeEnums.WEIGHT.getCode(), ServiceTypeEnums.PICK_UP.getCode()); }); } if (CollUtil.isNotEmpty(categoryEntities)) { - categoryBasicService.saveOrUpdateBatch(categoryEntities); + categoryBasicService.saveBatch(categoryEntities); } // 最低计费 if (ObjectUtil.equal(templateEntity.getPickupIsMinCost(), BooleanZeroOneEnums.YES.getCode()) && ObjectUtil.isNotEmpty(pickup.getMinCost())) { List priceGeneralEntities = new ArrayList<>(); biuldGeneral(priceId, GeneralServiceTypeEnums.PICK_UP.getCode(), pickup.getMinCost(), pickup.getAdditionalCost(), priceGeneralEntities); - generalService.saveOrUpdateBatch(priceGeneralEntities); + generalService.saveBatch(priceGeneralEntities); + } + } + + @Override + public void deleteByPriceIdAndServiceType(Long boId, Integer serviceType) { + // 删除整车数据 + if (!ObjectUtil.equal(serviceType, ServiceTypeEnums.WAREHOUSE.getCode())) { + fullVehicleService.removeByPriceIdAndServiceType(boId, serviceType); + } + // 删除品类数据 + if (ObjectUtil.equal(serviceType, ServiceTypeEnums.PICK_UP.getCode())) { + categoryBasicService.removeByPriceIdAndServiceType(boId, serviceType); + } else if (ObjectUtil.equal(serviceType, ServiceTypeEnums.TRUNK_LINE.getCode())) { + categoryBasicService.removeByPriceIdAndServiceType(boId, serviceType); + } else if (ObjectUtil.equal(serviceType, ServiceTypeEnums.WAREHOUSE.getCode())) { + categoryWarehouseService.removeByPriceIdAndServiceType(boId, serviceType); + } else if (ObjectUtil.equal(serviceType, ServiceTypeEnums.DISPATCH.getCode())) { + categoryDispatchService.removeByPriceIdAndServiceType(boId, serviceType); + } + // 删除一般数据 + if (!ObjectUtil.equal(serviceType, ServiceTypeEnums.WAREHOUSE.getCode())) { + generalService.removeByPriceIdAndServiceType(boId, serviceType); } } @@ -990,25 +1125,16 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl cubeCategoryEntities, PriceBasicVO cubeCategory, Integer type, Integer serviceType) { BasicdataPriceCategoryBasicEntity categoryEntity = new BasicdataPriceCategoryBasicEntity(); - Long id = cubeCategory.getId(); - if (ObjectUtil.isEmpty(id)) { - categoryEntity.setBoId(priceId); - categoryEntity.setType(type); - categoryEntity.setServiceType(serviceType); - } else { - categoryEntity.setId(id); - } + categoryEntity.setBoId(priceId); + categoryEntity.setType(type); + categoryEntity.setServiceType(serviceType); categoryEntity.setPriceId(priceId); categoryEntity.setPrice(cubeCategory.getPrice()); categoryEntity.setCategoryId(cubeCategory.getCategoryId()); diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceTemplateServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceTemplateServiceImpl.java index 92ed8d11e..f4312e4d2 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceTemplateServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceTemplateServiceImpl.java @@ -22,9 +22,15 @@ import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; -import com.logpm.basicdata.entity.BasicdataBrandEntity; import com.logpm.basicdata.entity.BasicdataPriceTemplateEntity; +import com.logpm.basicdata.enums.DispatchTypeEnums; +import com.logpm.basicdata.enums.MinCostTypeEnums; +import com.logpm.basicdata.enums.MinCostWayEnums; import com.logpm.basicdata.enums.ServiceTypeEnums; +import com.logpm.basicdata.enums.WarehouseCalculationBasisEnums; +import com.logpm.basicdata.enums.WarehousePricingModeEnums; +import com.logpm.basicdata.enums.WarehousePricingTypeEnums; +import com.logpm.basicdata.enums.WarehousePricingUnitEnums; import com.logpm.basicdata.excel.BasicdataPriceTemplateExcel; import com.logpm.basicdata.mapper.BasicdataPriceTemplateMapper; import com.logpm.basicdata.service.IBasicdataBrandService; @@ -73,30 +79,14 @@ public class BasicdataPriceTemplateServiceImpl extends BaseServiceImpl records = baseMapper.selectBasicdataPriceTemplatePage(page, basicdataPriceTemplate); if (CollUtil.isNotEmpty(records)) { List userIds = records.stream().map(BasicdataPriceTemplateVO::getCreateUser).collect(Collectors.toList()); - List brandIds = records.stream().map(BasicdataPriceTemplateVO::getBrandId).collect(Collectors.toList()); - List basicdataBrandEntities = brandService.listByIds(brandIds); - Map brandNameMap = new HashMap<>(); - if (CollUtil.isNotEmpty(basicdataBrandEntities)) { - brandNameMap = basicdataBrandEntities.stream().collect(Collectors.toMap(BasicdataBrandEntity::getId, BasicdataBrandEntity::getBrandName)); - } R> listR = userClient.userInfoByIds(AuthUtil.getTenantId(), userIds.stream().map(Object::toString).collect(Collectors.joining(","))); Map names = new HashMap<>(); - Map accounts = new HashMap<>(); if (ObjectUtil.equal(HttpConstants.HTTP.HTTP_RESOURCE_CODE.SUCCESS_CODE, listR.getCode())) { names = listR.getData().stream().collect(Collectors.toMap(User::getId, User::getName)); - accounts = listR.getData().stream().collect(Collectors.toMap(User::getId, User::getAccount)); } for (BasicdataPriceTemplateVO record : records) { Long createUser = record.getCreateUser(); - if (ObjectUtil.equal(accounts.get(createUser), "admin")) { - record.setTemplateType("系统"); - } else { - record.setTemplateType("用户"); - } record.setUserName(names.get(createUser)); - if (brandNameMap.containsKey(record.getBrandId())) { - record.setBrandName(brandNameMap.get(record.getBrandId())); - } String serviceType = record.getServiceType(); if (StrUtil.isNotEmpty(serviceType)) { StringBuilder sb = new StringBuilder(); @@ -116,9 +106,6 @@ public class BasicdataPriceTemplateServiceImpl extends BaseServiceImpl exportBasicdataPriceTemplate(Wrapper queryWrapper) { List basicdataPriceTemplateList = baseMapper.exportBasicdataPriceTemplate(queryWrapper); - //basicdataPriceTemplateList.forEach(basicdataPriceTemplate -> { - // basicdataPriceTemplate.setTypeName(DictCache.getValue(DictEnum.YES_NO, BasicdataPriceTemplate.getType())); - //}); return basicdataPriceTemplateList; } @@ -151,6 +138,7 @@ public class BasicdataPriceTemplateServiceImpl extends BaseServiceImpl myWarehouseList = getMyWarehouseList(); @@ -288,9 +287,7 @@ public class BasicdataWarehouseServiceImpl extends BaseServiceImpl>>>>> 获取仓库信息错误",e); } - return null; - } @Override diff --git a/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/controller/MerchantController.java b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/controller/MerchantController.java index 3ceffe362..5b978ea11 100644 --- a/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/controller/MerchantController.java +++ b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/controller/MerchantController.java @@ -17,7 +17,7 @@ package com.logpm.datasharing.controller; import com.logpm.datasharing.service.MerchantService; -import com.logpm.datasharing.vo.MerchantOrderVO; +import com.logpm.datasharing.vo.MerchantOrderPackageVO; import io.swagger.annotations.Api; import lombok.AllArgsConstructor; import org.springblade.core.boot.ctrl.BladeController; @@ -42,8 +42,8 @@ public class MerchantController extends BladeController { private final MerchantService merchantService; @GetMapping("goods") - public R goods(@RequestParam("contract_number") String contract_number, @RequestParam("auth_key") String auth_key) { - return R.data(merchantService.goods(contract_number,auth_key)); + public R goods(@RequestParam("contract_number") String contract_number, @RequestParam("auth_key") String auth_key) { + return R.data(merchantService.goods(contract_number, auth_key)); } diff --git a/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/mapper/MerchantMapper.xml b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/mapper/MerchantMapper.xml index 593bc3589..8119797af 100644 --- a/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/mapper/MerchantMapper.xml +++ b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/mapper/MerchantMapper.xml @@ -51,7 +51,7 @@ from logpm_distribution_delivery_list lddl left join logpm_distribution_delivery_self ldd on ldd.delivery_id = lddl.id left join logpm_distribution_delivery_tripartite lddt on lddt.delivery_id = lddl.id - group by lddl.id) driver on driver.id = lddl.id + group by lddl.id order by null) driver on driver.id = lddl.id where t.order_code = #{contractNumber} diff --git a/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/MerchantService.java b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/MerchantService.java index dc9944946..9f11edd9c 100644 --- a/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/MerchantService.java +++ b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/MerchantService.java @@ -1,6 +1,6 @@ package com.logpm.datasharing.service; -import com.logpm.datasharing.vo.MerchantOrderVO; +import com.logpm.datasharing.vo.MerchantOrderPackageVO; /** * @author zhaoqiaobo @@ -15,5 +15,5 @@ public interface MerchantService { * @param authKey 授权密钥,用于验证请求的合法性 * @return MerchantOrderVO 商户订单的视图对象,包含订单的详细信息 */ - MerchantOrderVO goods(String contractNumber, String authKey); + MerchantOrderPackageVO goods(String contractNumber, String authKey); } diff --git a/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/impl/MerchantServiceImpl.java b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/impl/MerchantServiceImpl.java index 16f5d7340..be8907542 100644 --- a/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/impl/MerchantServiceImpl.java +++ b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/impl/MerchantServiceImpl.java @@ -7,9 +7,9 @@ import com.logpm.datasharing.dto.MerchantOrderDTO; import com.logpm.datasharing.mapper.MerchantMapeer; import com.logpm.datasharing.service.MerchantService; import com.logpm.datasharing.vo.MerchantOrderPackageVO; -import com.logpm.datasharing.vo.MerchantOrderVO; import com.logpm.datasharing.vo.MerchantPackageVO; import lombok.AllArgsConstructor; +import org.springblade.common.enums.BooleanZeroOneEnums; import org.springframework.stereotype.Service; import java.util.List; @@ -25,7 +25,7 @@ public class MerchantServiceImpl implements MerchantService { private final MerchantMapeer merchantMapeer; @Override - public MerchantOrderVO goods(String contractNumber, String authKey) { + public MerchantOrderPackageVO goods(String contractNumber, String authKey) { MerchantOrderDTO dto = null; // 根据 authKey 获取仓库信息 List warehouseId = merchantMapeer.findWarehouseIdByAuthKey(authKey); @@ -34,14 +34,19 @@ public class MerchantServiceImpl implements MerchantService { dto = merchantMapeer.findMerchantOrder(contractNumber, warehouseId); if (ObjectUtil.isNotEmpty(dto)) { // TODO 这里分几种情况 零担订单,包件,库存品有数据/无数据 目前只实现了包件,其他的后续处理 + if (ObjectUtil.equal(dto.getZeroOrder(), BooleanZeroOneEnums.YES.getCode().toString())) { + + }else{ + List packageVO = merchantMapeer.findPackage(contractNumber); + MerchantOrderPackageVO orderPackageVO = new MerchantOrderPackageVO(); + BeanUtil.copyProperties(dto, orderPackageVO); + orderPackageVO.setPackageInfor(packageVO); + return orderPackageVO; + } // 零担订单 // 定制品 // 包件/库存品 - List packageVO = merchantMapeer.findPackage(contractNumber); - MerchantOrderPackageVO orderPackageVO = new MerchantOrderPackageVO(); - BeanUtil.copyProperties(dto, orderPackageVO); - orderPackageVO.setPackageInfor(packageVO); - return orderPackageVO; + } } return null; diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java index 7680cc9bc..63ac1720d 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java @@ -28,6 +28,7 @@ import org.apache.ibatis.annotations.Param; import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Set; /** * 在库订单包件清单 Mapper 接口 @@ -249,4 +250,13 @@ public interface DistributionParcelListMapper extends BaseMapper selectPackageCancelBillLading(@Param("orderPackageCode")String orderPackageCode,@Param("warehouseId") Long warehouseId); + + /** + * 根据包裹列表ID集合和仓库ID查询包裹列表实体集合。 + * + * @param parcelListIds 包裹列表ID的集合,类型为Set。 + * @param warehouseId 仓库的ID,类型为Long。 + * @return 返回一个List类型的集合,包含匹配的包裹列表实体。 + */ + List findListByIds(@Param("parcelListIds") Set parcelListIds, @Param("warehouseId") Long warehouseId); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml index 1689d8f3d..a2656ea9b 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml @@ -1381,4 +1381,11 @@ ldpl.order_package_code = #{orderPackageCode} AND ldpl.warehouse_id = #{warehouseId} AND ldbp.packet_bar_status = '2' AND ldbp.is_deleted = 0 + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java index ba3f51c33..ff71e7816 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java @@ -209,4 +209,14 @@ public interface IDistributionParcelListService extends BaseService。 + * @param warehouseId 仓库的ID,类型为Long。 + * @return 返回一个List类型的集合,包含匹配的包裹列表实体。 + */ + List findListByIds(Set parcelListIds, Long warehouseId); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java index c9992cf40..62fea41ab 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java @@ -16,6 +16,7 @@ */ package com.logpm.distribution.service.impl; +import cn.hutool.core.collection.CollUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; @@ -149,13 +150,13 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl selectDistributionParcelListPage(IPage page, DistributionParcelListVO distributionParcelList) { BasicdataWarehouseEntity myWatchWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse(); List collect = new ArrayList<>(); - if(ObjectUtils.isNull(myWatchWarehouse)){ + if (ObjectUtils.isNull(myWatchWarehouse)) { List myWatchWarehouse1 = basicdataWarehouseClient.getMyWatchWarehouse(); - myWatchWarehouse1.forEach(t->{ + myWatchWarehouse1.forEach(t -> { collect.add(t.getId()); }); - }else{ + } else { collect.add(myWatchWarehouse.getId()); } @@ -387,8 +388,8 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl planBillLadingPackage =baseMapper.selectPackagePlanBillLading(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId()); - if (Func.isNotEmpty(planBillLadingPackage)){ + List planBillLadingPackage = baseMapper.selectPackagePlanBillLading(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId()); + if (Func.isNotEmpty(planBillLadingPackage)) { parcelListNodeVOS.addAll(planBillLadingPackage); } //查询自提取消 - List cancelBillLadingPackage =baseMapper.selectPackageCancelBillLading(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId()); - if (Func.isNotEmpty(cancelBillLadingPackage)){ - cancelBillLadingPackage.forEach(s->{ + List cancelBillLadingPackage = baseMapper.selectPackageCancelBillLading(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId()); + if (Func.isNotEmpty(cancelBillLadingPackage)) { + cancelBillLadingPackage.forEach(s -> { R userR = userClient.userInfoById(s.getNodeControlsUserId()); s.setNodeControlsUserName(userR.getData().getName()); }); parcelListNodeVOS.addAll(cancelBillLadingPackage); } //查询自提签收扫描 - List signForBillLadingPackage =baseMapper.selectPackageSignForlBillLading(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId()); - if (Func.isNotEmpty(signForBillLadingPackage)){ - signForBillLadingPackage.forEach(s->{ + List signForBillLadingPackage = baseMapper.selectPackageSignForlBillLading(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId()); + if (Func.isNotEmpty(signForBillLadingPackage)) { + signForBillLadingPackage.forEach(s -> { R userR = userClient.userInfoById(s.getNodeControlsUserId()); s.setNodeControlsUserName(userR.getData().getName()); }); @@ -1166,33 +1167,33 @@ public class DistributionParcelListServiceImpl extends BaseServiceImplquery().lambda() .eq(DistributionParcelNumberEntity::getParcelListId, parcelListId) ); - if (Func.isNotEmpty(distributionParcelNumberEntity)){ + if (Func.isNotEmpty(distributionParcelNumberEntity)) { DistributionParcelListEntity parcelListEntity = new DistributionParcelListEntity(); int totalQuantity = distributionParcelNumberEntity.getQuantity(); int handledQuantity = distributionParcelNumberEntity.getHandQuantity(); int deliveryQuantity = distributionParcelNumberEntity.getDeliveryQuantity(); int outboundQuantity = distributionParcelNumberEntity.getOutboundQuantity(); int signinQuantity = distributionParcelNumberEntity.getSigninQuantity(); - if (totalQuantity > 0){ - if (handledQuantity == totalQuantity){ + if (totalQuantity > 0) { + if (handledQuantity == totalQuantity) { parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yiruku.getValue()); } parcelListEntity.setId(parcelListId); - if ((deliveryQuantity + outboundQuantity) == 0){ + if ((deliveryQuantity + outboundQuantity) == 0) { parcelListEntity.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.daiyuyue.getValue()); - }else if ((deliveryQuantity + outboundQuantity) == totalQuantity){ + } else if ((deliveryQuantity + outboundQuantity) == totalQuantity) { parcelListEntity.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.yiyueyue.getValue()); } - if (outboundQuantity == 0){ + if (outboundQuantity == 0) { parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.weizhuancghe.getValue()); - }else if (outboundQuantity == totalQuantity){ + } else if (outboundQuantity == totalQuantity) { parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue()); parcelListEntity.setOrderPackageReservationStatus(OrderPackageStatusConstant.yichuku.getValue()); } - if (signinQuantity == totalQuantity){ + if (signinQuantity == totalQuantity) { parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yiqianshou.getValue()); } this.updateById(parcelListEntity); @@ -1205,4 +1206,12 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl findListByIds(Set parcelListIds, Long warehouseId) { + if (CollUtil.isNotEmpty(parcelListIds) && ObjectUtils.isNotEmpty(warehouseId)) { + return this.baseMapper.findListByIds(parcelListIds, warehouseId); + } + return null; + } + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java index b00fba193..c6c072514 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java @@ -16,7 +16,9 @@ */ package com.logpm.distribution.service.impl; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.ObjectUtil; +import cn.hutool.json.JSONUtil; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; @@ -42,10 +44,14 @@ import com.logpm.distribution.service.*; import com.logpm.distribution.vo.*; import com.logpm.distribution.vo.app.*; import com.logpm.distribution.wrapper.DistributionStockArticleWrapper; +import com.logpm.factorydata.enums.BrandEnums; +import com.logpm.factorydata.util.FactoryDataMessageSender; +import com.logpm.factorydata.vo.NodePushMsg; import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient; import lombok.extern.log4j.Log4j2; import org.springblade.common.constant.DictBizConstant; import org.springblade.common.constant.Inventory.InventoryStockUpStatusConstant; +import org.springblade.common.constant.WorkNodeEnums; import org.springblade.common.constant.billLading.BillLadingStatusConstant; import org.springblade.common.constant.common.IsOrNoConstant; import org.springblade.common.constant.order.OrderReservationStatusConstant; @@ -75,6 +81,7 @@ import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import javax.annotation.Resource; import java.io.Serializable; import java.math.BigDecimal; import java.text.SimpleDateFormat; @@ -142,6 +149,8 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl parcelListIds = new HashSet<>(); for (int i = 0; i < split.length; i++) { String s = split[i]; //查询是不是上传图片 @@ -3007,6 +3017,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl parcelListIds) { + try { + // ladingScanEntities中的包件id数据封装为set + if (CollUtil.isNotEmpty(parcelListIds)) { + List parcelList = distributionParcelListService.findListByIds(parcelListIds, myCurrentWarehouse.getId()); + if (CollUtil.isNotEmpty(parcelList)) { + // parcelList 以品牌名称分组封装为map + Map> parcelMap = parcelList.stream().collect(Collectors.groupingBy(DistributionParcelListEntity::getBrandName)); + for (Map.Entry> entry : parcelMap.entrySet()) { + String key = entry.getKey(); + List value = entry.getValue(); + List contents = new ArrayList<>(); + if (CollUtil.isNotEmpty(value)) { + for (DistributionParcelListEntity distributionParcelListEntity : value) { + JSONObject jsonObject = new JSONObject(); + jsonObject.put("packageCode", distributionParcelListEntity.getOrderPackageCode()); + contents.add(jsonObject); + } + } + NodePushMsg msg = new NodePushMsg(); + msg.setNode(WorkNodeEnums.CLERK_REVIEW); + msg.setBrand(BrandEnums.getByValue(key)); + msg.setOperator(AuthUtil.getNickName()); + msg.setOperatorTime(new Date()); + msg.setContent(contents); + log.info("推送工厂数据:{}", JSONUtil.toJsonStr(msg)); + factoryDataMessageSender.sendNodeDataByBrand(msg); + } + + } + } + } catch (Exception e) { + log.error("回传工厂数据失败{}", e); + } + } + /** * 处理提货库存品签收 */