skyouc
2 天以前 1068673dcf41cdf7a7a06a26aaeb5652d734eb2d
rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/TaskServiceImpl.java
@@ -737,10 +737,10 @@
            LocItemWorking locWorking = locItemWorkingService.getOne(new LambdaQueryWrapper<LocItemWorking>()
                    .eq(LocItemWorking::getTaskId, taskItem.getTaskId())
                    .eq(LocItemWorking::getFieldsIndex, taskItem.getFieldsIndex())
                    .eq(StringUtils.isNotBlank(taskItem.getBatch()), LocItemWorking::getBatch, taskItem.getBatch())
                    .eq(StringUtils.isNotEmpty(taskItem.getBatch()), LocItemWorking::getBatch, taskItem.getBatch())
                    .eq(LocItemWorking::getMatnrId, taskItem.getMatnrId()));
            if (Objects.isNull(locWorking)) {
                throw new CoolException("数据错误,作业中库存数据丢失!!");
               continue;
            }
            if (task.getTaskType().equals(TaskType.TASK_TYPE_CHECK_IN.type)) {
                locWorking.setAnfme(taskItem.getAnfme());
@@ -1048,12 +1048,12 @@
        tempLocs.forEach(working -> {
            taskItems.forEach(taskItem -> {
                if (taskItem.getId().equals(working.getMatnrId()) && taskItem.getFieldsIndex().equals(working.getFieldsIndex())) {
                if (taskItem.getFieldsIndex().equals(working.getFieldsIndex())) {
                    Double minQty = taskItem.getAnfme();
                    if (!task.getTaskType().equals(TaskType.TASK_TYPE_CHECK_IN.type)) {
                        minQty = Math.round((working.getAnfme() - taskItem.getAnfme()) * 100) / 100.0;
                        minQty = Math.round((working.getAnfme() - taskItem.getQty()) * 100) / 100.0;
                    }
                    if (minQty.compareTo(0.0) > 0) {
                    if (minQty.compareTo(0.0) >= 0) {
                        taskItem.setAnfme(minQty);
                        if (!taskItemService.updateById(taskItem)) {
                            throw new CoolException("任务明细修改失败!!");
@@ -1104,6 +1104,7 @@
                LocItemWorking itemWorking = new LocItemWorking();
                BeanUtils.copyProperties(taskItem, itemWorking);
                itemWorking.setTaskId(task.getId())
                        .setQty(0.0)
                        .setLocId(loc1.getId())
                        .setLocCode(loc1.getCode());
                workings.add(itemWorking);