Browse Source

feat(all):优化价格体系

pull/34/head
zhaoqiaobo 12 months ago
parent
commit
40eeddb50c
  1. 18
      blade-biz-common/src/main/java/org/springblade/common/model/dto/NameDTO.java
  2. 2
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataPriceCategoryBasicEntity.java
  3. 2
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataPriceFullVehicleEntity.java
  4. 2
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataPriceGeneralEntity.java
  5. 2
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataPriceTemplateEntity.java
  6. 28
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/enums/PriceBizTypeApiEnums.java
  7. 8
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataPriceClient.java
  8. 59
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdatPriceApiVO.java
  9. 3
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataPriceFullVehicleVO.java
  10. 14
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataPricePageVO.java
  11. 3
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataPriceTemplateVO.java
  12. 3
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/PriceBasicVO.java
  13. 31
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/PriceClientVO.java
  14. 3
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/PriceDispatchAdditionalVO.java
  15. 3
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/PriceDispatchBasicVO.java
  16. 4
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/PriceRouteVO.java
  17. 3
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/PriceWarehouseAdditionalVO.java
  18. 3
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/PriceWarehouseBasicVO.java
  19. 3
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataPriceController.java
  20. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataPriceRouteController.java
  21. 27
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataPriceTemplateController.java
  22. 8
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/enums/FullVehicleTypeEnums.java
  23. 8
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/enums/GeneralServiceTypeEnums.java
  24. 44
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataPriceClient.java
  25. 1
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataWarehouseClient.java
  26. 3
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.java
  27. 6
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.xml
  28. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceCategoryBasicMapper.java
  29. 3
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceCategoryDispatchMapper.java
  30. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceCategoryWarehouseMapper.java
  31. 3
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceFullVehicleMapper.java
  32. 3
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceGeneralMapper.java
  33. 6
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceMapper.java
  34. 19
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceMapper.xml
  35. 5
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceRouteMapper.java
  36. 20
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceRouteMapper.xml
  37. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceTemplateMapper.java
  38. 22
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceTemplateMapper.xml
  39. 4
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataClientService.java
  40. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataPriceCategoryBasicService.java
  41. 1
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataPriceCategoryDispatchService.java
  42. 1
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataPriceCategoryWarehouseService.java
  43. 5
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataPriceFullVehicleService.java
  44. 1
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataPriceGeneralService.java
  45. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataPriceRouteService.java
  46. 14
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataPriceService.java
  47. 43
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java
  48. 7
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceCategoryBasicServiceImpl.java
  49. 7
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceCategoryDispatchServiceImpl.java
  50. 7
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceCategoryWarehouseServiceImpl.java
  51. 7
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceFullVehicleServiceImpl.java
  52. 12
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceGeneralServiceImpl.java
  53. 87
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceRouteServiceImpl.java
  54. 244
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceServiceImpl.java
  55. 124
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceTemplateServiceImpl.java
  56. 3
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataWarehouseServiceImpl.java
  57. 6
      blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/controller/MerchantController.java
  58. 2
      blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/mapper/MerchantMapper.xml
  59. 4
      blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/MerchantService.java
  60. 15
      blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/impl/MerchantServiceImpl.java
  61. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java
  62. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml
  63. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java
  64. 55
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java
  65. 49
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java

18
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;
}

2
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;

2
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;

2
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;

2
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;

28
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<Integer> {
/**
* 1- 全部费用 开单时调用,除仓储费
*/
ALL(1, "全部费用"),
/**
* 2- 仓储费 文员复核的时候调用
*/
WAREHOUSE(2, "仓储费"),
/**
* 3- 配送费 司机签收时调用
*/
DISPATCH(3, "配送费"),
;
PriceBizTypeApiEnums (Integer code, String name){
init(code, name);
}
}

8
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<BasicdataFreightDetailEntity> pirce(@RequestBody BasicdataFreightApiVO param);
PriceClientVO pirce(@RequestBody BasicdatPriceApiVO param);
}

59
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;
}

3
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;

14
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;
}

3
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;

3
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 = "单价")

31
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;
}

3
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 = "分货费")

3
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 = "单价")

4
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<BasicdataPriceFullVehicleVO> fullVehicle;

3
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 = "操作/装卸费")

3
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天内")

3
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<IPage<BasicdataPricePageVO>> page(BasicdataPriceVO basicdataPrice, Query query) {
public R<IPage<BasicdataPricePageVO>> page(BasicdataPricePageVO basicdataPrice, Query query) {
IPage<BasicdataPricePageVO> pages = basicdataPriceService.selectBasicdataPricePage(Condition.getPage(query), basicdataPrice);
return R.data(pages);
}

2
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));
}
/**

27
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<String, Object> basicdataPriceTemplate, BladeUser bladeUser, HttpServletResponse response) {
QueryWrapper<BasicdataPriceTemplateEntity> 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<BasicdataPriceTemplateExcel> list = basicdataPriceTemplateService.exportBasicdataPriceTemplate(queryWrapper);
ExcelUtil.export(response, "基础价格模板表数据" + DateUtil.time(), "基础价格模板表数据表", list, BasicdataPriceTemplateExcel.class);
}
}

8
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<Integer> {
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) {

8
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<Integer> {
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) {

44
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);
}
}

1
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;

3
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<BasicdataClientEntity>
List<BasicdataClientVO> selectListDict(@Param("id") Long id);
List<ClientInfoVO> findListByClientName(@Param("clientName") String clientName,@Param("linkMan") String linkMan,@Param("linkPhone") String linkPhone);
List<NameDTO> findNameByIds(@Param("sendOrgIds") List<Long> sendOrgIds);
}

6
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.xml

@ -74,5 +74,11 @@
</if>
limit 10
</select>
<select id="findNameByIds" resultType="org.springblade.common.model.dto.NameDTO">
select id,client_name name from logpm_basicdata_client where id in
<foreach collection="sendOrgIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</select>
</mapper>

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

@ -31,4 +31,6 @@ public interface BasicdataPriceCategoryBasicMapper extends BaseMapper<BasicdataP
@Delete("delete from logpm_basicdata_price_category_basic where price_id = #{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);
}

3
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceCategoryDispatchMapper.java

@ -31,4 +31,7 @@ public interface BasicdataPriceCategoryDispatchMapper extends BaseMapper<Basicda
@Delete("delete from logpm_basicdata_price_category_dispatch where price_id = #{priceId}")
void removeByPriceId(Long priceId);
@Delete("delete from logpm_basicdata_price_category_dispatch where bo_id = #{priceId} and service_type = 1 ")
void removeByPriceIdAndServiceType(Long priceId, Integer serviceType);
}

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

@ -32,4 +32,6 @@ public interface BasicdataPriceCategoryWarehouseMapper extends BaseMapper<Basicd
@Delete("delete from logpm_basicdata_price_category_warehouse where price_id = #{priceId}")
void removeByPriceId(Long priceId);
@Delete("delete from logpm_basicdata_price_category_warehouse where bo_id = #{priceId} and service_type = 1")
void removeByPriceIdAndServiceType(Long priceId, Integer serviceType);
}

3
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceFullVehicleMapper.java

@ -44,4 +44,7 @@ public interface BasicdataPriceFullVehicleMapper extends BaseMapper<BasicdataPri
@Delete("delete from logpm_basicdata_price_full_vehicle where price_id = #{priceId}")
void removeByPriceId(Long priceId);
@Delete("delete from logpm_basicdata_price_full_vehicle where bo_id = #{priceId} and type = #{serviceType}")
void removeByPriceIdAndServiceType(Long priceId, Integer serviceType);
}

3
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceGeneralMapper.java

@ -36,4 +36,7 @@ public interface BasicdataPriceGeneralMapper extends BaseMapper<BasicdataPriceGe
*/
@Delete("delete from logpm_basicdata_price_general where price_id = #{priceId}")
void removeByPriceId(Long priceId);
@Delete("delete from logpm_basicdata_price_general where bo_id = #{priceId} and service_type = #{serviceType}")
void removeByPriceIdAndServiceType(Long priceId, Integer serviceType);
}

6
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceMapper.java

@ -22,7 +22,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.basicdata.entity.BasicdataPriceEntity;
import com.logpm.basicdata.excel.BasicdataPriceExcel;
import com.logpm.basicdata.vo.BasicdataPricePageVO;
import com.logpm.basicdata.vo.BasicdataPriceVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -42,7 +42,7 @@ public interface BasicdataPriceMapper extends BaseMapper<BasicdataPriceEntity> {
* @param basicdataPrice
* @return
*/
List<BasicdataPricePageVO> selectBasicdataPricePage(IPage page, BasicdataPriceVO basicdataPrice);
List<BasicdataPricePageVO> selectBasicdataPricePage(IPage page, BasicdataPricePageVO basicdataPrice);
/**
@ -53,4 +53,6 @@ public interface BasicdataPriceMapper extends BaseMapper<BasicdataPriceEntity> {
*/
List<BasicdataPriceExcel> exportBasicdataPrice(@Param("ew") Wrapper<BasicdataPriceEntity> queryWrapper);
@Delete("delete from logpm_basicdata_price_route where price_id = #{id}")
void removeRouteByPriceId(Long id);
}

19
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceMapper.xml

@ -10,6 +10,8 @@
<select id="selectBasicdataPricePage" resultType="com.logpm.basicdata.vo.BasicdataPricePageVO">
select t.id,
cli.client_name,
t.brand_id,
t.template_id,
ldb.brand_name,
lbpt.service_type,
case
@ -25,11 +27,26 @@
left join logpm_basicdata_client cli on cli.id = t.client_id
left join logpm_basicdata_brand ldb on ldb.id = t.brand_id
where t.is_deleted = 0
<if test="basicdataPrice.clientName != null and basicdataPrice.clientName != ''">
and cli.client_name like concat('%',#{basicdataPrice.clientName},'%')
</if>
<if test="basicdataPrice.brandName != null and basicdataPrice.brandName != ''">
and ldb.brand_name like concat('%',#{basicdataPrice.brandName},'%')
</if>
<if test="basicdataPrice.maintenanceStatus != null and basicdataPrice.maintenanceStatus != ''">
<if test="basicdataPrice.maintenanceStatus != 3">
and t.maintenance_status = #{basicdataPrice.maintenanceStatus}
</if>
<if test="basicdataPrice.maintenanceStatus == 3">
and t.expiry_time <![CDATA[ < ]]> now()
</if>
</if>
</select>
<select id="exportBasicdataPrice" resultType="com.logpm.basicdata.excel.BasicdataPriceExcel">
SELECT * FROM logpm_basicdata_price ${ew.customSqlSegment}
SELECT *
FROM logpm_basicdata_price ${ew.customSqlSegment}
</select>
</mapper>

5
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<BasicdataPriceRout
* @param basicdataPriceRoute
* @return
*/
List<BasicdataPriceRouteVO> selectBasicdataPriceRoutePage(IPage page, BasicdataPriceRouteVO basicdataPriceRoute);
List<BasicdataPriceRouteVO> selectBasicdataPriceRoutePage(@Param("page") IPage page, @Param("basicdataPriceRoute") BasicdataPriceRouteVO basicdataPriceRoute);
/**
@ -51,4 +52,6 @@ public interface BasicdataPriceRouteMapper extends BaseMapper<BasicdataPriceRout
*/
List<BasicdataPriceRouteExcel> exportBasicdataPriceRoute(@Param("ew") Wrapper<BasicdataPriceRouteEntity> queryWrapper);
@Delete("delete from logpm_basicdata_price_route where price_id = #{id}")
void removeByPriceId(Long id);
}

20
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceRouteMapper.xml

@ -6,14 +6,20 @@
<resultMap id="basicdataPriceRouteResultMap" type="com.logpm.basicdata.entity.BasicdataPriceRouteEntity">
</resultMap>
<select id="selectBasicdataPriceRoutePage" resultMap="basicdataPriceRouteResultMap">
select * from logpm_basicdata_price_route where is_deleted = 0
</select>
<select id="exportBasicdataPriceRoute" resultType="com.logpm.basicdata.excel.BasicdataPriceRouteExcel">
SELECT * FROM logpm_basicdata_price_route ${ew.customSqlSegment}
SELECT *
FROM logpm_basicdata_price_route ${ew.customSqlSegment}
</select>
<select id="selectBasicdataPriceRoutePage" resultType="com.logpm.basicdata.vo.BasicdataPriceRouteVO">
select t.*,lbc.client_name sendOrgName from logpm_basicdata_price_route t
left join logpm_basicdata_client lbc on lbc.id = t.send_org_id
where t.is_deleted = 0
<if test="basicdataPriceRoute.priceId != null and basicdataPriceRoute.priceId != ''">
and t.price_id = #{basicdataPriceRoute.priceId}
</if>
<if test="basicdataPriceRoute.serviceType != null and basicdataPriceRoute.serviceType != ''">
and t.service_type = #{basicdataPriceRoute.serviceType}
</if>
</select>
</mapper>

2
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<BasicdataPriceTemplateEntity> {
/**

22
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceTemplateMapper.xml

@ -6,14 +6,28 @@
<resultMap id="basicdataPriceTemplateResultMap" type="com.logpm.basicdata.vo.BasicdataPriceTemplateVO">
</resultMap>
<select id="selectBasicdataPriceTemplatePage" resultMap="basicdataPriceTemplateResultMap">
select * from logpm_basicdata_price_template where is_deleted = 0 order by id desc
select t.*,b.brand_name as brandName from logpm_basicdata_price_template t
left join logpm_basicdata_brand b on t.brand_id = b.id
where t.is_deleted = 0
<if test="basicdataPriceTemplate.brandId != null and basicdataPriceTemplate.brandId != ''">
and t.brand_id = #{basicdataPriceTemplate.brandId}
</if>
<if test="basicdataPriceTemplate.templateType != null and basicdataPriceTemplate.templateType != ''">
and t.template_type = #{basicdataPriceTemplate.templateType}
</if>
<if test="basicdataPriceTemplate.name != null and basicdataPriceTemplate.name != ''">
and t.name like concat('%',#{basicdataPriceTemplate.name},'%')
</if>
<if test="basicdataPriceTemplate.brandName != null and basicdataPriceTemplate.brandName != ''">
and b.brand_name like concat('%',#{basicdataPriceTemplate.brandName},'%')
</if>
order by id desc
</select>
<select id="exportBasicdataPriceTemplate" resultType="com.logpm.basicdata.excel.BasicdataPriceTemplateExcel">
SELECT * FROM logpm_basicdata_price_template ${ew.customSqlSegment}
SELECT *
FROM logpm_basicdata_price_template ${ew.customSqlSegment}
</select>
</mapper>

4
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<BasicdataClientEnti
void importClient(List<BasicdataClientExcel> data, Boolean isCovered);
List<JSONObject> findListByClientName(String clientName,String linkMan,String linkPhone);
List<NameDTO> findNameByIds(List<Long> sendOrgIds);
}

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

@ -36,4 +36,6 @@ public interface IBasicdataPriceCategoryBasicService extends BaseService<Basicda
*/
void removeByPriceId(Long priceId);
void removeByPriceIdAndServiceType(Long priceId, Integer serviceType);
}

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

@ -36,4 +36,5 @@ public interface IBasicdataPriceCategoryDispatchService extends BaseService<Basi
*/
void removeByPriceId(Long priceId);
void removeByPriceIdAndServiceType(Long priceId, Integer serviceType);
}

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

@ -36,4 +36,5 @@ public interface IBasicdataPriceCategoryWarehouseService extends BaseService<Bas
*/
void removeByPriceId(Long priceId);
void removeByPriceIdAndServiceType(Long priceId, Integer serviceType);
}

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

@ -29,7 +29,10 @@ public interface IBasicdataPriceFullVehicleService extends BaseService<Basicdata
/**
* 根据价格id删除
* @param id
* @param priceId
*/
void removeByPriceId(Long priceId);
void removeByPriceIdAndServiceType(Long priceId, Integer serviceType);
}

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

@ -37,4 +37,5 @@ public interface IBasicdataPriceGeneralService extends BaseService<BasicdataPric
void removeByPriceId(Long priceId);
void removeByPriceIdAndServiceType(Long priceId, Integer serviceType);
}

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

@ -54,4 +54,6 @@ public interface IBasicdataPriceRouteService extends BaseService<BasicdataPriceR
Long saveRoute(PriceRouteVO vo);
PriceRouteVO detail(Long id);
void removeByPriceId(Long id);
}

14
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataPriceService.java

@ -20,9 +20,10 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.basicdata.entity.BasicdataPriceEntity;
import com.logpm.basicdata.excel.BasicdataPriceExcel;
import com.logpm.basicdata.vo.BasicdatPriceApiVO;
import com.logpm.basicdata.vo.BasicdataPriceBasicUpdateVO;
import com.logpm.basicdata.vo.BasicdataPricePageVO;
import com.logpm.basicdata.vo.BasicdataPriceVO;
import com.logpm.basicdata.vo.PriceClientVO;
import com.logpm.basicdata.vo.PriceVO;
import org.springblade.core.mp.base.BaseService;
@ -42,7 +43,7 @@ public interface IBasicdataPriceService extends BaseService<BasicdataPriceEntity
* @param basicdataPrice
* @return
*/
IPage<BasicdataPricePageVO > selectBasicdataPricePage(IPage<BasicdataPricePageVO > page, BasicdataPriceVO basicdataPrice);
IPage<BasicdataPricePageVO > selectBasicdataPricePage(IPage<BasicdataPricePageVO > page, BasicdataPricePageVO basicdataPrice);
/**
@ -57,5 +58,14 @@ public interface IBasicdataPriceService extends BaseService<BasicdataPriceEntity
Boolean updatePrice(PriceVO vo);
void deleteByPriceIdAndServiceType(Long boId, Integer serviceType);
PriceVO detail(Long id);
/**
* feign 调用 获取价格
* @param param
* @return
*/
PriceClientVO price(BasicdatPriceApiVO param);
}

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

@ -16,6 +16,7 @@
*/
package com.logpm.basicdata.service.impl;
import cn.hutool.core.collection.CollUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@ -24,15 +25,31 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.basicdata.entity.*;
import com.logpm.basicdata.entity.BasicdataBrandEntity;
import com.logpm.basicdata.entity.BasicdataClientEntity;
import com.logpm.basicdata.entity.BasicdataHistoricalContractEntity;
import com.logpm.basicdata.entity.BasicdataStorageServicesEntity;
import com.logpm.basicdata.entity.BasicdataStoreBrandEntity;
import com.logpm.basicdata.entity.BasicdataStoreBusinessEntity;
import com.logpm.basicdata.entity.BasicdataStoreContactEntity;
import com.logpm.basicdata.entity.BasicdataTripartiteMallEntity;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.excel.BasicdataClientExcel;
import com.logpm.basicdata.mapper.BasicdataClientMapper;
import com.logpm.basicdata.service.*;
import com.logpm.basicdata.service.IBasicdataBrandService;
import com.logpm.basicdata.service.IBasicdataClientService;
import com.logpm.basicdata.service.IBasicdataHistoricalContractService;
import com.logpm.basicdata.service.IBasicdataStorageServicesService;
import com.logpm.basicdata.service.IBasicdataStoreBrandService;
import com.logpm.basicdata.service.IBasicdataStoreBusinessService;
import com.logpm.basicdata.service.IBasicdataStoreContactService;
import com.logpm.basicdata.service.IBasicdataTripartiteMallService;
import com.logpm.basicdata.service.IBasicdataWarehouseService;
import com.logpm.basicdata.vo.BasicdataClientVO;
import com.logpm.basicdata.vo.ClientInfoVO;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.core.cache.utils.CacheUtil;
import org.springblade.common.model.dto.NameDTO;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.secure.BladeUser;
@ -47,7 +64,13 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.security.NoSuchAlgorithmException;
import java.util.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;
import static org.springblade.common.constant.DictBizConstant.OPEN_ORDER_PAY_WAY;
@ -334,7 +357,7 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
BeanUtil.copyProperties(i, basicdataClient);
log.info(">>>>>> 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<BasicdataClientM
//添加品牌
if (ObjectUtils.isNotNull(i.getBrandName())) {
String [] ars = i.getBrandName().split(",");
String[] ars = i.getBrandName().split(",");
for (String ar : ars) {
BasicdataStoreBrandEntity storeBrandEntity = new BasicdataStoreBrandEntity();
@ -592,4 +615,12 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
return list;
}
@Override
public List<NameDTO> findNameByIds(List<Long> sendOrgIds) {
if (CollUtil.isNotEmpty(sendOrgIds)) {
return this.baseMapper.findNameByIds(sendOrgIds);
}
return null;
}
}

7
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceCategoryBasicServiceImpl.java

@ -38,4 +38,11 @@ public class BasicdataPriceCategoryBasicServiceImpl extends BaseServiceImpl<Basi
baseMapper.removeByPriceId(priceId);
}
}
@Override
public void removeByPriceIdAndServiceType(Long priceId, Integer serviceType) {
if(!ObjectUtil.hasEmpty(priceId, serviceType)){
this.baseMapper.removeByPriceIdAndServiceType(priceId, serviceType);
}
}
}

7
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceCategoryDispatchServiceImpl.java

@ -38,4 +38,11 @@ public class BasicdataPriceCategoryDispatchServiceImpl extends BaseServiceImpl<B
this.baseMapper.removeByPriceId(priceId);
}
}
@Override
public void removeByPriceIdAndServiceType(Long priceId, Integer serviceType) {
if(!ObjectUtil.hasEmpty(priceId,serviceType)){
this.baseMapper.removeByPriceIdAndServiceType(priceId,serviceType);
}
}
}

7
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceCategoryWarehouseServiceImpl.java

@ -38,4 +38,11 @@ public class BasicdataPriceCategoryWarehouseServiceImpl extends BaseServiceImpl<
baseMapper.removeByPriceId(priceId);
}
}
@Override
public void removeByPriceIdAndServiceType(Long priceId, Integer serviceType) {
if (!ObjectUtil.hasEmpty(priceId, serviceType)) {
baseMapper.removeByPriceIdAndServiceType(priceId, serviceType);
}
}
}

7
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceFullVehicleServiceImpl.java

@ -38,4 +38,11 @@ public class BasicdataPriceFullVehicleServiceImpl extends BaseServiceImpl<Basicd
this.baseMapper.removeByPriceId(priceId);
}
}
@Override
public void removeByPriceIdAndServiceType(Long priceId, Integer serviceType) {
if (!ObjectUtil.hasEmpty(priceId, serviceType)) {
this.baseMapper.removeByPriceIdAndServiceType(priceId, serviceType);
}
}
}

12
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceGeneralServiceImpl.java

@ -18,6 +18,7 @@ package com.logpm.basicdata.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.logpm.basicdata.entity.BasicdataPriceGeneralEntity;
import com.logpm.basicdata.enums.ServiceTypeEnums;
import com.logpm.basicdata.mapper.BasicdataPriceGeneralMapper;
import com.logpm.basicdata.service.IBasicdataPriceGeneralService;
import org.springblade.core.mp.base.BaseServiceImpl;
@ -39,4 +40,15 @@ public class BasicdataPriceGeneralServiceImpl extends BaseServiceImpl<BasicdataP
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);
}
}
}

87
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<BasicdataPri
private final IBasicdataPriceFullVehicleService fullVehicleService;
private final IBasicdataPriceCategoryBasicService categoryBasicService;
private final IBasicdataPriceGeneralService generalService;
private final IBasicdataClientService clientService;
@Override
public IPage<BasicdataPriceRouteVO> selectBasicdataPriceRoutePage(IPage<BasicdataPriceRouteVO> page, BasicdataPriceRouteVO basicdataPriceRoute) {
return page.setRecords(baseMapper.selectBasicdataPriceRoutePage(page, basicdataPriceRoute));
List<BasicdataPriceRouteVO> basicdataPriceRouteVOS = baseMapper.selectBasicdataPriceRoutePage(page, basicdataPriceRoute);
return page.setRecords(basicdataPriceRouteVOS);
}
@Override
public List<BasicdataPriceRouteExcel> exportBasicdataPriceRoute(Wrapper<BasicdataPriceRouteEntity> queryWrapper) {
List<BasicdataPriceRouteExcel> 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<BasicdataPri
FullVehicleTypeEnums fullVehicleTypeEnums = null;
GeneralServiceTypeEnums generalServiceTypeEnums = null;
if (ObjectUtil.equal(vo.getServiceType(), ServiceTypeEnums.PICK_UP.getCode())) {
fullVehicleTypeEnums = FullVehicleTypeEnums.PICK_UP_ROUTE;
generalServiceTypeEnums = GeneralServiceTypeEnums.PICK_UP_ROUTE;
fullVehicleTypeEnums = FullVehicleTypeEnums.PICK_UP;
generalServiceTypeEnums = GeneralServiceTypeEnums.PICK_UP;
} else if (ObjectUtil.equal(vo.getServiceType(), ServiceTypeEnums.TRUNK_LINE.getCode())) {
fullVehicleTypeEnums = FullVehicleTypeEnums.TRUNK_LINE;
generalServiceTypeEnums = GeneralServiceTypeEnums.TRUNK_LINE;
} else {
fullVehicleTypeEnums = FullVehicleTypeEnums.TRUNK_LINE_ROUTE;
generalServiceTypeEnums = GeneralServiceTypeEnums.TRUNK_LINE_ROUTE;
throw new ServiceException("不支持该服务类型");
}
if (ObjectUtil.isNotEmpty(vo.getId())) {
this.deleteByPriceIdAndServiceType(route.getId(), vo.getServiceType());
}
// 整车
if (CollUtil.isNotEmpty(vo.getFullVehicle())) {
FullVehicleTypeEnums finalFullVehicleTypeEnums = fullVehicleTypeEnums;
vo.getFullVehicle().forEach(fullVehicle -> {
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<BasicdataPri
List<BasicdataPriceCategoryBasicEntity> 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<BasicdataPri
return route.getId();
}
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);
}
// 删除一般数据
if (!ObjectUtil.equal(serviceType, ServiceTypeEnums.WAREHOUSE.getCode())) {
generalService.removeByPriceIdAndServiceType(boId, serviceType);
}
}
@Override
public PriceRouteVO detail(Long id) {
// 1.查询基础数据
@ -153,12 +178,16 @@ public class BasicdataPriceRouteServiceImpl extends BaseServiceImpl<BasicdataPri
Integer serviceType = route.getServiceType();
PriceRouteVO vo = new PriceRouteVO();
BeanUtil.copyProperties(route, vo);
BasicdataClientEntity clientEntity = clientService.getById(route.getSendOrgId());
if (ObjectUtil.isNotEmpty(clientEntity)) {
vo.setSendOrgName(clientEntity.getClientName());
}
// 2.查询整车
Integer type = null;
if (ObjectUtil.equal(serviceType, ServiceTypeEnums.PICK_UP.getCode())) {
type = FullVehicleTypeEnums.PICK_UP_ROUTE.getCode();
type = FullVehicleTypeEnums.PICK_UP.getCode();
} else {
type = FullVehicleTypeEnums.TRUNK_LINE_ROUTE.getCode();
type = FullVehicleTypeEnums.TRUNK_LINE.getCode();
}
List<BasicdataPriceFullVehicleEntity> fullVehicleEntities = fullVehicleService.list(Wrappers.<BasicdataPriceFullVehicleEntity>lambdaQuery()
.eq(BasicdataPriceFullVehicleEntity::getBoId, route.getId())
@ -207,6 +236,7 @@ public class BasicdataPriceRouteServiceImpl extends BaseServiceImpl<BasicdataPri
weightCategory.forEach(weight -> {
PriceBasicVO basicdataPriceCategoryBasicVO = new PriceBasicVO();
BeanUtil.copyProperties(weight, basicdataPriceCategoryBasicVO);
weightCategoryVO.add(basicdataPriceCategoryBasicVO);
});
vo.setWeightCategory(weightCategoryVO);
}
@ -225,6 +255,14 @@ public class BasicdataPriceRouteServiceImpl extends BaseServiceImpl<BasicdataPri
throw new ServiceException("表单不存在");
}
@Override
public void removeByPriceId(Long id) {
// 根据主表id删除所有数据
if (ObjectUtil.isNotEmpty(id)) {
this.baseMapper.removeByPriceId(id);
}
}
private void biuldGeneral(Long priceId, Integer code, Double minCost, Double additionalCost, List<BasicdataPriceGeneralEntity> generalList) {
// 1 最低计费一个价格体系一个服务类型只存在一条
BasicdataPriceGeneralEntity generalEntity = generalService.getOne(Wrappers.<BasicdataPriceGeneralEntity>lambdaQuery()
@ -234,6 +272,7 @@ public class BasicdataPriceRouteServiceImpl extends BaseServiceImpl<BasicdataPri
if (ObjectUtil.isEmpty(generalEntity)) {
generalEntity = new BasicdataPriceGeneralEntity();
generalEntity.setBoId(priceId);
generalEntity.setPriceId(priceId);
generalEntity.setServiceType(code);
}
// 设置最低计费和加算价格
@ -243,30 +282,24 @@ public class BasicdataPriceRouteServiceImpl extends BaseServiceImpl<BasicdataPri
}
private void buildCategory(Long priceId, List<BasicdataPriceCategoryBasicEntity> cubeCategoryEntities, PriceBasicVO cubeCategory, Integer type) {
private void buildCategory(BasicdataPriceRouteEntity route, List<BasicdataPriceCategoryBasicEntity> cubeCategoryEntities, PriceBasicVO cubeCategory, Integer type, Integer serviceType) {
BasicdataPriceCategoryBasicEntity categoryEntity = new BasicdataPriceCategoryBasicEntity();
Long id = cubeCategory.getId();
if (ObjectUtil.isEmpty(id)) {
categoryEntity.setBoId(priceId);
categoryEntity.setBoId(route.getId());
categoryEntity.setPriceId(route.getPriceId());
categoryEntity.setType(type);
} else {
categoryEntity.setId(id);
}
categoryEntity.setServiceType(serviceType);
categoryEntity.setPrice(cubeCategory.getPrice());
categoryEntity.setCategoryId(cubeCategory.getCategoryId());
cubeCategoryEntities.add(categoryEntity);
}
private void buildFullVehicle(Long priceId, List<BasicdataPriceFullVehicleEntity> fullVehicleEntities, BasicdataPriceFullVehicleVO fullVehicle, Integer type) {
private void buildFullVehicle(BasicdataPriceRouteEntity route, List<BasicdataPriceFullVehicleEntity> 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.setBoId(route.getId());
basicdataPriceFullVehicleEntity.setType(type);
} else {
basicdataPriceFullVehicleEntity.setId(fullVehicle.getId());
}
basicdataPriceFullVehicleEntity.setPriceId(route.getPriceId());
fullVehicleEntities.add(basicdataPriceFullVehicleEntity);
}

244
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<BasicdataPriceMap
private final IBasicdataPriceCategoryWarehouseService categoryWarehouseService;
private final IBasicdataPriceGeneralService generalService;
private final IBasicdataPriceRouteService basicdataPriceRouteService;
@Override
public IPage<BasicdataPricePageVO> selectBasicdataPricePage(IPage<BasicdataPricePageVO> page, BasicdataPriceVO basicdataPrice) {
public IPage<BasicdataPricePageVO> selectBasicdataPricePage(IPage<BasicdataPricePageVO> page, BasicdataPricePageVO basicdataPrice) {
List<BasicdataPricePageVO> 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<BasicdataPriceMap
categoryBasicService.removeByPriceId(id);
categoryWarehouseService.removeByPriceId(id);
generalService.removeByPriceId(id);
basicdataPriceRouteService.removeByPriceId(id);
}
@Override
@ -193,19 +200,24 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
BasicdataPriceEntity priceEntity1 = new BasicdataPriceEntity();
priceEntity1.setId(priceEntity.getId());
priceEntity1.setMaintenanceStatus(2);
// 删除老数据,构建新数据
switch (serviceTypeEnum) {
case PICK_UP:
deleteByPriceIdAndServiceType(priceId, ServiceTypeEnums.PICK_UP.getCode());
buildPickup(vo.getPickup(), priceId, templateEntity);
break;
case TRUNK_LINE:
deleteByPriceIdAndServiceType(priceId, ServiceTypeEnums.TRUNK_LINE.getCode());
buildTrunkLine(vo.getTrunkLine(), priceId, templateEntity);
break;
case INSTALL:
break;
case WAREHOUSE:
deleteByPriceIdAndServiceType(priceId, ServiceTypeEnums.WAREHOUSE.getCode());
buildWarehouse(vo.getWarehouse(), priceId, templateEntity);
break;
case DISPATCH:
deleteByPriceIdAndServiceType(priceId, ServiceTypeEnums.DISPATCH.getCode());
buildDispatchCategory(vo.getDispatch(), priceEntity1, templateEntity);
break;
default:
@ -234,8 +246,133 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
String serviceType = templateEntity.getServiceType();
// 获取整车数据
Map<Integer, List<BasicdataPriceFullVehicleEntity>> fullMap = new HashMap<>();
Map<Integer, List<BasicdataPriceCategoryBasicEntity>> basicMap = new HashMap<>();
Map<Integer, List<BasicdataPriceCategoryWarehouseEntity>> warehouseMap = new HashMap<>();
Map<Integer, List<BasicdataPriceCategoryDispatchEntity>> dispatchMap = new HashMap<>();
Map<Integer, List<BasicdataPriceGeneralEntity>> 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<BasicdataPriceEntity> priceEntities = this.list(Wrappers.<BasicdataPriceEntity>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<Integer, List<BasicdataPriceFullVehicleEntity>> fullMap = new HashMap<>();
Map<Integer, List<BasicdataPriceCategoryBasicEntity>> basicMap = new HashMap<>();
Map<Integer, List<BasicdataPriceCategoryWarehouseEntity>> warehouseMap = new HashMap<>();
Map<Integer, List<BasicdataPriceCategoryDispatchEntity>> dispatchMap = new HashMap<>();
Map<Integer, List<BasicdataPriceGeneralEntity>> 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<BasicdataPriceRouteEntity> routeEntities = basicdataPriceRouteService.list(Wrappers.<BasicdataPriceRouteEntity>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<BasicdataPriceRouteEntity> routeEntities = basicdataPriceRouteService.list(Wrappers.<BasicdataPriceRouteEntity>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<Integer, List<BasicdataPriceFullVehicleEntity>> fullMap, Map<Integer, List<BasicdataPriceCategoryBasicEntity>> basicMap, Map<Integer, List<BasicdataPriceCategoryWarehouseEntity>> warehouseMap, Map<Integer, List<BasicdataPriceCategoryDispatchEntity>> dispatchMap, Map<Integer, List<BasicdataPriceGeneralEntity>> generalMap) {
// 获取整车数据
List<BasicdataPriceFullVehicleEntity> list = fullVehicleService.list(Wrappers.<BasicdataPriceFullVehicleEntity>lambdaQuery()
.eq(BasicdataPriceFullVehicleEntity::getBoId, priceEntity.getId()));
if (CollUtil.isNotEmpty(list)) {
@ -251,7 +388,6 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
});
}
// 获取品类数据
Map<Integer, List<BasicdataPriceCategoryBasicEntity>> basicMap = new HashMap<>();
List<BasicdataPriceCategoryBasicEntity> basicList = categoryBasicService.list(Wrappers.<BasicdataPriceCategoryBasicEntity>lambdaQuery()
.eq(BasicdataPriceCategoryBasicEntity::getBoId, priceEntity.getId()));
if (CollUtil.isNotEmpty(basicList)) {
@ -266,7 +402,7 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
basicMap.put(type, collect);
});
}
Map<Integer, List<BasicdataPriceCategoryWarehouseEntity>> warehouseMap = new HashMap<>();
List<BasicdataPriceCategoryWarehouseEntity> warehouseList = categoryWarehouseService.list(Wrappers.<BasicdataPriceCategoryWarehouseEntity>lambdaQuery()
.eq(BasicdataPriceCategoryWarehouseEntity::getBoId, priceEntity.getId()));
if (CollUtil.isNotEmpty(warehouseList)) {
@ -281,7 +417,7 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
warehouseMap.put(type, collect);
});
}
Map<Integer, List<BasicdataPriceCategoryDispatchEntity>> dispatchMap = new HashMap<>();
List<BasicdataPriceCategoryDispatchEntity> dispatchList = categoryDispatchService.list(Wrappers.<BasicdataPriceCategoryDispatchEntity>lambdaQuery()
.eq(BasicdataPriceCategoryDispatchEntity::getBoId, priceEntity.getId()));
if (CollUtil.isNotEmpty(dispatchList)) {
@ -297,7 +433,7 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
});
}
// 获取一般费用
Map<Integer, List<BasicdataPriceGeneralEntity>> generalMap = new HashMap<>();
List<BasicdataPriceGeneralEntity> generalList = generalService.list(Wrappers.<BasicdataPriceGeneralEntity>lambdaQuery()
.eq(BasicdataPriceGeneralEntity::getBoId, priceEntity.getId()));
if (CollUtil.isNotEmpty(generalList)) {
@ -312,19 +448,6 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
generalMap.put(type, collect);
});
}
if (serviceType.contains(ServiceTypeEnums.PICK_UP.getCode().toString())) {
vo.setPickup(initPickUp(priceEntity, templateEntity, fullMap.get(1), basicMap.get(1), generalMap.get(1)));
}
if (serviceType.contains(ServiceTypeEnums.TRUNK_LINE.getCode().toString())) {
vo.setTrunkLine(initTrunkLine(priceEntity, templateEntity, fullMap.get(2), basicMap.get(3), generalMap.get(3)));
}
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(3), dispatchMap, generalMap.get(5), generalMap.get(6)));
}
return vo;
}
private PriceDispatchVO initDispatch(BasicdataPriceEntity priceEntity, BasicdataPriceTemplateEntity templateEntity, List<BasicdataPriceFullVehicleEntity> fullVehicleEntities, Map<Integer, List<BasicdataPriceCategoryDispatchEntity>> dispatchMap, List<BasicdataPriceGeneralEntity> generalEntities, List<BasicdataPriceGeneralEntity> generalEntities1) {
@ -472,7 +595,7 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
List<BasicdataPriceCategoryWarehouseEntity> warehouseEntities = warehouseMap.get(1);
if (CollUtil.isNotEmpty(warehouseEntities)) {
warehouseEntities.forEach(item -> {
Integer type = item.getCostType();
Integer type = item.getType();
List<BasicdataPriceCategoryWarehouseEntity> collect = categoryBasicMap.get(type);
if (ObjectUtil.isEmpty(collect)) {
collect = new ArrayList<>();
@ -612,6 +735,7 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
// fullVehicleEntities转为BasicdataPriceFullVehicleVO
String pickupPricingType = templateEntity.getPickupPricingType();
if (pickupPricingType.contains(PickupPricingTypeEnums.COMPLETE_VEHICLE.getCode().toString())) {
if(CollUtil.isNotEmpty(fullVehicleEntities)){
List<BasicdataPriceFullVehicleVO> fullVehicleVOS = fullVehicleEntities.stream().map(item -> {
BasicdataPriceFullVehicleVO basicdataPriceFullVehicleVO = new BasicdataPriceFullVehicleVO();
BeanUtil.copyProperties(item, basicdataPriceFullVehicleVO);
@ -619,6 +743,7 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
}).collect(Collectors.toList());
pricePickupVO.setFullVehicle(fullVehicleVOS);
}
}
// 按件
if (pickupPricingType.contains(PickupPricingTypeEnums.PIECE.getCode().toString())) {
List<BasicdataPriceCategoryBasicEntity> categoryBasicEntityList = categoryBasicMap.get(PickupPricingTypeEnums.PIECE.getCode());
@ -697,7 +822,7 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
buildFullVehicle(priceEntity.getId(), fullVehicleEntities, fullVehicle, FullVehicleTypeEnums.DISPATCH.getCode());
});
if (CollUtil.isNotEmpty(fullVehicleEntities)) {
fullVehicleService.saveOrUpdateBatch(fullVehicleEntities);
fullVehicleService.saveBatch(fullVehicleEntities);
}
}
// 按件
@ -768,14 +893,11 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
categoryBasicEntity.setHandlingPrice(category.getHandlingPrice());
categoryBasicEntity.setRelocationPrice(category.getRelocationPrice());
categoryBasicEntity.setUpstairsDeliveryPrice(category.getUpstairsDeliveryPrice());
if (ObjectUtil.isNotEmpty(category.getId())) {
categoryBasicEntity.setId(category.getId());
}
categoryList.add(categoryBasicEntity);
});
}
if (CollUtil.isNotEmpty(categoryList)) {
categoryDispatchService.saveOrUpdateBatch(categoryList);
categoryDispatchService.saveBatch(categoryList);
}
// 一般费用
if (ObjectUtil.equal(templateEntity.getDispatchIsMinCost(), BooleanZeroOneEnums.YES.getCode()) && ObjectUtil.isNotEmpty(dispatch.getMinCost())) {
@ -808,9 +930,6 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
categoryBasicEntity.setServiceType(1);
categoryBasicEntity.setPrice(category.getPrice());
categoryBasicEntity.setLeaveBehindPrice(category.getLeaveBehindPrice());
if (ObjectUtil.isNotEmpty(category.getId())) {
categoryBasicEntity.setId(category.getId());
}
categoryList.add(categoryBasicEntity);
}
@ -834,9 +953,6 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
categoryBasicEntity.setBetweenThirtySixtyPrice(category.getBetweenThirtySixtyPrice());
categoryBasicEntity.setBeyondSixtyPrice(category.getBeyondSixtyPrice());
categoryBasicEntity.setMaximumPrice(category.getMaximumPrice());
if (ObjectUtil.isNotEmpty(category.getId())) {
categoryBasicEntity.setId(category.getId());
}
categoryList.add(categoryBasicEntity);
});
}
@ -853,14 +969,11 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
categoryBasicEntity.setWarehouseSortPrice(category.getWarehouseSortPrice());
categoryBasicEntity.setWarehouseManagementPrice(category.getWarehouseManagementPrice());
categoryBasicEntity.setOperatePrice(category.getOperatePrice());
if (ObjectUtil.isNotEmpty(category.getId())) {
categoryBasicEntity.setId(category.getId());
}
categoryList.add(categoryBasicEntity);
});
}
if (CollUtil.isNotEmpty(categoryList)) {
categoryWarehouseService.saveOrUpdateBatch(categoryList);
categoryWarehouseService.saveBatch(categoryList);
}
}
@ -875,7 +988,7 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
buildFullVehicle(priceId, fullVehicleEntities, fullVehicle, FullVehicleTypeEnums.TRUNK_LINE.getCode());
});
if (CollUtil.isNotEmpty(fullVehicleEntities)) {
fullVehicleService.saveOrUpdateBatch(fullVehicleEntities);
fullVehicleService.saveBatch(fullVehicleEntities);
}
}
List<BasicdataPriceCategoryBasicEntity> categoryEntities = new ArrayList<>();
@ -883,7 +996,7 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
if (trunkLinePricingType.contains(TrunkLinePricingTypeEnums.PIECE.getCode().toString())
&& CollUtil.isNotEmpty(trunkLine.getPieceCategory())) {
trunkLine.getPieceCategory().forEach(pieceCategory -> {
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<BasicdataPriceMap
if (trunkLinePricingType.contains(TrunkLinePricingTypeEnums.CUBE.getCode().toString())
&& CollUtil.isNotEmpty(trunkLine.getCubeCategory())) {
trunkLine.getCubeCategory().forEach(cubeCategory -> {
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<BasicdataPriceGeneralEntity> priceGeneralEntities = new ArrayList<>();
@ -947,7 +1060,7 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
buildFullVehicle(priceId, fullVehicleEntities, fullVehicle, FullVehicleTypeEnums.PICK_UP.getCode());
});
if (CollUtil.isNotEmpty(fullVehicleEntities)) {
fullVehicleService.saveOrUpdateBatch(fullVehicleEntities);
fullVehicleService.saveBatch(fullVehicleEntities);
}
}
List<BasicdataPriceCategoryBasicEntity> categoryEntities = new ArrayList<>();
@ -955,7 +1068,7 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
if (pickupPricingType.contains(PickupPricingTypeEnums.PIECE.getCode().toString())
&& CollUtil.isNotEmpty(pickup.getPieceCategory())) {
pickup.getPieceCategory().forEach(pieceCategory -> {
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<BasicdataPriceMap
if (pickupPricingType.contains(PickupPricingTypeEnums.CUBE.getCode().toString())
&& CollUtil.isNotEmpty(pickup.getCubeCategory())) {
pickup.getCubeCategory().forEach(cubeCategory -> {
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<BasicdataPriceGeneralEntity> 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<BasicdataPriceMap
basicdataPriceFullVehicleEntity.setPrice(fullVehicle.getPrice());
basicdataPriceFullVehicleEntity.setVehicleType(fullVehicle.getVehicleType());
basicdataPriceFullVehicleEntity.setPriceId(priceId);
if (ObjectUtil.isEmpty(fullVehicle.getId())) {
basicdataPriceFullVehicleEntity.setBoId(priceId);
basicdataPriceFullVehicleEntity.setType(type);
} else {
basicdataPriceFullVehicleEntity.setId(fullVehicle.getId());
}
fullVehicleEntities.add(basicdataPriceFullVehicleEntity);
}
private void buildCategory(Long priceId, List<BasicdataPriceCategoryBasicEntity> 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.setPriceId(priceId);
categoryEntity.setPrice(cubeCategory.getPrice());
categoryEntity.setCategoryId(cubeCategory.getCategoryId());

124
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<Basicdata
List<BasicdataPriceTemplateVO> records = baseMapper.selectBasicdataPriceTemplatePage(page, basicdataPriceTemplate);
if (CollUtil.isNotEmpty(records)) {
List<Long> userIds = records.stream().map(BasicdataPriceTemplateVO::getCreateUser).collect(Collectors.toList());
List<Long> brandIds = records.stream().map(BasicdataPriceTemplateVO::getBrandId).collect(Collectors.toList());
List<BasicdataBrandEntity> basicdataBrandEntities = brandService.listByIds(brandIds);
Map<Long, String> brandNameMap = new HashMap<>();
if (CollUtil.isNotEmpty(basicdataBrandEntities)) {
brandNameMap = basicdataBrandEntities.stream().collect(Collectors.toMap(BasicdataBrandEntity::getId, BasicdataBrandEntity::getBrandName));
}
R<List<User>> listR = userClient.userInfoByIds(AuthUtil.getTenantId(), userIds.stream().map(Object::toString).collect(Collectors.joining(",")));
Map<Long, String> names = new HashMap<>();
Map<Long, String> 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<Basicdata
@Override
public List<BasicdataPriceTemplateExcel> exportBasicdataPriceTemplate(Wrapper<BasicdataPriceTemplateEntity> queryWrapper) {
List<BasicdataPriceTemplateExcel> 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<Basicdata
priceTemplateEntity.setPickupWeightCategory(basicdataPriceTemplate.getPickupWeightCategory());
priceTemplateEntity.setPickupIsMinCost(basicdataPriceTemplate.getPickupIsMinCost());
priceTemplateEntity.setPickupMinCostType(basicdataPriceTemplate.getPickupMinCostType());
priceTemplateEntity.setPickupIsUnifyAreaBill(basicdataPriceTemplate.getPickupIsUnifyAreaBill());
break;
case TRUNK_LINE:
String trunklinePricingType = basicdataPriceTemplate.getTrunklinePricingType();
@ -233,6 +221,12 @@ public class BasicdataPriceTemplateServiceImpl extends BaseServiceImpl<Basicdata
@Override
public Long saveTemplate(BasicdataPriceTemplateEntity basicdataPriceTemplate) {
checkParam(basicdataPriceTemplate);
String userAccount = AuthUtil.getUserAccount();
if (ObjectUtil.equal(userAccount, "admin")) {
basicdataPriceTemplate.setTemplateType("系统");
}else{
basicdataPriceTemplate.setTemplateType("用户");
}
this.save(basicdataPriceTemplate);
return basicdataPriceTemplate.getId();
}
@ -256,57 +250,57 @@ public class BasicdataPriceTemplateServiceImpl extends BaseServiceImpl<Basicdata
ServiceTypeEnums currentDict = IDict.getByCode(ServiceTypeEnums.class, checkType);
switch (currentDict) {
case PICK_UP:
templateEntity.setPickupPricingType(null);
templateEntity.setPickupIsByCategory(null);
templateEntity.setPickupPieceCategory(null);
templateEntity.setPickupCubeCategory(null);
templateEntity.setPickupWeightCategory(null);
templateEntity.setPickupIsMinCost(null);
templateEntity.setPickupMinCostType(null);
templateEntity.setPickupPricingType("");
templateEntity.setPickupIsByCategory(0);
templateEntity.setPickupPieceCategory("");
templateEntity.setPickupCubeCategory("");
templateEntity.setPickupWeightCategory("");
templateEntity.setPickupIsMinCost(0);
templateEntity.setPickupMinCostType(MinCostTypeEnums.PRICE.getCode());
break;
case TRUNK_LINE:
templateEntity.setTrunklinePricingType(null);
templateEntity.setTrunklineIsUnifyAreaBill(null);
templateEntity.setTrunklineIsByCategory(null);
templateEntity.setTrunklinePieceCategory(null);
templateEntity.setTrunklineCubeCategory(null);
templateEntity.setTrunklineWeightCategory(null);
templateEntity.setTrunklineIsPeculiarSetup(null);
templateEntity.setTrunklineIsMinCost(null);
templateEntity.setTrunklineMinCostType(null);
templateEntity.setTrunklinePricingType("");
templateEntity.setTrunklineIsUnifyAreaBill(0);
templateEntity.setTrunklineIsByCategory(0);
templateEntity.setTrunklinePieceCategory("");
templateEntity.setTrunklineCubeCategory("");
templateEntity.setTrunklineWeightCategory("");
templateEntity.setTrunklineIsPeculiarSetup(0);
templateEntity.setTrunklineIsMinCost(0);
templateEntity.setTrunklineMinCostType(MinCostTypeEnums.PRICE.getCode());
break;
case WAREHOUSE:
templateEntity.setWarehousePricingType(null);
templateEntity.setWarehousePricingMode(null);
templateEntity.setWarehouseCalculationBasis(null);
templateEntity.setWarehouseIsByCategory(null);
templateEntity.setWarehousePieceCategory(null);
templateEntity.setWarehouseSubjoinFeeUnit(null);
templateEntity.setWarehouseIsManageFee(null);
templateEntity.setWarehouseIsOperateFee(null);
templateEntity.setWarehouseIsSortFee(null);
templateEntity.setWarehouseIsCategorySubjoin(null);
templateEntity.setWarehouseSubjoinCategory(null);
templateEntity.setWarehousePricingType(WarehousePricingTypeEnums.PIECE.getCode());
templateEntity.setWarehousePricingMode(WarehousePricingModeEnums.SEGMENTED_CHARGING.getCode());
templateEntity.setWarehouseCalculationBasis(WarehouseCalculationBasisEnums.PIECE_PER_DAY.getCode());
templateEntity.setWarehouseIsByCategory(0);
templateEntity.setWarehousePieceCategory("");
templateEntity.setWarehouseSubjoinFeeUnit(WarehousePricingUnitEnums.PIECE.getCode());
templateEntity.setWarehouseIsManageFee(0);
templateEntity.setWarehouseIsOperateFee(0);
templateEntity.setWarehouseIsSortFee(0);
templateEntity.setWarehouseIsCategorySubjoin(0);
templateEntity.setWarehouseSubjoinCategory("");
break;
case DISPATCH:
templateEntity.setDispatchServiceType(null);
templateEntity.setDispatchPricingType(null);
templateEntity.setDispatchIsByCategory(null);
templateEntity.setDispatchIsLeaveBehind(null);
templateEntity.setDispatchPieceCategory(null);
templateEntity.setDispatchCubeCategory(null);
templateEntity.setDispatchWeightCategory(null);
templateEntity.setDispatchIsCategorySubjoin(null);
templateEntity.setDispatchIsSortFee(null);
templateEntity.setDispatchIsOperateFee(null);
templateEntity.setDispatchIsStairsCarryingCharge(null);
templateEntity.setDispatchIsFeeFloor(null);
templateEntity.setDispatchIsShiftingCharge(null);
templateEntity.setDispatchSubjoinCategory(null);
templateEntity.setDispatchIsMinCost(null);
templateEntity.setDispatchMinCostMode(null);
templateEntity.setDispatchMinCostType(null);
templateEntity.setDispatchIsUpwardJudgment(null);
templateEntity.setDispatchServiceType(DispatchTypeEnums.COMMERCIAL_DISTRIBUTION.getCode());
templateEntity.setDispatchPricingType("");
templateEntity.setDispatchIsByCategory(0);
templateEntity.setDispatchIsLeaveBehind(0);
templateEntity.setDispatchPieceCategory("");
templateEntity.setDispatchCubeCategory("");
templateEntity.setDispatchWeightCategory("");
templateEntity.setDispatchIsCategorySubjoin(0);
templateEntity.setDispatchIsSortFee(0);
templateEntity.setDispatchIsOperateFee(0);
templateEntity.setDispatchIsStairsCarryingCharge(0);
templateEntity.setDispatchIsFeeFloor(0);
templateEntity.setDispatchIsShiftingCharge(0);
templateEntity.setDispatchSubjoinCategory("");
templateEntity.setDispatchIsMinCost(0);
templateEntity.setDispatchMinCostMode(MinCostTypeEnums.PRICE.getCode());
templateEntity.setDispatchMinCostType(MinCostWayEnums.PRICE.getCode());
templateEntity.setDispatchIsUpwardJudgment(0);
break;
case INSTALL:
break;

3
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataWarehouseServiceImpl.java

@ -272,7 +272,6 @@ public class BasicdataWarehouseServiceImpl extends BaseServiceImpl<BasicdataWare
// 根据当前登陆人的信息和角色判断查询是所属仓库 还是服务仓库
try {
BladeUser user = AuthUtil.getUser();
String json = redis.get(CacheNames.tenantKeyObj(user.getTenantId(), CacheNames.USER_WAREHOUSE_KEY, user.getUserId()));
if (StringUtil.isBlank(json)) {
List<BasicdataWarehouseEntity> myWarehouseList = getMyWarehouseList();
@ -288,9 +287,7 @@ public class BasicdataWarehouseServiceImpl extends BaseServiceImpl<BasicdataWare
log.error(">>>>>> 获取仓库信息错误",e);
}
return null;
}
@Override

6
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<MerchantOrderVO> goods(@RequestParam("contract_number") String contract_number, @RequestParam("auth_key") String auth_key) {
return R.data(merchantService.goods(contract_number,auth_key));
public R<MerchantOrderPackageVO> goods(@RequestParam("contract_number") String contract_number, @RequestParam("auth_key") String auth_key) {
return R.data(merchantService.goods(contract_number, auth_key));
}

2
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}
</select>

4
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);
}

15
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<String> warehouseId = merchantMapeer.findWarehouseIdByAuthKey(authKey);
@ -34,15 +34,20 @@ 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<MerchantPackageVO> packageVO = merchantMapeer.findPackage(contractNumber);
MerchantOrderPackageVO orderPackageVO = new MerchantOrderPackageVO();
BeanUtil.copyProperties(dto, orderPackageVO);
orderPackageVO.setPackageInfor(packageVO);
return orderPackageVO;
}
// 零担订单
// 定制品
// 包件/库存品
}
}
return null;
}

10
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<DistributionPar
List<DistributionParcelListNodeVO> selectPackageCancelBillLading(@Param("orderPackageCode")String orderPackageCode,@Param("warehouseId") Long warehouseId);
/**
* 根据包裹列表ID集合和仓库ID查询包裹列表实体集合
*
* @param parcelListIds 包裹列表ID的集合类型为Set<Long>
* @param warehouseId 仓库的ID类型为Long
* @return 返回一个List<DistributionParcelListEntity>类型的集合包含匹配的包裹列表实体
*/
List<DistributionParcelListEntity> findListByIds(@Param("parcelListIds") Set<Long> parcelListIds, @Param("warehouseId") Long warehouseId);
}

7
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
</select>
<select id="findListByIds" resultType="com.logpm.distribution.entity.DistributionParcelListEntity">
select id,order_package_code,brand_name from logpm_distribution_parcel_list where id in
<foreach collection="parcelListIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
and warehouse_id = #{warehouseId}
</select>
</mapper>

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

@ -209,4 +209,14 @@ public interface IDistributionParcelListService extends BaseService<Distribution
* @param parcelListId
*/
void maintenanceZerpPackageInfo(Long parcelListId);
/**
* 根据包裹列表ID集合和仓库ID查询包裹列表实体集合
*
* @param parcelListIds 包裹列表ID的集合类型为Set<Long>
* @param warehouseId 仓库的ID类型为Long
* @return 返回一个List<DistributionParcelListEntity>类型的集合包含匹配的包裹列表实体
*/
List<DistributionParcelListEntity> findListByIds(Set<Long> parcelListIds, Long warehouseId);
}

55
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<Distribut
public IPage<DistributionParcelListVO> selectDistributionParcelListPage(IPage<DistributionParcelListVO> page, DistributionParcelListVO distributionParcelList) {
BasicdataWarehouseEntity myWatchWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
List<Long> collect = new ArrayList<>();
if(ObjectUtils.isNull(myWatchWarehouse)){
if (ObjectUtils.isNull(myWatchWarehouse)) {
List<BasicdataWarehouseEntity> 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<Distribut
parcelListVO.setDeliveryQuantity(parcelNumber.getDeliveryQuantity());
parcelListVO.setTiQuantity((parcelNumber.getHandQuantity() - parcelNumber.getDeliveryQuantity()));
if (Func.isNotEmpty(reservationId)){
if (Func.isNotEmpty(one)){
if (Func.isNotEmpty(reservationId)) {
if (Func.isNotEmpty(one)) {
parcelListVO.setDeliveryQuantity(parcelNumber.getDeliveryQuantity() - one.getQuantity());
parcelListVO.setTiQuantity(one.getQuantity());
}
@ -745,9 +746,9 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
if (departureWarehouseId.equals(destinationWarehouseId)) {
parcelListEntity.setIsTransfer(0);
} else {
if(destinationWarehouseId.equals(packageWarehouseId)){
if (destinationWarehouseId.equals(packageWarehouseId)) {
parcelListEntity.setIsTransfer(0);
}else{
} else {
parcelListEntity.setIsTransfer(1);
}
}
@ -1052,23 +1053,23 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
parcelListNodeVOS.addAll(planDeliveryPackage);
}
//查询自提计划
List<DistributionParcelListNodeVO> planBillLadingPackage =baseMapper.selectPackagePlanBillLading(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId());
if (Func.isNotEmpty(planBillLadingPackage)){
List<DistributionParcelListNodeVO> planBillLadingPackage = baseMapper.selectPackagePlanBillLading(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId());
if (Func.isNotEmpty(planBillLadingPackage)) {
parcelListNodeVOS.addAll(planBillLadingPackage);
}
//查询自提取消
List<DistributionParcelListNodeVO> cancelBillLadingPackage =baseMapper.selectPackageCancelBillLading(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId());
if (Func.isNotEmpty(cancelBillLadingPackage)){
cancelBillLadingPackage.forEach(s->{
List<DistributionParcelListNodeVO> cancelBillLadingPackage = baseMapper.selectPackageCancelBillLading(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId());
if (Func.isNotEmpty(cancelBillLadingPackage)) {
cancelBillLadingPackage.forEach(s -> {
R<User> userR = userClient.userInfoById(s.getNodeControlsUserId());
s.setNodeControlsUserName(userR.getData().getName());
});
parcelListNodeVOS.addAll(cancelBillLadingPackage);
}
//查询自提签收扫描
List<DistributionParcelListNodeVO> signForBillLadingPackage =baseMapper.selectPackageSignForlBillLading(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId());
if (Func.isNotEmpty(signForBillLadingPackage)){
signForBillLadingPackage.forEach(s->{
List<DistributionParcelListNodeVO> signForBillLadingPackage = baseMapper.selectPackageSignForlBillLading(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId());
if (Func.isNotEmpty(signForBillLadingPackage)) {
signForBillLadingPackage.forEach(s -> {
R<User> userR = userClient.userInfoById(s.getNodeControlsUserId());
s.setNodeControlsUserName(userR.getData().getName());
});
@ -1166,33 +1167,33 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
DistributionParcelNumberEntity distributionParcelNumberEntity = distributionParcelNumberService.getOne(Wrappers.<DistributionParcelNumberEntity>query().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<Distribut
}
@Override
public List<DistributionParcelListEntity> findListByIds(Set<Long> parcelListIds, Long warehouseId) {
if (CollUtil.isNotEmpty(parcelListIds) && ObjectUtils.isNotEmpty(warehouseId)) {
return this.baseMapper.findListByIds(parcelListIds, warehouseId);
}
return null;
}
}

49
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<Distrilb
private IDisStockListDetailService disStockListDetailService;
@Autowired
private BladeRedis redis;
@Resource
private FactoryDataMessageSender factoryDataMessageSender;
@Override
@ -2976,6 +2985,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
if (Func.isEmpty(myCurrentWarehouse)){
return false;
}
Set<Long> parcelListIds = new HashSet<>();
for (int i = 0; i < split.length; i++) {
String s = split[i];
//查询是不是上传图片
@ -3007,6 +3017,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
//存在资源释放操作
distributionAsyncService.releaseBillLadingResource(Long.parseLong(s),myCurrentWarehouse.getId());
}
parcelListIds.addAll(ladingScanEntities.stream().map(DistributionBillLadingScanEntity::getParcelListId).collect(Collectors.toSet()));
}else {
distributionAsyncService.releaseBillLadingResource(Long.parseLong(s),myCurrentWarehouse.getId());
}
@ -3043,9 +3054,47 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
updateStock(s);
}
// 回传工厂数据
sendFactory(myCurrentWarehouse, parcelListIds);
return true;
}
private void sendFactory(BasicdataWarehouseEntity myCurrentWarehouse, Set<Long> parcelListIds) {
try {
// ladingScanEntities中的包件id数据封装为set
if (CollUtil.isNotEmpty(parcelListIds)) {
List<DistributionParcelListEntity> parcelList = distributionParcelListService.findListByIds(parcelListIds, myCurrentWarehouse.getId());
if (CollUtil.isNotEmpty(parcelList)) {
// parcelList 以品牌名称分组封装为map
Map<String, List<DistributionParcelListEntity>> parcelMap = parcelList.stream().collect(Collectors.groupingBy(DistributionParcelListEntity::getBrandName));
for (Map.Entry<String, List<DistributionParcelListEntity>> entry : parcelMap.entrySet()) {
String key = entry.getKey();
List<DistributionParcelListEntity> value = entry.getValue();
List<Object> 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);
}
}
/**
* 处理提货库存品签收
*/

Loading…
Cancel
Save