chen.lin
19 小时以前 c81fc5e2a4f4153be2bb8602ed14a0743e6ecd29
rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/PdaCheckOrderServiceImpl.java
@@ -28,6 +28,7 @@
import com.vincent.rsf.server.system.service.impl.FieldsItemServiceImpl;
import com.vincent.rsf.server.system.service.impl.UserServiceImpl;
import com.vincent.rsf.server.system.utils.SerialRuleUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -87,7 +88,7 @@
        lambdaQueryWrapper.eq(Task::getBarcode, barcode);
        Task task = taskService.getOne(lambdaQueryWrapper);
        if (null == task) {
            throw new CoolException("未找到容器号对应任务");
            throw new CoolException("未找到料箱码对应任务");
        }
        if (!task.getTaskStatus().equals(TaskStsType.AWAIT.id)) {
            return R.error("任务状态不是等待确认");
@@ -115,7 +116,7 @@
        }
        Task task = taskService.getOne(new LambdaQueryWrapper<Task>().eq(Task::getBarcode, params.getContainer()));
        if (null == task) {
            throw new CoolException("数据错误,未找到容器码对应盘点任务");
            throw new CoolException("数据错误,未找到料箱码对应盘点任务");
        }
        for (CheckDiffItem ckDiffItem : params.getCheckDiffItems()) {
            CheckDiffItem diffItem = new CheckDiffItem();
@@ -234,14 +235,14 @@
        lambdaQueryWrapper.eq(Task::getBarcode, barcode);
        Task task = taskService.getOne(lambdaQueryWrapper);
        if (null == task) {
            throw new CoolException("未找到容器号对应任务");
            throw new CoolException("未找到料箱码对应任务");
        }
        if (!task.getTaskStatus().equals(TaskStsType.AWAIT.id)) {
            return R.error("任务状态不是等待确认");
        }
        List<TaskItem> taskItems = taskItemService.list(new LambdaQueryWrapper<TaskItem>().eq(TaskItem::getTaskId, task.getId()));
        if (Cools.isEmpty(taskItems)) {
            throw new CoolException("未找到该容器码对应的任务明细");
            throw new CoolException("未找到该料箱码对应的任务明细");
        }
        String sourceCode = taskItems.stream().findFirst().map(TaskItem::getSourceCode).orElse(null);
        CheckDiff checkDiff = checkDiffService.getOne(new LambdaQueryWrapper<CheckDiff>().eq(CheckDiff::getOrderCode, sourceCode));
@@ -263,7 +264,7 @@
    /**
     * @author Ryan
     * @date 2025/11/5
     * @description: 希日无单据临时盘点
     * @description: 无单据临时盘点
     * @version 1.0
     */
    @Override
@@ -275,7 +276,7 @@
        lambdaQueryWrapper.eq(Task::getBarcode, barcode);
        Task task = taskService.getOne(lambdaQueryWrapper);
        if (null == task) {
            throw new CoolException("未找到容器号对应任务");
            throw new CoolException("未找到料箱码对应任务");
        }
        // 允许WAVE_SEED(199,等待确认/盘点中)和AWAIT(196,等待确认)两种状态
        if (!task.getTaskStatus().equals(TaskStsType.WAVE_SEED.id) 
@@ -284,7 +285,7 @@
        }
        List<TaskItem> taskItems = taskItemService.list(new LambdaQueryWrapper<TaskItem>().eq(TaskItem::getTaskId, task.getId()));
        if (Cools.isEmpty(taskItems)) {
            throw new CoolException("未找到该容器码对应的任务明细");
            throw new CoolException("未找到该料箱码对应的任务明细");
        }
        taskItems.forEach(taskItem -> {
            if (!Objects.isNull(taskItem.getFieldsIndex())) {
@@ -309,7 +310,7 @@
            throw new CoolException("参数不能为空!!");
        }
        if (Objects.isNull(map.get("barcode"))) {
            throw new CoolException("托盘码不能为空!!");
            throw new CoolException("料箱码不能为空!!");
        }
        if (Objects.isNull(map.get("matnrs"))) {
            throw new CoolException("新增物料不能为空!!");
@@ -319,7 +320,7 @@
        lambdaQueryWrapper.eq(Task::getBarcode, barcode);
        Task task = taskService.getOne(lambdaQueryWrapper);
        if (null == task) {
            throw new CoolException("未找到容器号对应任务");
            throw new CoolException("未找到料箱码对应任务");
        }
        if (!task.getTaskStatus().equals(TaskStsType.AWAIT.id)) {
            return R.error("任务状态不是等待确认");
@@ -350,11 +351,17 @@
                    .setMaktx(matnr.getName())
                    .setAnfme(item.getCheckQty());
            FieldsItem fieldsItem = fieldsItemService.getOne(new LambdaQueryWrapper<FieldsItem>().eq(FieldsItem::getValue, item.getFieldsIndex()).last("limit 1"));
            if (Objects.isNull(fieldsItem)) {
                throw new CoolException("当前票号不存在库存中,请拿出后重新入库!!");
            // 票号暂不使用,不校验票号是否存在
            FieldsItem fieldsItem = null;
            if (StringUtils.isNotBlank(item.getFieldsIndex())) {
                fieldsItem = fieldsItemService.getOne(new LambdaQueryWrapper<FieldsItem>().eq(FieldsItem::getValue, item.getFieldsIndex()).last("limit 1"));
                // if (Objects.isNull(fieldsItem)) {
                //     throw new CoolException("当前票号不存在库存中,请拿出后重新入库!!");
                // }
            }
            taskItem.setFieldsIndex(fieldsItem.getUuid());
            if (fieldsItem != null) {
                taskItem.setFieldsIndex(fieldsItem.getUuid());
            }
            taskItems.add(taskItem);
        });
@@ -380,7 +387,7 @@
            throw new CoolException("参数不能为空!!");
        }
        if (Objects.isNull(map.get("barcode"))) {
            throw new CoolException("托盘码不能为空!!");
            throw new CoolException("料箱码不能为空!!");
        }
        if (Objects.isNull(map.get("items"))) {
            throw new CoolException("新增物料不能为空!!");
@@ -390,7 +397,7 @@
        lambdaQueryWrapper.eq(Task::getBarcode, barcode);
        Task task = taskService.getOne(lambdaQueryWrapper);
        if (null == task) {
            throw new CoolException("未找到容器号对应任务");
            throw new CoolException("未找到料箱码对应任务");
        }
        // 允许WAVE_SEED(199,等待确认/盘点中)和AWAIT(196,等待确认)两种状态
        if (!task.getTaskStatus().equals(TaskStsType.WAVE_SEED.id) 
@@ -446,7 +453,7 @@
        ReportParams params = new ReportParams();
        List<TaskItem> taskItems = taskItemService.list(new LambdaQueryWrapper<TaskItem>().eq(TaskItem::getTaskId, task.getId()));
        if (Objects.isNull(taskItems) || taskItems.isEmpty()) {
            throw new CoolException("托盘明细为空!1");
            throw new CoolException("料箱明细为空!1");
        }
        List<ReportDataParam> reportDataParams = new ArrayList<>();
        taskItems.forEach(taskItem -> {
@@ -463,7 +470,7 @@
                    .setPDQty(taskItem.getAnfme())
                    .setEditUser(nickName)
                    .setEditDate(taskItem.getUpdateTime())
                    .setGoodsNO(fields.get("crushNo"))
                    // .setGoodsNO(fields.get("crushNo"))  // 票号暂不使用
                    .setIsBad(0 + "")
                    .setMemoDtl(taskItem.getMemo());