From 0cf1c13ac668cdb689b073c3961592d8ab41316c Mon Sep 17 00:00:00 2001 From: skyouc Date: 星期三, 21 五月 2025 19:35:17 +0800 Subject: [PATCH] 拣料出库任务优化 --- rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/TaskServiceImpl.java | 26 ++++++++++++++++---------- 1 files changed, 16 insertions(+), 10 deletions(-) diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/TaskServiceImpl.java b/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/TaskServiceImpl.java index 7f4972a..10de96f 100644 --- a/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/TaskServiceImpl.java +++ b/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/TaskServiceImpl.java @@ -3,19 +3,20 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.vincent.rsf.framework.common.Cools; +import com.vincent.rsf.server.api.controller.params.TaskInParam; import com.vincent.rsf.server.manager.enums.*; import com.vincent.rsf.framework.common.R; import com.vincent.rsf.framework.exception.CoolException; import com.vincent.rsf.server.api.utils.LocUtils; import com.vincent.rsf.server.manager.controller.params.GenerateTaskParams; import com.vincent.rsf.server.manager.entity.*; -import com.vincent.rsf.server.manager.mapper.TaskItemMapper; import com.vincent.rsf.server.manager.mapper.TaskMapper; import com.vincent.rsf.server.manager.service.*; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.vincent.rsf.server.manager.utils.LocManageUtil; import com.vincent.rsf.server.system.constant.SerialRuleCode; import com.vincent.rsf.server.system.enums.LocStsType; +import com.vincent.rsf.server.manager.enums.LocType; import com.vincent.rsf.server.system.utils.SerialRuleUtils; import lombok.Synchronized; import org.apache.commons.lang3.StringUtils; @@ -398,7 +399,6 @@ complateOutStock(task); } else if (task.getTaskType().equals(TaskType.TASK_TYPE_PICK_AGAIN_IN.type)) { //鎷f枡鍑哄簱 - // pickTask(task.getId()); //绉婚櫎鍘熷搴撳瓨 complateOutStock(task); @@ -448,7 +448,7 @@ throw new CoolException("鏁版嵁閿欒锛屼綔涓氫腑搴撳瓨鏁版嵁涓㈠け锛侊紒"); } if (locWorking.getAnfme().compareTo(taskItem.getAnfme()) >= 0) { - locWorking.setAnfme(Math.round((locWorking.getAnfme() - taskItem.getAnfme()) * 10000) / 10000.0); + locWorking.setAnfme(Math.round((locWorking.getAnfme() - taskItem.getAnfme()) * 10000) / 10000.0); } else { continue; } @@ -458,13 +458,13 @@ items.add(locItem); } - if (!locItemService.saveBatch(items)) { - throw new CoolException("浣滀笟搴撳瓨鍥炲啓澶辫触锛侊紒"); - } + if (!locItemService.saveBatch(items)) { + throw new CoolException("浣滀笟搴撳瓨鍥炲啓澶辫触锛侊紒"); + } - if (!locItemWorkingService.remove(new LambdaQueryWrapper<LocItemWorking>().eq(LocItemWorking::getTaskId, task.getId()))) { - throw new CoolException("浣滀笟涓簱瀛樺垹闄ゅけ璐ワ紒锛�"); - } + if (!locItemWorkingService.remove(new LambdaQueryWrapper<LocItemWorking>().eq(LocItemWorking::getTaskId, task.getId()))) { + throw new CoolException("浣滀笟涓簱瀛樺垹闄ゅけ璐ワ紒锛�"); + } } @@ -570,11 +570,17 @@ .setTaskType(TaskType.TASK_TYPE_PICK_IN.type) .setBarcode(task.getBarcode()) .setTaskStatus(TaskStsType.GENERATE_IN.id); + //TODO 鍚庣画闇�鏍规嵁浠撳簱绫诲瀷鏌ユ壘鏂板簱浣嶏紝鍘熷搴撲綅缃┖闂茬姸鎬� { + // TaskInParam param = new TaskInParam(); + // param.setSourceStaNo(Integer.parseInt(task.getOrgSite())) + // .setIoType(Integer.parseInt(TaskType.TASK_TYPE_IN.type + "")); + //// .setLocType1(LocType.LOC_TYPE_LOW.type);} + if (!this.updateById(task)) { throw new CoolException("浠诲姟鐘舵�佹洿鏂板け璐ワ紒锛�"); } - //TODO 鍚庣画闇�鏍规嵁浠撳簱绫诲瀷鏌ユ壘鏂板簱浣嶏紝鍘熷搴撲綅缃┖闂茬姸鎬� + List<LocItemWorking> workings = new ArrayList<>(); for (LocItem item : locItems) { LocItemWorking working = new LocItemWorking(); -- Gitblit v1.9.1