feat: 添加储位调拨和采购退货功能模块
- 新增 LocationTransferController 实现储位调拨功能 - 实现扫码获取转储信息和物料转储接口 - 新增 PurchaseReturnController 实现采购退货管理功能 - 添加退货申请单查询、审批、删除等核心业务接口 - 实现 PDA 端扫码和退货申请功能 - 集成 SAP 接口实现退货单据同步 - 添加采购退货申请单导出 PDF 功能
This commit is contained in:
parent
3fccb47858
commit
6c1cdb8d0e
|
|
@ -2,19 +2,23 @@ package com.nflg.wms.admin.controller;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
import cn.hutool.core.util.IdUtil;
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.nflg.wms.common.constant.BarCodeProcessStage;
|
import com.nflg.wms.common.constant.BarCodeProcessStage;
|
||||||
import com.nflg.wms.common.pojo.ApiResult;
|
import com.nflg.wms.common.pojo.ApiResult;
|
||||||
import com.nflg.wms.common.pojo.PageData;
|
import com.nflg.wms.common.pojo.PageData;
|
||||||
import com.nflg.wms.common.pojo.dto.InventoryInDTO;
|
import com.nflg.wms.common.pojo.dto.InventoryInDTO;
|
||||||
import com.nflg.wms.common.pojo.dto.InventoryOutDTO;
|
import com.nflg.wms.common.pojo.dto.InventoryOutDTO;
|
||||||
import com.nflg.wms.common.pojo.qo.*;
|
import com.nflg.wms.common.pojo.qo.LocationTransferItemQO;
|
||||||
|
import com.nflg.wms.common.pojo.qo.LocationTransferQO;
|
||||||
|
import com.nflg.wms.common.pojo.qo.PackingPDASearchQO;
|
||||||
|
import com.nflg.wms.common.pojo.qo.TransferOrderSearchQO;
|
||||||
import com.nflg.wms.common.pojo.vo.QrCodeVO;
|
import com.nflg.wms.common.pojo.vo.QrCodeVO;
|
||||||
import com.nflg.wms.common.pojo.vo.TransferOrderVO;
|
import com.nflg.wms.common.pojo.vo.TransferOrderVO;
|
||||||
import com.nflg.wms.common.util.UserUtil;
|
import com.nflg.wms.common.util.UserUtil;
|
||||||
import com.nflg.wms.common.util.VUtil;
|
import com.nflg.wms.common.util.VUtil;
|
||||||
import com.nflg.wms.repository.entity.*;
|
import com.nflg.wms.repository.entity.WmsBin;
|
||||||
|
import com.nflg.wms.repository.entity.WmsQrCodeMaster;
|
||||||
|
import com.nflg.wms.repository.entity.WmsTransferOrders;
|
||||||
import com.nflg.wms.repository.service.*;
|
import com.nflg.wms.repository.service.*;
|
||||||
import com.nflg.wms.starter.BaseController;
|
import com.nflg.wms.starter.BaseController;
|
||||||
import com.nflg.wms.starter.annotation.ApiMark;
|
import com.nflg.wms.starter.annotation.ApiMark;
|
||||||
|
|
@ -77,6 +81,7 @@ public class LocationTransferController extends BaseController {
|
||||||
.size() != request.getItems().size();
|
.size() != request.getItems().size();
|
||||||
VUtil.trueThrowBusinessError(hasDuplicates).throwMessage("存在重复或是无效的二维码");
|
VUtil.trueThrowBusinessError(hasDuplicates).throwMessage("存在重复或是无效的二维码");
|
||||||
|
|
||||||
|
List<WmsTransferOrders> transferOrders = new ArrayList<>();
|
||||||
List<WmsQrCodeMaster> allQcMasters = new ArrayList<>();
|
List<WmsQrCodeMaster> allQcMasters = new ArrayList<>();
|
||||||
//查找箱码,并将箱码下的物料进行标记
|
//查找箱码,并将箱码下的物料进行标记
|
||||||
List<String> barcodes = request.getItems().stream()
|
List<String> barcodes = request.getItems().stream()
|
||||||
|
|
@ -97,6 +102,25 @@ public class LocationTransferController extends BaseController {
|
||||||
if (CollectionUtil.isNotEmpty(smallQrCodeMasters)) {
|
if (CollectionUtil.isNotEmpty(smallQrCodeMasters)) {
|
||||||
allQcMasters.addAll(smallQrCodeMasters);
|
allQcMasters.addAll(smallQrCodeMasters);
|
||||||
}
|
}
|
||||||
|
parentQrCodeMasters.forEach(p->{
|
||||||
|
transferOrders.add(
|
||||||
|
new WmsTransferOrders()
|
||||||
|
.setBarcodeCode(p.getBarcodeCode())
|
||||||
|
.setTransferNum(p.getQuantity())
|
||||||
|
.setFromBinLocation(p.getBinLocation())
|
||||||
|
.setStorageLocation(p.getStorageLocation())
|
||||||
|
.setMaterialCode(p.getMaterialCode())
|
||||||
|
.setMaterialDescription(p.getMaterialDescription())
|
||||||
|
.setUnit(p.getUnit())
|
||||||
|
.setBatchNo(p.getBatchNo())
|
||||||
|
.setSerialNo(p.getSerialNo())
|
||||||
|
.setFactoryCode(p.getFactoryCode())
|
||||||
|
.setToBinLocation(request.getBinLocation())
|
||||||
|
.setCreateUserId(UserUtil.getUserId())
|
||||||
|
.setCreateUserName(UserUtil.getUserName())
|
||||||
|
.setCreateTime(LocalDateTime.now())
|
||||||
|
);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 处理物料二维码
|
// 处理物料二维码
|
||||||
|
|
@ -110,6 +134,25 @@ public class LocationTransferController extends BaseController {
|
||||||
if (CollectionUtil.isNotEmpty(materialQrCodeMasters)) {
|
if (CollectionUtil.isNotEmpty(materialQrCodeMasters)) {
|
||||||
//添加物料码
|
//添加物料码
|
||||||
allQcMasters.addAll(materialQrCodeMasters);
|
allQcMasters.addAll(materialQrCodeMasters);
|
||||||
|
materialQrCodeMasters.forEach(p->{
|
||||||
|
transferOrders.add(
|
||||||
|
new WmsTransferOrders()
|
||||||
|
.setBarcodeCode(p.getBarcodeCode())
|
||||||
|
.setTransferNum(p.getQuantity())
|
||||||
|
.setFromBinLocation(p.getBinLocation())
|
||||||
|
.setStorageLocation(p.getStorageLocation())
|
||||||
|
.setMaterialCode(p.getMaterialCode())
|
||||||
|
.setMaterialDescription(p.getMaterialDescription())
|
||||||
|
.setUnit(p.getUnit())
|
||||||
|
.setBatchNo(p.getBatchNo())
|
||||||
|
.setSerialNo(p.getSerialNo())
|
||||||
|
.setFactoryCode(p.getFactoryCode())
|
||||||
|
.setToBinLocation(request.getBinLocation())
|
||||||
|
.setCreateUserId(UserUtil.getUserId())
|
||||||
|
.setCreateUserName(UserUtil.getUserName())
|
||||||
|
.setCreateTime(LocalDateTime.now())
|
||||||
|
);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Integer count11 = allQcMasters.stream().filter(
|
Integer count11 = allQcMasters.stream().filter(
|
||||||
|
|
@ -156,7 +199,6 @@ public class LocationTransferController extends BaseController {
|
||||||
// .size() != request.getItems().size();
|
// .size() != request.getItems().size();
|
||||||
// VUtil.trueThrowBusinessError(!hasDuplicates1).throwMessage("存在同时扫箱码和箱中物料码的情况");
|
// VUtil.trueThrowBusinessError(!hasDuplicates1).throwMessage("存在同时扫箱码和箱中物料码的情况");
|
||||||
|
|
||||||
List<WmsTransferOrders> transferOrders = new ArrayList<>();
|
|
||||||
List<InventoryOutDTO> outBoundInventory = new ArrayList<>();
|
List<InventoryOutDTO> outBoundInventory = new ArrayList<>();
|
||||||
List<InventoryInDTO> inBoundInventory = new ArrayList<>();
|
List<InventoryInDTO> inBoundInventory = new ArrayList<>();
|
||||||
for (WmsQrCodeMaster smallQrCodeMaster : allQcMasters) {
|
for (WmsQrCodeMaster smallQrCodeMaster : allQcMasters) {
|
||||||
|
|
@ -166,23 +208,23 @@ public class LocationTransferController extends BaseController {
|
||||||
smallQrCodeMaster.setLastScanByname(UserUtil.getUserName());
|
smallQrCodeMaster.setLastScanByname(UserUtil.getUserName());
|
||||||
// 只有当储位发生变化的时候才会触发这个出库和入库的逻辑
|
// 只有当储位发生变化的时候才会触发这个出库和入库的逻辑
|
||||||
if (!smallQrCodeMaster.getPackagingType().equals((short) 0)) {
|
if (!smallQrCodeMaster.getPackagingType().equals((short) 0)) {
|
||||||
WmsTransferOrders transferOrder = new WmsTransferOrders();
|
// WmsTransferOrders transferOrder = new WmsTransferOrders();
|
||||||
transferOrder.setId(IdUtil.getSnowflakeNextId())
|
// transferOrder.setId(IdUtil.getSnowflakeNextId())
|
||||||
.setBarcodeCode(smallQrCodeMaster.getBarcodeCode())
|
// .setBarcodeCode(smallQrCodeMaster.getBarcodeCode())
|
||||||
.setTransferNum(smallQrCodeMaster.getQuantity())
|
// .setTransferNum(smallQrCodeMaster.getQuantity())
|
||||||
.setFromBinLocation(smallQrCodeMaster.getBinLocation())
|
// .setFromBinLocation(smallQrCodeMaster.getBinLocation())
|
||||||
.setStorageLocation(smallQrCodeMaster.getStorageLocation())
|
// .setStorageLocation(smallQrCodeMaster.getStorageLocation())
|
||||||
.setMaterialCode(smallQrCodeMaster.getMaterialCode())
|
// .setMaterialCode(smallQrCodeMaster.getMaterialCode())
|
||||||
.setMaterialDescription(smallQrCodeMaster.getMaterialDescription())
|
// .setMaterialDescription(smallQrCodeMaster.getMaterialDescription())
|
||||||
.setUnit(smallQrCodeMaster.getUnit())
|
// .setUnit(smallQrCodeMaster.getUnit())
|
||||||
.setBatchNo(smallQrCodeMaster.getBatchNo())
|
// .setBatchNo(smallQrCodeMaster.getBatchNo())
|
||||||
.setSerialNo(smallQrCodeMaster.getSerialNo())
|
// .setSerialNo(smallQrCodeMaster.getSerialNo())
|
||||||
.setFactoryCode(smallQrCodeMaster.getFactoryCode())
|
// .setFactoryCode(smallQrCodeMaster.getFactoryCode())
|
||||||
.setToBinLocation(request.getBinLocation())
|
// .setToBinLocation(request.getBinLocation())
|
||||||
.setCreateUserId(UserUtil.getUserId())
|
// .setCreateUserId(UserUtil.getUserId())
|
||||||
.setCreateUserName(UserUtil.getUserName())
|
// .setCreateUserName(UserUtil.getUserName())
|
||||||
.setCreateTime(LocalDateTime.now());
|
// .setCreateTime(LocalDateTime.now());
|
||||||
transferOrders.add(transferOrder);
|
// transferOrders.add(transferOrder);
|
||||||
|
|
||||||
InventoryOutDTO outItem = new InventoryOutDTO();
|
InventoryOutDTO outItem = new InventoryOutDTO();
|
||||||
outItem.setMaterialNo(smallQrCodeMaster.getMaterialCode())
|
outItem.setMaterialNo(smallQrCodeMaster.getMaterialCode())
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,6 @@ import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import software.amazon.awssdk.services.s3.endpoints.internal.Value;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
@ -202,8 +201,8 @@ public class PurchaseReturnController extends BaseController {
|
||||||
User user = userService.getById(UserUtil.getUserId());
|
User user = userService.getById(UserUtil.getUserId());
|
||||||
VUtil.trueThrowBusinessError(StrUtil.equals(user.getPurchasingGroup(), returnRequest.getPurchaseGroup()))
|
VUtil.trueThrowBusinessError(StrUtil.equals(user.getPurchasingGroup(), returnRequest.getPurchaseGroup()))
|
||||||
.throwMessage("无权限审核此单");
|
.throwMessage("无权限审核此单");
|
||||||
// VUtil.trueThrowBusinessError(returnRequest.getApprovalStatus() == 1)
|
VUtil.trueThrowBusinessError(returnRequest.getApprovalStatus() == 1)
|
||||||
// .throwMessage("此单已审核通过,不可以再此审核");
|
.throwMessage("此单已审核通过,不可以再此审核");
|
||||||
|
|
||||||
if (request.getApprovalStatus().equals(2)) {
|
if (request.getApprovalStatus().equals(2)) {
|
||||||
VUtil.trueThrowBusinessError(returnRequest.getApprovalStatus() == 2)
|
VUtil.trueThrowBusinessError(returnRequest.getApprovalStatus() == 2)
|
||||||
|
|
@ -230,6 +229,7 @@ public class PurchaseReturnController extends BaseController {
|
||||||
itemDTO25.setLgort(item.getStorageLocation());
|
itemDTO25.setLgort(item.getStorageLocation());
|
||||||
itemDTO25.setMatnr(item.getMaterialCode());
|
itemDTO25.setMatnr(item.getMaterialCode());
|
||||||
itemDTO25.setEbelp_old(Integer.parseInt(item.getPoLineNumber()));
|
itemDTO25.setEbelp_old(Integer.parseInt(item.getPoLineNumber()));
|
||||||
|
// itemDTO25.setEbelp_old("0080");
|
||||||
//itemDTO25.setEbelpNew(item.getDeliveryLineNo());
|
//itemDTO25.setEbelpNew(item.getDeliveryLineNo());
|
||||||
itemDTOList25.add(itemDTO25);
|
itemDTOList25.add(itemDTO25);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,4 +36,9 @@ public class TransferOrderSearchQO extends SearchBaseQO {
|
||||||
* 仓库
|
* 仓库
|
||||||
*/
|
*/
|
||||||
private String storageLocation;
|
private String storageLocation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工厂
|
||||||
|
*/
|
||||||
|
private String factoryCode;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,11 +6,8 @@
|
||||||
select
|
select
|
||||||
a.id,a.barcode_code,a.transfer_num,a.create_time,a.create_user_name,a.material_code,
|
a.id,a.barcode_code,a.transfer_num,a.create_time,a.create_user_name,a.material_code,
|
||||||
a.material_description,a.unit,a.batch_no,a.serial_no,a.factory_code,
|
a.material_description,a.unit,a.batch_no,a.serial_no,a.factory_code,
|
||||||
b."name" as from_bin_location,c."name" as to_bin_location,d.name as storage_location
|
a.from_bin_location,a.to_bin_location,a.storage_location
|
||||||
from wms_transfer_orders a
|
from wms_transfer_orders a
|
||||||
left join wms_bin b on a.from_bin_location=b."no"
|
|
||||||
left join wms_bin c on a.to_bin_location=c."no"
|
|
||||||
left join wms_warehouse d on a.storage_location=d."no"
|
|
||||||
<where>
|
<where>
|
||||||
<if test="request.barcodeCode !=null and request.barcodeCode !=''">
|
<if test="request.barcodeCode !=null and request.barcodeCode !=''">
|
||||||
and a.package_code ilike concat('%', #{request.barcodeCode}, '%')
|
and a.package_code ilike concat('%', #{request.barcodeCode}, '%')
|
||||||
|
|
@ -21,6 +18,9 @@
|
||||||
<if test="request.materialCode !=null and request.materialCode !=''">
|
<if test="request.materialCode !=null and request.materialCode !=''">
|
||||||
and a.material_code ilike concat('%', #{request.materialCode}, '%')
|
and a.material_code ilike concat('%', #{request.materialCode}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
<if test="request.factoryCode !=null and request.factoryCode !=''">
|
||||||
|
and a.factory_code = #{request.factoryCode}
|
||||||
|
</if>
|
||||||
<if test="request.fromBinLocation !=null and request.fromBinLocation !=''">
|
<if test="request.fromBinLocation !=null and request.fromBinLocation !=''">
|
||||||
and a.from_bin_location = #{request.fromBinLocation}
|
and a.from_bin_location = #{request.fromBinLocation}
|
||||||
</if>
|
</if>
|
||||||
|
|
@ -37,6 +37,6 @@
|
||||||
and a.create_time <= #{request.endDate}
|
and a.create_time <= #{request.endDate}
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
order by a.create_time DESC
|
order by a.id DESC
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue