wms修改
This commit is contained in:
parent
0df488ba0c
commit
f76e078237
|
|
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||
import com.nflg.wms.admin.pojo.dto.*;
|
||||
import com.nflg.wms.admin.pojo.request.UnqualifiedWarehousingRequest;
|
||||
import com.nflg.wms.admin.service.NormalQMControllerService;
|
||||
import com.nflg.wms.admin.service.SapService;
|
||||
import com.nflg.wms.common.constant.BarCodeProcessStage;
|
||||
import com.nflg.wms.common.pojo.ApiResult;
|
||||
import com.nflg.wms.common.pojo.PageData;
|
||||
|
|
@ -74,8 +75,11 @@ public class NormalQMController extends BaseController {
|
|||
@Resource
|
||||
private IWmsQrCodeMasterService qrCodeMasterService;
|
||||
|
||||
private SapService sapService;
|
||||
|
||||
/**
|
||||
* 获取SRM推送过来的质检单信息
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -87,6 +91,7 @@ public class NormalQMController extends BaseController {
|
|||
|
||||
/**
|
||||
* 导出质检单
|
||||
*
|
||||
* @param request 查询条件
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -100,6 +105,7 @@ public class NormalQMController extends BaseController {
|
|||
|
||||
/**
|
||||
* 质检物料上架任务(PDA)
|
||||
*
|
||||
* @param orderNo 送货单号或任务单号
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -112,6 +118,7 @@ public class NormalQMController extends BaseController {
|
|||
|
||||
/**
|
||||
* 质检物料上架物料详情
|
||||
*
|
||||
* @param taskId 任务ID
|
||||
**/
|
||||
@GetMapping("PDA/task/item")
|
||||
|
|
@ -123,6 +130,7 @@ public class NormalQMController extends BaseController {
|
|||
|
||||
/**
|
||||
* 质检物料上架任务确认
|
||||
*
|
||||
* @param request
|
||||
**/
|
||||
@Transactional
|
||||
|
|
@ -368,6 +376,7 @@ public class NormalQMController extends BaseController {
|
|||
|
||||
/**
|
||||
* 无码质检任务上架确认
|
||||
*
|
||||
* @param request 任务ID
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -478,7 +487,16 @@ public class NormalQMController extends BaseController {
|
|||
WmsSrmQualityInspection inspection = wmsSrmQualityInspectionService.getById(request.getId());
|
||||
VUtil.trueThrowBusinessError(Objects.isNull(inspection)).throwMessage("无效的质检单");
|
||||
VUtil.trueThrowBusinessError(!inspection.getInspectionResult().equals("不合格")).throwMessage("该质检单不是不合格单");
|
||||
VUtil.trueThrowBusinessError(inspection.getReceiveQty().compareTo(BigDecimal.ZERO) > 0).throwMessage("该质检单已生成上架任务");
|
||||
VUtil.trueThrowBusinessError(inspection.getReceiveQty().compareTo(BigDecimal.ZERO) > 0).throwMessage("该质检单已完成冲销");
|
||||
List<ZWM3A27ItemDTO> itemDTOs = new ArrayList<>();
|
||||
ZWM3A27ItemDTO itemDTO = new ZWM3A27ItemDTO()
|
||||
.setEbeln(inspection.getPoNum())
|
||||
.setEbeln(inspection.getPoNum()).
|
||||
setEbelp(Integer.valueOf(inspection.getPoLineNumber())).
|
||||
setMenge(inspection.getDeliveryQty()).setMatDoc(inspection.getMaterialDoc105())
|
||||
.setDocYear(inspection.getMaterialDocYear105());
|
||||
itemDTOs.add(itemDTO);
|
||||
sapService.zwm3a27(inspection.getMaterialDoc105(), inspection.getMaterialDocYear105(), itemDTOs);
|
||||
inspection.setReceiveQty(request.getReceiveQty());
|
||||
wmsSrmQualityInspectionService.updateById(inspection);
|
||||
return ApiResult.success();
|
||||
|
|
|
|||
|
|
@ -619,37 +619,26 @@ public class NormalPGIControllerService {
|
|||
}
|
||||
}
|
||||
|
||||
//编码管理
|
||||
// if (CollectionUtil.isNotEmpty(dto.getQrCodes())) {
|
||||
// //同步箱码信息到物料码中
|
||||
// List<WmsQrCodeMaster> parents = dto.getQrCodes()
|
||||
// .stream()
|
||||
// .filter(qrCode -> qrCode.getPackagingType() == 1)
|
||||
// .toList();
|
||||
// if (CollectionUtil.isNotEmpty(parents)) {
|
||||
// List<WmsQrCodeMaster> children = qrCodeMasterService.lambdaQuery()
|
||||
// .in(WmsQrCodeMaster::getParentBarcodeId, parents
|
||||
// .stream()
|
||||
// .map(WmsQrCodeMaster::getId)
|
||||
// .toList()
|
||||
// )
|
||||
// .list();
|
||||
// parents.forEach(p -> {
|
||||
// children.stream()
|
||||
// .filter(c -> c.getParentBarcodeId().equals(p.getId()))
|
||||
// .forEach(c -> {
|
||||
// c.setProcessStage(p.getProcessStage());
|
||||
// c.setLastScanBy(UserUtil.getUserId());
|
||||
// c.setLastScanByname(UserUtil.getUserName());
|
||||
// c.setLastScanTime(LocalDateTime.now());
|
||||
// c.setFactoryCode(p.getFactoryCode());
|
||||
// c.setStorageLocation(p.getStorageLocation());
|
||||
// c.setBinLocation(p.getBinLocation());
|
||||
// c.setReceiptItemId(p.getReceiptItemId());
|
||||
// });
|
||||
// });
|
||||
// dto.getQrCodes().addAll(children);
|
||||
// }
|
||||
// 这里需要同步一个信息,就是把箱码的状态也要改为收货状态,
|
||||
List<Long> parentIds = dto.getQrCodes().stream()
|
||||
.filter(qrCode -> qrCode.getPackagingType() == 0)
|
||||
.map(WmsQrCodeMaster::getId)
|
||||
.distinct()
|
||||
.toList();
|
||||
if (CollectionUtil.isNotEmpty(parentIds)) {
|
||||
// 获取所有的父级物料信息
|
||||
List<WmsQrCodeMaster> parents2 = qrCodeMasterService.lambdaQuery()
|
||||
.in(WmsQrCodeMaster::getId, parentIds)
|
||||
.list();
|
||||
for (WmsQrCodeMaster parent : parents2) {
|
||||
boolean exists = dto.getQrCodes().stream().anyMatch(qrCode ->
|
||||
qrCode.getBarcodeCode().equals(parent.getBarcodeCode()));
|
||||
if (!exists) {
|
||||
dto.getQrCodes().add(parent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
qrCodeMasterService.updateBarCode(dto.getQrCodes());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue