Browse Source

修改自提限制

training
caoyizhong 1 year ago
parent
commit
740d544d80
  1. 100
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistrilbutionBillPackageEntity.java
  2. 50
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistrilbutionBillPackageClient.java
  3. 35
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistrilbutionBillPackageVO.java
  4. 151
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistrilbutionBillPackageController.java
  5. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistrilbutionBillLadingDTO.java
  6. 34
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistrilbutionBillPackageDTO.java
  7. 117
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistrilbutionBillPackageExcel.java
  8. 53
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistrilbutionBillPackageClient.java
  9. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml
  10. 54
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillPackageMapper.java
  11. 38
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillPackageMapper.xml
  12. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.xml
  13. 52
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillPackageService.java
  14. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java
  15. 99
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java
  16. 54
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillPackageServiceImpl.java
  17. 50
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/wrapper/DistrilbutionBillPackageWrapper.java

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

50
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<DistrilbutionBillPackageEntity> top(@RequestParam("current") Integer current, @RequestParam("size") Integer size);
}

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

151
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<DistrilbutionBillPackageVO> 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<IPage<DistrilbutionBillPackageVO>> list(@ApiIgnore @RequestParam Map<String, Object> distrilbutionBillPackage, Query query) {
IPage<DistrilbutionBillPackageEntity> 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<IPage<DistrilbutionBillPackageVO>> page(DistrilbutionBillPackageVO distrilbutionBillPackage, Query query) {
IPage<DistrilbutionBillPackageVO> 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<String, Object> distrilbutionBillPackage, BladeUser bladeUser, HttpServletResponse response) {
QueryWrapper<DistrilbutionBillPackageEntity> 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<DistrilbutionBillPackageExcel> list = distrilbutionBillPackageService.exportDistrilbutionBillPackage(queryWrapper);
ExcelUtil.export(response, "自提包件中间表数据" + DateUtil.time(), "自提包件中间表数据表", list, DistrilbutionBillPackageExcel.class);
}
}

6
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.DistributionParcelListEntity;
import com.logpm.distribution.entity.DistributionStockArticleEntity; import com.logpm.distribution.entity.DistributionStockArticleEntity;
import com.logpm.distribution.entity.DistrilbutionBillLadingEntity; import com.logpm.distribution.entity.DistrilbutionBillLadingEntity;
import com.logpm.distribution.entity.DistrilbutionBillPackageEntity;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@ -143,6 +144,11 @@ public class DistrilbutionBillLadingDTO extends DistrilbutionBillLadingEntity {
*/ */
private List<DistributionStockArticleEntity> stockArticleList; private List<DistributionStockArticleEntity> stockArticleList;
/**
* 自提包件数据
*/
private List<DistrilbutionBillPackageEntity> billPackageEntityList;
private List<Print> printList; private List<Print> printList;
private List<Long> warehouseIdList; private List<Long> warehouseIdList;

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

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

53
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<DistrilbutionBillPackageEntity> top(Integer current, Integer size) {
Query query = new Query();
query.setCurrent(current);
query.setSize(size);
IPage<DistrilbutionBillPackageEntity> page = distrilbutionBillPackageService.page(Condition.getPage(query));
return BladePage.of(page);
}
}

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

@ -477,7 +477,7 @@
select COUNT(ldpl.id) select COUNT(ldpl.id)
from logpm_distrilbution_bill_stock ldbs from logpm_distrilbution_bill_stock ldbs
LEFT JOIN logpm_distribution_parcel_list ldpl on ldpl.stock_article_id = ldbs.stock_article_id 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,( ) planNum,(
select COUNT(id) select COUNT(id)
from logpm_distribution_stock from logpm_distribution_stock

54
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<DistrilbutionBillPackageEntity> {
/**
* 自定义分页
*
* @param page
* @param distrilbutionBillPackage
* @return
*/
List<DistrilbutionBillPackageVO> selectDistrilbutionBillPackagePage(IPage page, DistrilbutionBillPackageVO distrilbutionBillPackage);
/**
* 获取导出数据
*
* @param queryWrapper
* @return
*/
List<DistrilbutionBillPackageExcel> exportDistrilbutionBillPackage(@Param("ew") Wrapper<DistrilbutionBillPackageEntity> queryWrapper);
}

38
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillPackageMapper.xml

@ -0,0 +1,38 @@
<?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.DistrilbutionBillPackageMapper">
<!-- 通用查询映射结果 -->
<resultMap id="distrilbutionBillPackageResultMap" type="com.logpm.distribution.entity.DistrilbutionBillPackageEntity">
<result column="id" property="id"/>
<result column="tenant_id" property="tenantId"/>
<result column="create_user" property="createUser"/>
<result column="create_time" property="createTime"/>
<result column="update_user" property="updateUser"/>
<result column="update_time" property="updateTime"/>
<result column="status" property="status"/>
<result column="is_deleted" property="isDeleted"/>
<result column="create_dept" property="createDept"/>
<result column="reserve1" property="reserve1"/>
<result column="reserve2" property="reserve2"/>
<result column="reserve3" property="reserve3"/>
<result column="reserve4" property="reserve4"/>
<result column="reserve5" property="reserve5"/>
<result column="bill_lading_id" property="billLadingId"/>
<result column="parce_list_id" property="parceListId"/>
<result column="stock_article_id" property="stockArticleId"/>
<result column="packet_bar_code" property="packetBarCode"/>
<result column="packet_bar_status" property="packetBarStatus"/>
</resultMap>
<select id="selectDistrilbutionBillPackagePage" resultMap="distrilbutionBillPackageResultMap">
select * from logpm_distrilbution_bill_package where is_deleted = 0
</select>
<select id="exportDistrilbutionBillPackage" resultType="com.logpm.distribution.excel.DistrilbutionBillPackageExcel">
SELECT * FROM logpm_distrilbution_bill_package ${ew.customSqlSegment}
</select>
</mapper>

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

@ -10,7 +10,7 @@
from logpm_distrilbution_bill_stock ldbs 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' 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'
</select> </select>
<select id="selectDistrilbutionBillStockPage" resultMap="distrilbutionBillStockResultMap"> <select id="selectDistrilbutionBillStockPage" resultMap="distrilbutionBillStockResultMap">
@ -181,7 +181,7 @@
LEFT JOIN logpm_warehouse_updown_goods lwug on ldpl.id = lwug.association_id LEFT JOIN logpm_warehouse_updown_goods lwug on ldpl.id = lwug.association_id
LEFT JOIN logpm_warehouse_tray_goods lwtg on lwtg.association_id = ldpl.id LEFT JOIN logpm_warehouse_tray_goods lwtg on lwtg.association_id = ldpl.id
LEFT JOIN logpm_distribution_stock lds on lds.parcel_list_id = ldpl.id and lds.bill_lading_id = ldbs.bill_lading_id LEFT JOIN logpm_distribution_stock lds on lds.parcel_list_id = ldpl.id and lds.bill_lading_id = ldbs.bill_lading_id
where ldbs.bill_lading_id = #{reservationId} and ldsa.is_zero = #{isZero} where ldbs.bill_lading_id = #{reservationId} and ldsa.is_zero = #{isZero} and ldpl.conditions = '1'
</select> </select>

52
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<DistrilbutionBillPackageEntity> {
/**
* 自定义分页
*
* @param page
* @param distrilbutionBillPackage
* @return
*/
IPage<DistrilbutionBillPackageVO> selectDistrilbutionBillPackagePage(IPage<DistrilbutionBillPackageVO> page, DistrilbutionBillPackageVO distrilbutionBillPackage);
/**
* 导出数据
*
* @param queryWrapper
* @return
*/
List<DistrilbutionBillPackageExcel> exportDistrilbutionBillPackage(Wrapper<DistrilbutionBillPackageEntity> queryWrapper);
}

7
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java

@ -1724,6 +1724,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
//订单 //订单
List<DistributionParcelListEntity> list = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda() List<DistributionParcelListEntity> list = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda()
.eq(DistributionParcelListEntity::getOrderPackageCode, stockupDTO.getPacketBarCode()) .eq(DistributionParcelListEntity::getOrderPackageCode, stockupDTO.getPacketBarCode())
.eq(DistributionParcelListEntity::getConditions, 1)
); );
if (!list.isEmpty()) { if (!list.isEmpty()) {
Integer integer = baseMapper.selectPackageExistSelf(stockupDTO); Integer integer = baseMapper.selectPackageExistSelf(stockupDTO);
@ -1834,8 +1835,12 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
} }
} else { } else {
List<DistributionParcelListEntity> list = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda().eq(DistributionParcelListEntity::getOrderPackageCode, packetBarCode)); List<DistributionParcelListEntity> list = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda()
.eq(DistributionParcelListEntity::getOrderPackageCode, packetBarCode)
.eq(DistributionParcelListEntity::getConditions, 1)
);
if (!list.isEmpty()) { if (!list.isEmpty()) {
//窜货
return 5; return 5;
} }
//不存在 //不存在

99
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.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream;
/** /**
* 提货单 服务实现类 * 提货单 服务实现类
@ -110,6 +111,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
private final IDistributionReservationZeroPackageService distributionZeroPackageService; //零担配送记录 private final IDistributionReservationZeroPackageService distributionZeroPackageService; //零担配送记录
private final IDistributionParcelNumberService distributionParcelNumberService; //零担配送数量记录 private final IDistributionParcelNumberService distributionParcelNumberService; //零担配送数量记录
private final IDistrilbutionBillPackageService distrilbutionBillPackageService;
@Override @Override
@ -288,7 +290,13 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
.in(distrilbutionBillLading.getStockArticleId().contains(","),DistrilbutionBillStockEntity::getStockArticleId, distrilbutionBillLading.getStockArticleId().split(",")) .in(distrilbutionBillLading.getStockArticleId().contains(","),DistrilbutionBillStockEntity::getStockArticleId, distrilbutionBillLading.getStockArticleId().split(","))
); );
if(!list.isEmpty()){ if(!list.isEmpty()){
throw new ServiceException("当前订单已创建!"); list.stream().forEach( i ->{
DistributionStockArticleEntity byId = distributionStockArticleService.getById(i.getStockArticleId());
if(byId.getIsZero().equals("0")){
throw new ServiceException("当前订单已创建!");
}
});
} }
//新增 //新增
distrilbutionBillLading.setConsignee("1"); distrilbutionBillLading.setConsignee("1");
@ -301,19 +309,17 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
throw new ServiceException("请选择仓库在操作!!!"); throw new ServiceException("请选择仓库在操作!!!");
} }
distrilbutionBillLading.setWarehouseId(myCurrentWarehouse.getId()); distrilbutionBillLading.setWarehouseId(myCurrentWarehouse.getId());
List<DistributionParcelListDTO> parcelLisList = distrilbutionBillLading.getParcelLisList();
this.saveDistrilbutionBillLading(distrilbutionBillLading); this.saveDistrilbutionBillLading(distrilbutionBillLading);
//修改订单状态 //修改订单状态
if (StringUtils.isNotBlank(distrilbutionBillLading.getStockArticleId())) { if (StringUtils.isNotBlank(distrilbutionBillLading.getStockArticleId())) {
String[] split = distrilbutionBillLading.getStockArticleId().split(","); String[] split = distrilbutionBillLading.getStockArticleId().split(",");
for (String s : split) { for (String s : split) {
//查询订单信息
DistributionStockArticleEntity byId = distributionStockArticleService.getById(s);
//查询是否创建过 //查询是否创建过
DistributionStockArticleEntity distributionStockArticle = new DistributionStockArticleEntity(); 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(); DistrilbutionBillStockEntity distrilbutionBillStock = new DistrilbutionBillStockVO();
distrilbutionBillStock.setBillLadingId(distrilbutionBillLading.getId()); distrilbutionBillStock.setBillLadingId(distrilbutionBillLading.getId());
@ -321,6 +327,85 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
distrilbutionBillStock.setConditions("1"); distrilbutionBillStock.setConditions("1");
distrilbutionBillStock.setOrderStatus("1"); distrilbutionBillStock.setOrderStatus("1");
distrilbutionBillStockService.save(distrilbutionBillStock); distrilbutionBillStockService.save(distrilbutionBillStock);
List<DistrilbutionBillPackageEntity> packageEntityList = new ArrayList<>();
if(ObjectUtils.isNotNull(distrilbutionBillLading.getBillPackageEntityList())){
//添加自提包件信息
List<DistrilbutionBillPackageEntity> 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<DistributionParcelListEntity> list1 = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>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<DistributionParcelListDTO> 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<DistributionParcelListEntity> list1 = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>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<DistributionParcelListDTO> 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<Distrilb
List<DistributionParcelNumberEntity> parcelNumberEntityList = new ArrayList<>(); List<DistributionParcelNumberEntity> parcelNumberEntityList = new ArrayList<>();
AtomicInteger nu = new AtomicInteger(); AtomicInteger nu = new AtomicInteger();
//是 添加物料信息 //是 添加物料信息
list.forEach(i -> { list.stream().forEach(i -> {
if(i.getQuantity() != 0){ if(i.getQuantity() != 0){
DistributionReservationZeroPackageEntity zeroPackageEntity = new DistributionReservationZeroPackageEntity(); DistributionReservationZeroPackageEntity zeroPackageEntity = new DistributionReservationZeroPackageEntity();
zeroPackageEntity.setQuantity(i.getQuantity()); zeroPackageEntity.setQuantity(i.getQuantity());

54
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<DistrilbutionBillPackageMapper, DistrilbutionBillPackageEntity> implements IDistrilbutionBillPackageService {
@Override
public IPage<DistrilbutionBillPackageVO> selectDistrilbutionBillPackagePage(IPage<DistrilbutionBillPackageVO> page, DistrilbutionBillPackageVO distrilbutionBillPackage) {
return page.setRecords(baseMapper.selectDistrilbutionBillPackagePage(page, distrilbutionBillPackage));
}
@Override
public List<DistrilbutionBillPackageExcel> exportDistrilbutionBillPackage(Wrapper<DistrilbutionBillPackageEntity> queryWrapper) {
List<DistrilbutionBillPackageExcel> distrilbutionBillPackageList = baseMapper.exportDistrilbutionBillPackage(queryWrapper);
//distrilbutionBillPackageList.forEach(distrilbutionBillPackage -> {
// distrilbutionBillPackage.setTypeName(DictCache.getValue(DictEnum.YES_NO, DistrilbutionBillPackage.getType()));
//});
return distrilbutionBillPackageList;
}
}

50
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<DistrilbutionBillPackageEntity, DistrilbutionBillPackageVO> {
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;
}
}
Loading…
Cancel
Save