From c10888c9545c272d4b5aa113c65483c2ed19a6d7 Mon Sep 17 00:00:00 2001 From: caoyizhong <1270296080@qq.com> Date: Tue, 25 Jul 2023 18:56:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8F=90=E8=B4=A7=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/DistributionStockupEntity.java | 5 + .../entity/DistrilbutionBillLadingEntity.java | 5 + .../entity/DistrilbutionBillStockEntity.java | 76 +++++++++ .../feign/IDistrilbutionBillStockClient.java | 49 ++++++ .../vo/DistrilbutionBillLadingDetailsVO.java | 51 ++++++ .../vo/DistrilbutionBillLadingOwnVO.java | 60 +++++++ .../vo/DistrilbutionBillLadingVO.java | 1 - .../vo/DistrilbutionBillStockVO.java | 35 ++++ .../DistrilbutionBillLadingController.java | 27 ++-- .../DistrilbutionBillStockController.java | 150 ++++++++++++++++++ .../dto/DistrilbutionBillStockDTO.java | 34 ++++ .../excel/DistrilbutionBillStockExcel.java | 44 +++++ .../feign/DistrilbutionBillStockClient.java | 53 +++++++ .../mapper/DistrilbutionBillLadingMapper.java | 12 +- .../mapper/DistrilbutionBillLadingMapper.xml | 56 ++++++- .../mapper/DistrilbutionBillStockMapper.java | 54 +++++++ .../mapper/DistrilbutionBillStockMapper.xml | 19 +++ .../IDistrilbutionBillLadingService.java | 18 ++- .../IDistrilbutionBillStockService.java | 52 ++++++ .../DistrilbutionBillLadingServiceImpl.java | 138 ++++++++++++++-- .../DistrilbutionBillStockServiceImpl.java | 54 +++++++ 21 files changed, 951 insertions(+), 42 deletions(-) create mode 100644 blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistrilbutionBillStockEntity.java create mode 100644 blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistrilbutionBillStockClient.java create mode 100644 blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistrilbutionBillLadingDetailsVO.java create mode 100644 blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistrilbutionBillLadingOwnVO.java create mode 100644 blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistrilbutionBillStockVO.java create mode 100644 blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistrilbutionBillStockController.java create mode 100644 blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistrilbutionBillStockDTO.java create mode 100644 blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistrilbutionBillStockExcel.java create mode 100644 blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistrilbutionBillStockClient.java create mode 100644 blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.java create mode 100644 blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.xml create mode 100644 blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillStockService.java create mode 100644 blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillStockServiceImpl.java diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockupEntity.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockupEntity.java index 318c892f1..649c5f55c 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockupEntity.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockupEntity.java @@ -164,6 +164,11 @@ public class DistributionStockupEntity extends TenantEntity { */ @ApiModelProperty(value = "备注") private String remarks; + /** + * 取消原因 + */ + @ApiModelProperty(value = "取消原因") + private String annulment; diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistrilbutionBillLadingEntity.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistrilbutionBillLadingEntity.java index c98a4ec40..6870d30b4 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistrilbutionBillLadingEntity.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistrilbutionBillLadingEntity.java @@ -182,6 +182,11 @@ public class DistrilbutionBillLadingEntity extends TenantEntity { */ @ApiModelProperty(value = "备货人") private String stockupUser; + /** + * 备货编码 + */ + @ApiModelProperty(value = "备货编码") + private String stockupCode; /** * 备货人 */ diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistrilbutionBillStockEntity.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistrilbutionBillStockEntity.java new file mode 100644 index 000000000..b55d6c01a --- /dev/null +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistrilbutionBillStockEntity.java @@ -0,0 +1,76 @@ +/* + * 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 lombok.EqualsAndHashCode; +import org.springblade.core.tenant.mp.TenantEntity; + +/** + * 提货单订单信息关联 实体类 + * + * @author cyz + * @since 2023-07-25 + */ +@Data +@TableName("logpm_distrilbution_bill_stock") +@ApiModel(value = "DistrilbutionBillStock对象", description = "提货单订单信息关联") +@EqualsAndHashCode(callSuper = true) +public class DistrilbutionBillStockEntity 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; + /** + * 在库订单 + */ + @ApiModelProperty(value = "在库订单") + private Long stockArticleId; + + +} diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistrilbutionBillStockClient.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistrilbutionBillStockClient.java new file mode 100644 index 000000000..85a6b11c6 --- /dev/null +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistrilbutionBillStockClient.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.DistrilbutionBillStockEntity; +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-07-25 + */ +@FeignClient( + value = "blade-distrilbutionBillStock" +) +public interface IDistrilbutionBillStockClient { + + String API_PREFIX = "/cl1ient"; + String TOP = API_PREFIX + "/top"; + + /** + * 获取提货单订单信息关联列表 + * + * @param current 页号 + * @param size 页数 + * @return BladePage + */ + @GetMapping(TOP) + BladePage<DistrilbutionBillStockEntity> top(@RequestParam("current") Integer current, @RequestParam("size") Integer size); + +} diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistrilbutionBillLadingDetailsVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistrilbutionBillLadingDetailsVO.java new file mode 100644 index 000000000..3dcab685a --- /dev/null +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistrilbutionBillLadingDetailsVO.java @@ -0,0 +1,51 @@ +/* + * 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.DistributionDeliveryChargeEntity; +import com.logpm.distribution.entity.DistributionPrintEntity; +import com.logpm.distribution.entity.DistrilbutionBillLadingEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +/** + * 提货单 视图实体类 + * + * @author cyz + * @since 2023-06-14 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class DistrilbutionBillLadingDetailsVO extends DistrilbutionBillLadingEntity { + private static final long serialVersionUID = 1L; + /** + * 订单数据 + */ + private List<DistributionStockArticleVO> stockArticleVOS; + /** + * 库存品数据 + */ + private List<DistributionStockListVO> stockListVOS; + /** + * 图片信息 + */ + private List<DistributionPrintEntity> printVOS; + + +} diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistrilbutionBillLadingOwnVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistrilbutionBillLadingOwnVO.java new file mode 100644 index 000000000..bc03f94ae --- /dev/null +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistrilbutionBillLadingOwnVO.java @@ -0,0 +1,60 @@ +/* + * 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.DistributionDeliveryChargeEntity; +import com.logpm.distribution.entity.DistrilbutionBillLadingEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +/** + * 提货单 视图实体类 + * + * @author cyz + * @since 2023-06-14 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class DistrilbutionBillLadingOwnVO extends DistrilbutionBillLadingEntity { + private static final long serialVersionUID = 1L; + + private String orderSelfNumbering; + private String descriptionGoods; + private Integer totalNumber; + private String stockupStatus; + //库位信息 + private String stockipAllocation; + private Integer esau; + + private String packetBarCode; + private String firsts; + private String second; + private String thirdProduct; + //物料名称 + private String materialName; + private String goodsAllocation; + private String pallet; + private String StockUp; + private String sku; + private Integer quantity; + private Integer number; + + + +} diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistrilbutionBillLadingVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistrilbutionBillLadingVO.java index ed26df3b1..d66ffb9a2 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistrilbutionBillLadingVO.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistrilbutionBillLadingVO.java @@ -51,7 +51,6 @@ public class DistrilbutionBillLadingVO extends DistrilbutionBillLadingEntity { private String typeServiceName; private String transport; //搬运 private String forklift; //叉车 - private Integer reservationStockListNum; //数量 private List<DistributionDeliveryChargeEntity> list; diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistrilbutionBillStockVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistrilbutionBillStockVO.java new file mode 100644 index 000000000..df6f9f3cb --- /dev/null +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistrilbutionBillStockVO.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.DistrilbutionBillStockEntity; +import org.springblade.core.tool.node.INode; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 提货单订单信息关联 视图实体类 + * + * @author cyz + * @since 2023-07-25 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class DistrilbutionBillStockVO extends DistrilbutionBillStockEntity { + private static final long serialVersionUID = 1L; + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistrilbutionBillLadingController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistrilbutionBillLadingController.java index d9795d965..986209dea 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistrilbutionBillLadingController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistrilbutionBillLadingController.java @@ -19,6 +19,8 @@ package com.logpm.distribution.controller; import com.logpm.distribution.dto.DistrilbutionBillLadingDTO; import com.logpm.distribution.entity.DistributionStockupEntity; import com.logpm.distribution.vo.DistributionStockupVO; +import com.logpm.distribution.vo.DistrilbutionBillLadingDetailsVO; +import com.logpm.distribution.vo.DistrilbutionBillLadingOwnVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; @@ -31,6 +33,7 @@ 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.springblade.core.tool.utils.ObjectUtil; import org.springblade.system.entity.DictBiz; import org.springblade.system.feign.IDictBizClient; import org.springframework.web.bind.annotation.*; @@ -72,8 +75,9 @@ public class DistrilbutionBillLadingController extends BladeController { @GetMapping("/detail") @ApiOperationSupport(order = 1) @ApiOperation(value = "详情", notes = "传入distrilbutionBillLading") - public R<DistrilbutionBillLadingEntity> detail(DistrilbutionBillLadingEntity distrilbutionBillLading) { - DistrilbutionBillLadingEntity detail = distrilbutionBillLadingService.getOne(Condition.getQueryWrapper(distrilbutionBillLading)); + public R<DistrilbutionBillLadingDetailsVO> detail(DistrilbutionBillLadingEntity distrilbutionBillLading) { + + DistrilbutionBillLadingDetailsVO detail = distrilbutionBillLadingService.getDetailOne(distrilbutionBillLading); return R.data(detail); } /** @@ -159,13 +163,13 @@ public class DistrilbutionBillLadingController extends BladeController { } /** - * 备货信息表 预约信息 详情 + * 备货信息表 包件信息 详情 */ @GetMapping("/detailReservationOwn") @ApiOperation(value = "详情", notes = "传入distributionStockup") - public R<IPage<DistrilbutionBillLadingVO>> detailReservationOwn(@ApiIgnore @RequestParam Map<String, Object> distrilbutionBillLading, Query query) { + public R<IPage<DistrilbutionBillLadingOwnVO>> detailReservationOwn(@ApiIgnore @RequestParam Map<String, Object> distrilbutionBillLading, Query query) { Object o = distrilbutionBillLading.get("id"); - IPage<DistrilbutionBillLadingVO> detail = distrilbutionBillLadingService.detailReservationOwn(Condition.getPage(query),Long.parseLong((String) o)); + IPage<DistrilbutionBillLadingOwnVO> detail = distrilbutionBillLadingService.detailReservationOwn(Condition.getPage(query),Long.parseLong((String) o)); return R.data(detail); } @@ -174,9 +178,9 @@ public class DistrilbutionBillLadingController extends BladeController { */ @GetMapping("/inventoryOwn") @ApiOperation(value = "详情", notes = "传入distributionStockup") - public R<IPage<DistrilbutionBillLadingVO>> getInventoryOwn(@ApiIgnore @RequestParam Map<String, Object> distrilbutionBillLading, Query query) { + public R<IPage<DistrilbutionBillLadingOwnVO>> getInventoryOwn(@ApiIgnore @RequestParam Map<String, Object> distrilbutionBillLading, Query query) { Object o = distrilbutionBillLading.get("id"); - IPage<DistrilbutionBillLadingVO> detail = distrilbutionBillLadingService.getInventoryOwn(Condition.getPage(query),Long.parseLong((String) o)); + IPage<DistrilbutionBillLadingOwnVO> detail = distrilbutionBillLadingService.getInventoryOwn(Condition.getPage(query),Long.parseLong((String) o)); return R.data(detail); } /** @@ -184,10 +188,13 @@ public class DistrilbutionBillLadingController extends BladeController { */ @GetMapping("/detailOrderOwn") @ApiOperation(value = "详情", notes = "传入distributionStockup") - public R<IPage<DistrilbutionBillLadingVO>> detailOrderOwn(@ApiIgnore @RequestParam Map<String, Object> distrilbutionBillLading, Query query) { + public R<IPage<DistrilbutionBillLadingOwnVO>> detailOrderOwn(@ApiIgnore @RequestParam Map<String, Object> distrilbutionBillLading, Query query) { Object o = distrilbutionBillLading.get("id"); - IPage<DistrilbutionBillLadingVO> detail = distrilbutionBillLadingService.detailOrderOwn(Condition.getPage(query),Long.parseLong((String) o)); - return R.data(detail); + if(ObjectUtil.isNotEmpty(o)){ + IPage<DistrilbutionBillLadingOwnVO> detail = distrilbutionBillLadingService.detailOrderOwn(Condition.getPage(query),Long.parseLong((String) o)); + return R.data(detail); + } + return null; } /** diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistrilbutionBillStockController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistrilbutionBillStockController.java new file mode 100644 index 000000000..7990ecd69 --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistrilbutionBillStockController.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.DistrilbutionBillStockEntity; +import com.logpm.distribution.vo.DistrilbutionBillStockVO; +import com.logpm.distribution.excel.DistrilbutionBillStockExcel; +import com.logpm.distribution.service.IDistrilbutionBillStockService; +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-07-25 + */ +@RestController +@AllArgsConstructor +@RequestMapping("blade-distrilbutionBillStock/distrilbutionBillStock") +@Api(value = "提货单订单信息关联", tags = "提货单订单信息关联接口") +public class DistrilbutionBillStockController extends BladeController { + + private final IDistrilbutionBillStockService distrilbutionBillStockService; + + /** + * 提货单订单信息关联 详情 + */ + @GetMapping("/detail") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入distrilbutionBillStock") + public R<DistrilbutionBillStockEntity> detail(DistrilbutionBillStockEntity distrilbutionBillStock) { + DistrilbutionBillStockEntity detail = distrilbutionBillStockService.getOne(Condition.getQueryWrapper(distrilbutionBillStock)); + return R.data(detail); + } + /** + * 提货单订单信息关联 分页 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入distrilbutionBillStock") + public R<IPage<DistrilbutionBillStockEntity>> list(@ApiIgnore @RequestParam Map<String, Object> distrilbutionBillStock, Query query) { + IPage<DistrilbutionBillStockEntity> pages = distrilbutionBillStockService.page(Condition.getPage(query), Condition.getQueryWrapper(distrilbutionBillStock, DistrilbutionBillStockEntity.class)); + return R.data(pages); + } + + /** + * 提货单订单信息关联 自定义分页 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入distrilbutionBillStock") + public R<IPage<DistrilbutionBillStockVO>> page(DistrilbutionBillStockVO distrilbutionBillStock, Query query) { + IPage<DistrilbutionBillStockVO> pages = distrilbutionBillStockService.selectDistrilbutionBillStockPage(Condition.getPage(query), distrilbutionBillStock); + return R.data(pages); + } + + /** + * 提货单订单信息关联 新增 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入distrilbutionBillStock") + public R save(@Valid @RequestBody DistrilbutionBillStockEntity distrilbutionBillStock) { + return R.status(distrilbutionBillStockService.save(distrilbutionBillStock)); + } + + /** + * 提货单订单信息关联 修改 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入distrilbutionBillStock") + public R update(@Valid @RequestBody DistrilbutionBillStockEntity distrilbutionBillStock) { + return R.status(distrilbutionBillStockService.updateById(distrilbutionBillStock)); + } + + /** + * 提货单订单信息关联 新增或修改 + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "新增或修改", notes = "传入distrilbutionBillStock") + public R submit(@Valid @RequestBody DistrilbutionBillStockEntity distrilbutionBillStock) { + return R.status(distrilbutionBillStockService.saveOrUpdate(distrilbutionBillStock)); + } + + /** + * 提货单订单信息关联 删除 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 7) + @ApiOperation(value = "逻辑删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(distrilbutionBillStockService.deleteLogic(Func.toLongList(ids))); + } + + + /** + * 导出数据 + */ + @GetMapping("/export-distrilbutionBillStock") + @ApiOperationSupport(order = 9) + @ApiOperation(value = "导出数据", notes = "传入distrilbutionBillStock") + public void exportDistrilbutionBillStock(@ApiIgnore @RequestParam Map<String, Object> distrilbutionBillStock, BladeUser bladeUser, HttpServletResponse response) { + QueryWrapper<DistrilbutionBillStockEntity> queryWrapper = Condition.getQueryWrapper(distrilbutionBillStock, DistrilbutionBillStockEntity.class); + //if (!AuthUtil.isAdministrator()) { + // queryWrapper.lambda().eq(DistrilbutionBillStock::getTenantId, bladeUser.getTenantId()); + //} + queryWrapper.lambda().eq(DistrilbutionBillStockEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED); + List<DistrilbutionBillStockExcel> list = distrilbutionBillStockService.exportDistrilbutionBillStock(queryWrapper); + ExcelUtil.export(response, "提货单订单信息关联数据" + DateUtil.time(), "提货单订单信息关联数据表", list, DistrilbutionBillStockExcel.class); + } + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistrilbutionBillStockDTO.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistrilbutionBillStockDTO.java new file mode 100644 index 000000000..caf8be82c --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistrilbutionBillStockDTO.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.DistrilbutionBillStockEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 提货单订单信息关联 数据传输对象实体类 + * + * @author cyz + * @since 2023-07-25 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class DistrilbutionBillStockDTO extends DistrilbutionBillStockEntity { + private static final long serialVersionUID = 1L; + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistrilbutionBillStockExcel.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistrilbutionBillStockExcel.java new file mode 100644 index 000000000..4d77b4a4c --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistrilbutionBillStockExcel.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.distribution.excel; + + +import lombok.Data; + +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-07-25 + */ +@Data +@ColumnWidth(25) +@HeadRowHeight(20) +@ContentRowHeight(18) +public class DistrilbutionBillStockExcel implements Serializable { + + private static final long serialVersionUID = 1L; + + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistrilbutionBillStockClient.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistrilbutionBillStockClient.java new file mode 100644 index 000000000..9e35f6e13 --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistrilbutionBillStockClient.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.DistrilbutionBillStockEntity; +import com.logpm.distribution.service.IDistrilbutionBillStockService; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; +import springfox.documentation.annotations.ApiIgnore; + +/** + * 提货单订单信息关联 Feign实现类 + * + * @author cyz + * @since 2023-07-25 + */ +@ApiIgnore() +@RestController +@AllArgsConstructor +public class DistrilbutionBillStockClient implements IDistrilbutionBillStockClient { + + private final IDistrilbutionBillStockService distrilbutionBillStockService; + + @Override + @GetMapping(TOP) + public BladePage<DistrilbutionBillStockEntity> top(Integer current, Integer size) { + Query query = new Query(); + query.setCurrent(current); + query.setSize(size); + IPage<DistrilbutionBillStockEntity> page = distrilbutionBillStockService.page(Condition.getPage(query)); + return BladePage.of(page); + } + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.java index 58d0ce6bd..424f7799a 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.java @@ -19,6 +19,8 @@ package com.logpm.distribution.mapper; import com.logpm.distribution.dto.DistrilbutionBillLadingDTO; import com.logpm.distribution.entity.DistrilbutionBillLadingEntity; import com.logpm.distribution.vo.DistrilbutionBillLadingAppVO; +import com.logpm.distribution.vo.DistrilbutionBillLadingDetailsVO; +import com.logpm.distribution.vo.DistrilbutionBillLadingOwnVO; import com.logpm.distribution.vo.DistrilbutionBillLadingVO; import com.logpm.distribution.excel.DistrilbutionBillLadingExcel; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -63,13 +65,13 @@ public interface DistrilbutionBillLadingMapper extends BaseMapper<DistrilbutionB List<DistrilbutionAppBillLadingDetailVO> selectDetailList(@Param("stockArticleId") Long stockArticleId, @Param("scanStatus") Integer scanStatus,@Param("orderSelfNumbering") String orderSelfNumbering); - DistrilbutionBillLadingVO getOneOwn(@Param("param") Long id); + DistrilbutionBillLadingVO getOneOwn(@Param("id") Long id); - IPage<DistrilbutionBillLadingVO> detailReservationOwn(IPage<Object> page,@Param("param") Long id); + IPage<DistrilbutionBillLadingOwnVO> detailReservationOwn(IPage<Object> page,@Param("id") Long id); - List<DistrilbutionBillLadingVO> getInventoryChe(@Param("param") Long id); + IPage<DistrilbutionBillLadingOwnVO> detailOrderOwn(IPage<Object> page, @Param("id") Long id); - IPage<DistrilbutionBillLadingVO> detailOrderOwn(IPage<Object> page,@Param("param") Long id); + IPage<DistrilbutionBillLadingOwnVO> getInventoryOwn(IPage<Object> page,@Param("id") Long id); - IPage<DistrilbutionBillLadingVO> getInventoryOwn(IPage<Object> page,@Param("param") Long id); + DistrilbutionBillLadingDetailsVO getDetailOne(@Param("id") Long id); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml index dc928bb58..f1f156806 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml @@ -119,19 +119,59 @@ and bls.id is null </select> <select id="getOneOwn" resultType="com.logpm.distribution.vo.DistrilbutionBillLadingVO"> - + select ldbl.id,ldbl.stockup_code stockupCode,ldbl.pick_up_time pickUpTime,ldbl.stockup_area stockupArea,ldbl.consignee, + ldbl.pick_up_plate pickUpPlate,ldbl.total_cost totalCost + from logpm_distrilbution_bill_lading ldbl + <where> + ldbl.id = #{id} + </where> </select> - <select id="detailReservationOwn" resultType="com.logpm.distribution.vo.DistrilbutionBillLadingVO"> - + <select id="detailReservationOwn" resultType="com.logpm.distribution.vo.DistrilbutionBillLadingOwnVO"> + select ldpi.id,ldpi.packet_bar_code packetBarCode,ldpi.firsts ,ldpi.second ,ldpi.third_product thirdProduct,ldpi.material_name materialName, + ldpi.goods_allocation goodsAllocation,ldpi.pallet + from logpm_distribution_parcel_list ldpi + where ldpi.stock_article_id in ( + select dbs.stock_article_id + from logpm_distrilbution_bill_stock dbs + where dbs.bill_lading_id = #{id} + ) </select> - <select id="getInventoryChe" resultType="com.logpm.distribution.vo.DistrilbutionBillLadingVO"> - + <select id="detailOrderOwn" resultType="com.logpm.distribution.vo.DistrilbutionBillLadingOwnVO"> + select ldsa.id,ldsa.order_self_numbering orderSelfNumbering,ldsa.description_goods descriptionGoods,ldsa.total_number totalNumber, + ldbl.stockup_status stockupStatus,ldbl.stockip_allocation stockipAllocation, + ( select count(*) + from logpm_distribution_stockup_scan ldss + where ldss.parcel_list_id in ( + select ldpi.id + from logpm_distribution_parcel_list ldpi + where ldpi.stock_article_id in ( + select dbs.stock_article_id + from logpm_distrilbution_bill_stock dbs + where dbs.bill_lading_id = #{id} + ) + ) + ) esau + from logpm_distrilbution_bill_lading ldbl + LEFT JOIN logpm_distrilbution_bill_stock ldbs on ldbl.id = ldbs.bill_lading_id + LEFT JOIN logpm_distribution_stock_article ldsa on ldbs.stock_article_id = ldsa.id + <where> + ldbl.id = #{id} + </where> </select> - <select id="detailOrderOwn" resultType="com.logpm.distribution.vo.DistrilbutionBillLadingVO"> - + <select id="getInventoryOwn" resultType="com.logpm.distribution.vo.DistrilbutionBillLadingOwnVO"> + select ldsi.id,ldsi.sku,ldsi.order_self_numbering,ldsi.description_goods ,ldsi.cargo_unit ,lddd.quantity ,ldsi.tray_name ,ldsi.storage_location + from logpm_distribution_delivery_details lddd LEFT JOIN logpm_distribution_stock_list ldsi on lddd.stock_list_id = ldsi.id + <where> + lddd.bill_lading_id = #{id} + </where> </select> - <select id="getInventoryOwn" resultType="com.logpm.distribution.vo.DistrilbutionBillLadingVO"> + <select id="getDetailOne" resultType="com.logpm.distribution.vo.DistrilbutionBillLadingDetailsVO"> + select ldbl.id,ldbl.pick_up_time ,ldbl.consignee ,ldbl.pick_up_plate ,ldbl.delivery_document ,ldbl.certificate_type ,ldbl.total_cost + from logpm_distrilbution_bill_lading ldbl + <where> + ldbl.id = #{id} + </where> </select> diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.java new file mode 100644 index 000000000..45a897017 --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.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.DistrilbutionBillStockEntity; +import com.logpm.distribution.vo.DistrilbutionBillStockVO; +import com.logpm.distribution.excel.DistrilbutionBillStockExcel; +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-07-25 + */ +public interface DistrilbutionBillStockMapper extends BaseMapper<DistrilbutionBillStockEntity> { + + /** + * 自定义分页 + * + * @param page + * @param distrilbutionBillStock + * @return + */ + List<DistrilbutionBillStockVO> selectDistrilbutionBillStockPage(IPage page, DistrilbutionBillStockVO distrilbutionBillStock); + + + /** + * 获取导出数据 + * + * @param queryWrapper + * @return + */ + List<DistrilbutionBillStockExcel> exportDistrilbutionBillStock(@Param("ew") Wrapper<DistrilbutionBillStockEntity> queryWrapper); + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.xml new file mode 100644 index 000000000..8471845b1 --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.xml @@ -0,0 +1,19 @@ +<?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.DistrilbutionBillStockMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="distrilbutionBillStockResultMap" type="com.logpm.distribution.entity.DistrilbutionBillStockEntity"> + </resultMap> + + + <select id="selectDistrilbutionBillStockPage" resultMap="distrilbutionBillStockResultMap"> + select * from logpm_distrilbution_bill_stock where is_deleted = 0 + </select> + + + <select id="exportDistrilbutionBillStock" resultType="com.logpm.distribution.excel.DistrilbutionBillStockExcel"> + SELECT * FROM logpm_distrilbution_bill_stock ${ew.customSqlSegment} + </select> + +</mapper> diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillLadingService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillLadingService.java index 209d6265c..6f61679e2 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillLadingService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillLadingService.java @@ -17,9 +17,12 @@ package com.logpm.distribution.service; import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.logpm.distribution.dto.DistrilbutionBillLadingDTO; import com.logpm.distribution.entity.DistrilbutionBillLadingEntity; import com.logpm.distribution.vo.DistrilbutionBillLadingAppVO; +import com.logpm.distribution.vo.DistrilbutionBillLadingDetailsVO; +import com.logpm.distribution.vo.DistrilbutionBillLadingOwnVO; import com.logpm.distribution.vo.DistrilbutionBillLadingVO; import com.logpm.distribution.excel.DistrilbutionBillLadingExcel; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -75,15 +78,22 @@ public interface IDistrilbutionBillLadingService extends BaseService<Distrilbuti */ DistrilbutionBillLadingVO getOneOwn(Long id); /** - * 备货信息表 预约信息 详情 + * 备货信息表 包件信息 详情 */ - IPage<DistrilbutionBillLadingVO> detailReservationOwn(IPage<Object> page, long parseLong); + IPage<DistrilbutionBillLadingOwnVO> detailReservationOwn(IPage<Object> page, long parseLong); /** * 备货信息表 库存品信息 详情 */ - IPage<DistrilbutionBillLadingVO> getInventoryOwn(IPage<Object> page, long parseLong); + IPage<DistrilbutionBillLadingOwnVO> getInventoryOwn(IPage<Object> page, long parseLong); /** * 备货信息表 订单信息 详情 */ - IPage<DistrilbutionBillLadingVO> detailOrderOwn(IPage<Object> page, long parseLong); + IPage<DistrilbutionBillLadingOwnVO> detailOrderOwn(IPage<Object> page, long parseLong); + + /** + * 查询提货单详情数据 + * @param queryWrapper + * @return + */ + DistrilbutionBillLadingDetailsVO getDetailOne(DistrilbutionBillLadingEntity distrilbutionBillLadingEntity); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillStockService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillStockService.java new file mode 100644 index 000000000..78c9a068d --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillStockService.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.DistrilbutionBillStockEntity; +import com.logpm.distribution.vo.DistrilbutionBillStockVO; +import com.logpm.distribution.excel.DistrilbutionBillStockExcel; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.mp.base.BaseService; +import java.util.List; + +/** + * 提货单订单信息关联 服务类 + * + * @author cyz + * @since 2023-07-25 + */ +public interface IDistrilbutionBillStockService extends BaseService<DistrilbutionBillStockEntity> { + /** + * 自定义分页 + * + * @param page + * @param distrilbutionBillStock + * @return + */ + IPage<DistrilbutionBillStockVO> selectDistrilbutionBillStockPage(IPage<DistrilbutionBillStockVO> page, DistrilbutionBillStockVO distrilbutionBillStock); + + + /** + * 导出数据 + * + * @param queryWrapper + * @return + */ + List<DistrilbutionBillStockExcel> exportDistrilbutionBillStock(Wrapper<DistrilbutionBillStockEntity> queryWrapper); + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java index 617e8d082..685c82109 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java @@ -24,14 +24,13 @@ import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.logpm.distribution.dto.DistributionStockArticleDTO; import com.logpm.distribution.dto.DistrilbutionBillLadingDTO; import com.logpm.distribution.entity.*; import com.logpm.distribution.excel.DistrilbutionBillLadingExcel; import com.logpm.distribution.mapper.DistrilbutionBillLadingMapper; import com.logpm.distribution.service.*; -import com.logpm.distribution.vo.DistributionStockupVO; -import com.logpm.distribution.vo.DistrilbutionBillLadingAppVO; -import com.logpm.distribution.vo.DistrilbutionBillLadingVO; +import com.logpm.distribution.vo.*; import com.logpm.distribution.vo.app.DistrilbutionAppBillLadingDetailVO; import com.logpm.distribution.vo.app.DistrilbutionAppBillLadingOrderMainVO; import com.logpm.distribution.vo.app.DistrilbutionAppBillLadingOrderVO; @@ -69,6 +68,12 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb private final IDistributionBillLadingScanService distributionBillLadingScanService; + private final IDistrilbutionBillStockService distrilbutionBillStockService; + + private final IDistributionStockupScanService distributionStockupScanService; + + private final IDistributionStockListService distributionStockListService; + @Override public IPage<DistrilbutionBillLadingVO> selectDistrilbutionBillLadingPage(IPage<DistrilbutionBillLadingVO> page, DistrilbutionBillLadingVO distrilbutionBillLading) { @@ -185,6 +190,11 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb distributionStockArticle.setId(Long.parseLong(s)); distributionStockArticle.setState(2); distributionStockArticleService.updateById(distributionStockArticle); + //添加订单和提货单关联 + DistrilbutionBillStockEntity distrilbutionBillStock = new DistrilbutionBillStockVO(); + distrilbutionBillStock.setBillLadingId(distrilbutionBillLading.getId()); + distrilbutionBillStock.setStockArticleId(Long.parseLong(s)); + distrilbutionBillStockService.save(distrilbutionBillStock); } return true; } @@ -424,32 +434,132 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb return null; } + /** + * 提货基本信息 + * @param id + * @return + */ @Override public DistrilbutionBillLadingVO getOneOwn(Long id) { return baseMapper.getOneOwn(id); } + /** + * 提货内查询包件 + * @param page + * @param id + * @return + */ @Override - public IPage<DistrilbutionBillLadingVO> detailReservationOwn(IPage<Object> page, long id) { - return baseMapper.detailReservationOwn(page,id); + public IPage<DistrilbutionBillLadingOwnVO> detailReservationOwn(IPage<Object> page, long id) { + IPage<DistrilbutionBillLadingOwnVO> distrilbutionBillLadingOwnVOIPage = baseMapper.detailReservationOwn(page, id); + distrilbutionBillLadingOwnVOIPage.getRecords().forEach( i ->{ + List<DistributionStockupScanEntity> list = distributionStockupScanService.list(Wrappers.<DistributionStockupScanEntity>query().lambda() + .eq(DistributionStockupScanEntity::getPackageType, '1') + .eq(DistributionStockupScanEntity::getParcelListId, i.getId()) + ); + i.setStockUp(list.size() > 0 ? "已备货": "未备货"); + }); + return distrilbutionBillLadingOwnVOIPage; } + /** + * 提货库存品 + * @param page + * @param id + * @return + */ @Override - public IPage<DistrilbutionBillLadingVO> getInventoryOwn(IPage<Object> page, long id) { - IPage<DistrilbutionBillLadingVO> l = new Page<>(); - List<DistrilbutionBillLadingVO> inventoryChe = baseMapper.getInventoryChe(id); - boolean b = inventoryChe.stream().anyMatch(i -> i.getReservationStockListNum() > 0); - if(b){ + public IPage<DistrilbutionBillLadingOwnVO> getInventoryOwn(IPage<Object> page, long id) { + IPage<DistrilbutionBillLadingOwnVO> l = new Page<>(); + IPage<DistrilbutionBillLadingOwnVO> inventoryOwn = baseMapper.getInventoryOwn(page, id); + if(inventoryOwn.getRecords().size()> 0){ //查询库存品 - return baseMapper.getInventoryOwn(page,id); + inventoryOwn.getRecords().forEach( i ->{ + //是否备货 + List<DistributionStockupScanEntity> list = distributionStockupScanService.list(Wrappers.<DistributionStockupScanEntity>query().lambda() + .eq(DistributionStockupScanEntity::getPackageType, "2") + .eq(DistributionStockupScanEntity::getStockListId, i.getId()) + ); + String s = ""; + if(list.size() > 0 && i.getQuantity() > list.size()){ + s = "备货中"; + }else if(list.size() > 0 && i.getQuantity() == list.size()){ + s = "备货完成"; + }else{ + s = "未备货"; + } + i.setStockUp(s); + i.setNumber(list.size() > 0 ? list.size() : 0); + }); + return inventoryOwn; }else{ - return l; + return l; } + + } + /** + * 查询订单 + * @param page + * @param id + * @return + */ + @Override + public IPage<DistrilbutionBillLadingOwnVO> detailOrderOwn(IPage<Object> page, long id) { + IPage<DistrilbutionBillLadingOwnVO> distrilbutionBillLadingOwnVOIPage = baseMapper.detailOrderOwn(page, id); + return distrilbutionBillLadingOwnVOIPage; + } + + /** + * 根据id查询提货的全部数据 + * @param distrilbutionBillLadingEntity + * @return + */ @Override - public IPage<DistrilbutionBillLadingVO> detailOrderOwn(IPage<Object> page, long id) { - return baseMapper.detailOrderOwn(page,id); + public DistrilbutionBillLadingDetailsVO getDetailOne(DistrilbutionBillLadingEntity distrilbutionBillLadingEntity) { + DistrilbutionBillLadingDetailsVO detailOne = baseMapper.getDetailOne(distrilbutionBillLadingEntity.getId()); + List<DistributionStockArticleVO> list1 = new ArrayList<>(); + List<DistributionStockListVO> stockListEntities = new ArrayList<>(); + //查询提货信息 + List<DistrilbutionBillStockEntity> list = distrilbutionBillStockService.list(Wrappers.<DistrilbutionBillStockEntity>query().lambda() + .eq(DistrilbutionBillStockEntity::getBillLadingId, distrilbutionBillLadingEntity.getId()) + ); + list.forEach( i ->{ + DistributionStockArticleEntity one = distributionStockArticleService.getOne(Wrappers.<DistributionStockArticleEntity>query().lambda().eq(DistributionStockArticleEntity::getId, i.getStockArticleId())); + if(ObjectUtils.isNotNull(one)){ + DistributionStockArticleVO articleVO = new DistributionStockArticleVO(); + BeanUtils.copyProperties(one,articleVO); + list1.add(articleVO); + } + + }); + detailOne.setStockArticleVOS(list1); //订单数据 + //查询图片 + List<DistributionPrintEntity> list2 = distributionPrintService.list(Wrappers.<DistributionPrintEntity>query().lambda() + .eq(DistributionPrintEntity::getBillLadingId, distrilbutionBillLadingEntity.getId()) + ); + detailOne.setPrintVOS(list2); + //查询库存品 + List<DistributionDeliveryDetailsEntity> list3 = distributionDeliveryDetailsService.list(Wrappers.<DistributionDeliveryDetailsEntity>query().lambda() + .eq(DistributionDeliveryDetailsEntity::getBillLadingId, distrilbutionBillLadingEntity.getId()) + ); + if(list3.size() > 0){ + list3.forEach( i ->{ + DistributionStockListEntity one = distributionStockListService.getOne(Wrappers.<DistributionStockListEntity>query().lambda() + .eq(DistributionStockListEntity::getId, i.getStockListId()) + ); + if(ObjectUtils.isNotNull(one)){ + DistributionStockListVO distributionStockListVO = new DistributionStockListVO(); + BeanUtils.copyProperties(one,distributionStockListVO); + stockListEntities.add(distributionStockListVO); + } + + }); + } + detailOne.setStockListVOS(stockListEntities); + return detailOne; } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillStockServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillStockServiceImpl.java new file mode 100644 index 000000000..303937c77 --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillStockServiceImpl.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.DistrilbutionBillStockEntity; +import com.logpm.distribution.vo.DistrilbutionBillStockVO; +import com.logpm.distribution.excel.DistrilbutionBillStockExcel; +import com.logpm.distribution.mapper.DistrilbutionBillStockMapper; +import com.logpm.distribution.service.IDistrilbutionBillStockService; +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-07-25 + */ +@Service +public class DistrilbutionBillStockServiceImpl extends BaseServiceImpl<DistrilbutionBillStockMapper, DistrilbutionBillStockEntity> implements IDistrilbutionBillStockService { + + @Override + public IPage<DistrilbutionBillStockVO> selectDistrilbutionBillStockPage(IPage<DistrilbutionBillStockVO> page, DistrilbutionBillStockVO distrilbutionBillStock) { + return page.setRecords(baseMapper.selectDistrilbutionBillStockPage(page, distrilbutionBillStock)); + } + + + @Override + public List<DistrilbutionBillStockExcel> exportDistrilbutionBillStock(Wrapper<DistrilbutionBillStockEntity> queryWrapper) { + List<DistrilbutionBillStockExcel> distrilbutionBillStockList = baseMapper.exportDistrilbutionBillStock(queryWrapper); + //distrilbutionBillStockList.forEach(distrilbutionBillStock -> { + // distrilbutionBillStock.setTypeName(DictCache.getValue(DictEnum.YES_NO, DistrilbutionBillStock.getType())); + //}); + return distrilbutionBillStockList; + } + +}