| | |
| | | import com.vincent.rsf.server.system.utils.SerialRuleUtils; |
| | | import com.vincent.rsf.server.system.utils.SystemAuthUtils; |
| | | import lombok.Synchronized; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Slf4j |
| | | @Service("taskService") |
| | | public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements TaskService { |
| | | |
| | |
| | | */ |
| | | @Synchronized |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void complateInTask(List<Task> tasks) throws Exception { |
| | | Long loginUserId = SystemAuthUtils.getLoginUserId(); |
| | | for (Task task : tasks) { |
| | | if (task.getTaskType().equals(TaskType.TASK_TYPE_IN.type)) { |
| | | //1.入库 |
| | | complateInstock(task, loginUserId); |
| | | } else if (task.getTaskType().equals(TaskType.TASK_TYPE_PICK_IN.type) || task.getTaskType().equals(TaskType.TASK_TYPE_CHECK_IN.type)) { |
| | | //53.拣料再入库 |
| | | //57.盘点再入库 |
| | | pickComplateInStock(task, loginUserId); |
| | | } else if (task.getTaskType().equals(TaskType.TASK_TYPE_LOC_MOVE.type)) { |
| | | //移库 |
| | | moveInStock(task, loginUserId); |
| | | try { |
| | | if (task.getTaskType().equals(TaskType.TASK_TYPE_IN.type)) { |
| | | //1.入库 |
| | | complateInstock(task, loginUserId); |
| | | } else if (task.getTaskType().equals(TaskType.TASK_TYPE_PICK_IN.type) || task.getTaskType().equals(TaskType.TASK_TYPE_CHECK_IN.type)) { |
| | | //53.拣料再入库 |
| | | //57.盘点再入库 |
| | | pickComplateInStock(task, loginUserId); |
| | | } else if (task.getTaskType().equals(TaskType.TASK_TYPE_LOC_MOVE.type)) { |
| | | //移库 |
| | | moveInStock(task, loginUserId); |
| | | } |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | */ |
| | | @Synchronized |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void completeTask(List<Task> tasks) { |
| | | Long loginUserId = SystemAuthUtils.getLoginUserId(); |
| | | for (Task task : tasks) { |
| | |
| | | try { |
| | | complateOutStock(task, loginUserId); |
| | | } catch (Exception e) { |
| | | throw new CoolException(e.getMessage()); |
| | | log.error(e.getMessage(), e); |
| | | // throw new CoolException(e.getMessage()); |
| | | } |
| | | } |
| | | } |
| | |
| | | if (Objects.isNull(locInfo)) { |
| | | throw new CoolException("获取库位失败!!"); |
| | | } |
| | | task.setTargLoc(locInfo.getLocNo()); |
| | | task.setTargLoc(locInfo.getLocNo()) |
| | | .setOrgSite(task.getTargSite()); |
| | | |
| | | if (!this.updateById(task)) { |
| | | throw new CoolException("任务状态更新失败!!"); |