diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistrilbutionBillPackageEntity.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistrilbutionBillPackageEntity.java new file mode 100644 index 000000000..d1fcab3be --- /dev/null +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistrilbutionBillPackageEntity.java @@ -0,0 +1,100 @@ +/* + * 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-10-25 + */ +@Data +@TableName("logpm_distrilbution_bill_package") +@ApiModel(value = "DistrilbutionBillPackage对象", description = "自提包件中间表") +@EqualsAndHashCode(callSuper = true) +public class DistrilbutionBillPackageEntity extends TenantEntity { + + /** + * + */ + @ApiModelProperty(value = "") + private String reserve1; + /** + * + */ + @ApiModelProperty(value = "") + private String reserve2; + /** + * + */ + @ApiModelProperty(value = "") + private String reserve3; + /** + * + */ + @ApiModelProperty(value = "") + private String reserve4; + /** + * + */ + @ApiModelProperty(value = "") + private String reserve5; + /** + *自提ID + */ + @ApiModelProperty(value = "自提ID") + private Long billLadingId; + /** + *包件ID + */ + @ApiModelProperty(value = "包件ID") + private Long parceListId; + /** + * + */ + @ApiModelProperty(value = "订单ID") + private Long stockArticleId; + /** + *包件码 + */ + @ApiModelProperty(value = "包件码") + private String packetBarCode; + /** + * 包件配送状态;1-正常、2-取消 3,新增 + */ + @ApiModelProperty(value = "包件配送状态;1-正常、2-取消 3,新增") + private Integer packetBarStatus; + /** + * 包件数量 + */ + @ApiModelProperty(value = "包件数量") + private Integer packetNumber; + /** + * 包件类型 + */ + @ApiModelProperty(value = "包件类型") + private String billType; + +} diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistrilbutionBillPackageClient.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistrilbutionBillPackageClient.java new file mode 100644 index 000000000..229fba743 --- /dev/null +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistrilbutionBillPackageClient.java @@ -0,0 +1,50 @@ +/* + * 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.common.constant.ModuleNameConstant; +import org.springblade.core.mp.support.BladePage; +import com.logpm.distribution.entity.DistrilbutionBillPackageEntity; +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-10-25 + */ +@FeignClient( + value = ModuleNameConstant.APPLICATION_DISTRIBUTION_NAME +) +public interface IDistrilbutionBillPackageClient { + + String API_PREFIX = "/client/billPackage"; + String TOP = API_PREFIX + "/top"; + + /** + * 获取自提包件中间表列表 + * + * @param current 页号 + * @param size 页数 + * @return BladePage + */ + @GetMapping(TOP) + BladePage 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/DistrilbutionBillPackageVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistrilbutionBillPackageVO.java new file mode 100644 index 000000000..b853763fd --- /dev/null +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistrilbutionBillPackageVO.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.DistrilbutionBillPackageEntity; +import org.springblade.core.tool.node.INode; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 自提包件中间表 视图实体类 + * + * @author cyz + * @since 2023-10-25 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class DistrilbutionBillPackageVO extends DistrilbutionBillPackageEntity { + private static final long serialVersionUID = 1L; + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistrilbutionBillPackageController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistrilbutionBillPackageController.java new file mode 100644 index 000000000..830e552da --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistrilbutionBillPackageController.java @@ -0,0 +1,151 @@ +/* + * 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.DistrilbutionBillPackageEntity; +import com.logpm.distribution.vo.DistrilbutionBillPackageVO; +import com.logpm.distribution.excel.DistrilbutionBillPackageExcel; +import com.logpm.distribution.wrapper.DistrilbutionBillPackageWrapper; +import com.logpm.distribution.service.IDistrilbutionBillPackageService; +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-10-25 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/distrilbutionBillPackage") +@Api(value = "自提包件中间表", tags = "自提包件中间表接口") +public class DistrilbutionBillPackageController extends BladeController { + + private final IDistrilbutionBillPackageService distrilbutionBillPackageService; + + /** + * 自提包件中间表 详情 + */ + @GetMapping("/detail") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入distrilbutionBillPackage") + public R detail(DistrilbutionBillPackageEntity distrilbutionBillPackage) { + DistrilbutionBillPackageEntity detail = distrilbutionBillPackageService.getOne(Condition.getQueryWrapper(distrilbutionBillPackage)); + return R.data(DistrilbutionBillPackageWrapper.build().entityVO(detail)); + } + /** + * 自提包件中间表 分页 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入distrilbutionBillPackage") + public R> list(@ApiIgnore @RequestParam Map distrilbutionBillPackage, Query query) { + IPage pages = distrilbutionBillPackageService.page(Condition.getPage(query), Condition.getQueryWrapper(distrilbutionBillPackage, DistrilbutionBillPackageEntity.class)); + return R.data(DistrilbutionBillPackageWrapper.build().pageVO(pages)); + } + + /** + * 自提包件中间表 自定义分页 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入distrilbutionBillPackage") + public R> page(DistrilbutionBillPackageVO distrilbutionBillPackage, Query query) { + IPage pages = distrilbutionBillPackageService.selectDistrilbutionBillPackagePage(Condition.getPage(query), distrilbutionBillPackage); + return R.data(pages); + } + + /** + * 自提包件中间表 新增 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入distrilbutionBillPackage") + public R save(@Valid @RequestBody DistrilbutionBillPackageEntity distrilbutionBillPackage) { + return R.status(distrilbutionBillPackageService.save(distrilbutionBillPackage)); + } + + /** + * 自提包件中间表 修改 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入distrilbutionBillPackage") + public R update(@Valid @RequestBody DistrilbutionBillPackageEntity distrilbutionBillPackage) { + return R.status(distrilbutionBillPackageService.updateById(distrilbutionBillPackage)); + } + + /** + * 自提包件中间表 新增或修改 + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "新增或修改", notes = "传入distrilbutionBillPackage") + public R submit(@Valid @RequestBody DistrilbutionBillPackageEntity distrilbutionBillPackage) { + return R.status(distrilbutionBillPackageService.saveOrUpdate(distrilbutionBillPackage)); + } + + /** + * 自提包件中间表 删除 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 7) + @ApiOperation(value = "逻辑删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(distrilbutionBillPackageService.deleteLogic(Func.toLongList(ids))); + } + + + /** + * 导出数据 + */ + @GetMapping("/export-distrilbutionBillPackage") + @ApiOperationSupport(order = 9) + @ApiOperation(value = "导出数据", notes = "传入distrilbutionBillPackage") + public void exportDistrilbutionBillPackage(@ApiIgnore @RequestParam Map distrilbutionBillPackage, BladeUser bladeUser, HttpServletResponse response) { + QueryWrapper queryWrapper = Condition.getQueryWrapper(distrilbutionBillPackage, DistrilbutionBillPackageEntity.class); + //if (!AuthUtil.isAdministrator()) { + // queryWrapper.lambda().eq(DistrilbutionBillPackage::getTenantId, bladeUser.getTenantId()); + //} + queryWrapper.lambda().eq(DistrilbutionBillPackageEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED); + List list = distrilbutionBillPackageService.exportDistrilbutionBillPackage(queryWrapper); + ExcelUtil.export(response, "自提包件中间表数据" + DateUtil.time(), "自提包件中间表数据表", list, DistrilbutionBillPackageExcel.class); + } + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistrilbutionBillLadingDTO.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistrilbutionBillLadingDTO.java index 3b823e9d4..4a6cf5ed0 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistrilbutionBillLadingDTO.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistrilbutionBillLadingDTO.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.logpm.distribution.entity.DistributionParcelListEntity; import com.logpm.distribution.entity.DistributionStockArticleEntity; import com.logpm.distribution.entity.DistrilbutionBillLadingEntity; +import com.logpm.distribution.entity.DistrilbutionBillPackageEntity; import lombok.Data; import lombok.EqualsAndHashCode; @@ -143,6 +144,11 @@ public class DistrilbutionBillLadingDTO extends DistrilbutionBillLadingEntity { */ private List stockArticleList; + /** + * 自提包件数据 + */ + private List billPackageEntityList; + private List printList; private List warehouseIdList; diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistrilbutionBillPackageDTO.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistrilbutionBillPackageDTO.java new file mode 100644 index 000000000..6b902b411 --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistrilbutionBillPackageDTO.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.DistrilbutionBillPackageEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 自提包件中间表 数据传输对象实体类 + * + * @author cyz + * @since 2023-10-25 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class DistrilbutionBillPackageDTO extends DistrilbutionBillPackageEntity { + private static final long serialVersionUID = 1L; + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistrilbutionBillPackageExcel.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistrilbutionBillPackageExcel.java new file mode 100644 index 000000000..a65d44b00 --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistrilbutionBillPackageExcel.java @@ -0,0 +1,117 @@ +/* + * 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-10-25 + */ +@Data +@ColumnWidth(25) +@HeadRowHeight(20) +@ContentRowHeight(18) +public class DistrilbutionBillPackageExcel implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + @ColumnWidth(20) + @ExcelProperty("") + private String tenantId; + /** + * + */ + @ColumnWidth(20) + @ExcelProperty("") + private Integer isDeleted; + /** + * + */ + @ColumnWidth(20) + @ExcelProperty("") + private String reserve1; + /** + * + */ + @ColumnWidth(20) + @ExcelProperty("") + private String reserve2; + /** + * + */ + @ColumnWidth(20) + @ExcelProperty("") + private String reserve3; + /** + * + */ + @ColumnWidth(20) + @ExcelProperty("") + private String reserve4; + /** + * + */ + @ColumnWidth(20) + @ExcelProperty("") + private String reserve5; + /** + * + */ + @ColumnWidth(20) + @ExcelProperty("") + private Long billLadingId; + /** + * + */ + @ColumnWidth(20) + @ExcelProperty("") + private Long parceListId; + /** + * + */ + @ColumnWidth(20) + @ExcelProperty("") + private Long stockArticleId; + /** + * + */ + @ColumnWidth(20) + @ExcelProperty("") + private String packetBarCode; + /** + * + */ + @ColumnWidth(20) + @ExcelProperty("") + private Integer packetBarStatus; + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistrilbutionBillPackageClient.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistrilbutionBillPackageClient.java new file mode 100644 index 000000000..72b2daf93 --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistrilbutionBillPackageClient.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.DistrilbutionBillPackageEntity; +import com.logpm.distribution.service.IDistrilbutionBillPackageService; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; +import springfox.documentation.annotations.ApiIgnore; + +/** + * 自提包件中间表 Feign实现类 + * + * @author cyz + * @since 2023-10-25 + */ +@ApiIgnore() +@RestController +@AllArgsConstructor +public class DistrilbutionBillPackageClient implements IDistrilbutionBillPackageClient { + + private final IDistrilbutionBillPackageService distrilbutionBillPackageService; + + @Override + @GetMapping(TOP) + public BladePage top(Integer current, Integer size) { + Query query = new Query(); + query.setCurrent(current); + query.setSize(size); + IPage page = distrilbutionBillPackageService.page(Condition.getPage(query)); + return BladePage.of(page); + } + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml index 029c16694..747e1bfb2 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml @@ -477,7 +477,7 @@ select COUNT(ldpl.id) from logpm_distrilbution_bill_stock ldbs LEFT JOIN logpm_distribution_parcel_list ldpl on ldpl.stock_article_id = ldbs.stock_article_id - where ldbs.bill_lading_id = ldsi.reservation_id and ldpl.order_package_code is not null + where ldbs.bill_lading_id = ldsi.reservation_id and ldpl.order_package_code is not null and ldpl.conditions = '1' ) planNum,( select COUNT(id) from logpm_distribution_stock diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillPackageMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillPackageMapper.java new file mode 100644 index 000000000..d87e66215 --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillPackageMapper.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.DistrilbutionBillPackageEntity; +import com.logpm.distribution.vo.DistrilbutionBillPackageVO; +import com.logpm.distribution.excel.DistrilbutionBillPackageExcel; +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-10-25 + */ +public interface DistrilbutionBillPackageMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param distrilbutionBillPackage + * @return + */ + List selectDistrilbutionBillPackagePage(IPage page, DistrilbutionBillPackageVO distrilbutionBillPackage); + + + /** + * 获取导出数据 + * + * @param queryWrapper + * @return + */ + List exportDistrilbutionBillPackage(@Param("ew") Wrapper queryWrapper); + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillPackageMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillPackageMapper.xml new file mode 100644 index 000000000..711416665 --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillPackageMapper.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 index 7677b9ab8..3effa5b44 100644 --- 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 @@ -10,7 +10,7 @@ from logpm_distrilbution_bill_stock ldbs LEFT JOIN logpm_distribution_parcel_list ldpl on ldpl.stock_article_id = ldbs.stock_article_id and ldpl.order_package_status != '70' - where ldbs.bill_lading_id = #{reservationId} and ldpl.order_package_code is NOT null + where ldbs.bill_lading_id = #{reservationId} and ldpl.order_package_code is NOT null and ldpl.conditions = '1' diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillPackageService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillPackageService.java new file mode 100644 index 000000000..530468324 --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillPackageService.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.DistrilbutionBillPackageEntity; +import com.logpm.distribution.vo.DistrilbutionBillPackageVO; +import com.logpm.distribution.excel.DistrilbutionBillPackageExcel; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.mp.base.BaseService; +import java.util.List; + +/** + * 自提包件中间表 服务类 + * + * @author cyz + * @since 2023-10-25 + */ +public interface IDistrilbutionBillPackageService extends BaseService { + /** + * 自定义分页 + * + * @param page + * @param distrilbutionBillPackage + * @return + */ + IPage selectDistrilbutionBillPackagePage(IPage page, DistrilbutionBillPackageVO distrilbutionBillPackage); + + + /** + * 导出数据 + * + * @param queryWrapper + * @return + */ + List exportDistrilbutionBillPackage(Wrapper queryWrapper); + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java index 946f8794a..a7d3995c7 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java @@ -1724,6 +1724,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl list = distributionParcelListService.list(Wrappers.query().lambda() .eq(DistributionParcelListEntity::getOrderPackageCode, stockupDTO.getPacketBarCode()) + .eq(DistributionParcelListEntity::getConditions, 1) ); if (!list.isEmpty()) { Integer integer = baseMapper.selectPackageExistSelf(stockupDTO); @@ -1834,8 +1835,12 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl list = distributionParcelListService.list(Wrappers.query().lambda().eq(DistributionParcelListEntity::getOrderPackageCode, packetBarCode)); + List list = distributionParcelListService.list(Wrappers.query().lambda() + .eq(DistributionParcelListEntity::getOrderPackageCode, packetBarCode) + .eq(DistributionParcelListEntity::getConditions, 1) + ); if (!list.isEmpty()) { + //窜货 return 5; } //不存在 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 a50774ed5..6308203ef 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 @@ -71,6 +71,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; +import java.util.stream.Stream; /** * 提货单 服务实现类 @@ -110,6 +111,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl{ + DistributionStockArticleEntity byId = distributionStockArticleService.getById(i.getStockArticleId()); + if(byId.getIsZero().equals("0")){ + throw new ServiceException("当前订单已创建!"); + } + }); + } //新增 distrilbutionBillLading.setConsignee("1"); @@ -301,19 +309,17 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl parcelLisList = distrilbutionBillLading.getParcelLisList(); this.saveDistrilbutionBillLading(distrilbutionBillLading); //修改订单状态 if (StringUtils.isNotBlank(distrilbutionBillLading.getStockArticleId())) { String[] split = distrilbutionBillLading.getStockArticleId().split(","); for (String s : split) { + //查询订单信息 + DistributionStockArticleEntity byId = distributionStockArticleService.getById(s); //查询是否创建过 DistributionStockArticleEntity distributionStockArticle = new DistributionStockArticleEntity(); - distributionStockArticle.setId(Long.parseLong(s)); -// distributionStockArticle.setOrderStatus(OrderStatusConstant.zhuangche.getValue()); - distributionStockArticle.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue()); - distributionStockArticle.setStockupStatus(StockupStatusConstant.daibeihuo.getValue()); - distributionStockArticleService.updateById(distributionStockArticle); //添加订单和提货单关联 DistrilbutionBillStockEntity distrilbutionBillStock = new DistrilbutionBillStockVO(); distrilbutionBillStock.setBillLadingId(distrilbutionBillLading.getId()); @@ -321,6 +327,85 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl packageEntityList = new ArrayList<>(); + if(ObjectUtils.isNotNull(distrilbutionBillLading.getBillPackageEntityList())){ + //添加自提包件信息 + List collect = distrilbutionBillLading.getBillPackageEntityList().stream().filter(q -> q.getStockArticleId().equals(s)).collect(Collectors.toList()); + if(!collect.isEmpty()){ + //有包件 + collect.stream().forEach(ss ->{ + DistrilbutionBillPackageEntity billPackageEntity = new DistrilbutionBillPackageEntity(); + billPackageEntity.setBillLadingId(distrilbutionBillLading.getId()); + billPackageEntity.setPacketBarCode(ss.getPacketBarCode()); + billPackageEntity.setPacketBarStatus(1); + billPackageEntity.setParceListId(ss.getParceListId()); + billPackageEntity.setStockArticleId(ss.getStockArticleId()); + billPackageEntity.setPacketNumber(ss.getPacketNumber()); + billPackageEntity.setBillType(byId.getIsZero().equals("1") ? "2" : "1"); + packageEntityList.add(billPackageEntity); + }); + distributionStockArticle.setReservationStatus(OrderReservationStatusConstant.bufenyuyue.getValue()); + }else{ + //没有包件 查询包件信息 + List list1 = distributionParcelListService.list(Wrappers.query().lambda() + .eq(DistributionParcelListEntity::getStockArticleId, s) + .eq(DistributionParcelListEntity::getConditions, 1) + ); + list1.stream().forEach(ss ->{ + DistrilbutionBillPackageEntity billPackageEntity = new DistrilbutionBillPackageEntity(); + billPackageEntity.setBillLadingId(distrilbutionBillLading.getId()); + billPackageEntity.setPacketBarCode(ss.getOrderPackageCode()); + billPackageEntity.setPacketBarStatus(1); + billPackageEntity.setParceListId(ss.getId()); + billPackageEntity.setStockArticleId(ss.getStockArticleId()); + + if(byId.getIsZero().equals("1")){ + //零担 + Optional first = parcelLisList.stream().filter(i -> i.getStockArticleId().equals(ss.getStockArticleId()) && i.getId().equals(ss.getId())).findFirst(); + billPackageEntity.setBillType("2"); + billPackageEntity.setPacketNumber(first.get().getQuantity()); + }else{ + billPackageEntity.setBillType("1"); + billPackageEntity.setPacketNumber(ss.getQuantity()); + } + packageEntityList.add(billPackageEntity); + }); + distributionStockArticle.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue()); + + + } + }else{ + //没有包件 查询包件信息 + List list1 = distributionParcelListService.list(Wrappers.query().lambda() + .eq(DistributionParcelListEntity::getStockArticleId, s) + .eq(DistributionParcelListEntity::getConditions, 1) + ); + list1.stream().forEach(ss ->{ + + DistrilbutionBillPackageEntity billPackageEntity = new DistrilbutionBillPackageEntity(); + billPackageEntity.setBillLadingId(distrilbutionBillLading.getId()); + billPackageEntity.setPacketBarCode(ss.getOrderPackageCode()); + billPackageEntity.setPacketBarStatus(1); + billPackageEntity.setParceListId(ss.getId()); + billPackageEntity.setStockArticleId(ss.getStockArticleId()); + if(byId.getIsZero().equals("1")){ + //零担 + Optional first = parcelLisList.stream().filter(i -> i.getStockArticleId().equals(ss.getStockArticleId()) && i.getId().equals(ss.getId())).findFirst(); + billPackageEntity.setBillType("2"); + billPackageEntity.setPacketNumber(first.get().getQuantity()); + }else{ + billPackageEntity.setBillType("1"); + billPackageEntity.setPacketNumber(ss.getQuantity()); + } + + packageEntityList.add(billPackageEntity); + }); + distributionStockArticle.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue()); + } + distrilbutionBillPackageService.saveBatch(packageEntityList); + distributionStockArticle.setId(Long.parseLong(s)); + distributionStockArticle.setStockupStatus(StockupStatusConstant.daibeihuo.getValue()); + distributionStockArticleService.updateById(distributionStockArticle); } } //操作图片 @@ -1365,7 +1450,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl parcelNumberEntityList = new ArrayList<>(); AtomicInteger nu = new AtomicInteger(); //是 添加物料信息 - list.forEach(i -> { + list.stream().forEach(i -> { if(i.getQuantity() != 0){ DistributionReservationZeroPackageEntity zeroPackageEntity = new DistributionReservationZeroPackageEntity(); zeroPackageEntity.setQuantity(i.getQuantity()); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillPackageServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillPackageServiceImpl.java new file mode 100644 index 000000000..de9f8ac12 --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillPackageServiceImpl.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.DistrilbutionBillPackageEntity; +import com.logpm.distribution.vo.DistrilbutionBillPackageVO; +import com.logpm.distribution.excel.DistrilbutionBillPackageExcel; +import com.logpm.distribution.mapper.DistrilbutionBillPackageMapper; +import com.logpm.distribution.service.IDistrilbutionBillPackageService; +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-10-25 + */ +@Service +public class DistrilbutionBillPackageServiceImpl extends BaseServiceImpl implements IDistrilbutionBillPackageService { + + @Override + public IPage selectDistrilbutionBillPackagePage(IPage page, DistrilbutionBillPackageVO distrilbutionBillPackage) { + return page.setRecords(baseMapper.selectDistrilbutionBillPackagePage(page, distrilbutionBillPackage)); + } + + + @Override + public List exportDistrilbutionBillPackage(Wrapper queryWrapper) { + List distrilbutionBillPackageList = baseMapper.exportDistrilbutionBillPackage(queryWrapper); + //distrilbutionBillPackageList.forEach(distrilbutionBillPackage -> { + // distrilbutionBillPackage.setTypeName(DictCache.getValue(DictEnum.YES_NO, DistrilbutionBillPackage.getType())); + //}); + return distrilbutionBillPackageList; + } + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/wrapper/DistrilbutionBillPackageWrapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/wrapper/DistrilbutionBillPackageWrapper.java new file mode 100644 index 000000000..c4c8c169b --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/wrapper/DistrilbutionBillPackageWrapper.java @@ -0,0 +1,50 @@ +/* + * 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.wrapper; + +import org.springblade.core.mp.support.BaseEntityWrapper; +import org.springblade.core.tool.utils.BeanUtil; +import com.logpm.distribution.entity.DistrilbutionBillPackageEntity; +import com.logpm.distribution.vo.DistrilbutionBillPackageVO; +import java.util.Objects; + +/** + * 自提包件中间表 包装类,返回视图层所需的字段 + * + * @author cyz + * @since 2023-10-25 + */ +public class DistrilbutionBillPackageWrapper extends BaseEntityWrapper { + + public static DistrilbutionBillPackageWrapper build() { + return new DistrilbutionBillPackageWrapper(); + } + + @Override + public DistrilbutionBillPackageVO entityVO(DistrilbutionBillPackageEntity distrilbutionBillPackage) { + DistrilbutionBillPackageVO distrilbutionBillPackageVO = Objects.requireNonNull(BeanUtil.copy(distrilbutionBillPackage, DistrilbutionBillPackageVO.class)); + + //User createUser = UserCache.getUser(distrilbutionBillPackage.getCreateUser()); + //User updateUser = UserCache.getUser(distrilbutionBillPackage.getUpdateUser()); + //distrilbutionBillPackageVO.setCreateUserName(createUser.getName()); + //distrilbutionBillPackageVO.setUpdateUserName(updateUser.getName()); + + return distrilbutionBillPackageVO; + } + + +}