parent
c8722c267a
commit
afb0b214a9
|
|
@ -140,7 +140,7 @@ public class ComponentOutboundController {
|
|||
List<WmsComponentOutboundItem> outboundItems = new ArrayList<>();
|
||||
List<WmsComponentOutboundScanCodes> outboundScanCodes = new ArrayList<>();
|
||||
List<InventoryDTO> inventories = new ArrayList<>();
|
||||
List<String> codeIds = new ArrayList<>();
|
||||
//List<String> codeIds = new ArrayList<>();
|
||||
ZWM3A20DTO zwm3a20DTO = new ZWM3A20DTO()
|
||||
.setItSernrPatch(new ArrayList<>())
|
||||
.setItem(new ArrayList<>())
|
||||
|
|
@ -153,19 +153,37 @@ public class ComponentOutboundController {
|
|||
if (Objects.isNull(outboundItem))
|
||||
continue;
|
||||
outboundItems.add(outboundItem);
|
||||
//处理条码,先根据批次号、序列号进行一次数量汇总
|
||||
|
||||
if (CollectionUtil.isNotEmpty(item.getScanCodes())) {
|
||||
List<ScanCodeQO> scanCodesGroup=new ArrayList<>();
|
||||
for (ScanCodeQO code : item.getScanCodes())
|
||||
{
|
||||
ScanCodeQO codeItem=scanCodesGroup.stream().filter(c->c.getBatchNumber().equals(code.getBatchNumber())
|
||||
&& c.getSerialNumber().equals(code.getSerialNumber())
|
||||
).findFirst().orElse(null);
|
||||
|
||||
if(Objects.isNull(codeItem))
|
||||
{
|
||||
scanCodesGroup.add(code);
|
||||
}
|
||||
else
|
||||
{
|
||||
codeItem.setCodeNum(codeItem.getCodeNum().add(code.getCodeNum()));
|
||||
}
|
||||
}
|
||||
|
||||
//判断扫码数量是否等于了出货数量
|
||||
BigDecimal qty = item.getScanCodes().stream().map(ScanCodeQO::getCodeNum).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
BigDecimal qty = scanCodesGroup.stream().map(ScanCodeQO::getCodeNum).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
VUtil.trueThrowBusinessError(outboundItem.getOutQty().equals(qty)).throwMessage("物料[" + outboundItem.getIdnrk() + "]的出库数量[" + qty + "]不等于装箱数量[" + outboundItem.getOutQty() + "]");
|
||||
|
||||
//判断是否有多个批次号
|
||||
List<String> batchNumbers = item.getScanCodes().stream().map(ScanCodeQO::getBatchNumber).distinct().toList();
|
||||
List<String> batchNumbers = scanCodesGroup.stream().map(ScanCodeQO::getBatchNumber).distinct().toList();
|
||||
if (batchNumbers.size() == 1) {
|
||||
// 只需要组装一个批次号,剩下的放入到批次拆分信息中
|
||||
set3A20Item(batchNumbers.get(0), outboundItem, outboundItem.getOutQty(), zwm3a20DTO);
|
||||
//判断是否有多个序列号
|
||||
List<String> serialNumbers = item.getScanCodes().stream()
|
||||
List<String> serialNumbers = scanCodesGroup.stream()
|
||||
.map(ScanCodeQO::getSerialNumber)
|
||||
.filter(StrUtil::isNotBlank)
|
||||
.distinct()
|
||||
|
|
@ -186,16 +204,16 @@ public class ComponentOutboundController {
|
|||
//首先要组装物料详情信息,此时物料详情的批次号和数量是无效的,可以忽略不计
|
||||
set3A20Item(batchNumbers.get(0), outboundItem, outboundItem.getOutQty(), zwm3a20DTO);
|
||||
//接着处理序号和批次的关系列表
|
||||
for (ScanCodeQO code : item.getScanCodes()) {
|
||||
for (ScanCodeQO code : scanCodesGroup) {
|
||||
// 批次和序号的组装
|
||||
setItLipsItem(code, zwm3a20DTO, outboundItem);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (ScanCodeQO code : item.getScanCodes()) {
|
||||
VUtil.trueThrowBusinessError(codeIds.contains(code.getCodeId())).throwMessage("物料[" + outboundItem.getIdnrk() + "]的条码[" + code.getCodeId() + "]被重复使用");
|
||||
codeIds.add(code.getCodeId());
|
||||
for (ScanCodeQO code : scanCodesGroup) {
|
||||
// VUtil.trueThrowBusinessError(codeIds.contains(code.getCodeId())).throwMessage("物料[" + outboundItem.getIdnrk() + "]的条码[" + code.getCodeId() + "]被重复使用");
|
||||
// codeIds.add(code.getCodeId());
|
||||
// 组装条码信息
|
||||
WmsComponentOutboundScanCodes scanCodes = new WmsComponentOutboundScanCodes();
|
||||
scanCodes.setOutboundItemId(outboundItem.getId())
|
||||
|
|
@ -217,8 +235,8 @@ public class ComponentOutboundController {
|
|||
}
|
||||
}
|
||||
// 判断下当前的条码是否有已经使用过得
|
||||
List<WmsComponentOutboundScanCodes> existScanCodes = wmsComponentOutboundScanCodesService.findByCodeIdIn(codeIds);
|
||||
VUtil.trueThrowBusinessError(CollectionUtil.isNotEmpty(existScanCodes)).throwMessage("存在已经使用过的条码");
|
||||
// List<WmsComponentOutboundScanCodes> existScanCodes = wmsComponentOutboundScanCodesService.findByCodeIdIn(codeIds);
|
||||
// VUtil.trueThrowBusinessError(CollectionUtil.isNotEmpty(existScanCodes)).throwMessage("存在已经使用过的条码");
|
||||
componentOutboundControllerService.confirmPda(outbound, outboundItems, outboundScanCodes, zwm3a20DTO, inventories);
|
||||
return ApiResult.success();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -131,6 +131,7 @@ public class NormalQMController extends BaseController {
|
|||
QCReceiveDTO qcReceiveDTO = new QCReceiveDTO()
|
||||
.setUnqualifiedInventories(new ArrayList<>())
|
||||
.setQcIdList(new ArrayList<>())
|
||||
.setReceiveIds(new ArrayList<>())
|
||||
.setWaitModifyItems(new ArrayList<>())
|
||||
.setStorageLocationDTOS(new ArrayList<>())
|
||||
.setQualifiednventories(new ArrayList<>());
|
||||
|
|
@ -146,6 +147,9 @@ public class NormalQMController extends BaseController {
|
|||
if (Objects.isNull(wmsQcReceiveItem)) {
|
||||
continue;
|
||||
}
|
||||
if (!qcReceiveDTO.getReceiveIds().stream().anyMatch(id -> id.equals(wmsQcReceiveItem.getReceiveId()))) {
|
||||
qcReceiveDTO.getReceiveIds().add(wmsQcReceiveItem.getReceiveId());
|
||||
}
|
||||
|
||||
qcReceiveDTO.setZwm3a18DTO(new ZWM3A18DTO()
|
||||
.setEbeln(item.getPoNum())
|
||||
|
|
@ -262,12 +266,21 @@ public class NormalQMController extends BaseController {
|
|||
@PostMapping("unscan/task/confirm")
|
||||
@ApiMark(moduleName = "质检物料管理", apiName = "无码质检任务上架确认")
|
||||
public ApiResult<Void> confirmNoScan(@Valid @RequestBody ReceiveQO request) {
|
||||
WmsQcReceive qcReceive = wmsQcReceiveService.getById( request.getId());
|
||||
List<WmsQcReceive> qcReceives = wmsQcReceiveService
|
||||
.lambdaQuery()
|
||||
.in(WmsQcReceive::getId, request.getIds())
|
||||
.ne(WmsQcReceive::getIsCompleted, 2)
|
||||
.eq(WmsQcReceive::getIsCheck, true)
|
||||
.list();
|
||||
|
||||
VUtil.trueThrowBusinessError(Objects.isNull(qcReceive)).throwMessage("无此任务");
|
||||
VUtil.trueThrowBusinessError(!qcReceive.getSourceType().equals(1)).throwMessage("不属于无码收货的采购单");
|
||||
|
||||
//.getById(request.getId());
|
||||
|
||||
VUtil.trueThrowBusinessError(CollectionUtil.isEmpty(qcReceives)).throwMessage("无有效的上架任务");
|
||||
//VUtil.trueThrowBusinessError(!qcReceive.getSourceType().equals(1)).throwMessage("不属于无码收货的采购单");
|
||||
//根据ID获取到任务单
|
||||
List<QCReceiveTaskConfirmQO> taskConfirmQOS = new ArrayList<>();
|
||||
for (WmsQcReceive qcReceive : qcReceives) {
|
||||
List<QCTaskItemVO> tasks = normalQMControllerService.getTaskItem(qcReceive.getId());
|
||||
if (CollectionUtil.isNotEmpty(tasks)) {
|
||||
for (QCTaskItemVO item : tasks) {
|
||||
|
|
@ -286,9 +299,9 @@ public class NormalQMController extends BaseController {
|
|||
taskConfirmQOS.add(taskConfirmQO);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
VUtil.trueThrowBusinessError(CollectionUtil.isEmpty(taskConfirmQOS)).throwMessage("无效的上架任务");
|
||||
|
||||
return confirm(taskConfirmQOS);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,4 +32,9 @@ public class QCReceiveDTO {
|
|||
* 质检单ID,更改入库标记
|
||||
*/
|
||||
private List<Long> QcIdList;
|
||||
|
||||
/**
|
||||
* 入库单ID,更改入库标记
|
||||
*/
|
||||
private List<Long> receiveIds;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,22 +104,24 @@ public class NormalQMControllerService {
|
|||
qcReceiveDTO.getWaitModifyItems().forEach(item -> {
|
||||
wmsQcReceiveItemService.updateInQty(item.getId(), item.getInQty(), item.getUnqualifiedQty(), item.getQualifiedQty());
|
||||
});
|
||||
// 修改表头的状态
|
||||
Long id = qcReceiveDTO.getWaitModifyItems().get(0).getId();
|
||||
WmsQcReceiveItem wmsQcReceiveItem = wmsQcReceiveItemService.getById(id);
|
||||
Long receiveId = wmsQcReceiveItem.getReceiveId();
|
||||
List<Long> ids = wmsQcReceiveItemService.getUnReceivedItems(receiveId);
|
||||
|
||||
}
|
||||
// 修改表头的状态
|
||||
if (CollectionUtil.isNotEmpty(qcReceiveDTO.getReceiveIds())) {
|
||||
for (Long receiveId : qcReceiveDTO.getReceiveIds()) {
|
||||
List<Long> ids = wmsQcReceiveItemService.getUnReceivedItems(receiveId);
|
||||
//判断是否全部完成
|
||||
if (CollectionUtil.isEmpty(ids)) {
|
||||
iWmsQcReceiveService.lambdaUpdate()
|
||||
.eq(WmsQcReceive::getId, receiveId)
|
||||
.set(WmsQcReceive::getIsCompleted, 2)
|
||||
.update();
|
||||
} else {
|
||||
iWmsQcReceiveService.lambdaUpdate()
|
||||
.eq(WmsQcReceive::getId, receiveId)
|
||||
.set(WmsQcReceive::getIsCompleted, 1)
|
||||
.update();
|
||||
if (CollectionUtil.isEmpty(ids)) {
|
||||
iWmsQcReceiveService.lambdaUpdate()
|
||||
.eq(WmsQcReceive::getId, receiveId)
|
||||
.set(WmsQcReceive::getIsCompleted, 2)
|
||||
.update();
|
||||
} else {
|
||||
iWmsQcReceiveService.lambdaUpdate()
|
||||
.eq(WmsQcReceive::getId, receiveId)
|
||||
.set(WmsQcReceive::getIsCompleted, 1)
|
||||
.update();
|
||||
}
|
||||
}
|
||||
}
|
||||
// 上传SAP
|
||||
|
|
|
|||
|
|
@ -3,8 +3,10 @@ package com.nflg.wms.common.pojo.qo;
|
|||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class ReceiveQO {
|
||||
@NotNull
|
||||
private Long id;
|
||||
private List<Long> ids;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue