Browse Source

Merge branch 'dev' into test

test
zhenghaoyu 2 years ago
parent
commit
7c5533a24e
  1. 2
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataStoreBusinessClient.java
  2. 4
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionDeliveryChargeEntity.java
  3. 80
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionDeliveryDetailsEntity.java
  4. 7
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionPrintEntity.java
  5. 21
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockArticleEntity.java
  6. 49
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionDeliveryDetailsClient.java
  7. 35
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionDeliveryDetailsVO.java
  8. 20
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionReservationVO.java
  9. 19
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistrilbutionBillLadingVO.java
  10. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java
  11. 150
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryDetailsController.java
  12. 12
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java
  13. 15
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistrilbutionBillLadingController.java
  14. 34
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionDeliveryDetailsDTO.java
  15. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionStockListDTO.java
  16. 26
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistrilbutionBillLadingDTO.java
  17. 105
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistributionDeliveryDetailsExcel.java
  18. 53
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionDeliveryDetailsClient.java
  19. 54
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryDetailsMapper.java
  20. 36
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryDetailsMapper.xml
  21. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml
  22. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.xml
  23. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.java
  24. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml
  25. 52
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryDetailsService.java
  26. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java
  27. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillLadingService.java
  28. 54
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryDetailsServiceImpl.java
  29. 38
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  30. 156
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java

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

@ -47,6 +47,6 @@ public interface IBasicdataStoreBusinessClient {
BladePage<BasicdataStoreBusinessEntity> top(@RequestParam("current") Integer current, @RequestParam("size") Integer size);
@GetMapping(API_PREFIX+"/findByClientIdAndTypeService")
BasicdataStoreBusinessEntity findByClientIdAndTypeService(Long clientEntityId, Integer typeService);
BasicdataStoreBusinessEntity findByClientIdAndTypeService(@RequestParam Long clientEntityId,@RequestParam Integer typeService);
}

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

@ -71,7 +71,7 @@ public class DistributionDeliveryChargeEntity extends TenantEntity {
* 费用类型
*/
@ApiModelProperty(value = "费用类型")
private Integer cost;
private String cost;
/**
* 金额
*/
@ -81,6 +81,6 @@ public class DistributionDeliveryChargeEntity extends TenantEntity {
* 类型
*/
@ApiModelProperty(value = "类型")
private Integer genre;
private String genre;
}

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

@ -0,0 +1,80 @@
/*
* 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.distribution.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
/**
* 提货订单明细 实体类
*
* @author cyz
* @since 2023-06-28
*/
@Data
@TableName("logpm_distribution_delivery_details")
@ApiModel(value = "DistributionDeliveryDetails对象", description = "提货订单明细")
@EqualsAndHashCode(callSuper = true)
public class DistributionDeliveryDetailsEntity extends TenantEntity {
/**
* 预留1
*/
@ApiModelProperty(value = "预留1")
private String reserve1;
/**
* 预留2
*/
@ApiModelProperty(value = "预留2")
private String reserve2;
/**
* 预留3
*/
@ApiModelProperty(value = "预留3")
private String reserve3;
/**
* 预留4
*/
@ApiModelProperty(value = "预留4")
private String reserve4;
/**
* 预留5
*/
@ApiModelProperty(value = "预留5")
private String reserve5;
/**
* 提货ID
*/
@ApiModelProperty(value = "提货ID")
private Long billLadingId;
/**
* 库存品ID
*/
@ApiModelProperty(value = "库存品ID")
private Long stockId;
/**
* 数量
*/
@ApiModelProperty(value = "数量")
private Integer quantity;
}

7
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionPrintEntity.java

@ -65,7 +65,7 @@ public class DistributionPrintEntity extends TenantEntity {
* 提货单ID
*/
@ApiModelProperty(value = "提货单ID")
private String billLadingId;
private Long billLadingId;
/**
* 类型;1.提货证件 2.文员确认 3.库管签收
*/
@ -76,5 +76,10 @@ public class DistributionPrintEntity extends TenantEntity {
*/
@ApiModelProperty(value = "图片地址")
private String site;
/**
* 图片名称
*/
@ApiModelProperty(value = "图片名称")
private String siteName;
}

21
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockArticleEntity.java

@ -193,6 +193,27 @@ public class DistributionStockArticleEntity extends TenantEntity {
*/
@ApiModelProperty(value = "预约数量")
private Integer reservationNum;
/**
* 运单号
*/
@ApiModelProperty(value = "运单号")
private Integer waybillNumber;
/**
* 收货单位
*/
@ApiModelProperty(value = "收货单位")
private Integer consigneeUnit;
/**
* 预约数量
*/
@ApiModelProperty(value = "到付费用")
private BigDecimal collectFee;
/**
* 仓储费
*/
@ApiModelProperty(value = "仓储费")
private BigDecimal storageFee;

49
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionDeliveryDetailsClient.java

@ -0,0 +1,49 @@
/*
* 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.distribution.feign;
import org.springblade.core.mp.support.BladePage;
import com.logpm.distribution.entity.DistributionDeliveryDetailsEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
/**
* 提货订单明细 Feign接口类
*
* @author cyz
* @since 2023-06-28
*/
@FeignClient(
value = "blade-distributionDeliveryDetails"
)
public interface IDistributionDeliveryDetailsClient {
String API_PREFIX = "/client";
String TOP = API_PREFIX + "/to234p";
/**
* 获取提货订单明细列表
*
* @param current 页号
* @param size 页数
* @return BladePage
*/
@GetMapping(TOP)
BladePage<DistributionDeliveryDetailsEntity> top(@RequestParam("current") Integer current, @RequestParam("size") Integer size);
}

35
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionDeliveryDetailsVO.java

@ -0,0 +1,35 @@
/*
* 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.distribution.vo;
import com.logpm.distribution.entity.DistributionDeliveryDetailsEntity;
import org.springblade.core.tool.node.INode;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 提货订单明细 视图实体类
*
* @author cyz
* @since 2023-06-28
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class DistributionDeliveryDetailsVO extends DistributionDeliveryDetailsEntity {
private static final long serialVersionUID = 1L;
}

20
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionReservationVO.java

@ -18,6 +18,9 @@ package com.logpm.distribution.vo;
import com.logpm.distribution.entity.DistributionAddvalueEntity;
import com.logpm.distribution.entity.DistributionReservationEntity;
import com.logpm.distribution.entity.DistributionStockArticleEntity;
import com.logpm.distribution.entity.DistributionStockListEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
@ -34,10 +37,19 @@ import java.util.List;
public class DistributionReservationVO extends DistributionReservationEntity {
private static final long serialVersionUID = 1L;
//增值服务信息
List<DistributionAddvalueEntity> addvalueEntityList;
//订单信息
List<?> orderInfos;
/**
* 库存品信息列表
*/
@ApiModelProperty(value = "库存品信息列表")
private List<DistributionStockListEntity> inventoryList;
/**
* 订单信息列表
*/
@ApiModelProperty(value = "订单信息列表")
private List<DistributionStockArticleEntity> stockArticleList;
}

19
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistrilbutionBillLadingVO.java

@ -16,11 +16,14 @@
*/
package com.logpm.distribution.vo;
import com.logpm.distribution.entity.DistributionDeliveryChargeEntity;
import com.logpm.distribution.entity.DistrilbutionBillLadingEntity;
import org.springblade.core.tool.node.INode;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
/**
* 提货单 视图实体类
*
@ -32,4 +35,20 @@ import lombok.EqualsAndHashCode;
public class DistrilbutionBillLadingVO extends DistrilbutionBillLadingEntity {
private static final long serialVersionUID = 1L;
private String serviceNumber;
private String waybillNumber;
private String consigneeUnit;
private String customerName;
private String customerTelephone;
private String warehouse;
private String warehouseEntryTime;
private String storageFee;
private String totalNumber;
private String brand;
private String typeService;
private String transport; //搬运
private String forklift; //叉车
private List<DistributionDeliveryChargeEntity> list;
}

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

@ -102,7 +102,7 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
basicdataStoreBusinessEntity.setTypeService(s);
basicdataStoreBusinessEntity.setClientId(basicdataClient.getId().toString());
if(s.equals("3")){
basicdataStoreBusinessEntity.setMold(basicdataClient.getBusinessType());
basicdataStoreBusinessEntity.setMold(Integer.parseInt(basicdataClient.getBusinessType()));
}
basicdataStoreBusinessService.save(basicdataStoreBusinessEntity);
}

150
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryDetailsController.java

@ -0,0 +1,150 @@
/*
* 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.distribution.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import lombok.AllArgsConstructor;
import javax.validation.Valid;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.distribution.entity.DistributionDeliveryDetailsEntity;
import com.logpm.distribution.vo.DistributionDeliveryDetailsVO;
import com.logpm.distribution.excel.DistributionDeliveryDetailsExcel;
import com.logpm.distribution.service.IDistributionDeliveryDetailsService;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.tool.constant.BladeConstant;
import springfox.documentation.annotations.ApiIgnore;
import java.util.Map;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
/**
* 提货订单明细 控制器
*
* @author cyz
* @since 2023-06-28
*/
@RestController
@AllArgsConstructor
@RequestMapping("/distributionDeliveryDetails")
@Api(value = "提货订单明细", tags = "提货订单明细接口")
public class DistributionDeliveryDetailsController extends BladeController {
private final IDistributionDeliveryDetailsService distributionDeliveryDetailsService;
/**
* 提货订单明细 详情
*/
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "详情", notes = "传入distributionDeliveryDetails")
public R<DistributionDeliveryDetailsEntity> detail(DistributionDeliveryDetailsEntity distributionDeliveryDetails) {
DistributionDeliveryDetailsEntity detail = distributionDeliveryDetailsService.getOne(Condition.getQueryWrapper(distributionDeliveryDetails));
return R.data(detail);
}
/**
* 提货订单明细 分页
*/
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入distributionDeliveryDetails")
public R<IPage<DistributionDeliveryDetailsEntity>> list(@ApiIgnore @RequestParam Map<String, Object> distributionDeliveryDetails, Query query) {
IPage<DistributionDeliveryDetailsEntity> pages = distributionDeliveryDetailsService.page(Condition.getPage(query), Condition.getQueryWrapper(distributionDeliveryDetails, DistributionDeliveryDetailsEntity.class));
return R.data(pages);
}
/**
* 提货订单明细 自定义分页
*/
@GetMapping("/page")
@ApiOperationSupport(order = 3)
@ApiOperation(value = "分页", notes = "传入distributionDeliveryDetails")
public R<IPage<DistributionDeliveryDetailsVO>> page(DistributionDeliveryDetailsVO distributionDeliveryDetails, Query query) {
IPage<DistributionDeliveryDetailsVO> pages = distributionDeliveryDetailsService.selectDistributionDeliveryDetailsPage(Condition.getPage(query), distributionDeliveryDetails);
return R.data(pages);
}
/**
* 提货订单明细 新增
*/
@PostMapping("/save")
@ApiOperationSupport(order = 4)
@ApiOperation(value = "新增", notes = "传入distributionDeliveryDetails")
public R save(@Valid @RequestBody DistributionDeliveryDetailsEntity distributionDeliveryDetails) {
return R.status(distributionDeliveryDetailsService.save(distributionDeliveryDetails));
}
/**
* 提货订单明细 修改
*/
@PostMapping("/update")
@ApiOperationSupport(order = 5)
@ApiOperation(value = "修改", notes = "传入distributionDeliveryDetails")
public R update(@Valid @RequestBody DistributionDeliveryDetailsEntity distributionDeliveryDetails) {
return R.status(distributionDeliveryDetailsService.updateById(distributionDeliveryDetails));
}
/**
* 提货订单明细 新增或修改
*/
@PostMapping("/submit")
@ApiOperationSupport(order = 6)
@ApiOperation(value = "新增或修改", notes = "传入distributionDeliveryDetails")
public R submit(@Valid @RequestBody DistributionDeliveryDetailsEntity distributionDeliveryDetails) {
return R.status(distributionDeliveryDetailsService.saveOrUpdate(distributionDeliveryDetails));
}
/**
* 提货订单明细 删除
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 7)
@ApiOperation(value = "逻辑删除", notes = "传入ids")
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
return R.status(distributionDeliveryDetailsService.deleteLogic(Func.toLongList(ids)));
}
/**
* 导出数据
*/
@GetMapping("/export-distributionDeliveryDetails")
@ApiOperationSupport(order = 9)
@ApiOperation(value = "导出数据", notes = "传入distributionDeliveryDetails")
public void exportDistributionDeliveryDetails(@ApiIgnore @RequestParam Map<String, Object> distributionDeliveryDetails, BladeUser bladeUser, HttpServletResponse response) {
QueryWrapper<DistributionDeliveryDetailsEntity> queryWrapper = Condition.getQueryWrapper(distributionDeliveryDetails, DistributionDeliveryDetailsEntity.class);
//if (!AuthUtil.isAdministrator()) {
// queryWrapper.lambda().eq(DistributionDeliveryDetails::getTenantId, bladeUser.getTenantId());
//}
queryWrapper.lambda().eq(DistributionDeliveryDetailsEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
List<DistributionDeliveryDetailsExcel> list = distributionDeliveryDetailsService.exportDistributionDeliveryDetails(queryWrapper);
ExcelUtil.export(response, "提货订单明细数据" + DateUtil.time(), "提货订单明细数据表", list, DistributionDeliveryDetailsExcel.class);
}
}

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

@ -194,4 +194,16 @@ public class DistributionReservationController extends BladeController {
R<?> result = reservationService.deliveryTask(deliveryInfo);
return result;
}
/**
* 获取指定预约信息
*/
@GetMapping("/getReservationInfo")
@ApiOperationSupport(order = 7)
@ApiOperation(value = "批量预约转备货任务")
public R<DistributionReservationVO> getReservationInfo(@RequestParam String reservationId) {
R<DistributionReservationVO> result = reservationService.getReservationInfo(reservationId);
return result;
}
}

15
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistrilbutionBillLadingController.java

@ -16,6 +16,7 @@
*/
package com.logpm.distribution.controller;
import com.logpm.distribution.dto.DistrilbutionBillLadingDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -79,6 +80,18 @@ public class DistrilbutionBillLadingController extends BladeController {
return R.data(pages);
}
/**
* 提货单 分页
*/
@GetMapping("/listOwn")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入distrilbutionBillLading")
public R<IPage<DistrilbutionBillLadingVO>> listOwn(@ApiIgnore @RequestParam Map<String, Object> distrilbutionBillLading, Query query) {
IPage<DistrilbutionBillLadingVO> pages = distrilbutionBillLadingService.pageList(Condition.getPage(query), distrilbutionBillLading);
return R.data(pages);
}
/**
* 提货单 自定义分页
*/
@ -116,7 +129,7 @@ public class DistrilbutionBillLadingController extends BladeController {
@PostMapping("/submit")
@ApiOperationSupport(order = 6)
@ApiOperation(value = "新增或修改", notes = "传入distrilbutionBillLading")
public R submit(@Valid @RequestBody DistrilbutionBillLadingEntity distrilbutionBillLading) {
public R submit(@Valid @RequestBody DistrilbutionBillLadingDTO distrilbutionBillLading) {
return R.status(distrilbutionBillLadingService.ownSaveOrUpdate(distrilbutionBillLading));
}

34
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionDeliveryDetailsDTO.java

@ -0,0 +1,34 @@
/*
* 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.distribution.dto;
import com.logpm.distribution.entity.DistributionDeliveryDetailsEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 提货订单明细 数据传输对象实体类
*
* @author cyz
* @since 2023-06-28
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class DistributionDeliveryDetailsDTO extends DistributionDeliveryDetailsEntity {
private static final long serialVersionUID = 1L;
}

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionStockListDTO.java

@ -31,4 +31,9 @@ import lombok.EqualsAndHashCode;
public class DistributionStockListDTO extends DistributionStockListEntity {
private static final long serialVersionUID = 1L;
/**
* 添加数量
*/
private Integer inventoryQuantity;
}

26
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistrilbutionBillLadingDTO.java

@ -20,6 +20,8 @@ import com.logpm.distribution.entity.DistrilbutionBillLadingEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
/**
* 提货单 数据传输对象实体类
*
@ -31,4 +33,28 @@ import lombok.EqualsAndHashCode;
public class DistrilbutionBillLadingDTO extends DistrilbutionBillLadingEntity {
private static final long serialVersionUID = 1L;
/**
*
*/
private String name;
/**
* 订单Id
*/
private String stockArticleId;
/**
* 库存品
*/
private List<DistributionStockListDTO> stockDTOList;
private List<print> printList;
@Data
public class print{
private String state;
private String name;
private String url;
}
}

105
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistributionDeliveryDetailsExcel.java

@ -0,0 +1,105 @@
/*
* 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.distribution.excel;
import lombok.Data;
import java.util.Date;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import java.io.Serializable;
/**
* 提货订单明细 Excel实体类
*
* @author cyz
* @since 2023-06-28
*/
@Data
@ColumnWidth(25)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class DistributionDeliveryDetailsExcel implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("租户号")
private String tenantId;
/**
* 是否已删除
*/
@ColumnWidth(20)
@ExcelProperty("是否已删除")
private Integer isDeleted;
/**
* 预留1
*/
@ColumnWidth(20)
@ExcelProperty("预留1")
private String reserve1;
/**
* 预留2
*/
@ColumnWidth(20)
@ExcelProperty("预留2")
private String reserve2;
/**
* 预留3
*/
@ColumnWidth(20)
@ExcelProperty("预留3")
private String reserve3;
/**
* 预留4
*/
@ColumnWidth(20)
@ExcelProperty("预留4")
private String reserve4;
/**
* 预留5
*/
@ColumnWidth(20)
@ExcelProperty("预留5")
private String reserve5;
/**
* 提货ID
*/
@ColumnWidth(20)
@ExcelProperty("提货ID")
private String billLadingId;
/**
* 库存品ID
*/
@ColumnWidth(20)
@ExcelProperty("库存品ID")
private String stockId;
/**
* 数量
*/
@ColumnWidth(20)
@ExcelProperty("数量")
private Integer quantity;
}

53
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionDeliveryDetailsClient.java

@ -0,0 +1,53 @@
/*
* 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.distribution.feign;
import com.baomidou.mybatisplus.core.metadata.IPage;
import lombok.AllArgsConstructor;
import org.springblade.core.mp.support.BladePage;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import com.logpm.distribution.entity.DistributionDeliveryDetailsEntity;
import com.logpm.distribution.service.IDistributionDeliveryDetailsService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
/**
* 提货订单明细 Feign实现类
*
* @author cyz
* @since 2023-06-28
*/
@ApiIgnore()
@RestController
@AllArgsConstructor
public class DistributionDeliveryDetailsClient implements IDistributionDeliveryDetailsClient {
private final IDistributionDeliveryDetailsService distributionDeliveryDetailsService;
@Override
@GetMapping(TOP)
public BladePage<DistributionDeliveryDetailsEntity> top(Integer current, Integer size) {
Query query = new Query();
query.setCurrent(current);
query.setSize(size);
IPage<DistributionDeliveryDetailsEntity> page = distributionDeliveryDetailsService.page(Condition.getPage(query));
return BladePage.of(page);
}
}

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

@ -0,0 +1,54 @@
/*
* 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.distribution.mapper;
import com.logpm.distribution.entity.DistributionDeliveryDetailsEntity;
import com.logpm.distribution.vo.DistributionDeliveryDetailsVO;
import com.logpm.distribution.excel.DistributionDeliveryDetailsExcel;
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.Param;
import java.util.List;
/**
* 提货订单明细 Mapper 接口
*
* @author cyz
* @since 2023-06-28
*/
public interface DistributionDeliveryDetailsMapper extends BaseMapper<DistributionDeliveryDetailsEntity> {
/**
* 自定义分页
*
* @param page
* @param distributionDeliveryDetails
* @return
*/
List<DistributionDeliveryDetailsVO> selectDistributionDeliveryDetailsPage(IPage page, DistributionDeliveryDetailsVO distributionDeliveryDetails);
/**
* 获取导出数据
*
* @param queryWrapper
* @return
*/
List<DistributionDeliveryDetailsExcel> exportDistributionDeliveryDetails(@Param("ew") Wrapper<DistributionDeliveryDetailsEntity> queryWrapper);
}

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

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.logpm.distribution.mapper.DistributionDeliveryDetailsMapper">
<!-- 通用查询映射结果 -->
<resultMap id="distributionDeliveryDetailsResultMap" type="com.logpm.distribution.entity.DistributionDeliveryDetailsEntity">
<result column="tenant_id" property="tenantId"/>
<result column="create_user" property="createUser"/>
<result column="create_time" property="createTime"/>
<result column="update_user" property="updateUser"/>
<result column="update_time" property="updateTime"/>
<result column="status" property="status"/>
<result column="is_deleted" property="isDeleted"/>
<result column="create_dept" property="createDept"/>
<result column="id" property="id"/>
<result column="reserve1" property="reserve1"/>
<result column="reserve2" property="reserve2"/>
<result column="reserve3" property="reserve3"/>
<result column="reserve4" property="reserve4"/>
<result column="reserve5" property="reserve5"/>
<result column="bill_lading_id" property="billLadingId"/>
<result column="stock_id" property="stockId"/>
<result column="quantity" property="quantity"/>
</resultMap>
<select id="selectDistributionDeliveryDetailsPage" resultMap="distributionDeliveryDetailsResultMap">
select * from logpm_distribution_delivery_details where is_deleted = 0
</select>
<select id="exportDistributionDeliveryDetails" resultType="com.logpm.distribution.excel.DistributionDeliveryDetailsExcel">
SELECT * FROM logpm_distribution_delivery_details ${ew.customSqlSegment}
</select>
</mapper>

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

@ -36,8 +36,8 @@
<result column="genre" property="genre"/>
<result column="state" property="state"/>
<result column="fee" property="fee"/>
<result column="reservation_id" property="reservationId"/>
<result column="reservation_num" property="reservationNum"/>
<!-- <result column="reservation_id" property="reservationId"/>-->
<!-- <result column="reservation_num" property="reservationNum"/>-->
</resultMap>

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

@ -31,7 +31,7 @@
<result column="quantity_stock" property="quantityStock"/>
<result column="outbound_quantity" property="outboundQuantity"/>
<result column="despatch" property="despatch"/>
<result column="reservation_num" property="reservationNum"/>
<!-- <result column="reservation_num" property="reservationNum"/>-->
</resultMap>

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.java

@ -51,4 +51,5 @@ public interface DistrilbutionBillLadingMapper extends BaseMapper<DistrilbutionB
*/
List<DistrilbutionBillLadingExcel> exportDistrilbutionBillLading(@Param("ew") Wrapper<DistrilbutionBillLadingEntity> queryWrapper);
IPage<DistrilbutionBillLadingVO> pageList(IPage<Object> page, DistrilbutionBillLadingEntity distrilbutionBillLadingEntity);
}

8
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml

@ -25,7 +25,15 @@
<result column="certificate_type" property="certificateType"/>
<result column="total_cost" property="totalCost"/>
</resultMap>
<select id="pageList" resultType="com.logpm.distribution.vo.DistrilbutionBillLadingVO">
select dbl.id,dsa.service_number serviceNumber,dsa.waybill_number waybillNumber,dsa.consignee_unit consigneeUnit,dsa.customer_name customerName,dsa.customer_telephone
customerTelephone,dsa.warehouse,dsa.warehouse_entry_time warehouseEntryTime,dsa.storage_fee storageFee,dsa.total_number totalNumber,
dsa.brand,dsa.type_service typeService,dbl.pick_up_time,dbl.consignee,dbl.delivery_document
from logpm_distrilbution_bill_lading dbl
LEFT JOIN logpm_distribution_stock_article dsa on dbl.stock_article_id = dsa.id
where dbl.is_deleted = 0
</select>
<select id="selectDistrilbutionBillLadingPage" resultMap="distrilbutionBillLadingResultMap">
select * from logpm_distrilbution_bill_lading where is_deleted = 0

52
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryDetailsService.java

@ -0,0 +1,52 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.distribution.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.logpm.distribution.entity.DistributionDeliveryDetailsEntity;
import com.logpm.distribution.vo.DistributionDeliveryDetailsVO;
import com.logpm.distribution.excel.DistributionDeliveryDetailsExcel;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseService;
import java.util.List;
/**
* 提货订单明细 服务类
*
* @author cyz
* @since 2023-06-28
*/
public interface IDistributionDeliveryDetailsService extends BaseService<DistributionDeliveryDetailsEntity> {
/**
* 自定义分页
*
* @param page
* @param distributionDeliveryDetails
* @return
*/
IPage<DistributionDeliveryDetailsVO> selectDistributionDeliveryDetailsPage(IPage<DistributionDeliveryDetailsVO> page, DistributionDeliveryDetailsVO distributionDeliveryDetails);
/**
* 导出数据
*
* @param queryWrapper
* @return
*/
List<DistributionDeliveryDetailsExcel> exportDistributionDeliveryDetails(Wrapper<DistributionDeliveryDetailsEntity> queryWrapper);
}

8
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java

@ -55,7 +55,7 @@ public interface IDistributionReservationService extends BaseService<Distributio
/**
* 批量确认预约信息
* @param ids
* @param param
* @return
*/
R addReservations(Map<String,Object> param);
@ -97,4 +97,10 @@ public interface IDistributionReservationService extends BaseService<Distributio
R<?> deliveryTask(Map<String, Object> deliveryInfo);
/**
* 查询指定预约信息
* @param id
* @return
*/
R<DistributionReservationVO> getReservationInfo(String reservationId);
}

6
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillLadingService.java

@ -17,12 +17,14 @@
package com.logpm.distribution.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.logpm.distribution.dto.DistrilbutionBillLadingDTO;
import com.logpm.distribution.entity.DistrilbutionBillLadingEntity;
import com.logpm.distribution.vo.DistrilbutionBillLadingVO;
import com.logpm.distribution.excel.DistrilbutionBillLadingExcel;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseService;
import java.util.List;
import java.util.Map;
/**
* 提货单 服务类
@ -49,5 +51,7 @@ public interface IDistrilbutionBillLadingService extends BaseService<Distrilbuti
*/
List<DistrilbutionBillLadingExcel> exportDistrilbutionBillLading(Wrapper<DistrilbutionBillLadingEntity> queryWrapper);
Boolean ownSaveOrUpdate(DistrilbutionBillLadingEntity distrilbutionBillLading);
Boolean ownSaveOrUpdate(DistrilbutionBillLadingDTO distrilbutionBillLading);
IPage<DistrilbutionBillLadingVO> pageList(IPage<Object> page, Map<String, Object> distrilbutionBillLading);
}

54
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryDetailsServiceImpl.java

@ -0,0 +1,54 @@
/*
* 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.distribution.service.impl;
import com.logpm.distribution.entity.DistributionDeliveryDetailsEntity;
import com.logpm.distribution.vo.DistributionDeliveryDetailsVO;
import com.logpm.distribution.excel.DistributionDeliveryDetailsExcel;
import com.logpm.distribution.mapper.DistributionDeliveryDetailsMapper;
import com.logpm.distribution.service.IDistributionDeliveryDetailsService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseServiceImpl;
import java.util.List;
/**
* 提货订单明细 服务实现类
*
* @author cyz
* @since 2023-06-28
*/
@Service
public class DistributionDeliveryDetailsServiceImpl extends BaseServiceImpl<DistributionDeliveryDetailsMapper, DistributionDeliveryDetailsEntity> implements IDistributionDeliveryDetailsService {
@Override
public IPage<DistributionDeliveryDetailsVO> selectDistributionDeliveryDetailsPage(IPage<DistributionDeliveryDetailsVO> page, DistributionDeliveryDetailsVO distributionDeliveryDetails) {
return page.setRecords(baseMapper.selectDistributionDeliveryDetailsPage(page, distributionDeliveryDetails));
}
@Override
public List<DistributionDeliveryDetailsExcel> exportDistributionDeliveryDetails(Wrapper<DistributionDeliveryDetailsEntity> queryWrapper) {
List<DistributionDeliveryDetailsExcel> distributionDeliveryDetailsList = baseMapper.exportDistributionDeliveryDetails(queryWrapper);
//distributionDeliveryDetailsList.forEach(distributionDeliveryDetails -> {
// distributionDeliveryDetails.setTypeName(DictCache.getValue(DictEnum.YES_NO, DistributionDeliveryDetails.getType()));
//});
return distributionDeliveryDetailsList;
}
}

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

@ -16,6 +16,7 @@
*/
package com.logpm.distribution.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
import com.logpm.distribution.dto.DistributionReservationDTO;
@ -25,6 +26,7 @@ import com.logpm.distribution.mapper.DistributionReservationMapper;
import com.logpm.distribution.service.*;
import com.logpm.distribution.vo.DistributionReservationVO;
import lombok.AllArgsConstructor;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
@ -391,4 +393,40 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
}
return R.status(result);
}
@Override
public R<DistributionReservationVO> getReservationInfo(String reservationId) {
//查询出预约信息
DistributionReservationEntity reservationEntity = this.getBaseMapper().selectById(reservationId);
DistributionReservationVO reservationVO = new DistributionReservationVO();
Func.copy(reservationEntity,reservationVO);
//查询出订单信息
QueryWrapper<DistributionReservationStockarticleEntity> q = Condition.getQueryWrapper(new HashMap<String, Object>(),DistributionReservationStockarticleEntity.class);
q.lambda().eq(DistributionReservationStockarticleEntity::getReservationId,reservationEntity.getId());
List<DistributionReservationStockarticleEntity> reservationStockarticleEntityList = distributionReservationStockarticleService.getBaseMapper().selectList(q);
QueryWrapper<DistributionReservationStocklistEntity> w = Condition.getQueryWrapper(new HashMap<String, Object>(),DistributionReservationStocklistEntity.class);
w.lambda().eq(DistributionReservationStocklistEntity::getReservationId,reservationEntity.getId());
List<DistributionReservationStocklistEntity> reservationStocklistEntityList = distributionReservationStocklistService.getBaseMapper().selectList(w);
if (!Func.isEmpty(reservationStockarticleEntityList)){
List<DistributionStockArticleEntity> stockArticleEntityList = new ArrayList<>();
reservationStockarticleEntityList.forEach(a->{
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(a.getStockarticleId());
stockArticleEntity.setReservationNum(a.getReservationNum());
stockArticleEntityList.add(stockArticleEntity);
});
//查询出库存信息
reservationVO.setStockArticleList(stockArticleEntityList);
}
if (!Func.isEmpty(reservationStocklistEntityList)){
List<DistributionStockListEntity> stockArticleEntityList = new ArrayList<>();
reservationStocklistEntityList.forEach(a->{
DistributionStockListEntity stockListEntity = distributionStockListService.getById(a.getStocklistId());
stockListEntity.setReservationNum(a.getReservationNum());
stockArticleEntityList.add(stockListEntity);
});
//查询出库存信息
reservationVO.setInventoryList(stockArticleEntityList);
}
return R.data(reservationVO);
}
}

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

@ -16,17 +16,18 @@
*/
package com.logpm.distribution.service.impl;
import cn.hutool.log.Log;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.distribution.entity.DistributionDeliveryChargeEntity;
import com.logpm.distribution.entity.DistrilbutionBillLadingEntity;
import com.logpm.distribution.service.IDistributionDeliveryChargeService;
import com.logpm.distribution.vo.DistributionDeliveryChargeVO;
import com.logpm.distribution.dto.DistributionStockDTO;
import com.logpm.distribution.dto.DistrilbutionBillLadingDTO;
import com.logpm.distribution.entity.*;
import com.logpm.distribution.service.*;
import com.logpm.distribution.vo.DistrilbutionBillLadingVO;
import com.logpm.distribution.excel.DistrilbutionBillLadingExcel;
import com.logpm.distribution.mapper.DistrilbutionBillLadingMapper;
import com.logpm.distribution.service.IDistrilbutionBillLadingService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
@ -38,6 +39,7 @@ import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 提货单 服务实现类
@ -49,7 +51,14 @@ import java.util.Map;
@AllArgsConstructor
public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<DistrilbutionBillLadingMapper, DistrilbutionBillLadingEntity> implements IDistrilbutionBillLadingService {
private final IDistributionDeliveryChargeService distributionDeliveryChargeService;
private final IDistributionDeliveryChargeService distributionDeliveryChargeService;
private final IDistributionDeliveryDetailsService distributionDeliveryDetailsService;
private final IDistributionPrintService distributionPrintService;
private final IDistributionStockArticleService distributionStockArticleService;
@Override
public IPage<DistrilbutionBillLadingVO> selectDistrilbutionBillLadingPage(IPage<DistrilbutionBillLadingVO> page, DistrilbutionBillLadingVO distrilbutionBillLading) {
@ -68,42 +77,145 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean ownSaveOrUpdate(DistrilbutionBillLadingEntity distrilbutionBillLading) {
if(ObjectUtils.isNotNull(distrilbutionBillLading.getId())){
public Boolean ownSaveOrUpdate(DistrilbutionBillLadingDTO distrilbutionBillLading) {
if (ObjectUtils.isNotNull(distrilbutionBillLading.getId())) {
//修改
this.updateById(distrilbutionBillLading);
//查询这个费用
List<DistributionDeliveryChargeEntity> list = distributionDeliveryChargeService.list(Wrappers.<DistributionDeliveryChargeEntity>query().lambda()
.eq(DistributionDeliveryChargeEntity::getBillLading, distrilbutionBillLading.getId())
);
list.forEach( i ->{
list.forEach(i -> {
String s = distrilbutionBillLading.getFei().get(i.getCost());
if(StringUtils.isNotBlank(s)){
if (StringUtils.isNotBlank(s)) {
//修改
DistributionDeliveryChargeEntity distributionDeliveryCharge = new DistributionDeliveryChargeEntity();
distributionDeliveryCharge.setId(i.getId());
distributionDeliveryCharge.setMoney(new BigDecimal(s));
distributionDeliveryChargeService.updateById(distributionDeliveryCharge);
}else{
} else {
//删除
distributionDeliveryChargeService.removeById(i.getId());
}
});
}else{
//删除
//修改库存品
if (distrilbutionBillLading.getStockDTOList().size() > 0) {
//全部库存品数据
List<DistributionDeliveryDetailsEntity> listDetails = distributionDeliveryDetailsService.list(Wrappers.<DistributionDeliveryDetailsEntity>query().lambda()
.eq(DistributionDeliveryDetailsEntity::getBillLadingId, distrilbutionBillLading.getId())
);
if (listDetails.size() > 0) {
List<Long> ids = new ArrayList<>();
//有
//修改
listDetails.forEach(i -> {
boolean b = distrilbutionBillLading.getStockDTOList().stream().anyMatch(a -> i.getStockId().equals(a.getId()));
if (b) {
//有
distrilbutionBillLading.getStockDTOList().forEach(q -> {
if (i.getStockId().equals(q.getId())) {
DistributionDeliveryDetailsEntity deliveryDetails = new DistributionDeliveryDetailsEntity();
deliveryDetails.setQuantity(q.getInventoryQuantity());
deliveryDetails.setId(q.getId());
distributionDeliveryDetailsService.updateById(deliveryDetails);
distrilbutionBillLading.getStockDTOList().remove(q);
return;
}
});
} else {
//没有 删除
ids.add(i.getId());
}
});
//删除没有的库存品
distributionDeliveryDetailsService.deleteLogic(ids);
}
}
} else {
//新增
this.save(distrilbutionBillLading);
}
//添加图片
if(distrilbutionBillLading.getPrintList().size() > 0){
addPrint(distrilbutionBillLading);
}
//添加库存品
if(distrilbutionBillLading.getStockDTOList().size() > 0){
//没有
List<DistributionDeliveryDetailsEntity> detailsEntities = new ArrayList<>();
distrilbutionBillLading.getStockDTOList().forEach(i -> {
DistributionDeliveryDetailsEntity details = new DistributionDeliveryDetailsEntity();
details.setBillLadingId(distrilbutionBillLading.getId());
details.setStockId(i.getId());
details.setQuantity(i.getInventoryQuantity());
detailsEntities.add(details);
});
distributionDeliveryDetailsService.saveBatch(detailsEntities);
}
//添加费用
List<DistributionDeliveryChargeEntity> list = new ArrayList<>();
distrilbutionBillLading.getFei().forEach((k,v) ->{
DistributionDeliveryChargeEntity distributionDeliveryCharge = new DistributionDeliveryChargeEntity();
distributionDeliveryCharge.setBillLading(distrilbutionBillLading.getId());
distributionDeliveryCharge.setCost(Integer.parseInt(k));
distributionDeliveryCharge.setMoney(new BigDecimal(v));
distributionDeliveryCharge.setGenre(1);
list.add(distributionDeliveryCharge);
if(distrilbutionBillLading.getFei().size() > 0){
List<DistributionDeliveryChargeEntity> listEntity = new ArrayList<>();
distrilbutionBillLading.getFei().forEach((k, v) -> {
DistributionDeliveryChargeEntity distributionDeliveryCharge = new DistributionDeliveryChargeEntity();
distributionDeliveryCharge.setBillLading(distrilbutionBillLading.getId());
distributionDeliveryCharge.setCost(k);
distributionDeliveryCharge.setMoney(new BigDecimal(v));
distributionDeliveryCharge.setGenre("1");
listEntity.add(distributionDeliveryCharge);
});
distributionDeliveryChargeService.saveBatch(listEntity);
}
//修改订单状态
String[] split = distrilbutionBillLading.getStockArticleId().split(",");
for (String s : split) {
DistributionStockArticleEntity distributionStockArticle = new DistributionStockArticleEntity();
distributionStockArticle.setId(Long.parseLong(s));
distributionStockArticle.setState(2);
distributionStockArticleService.updateById(distributionStockArticle);
}
return true;
}
@Override
public IPage<DistrilbutionBillLadingVO> pageList(IPage<Object> page, Map<String, Object> distrilbutionBillLading) {
DistrilbutionBillLadingEntity distrilbutionBillLadingEntity = JSONObject.parseObject(JSONObject.toJSONString(distrilbutionBillLading), DistrilbutionBillLadingEntity.class);
IPage<DistrilbutionBillLadingVO> distrilbutionBillLadingVOIPage = baseMapper.pageList(page, distrilbutionBillLadingEntity);
List<DistrilbutionBillLadingVO> records =distrilbutionBillLadingVOIPage.getRecords();
records.forEach( i -> {
List<DistributionDeliveryChargeEntity> list = distributionDeliveryChargeService.list(Wrappers.<DistributionDeliveryChargeEntity>query().lambda()
.eq(DistributionDeliveryChargeEntity::getBillLading, i.getId())
);
i.setList(list);
});
distrilbutionBillLadingVOIPage.setRecords(records);
return distrilbutionBillLadingVOIPage;
}
/**
* 添加提货图片
*/
public Boolean addPrint(DistrilbutionBillLadingDTO distrilbutionBillLadingDTO){
List<DistributionPrintEntity> list = distributionPrintService.list(Wrappers.<DistributionPrintEntity>query().lambda()
.eq(DistributionPrintEntity::getBillLadingId, distrilbutionBillLadingDTO.getId())
);
//删除
List<Long> list1 = new ArrayList<>();
list.forEach( i -> list1.add(i.getId()));
distributionPrintService.deleteLogic(list1);
//新增
List<DistributionPrintEntity> list2 = new ArrayList<>();
distrilbutionBillLadingDTO.getPrintList().forEach(print -> {
DistributionPrintEntity distributionPrintEntity = new DistributionPrintEntity();
distributionPrintEntity.setBillLadingId(distrilbutionBillLadingDTO.getId());
distributionPrintEntity.setGenre(Integer.parseInt(print.getState()));
distributionPrintEntity.setSite(print.getUrl());
distributionPrintEntity.setSiteName(print.getName());
list2.add(distributionPrintEntity);
});
return distributionDeliveryChargeService.saveBatch(list);
return distributionPrintService.saveBatch(list2);
}
}

Loading…
Cancel
Save