|
@@ -2,7 +2,9 @@ package com.imcs.admin.business.service.impl;
|
|
|
|
|
|
import cn.hutool.core.date.DateTime;
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import com.imcs.admin.business.constants.Status;
|
|
@@ -12,6 +14,9 @@ import com.imcs.admin.common.constants.Constants;
|
|
|
import com.imcs.admin.entity.*;
|
|
|
import com.imcs.admin.entity.assemble.PolicyInputResult;
|
|
|
import com.imcs.admin.entity.query.PolicyInputQuery;
|
|
|
+import com.imcs.admin.vo.RequestData;
|
|
|
+import lombok.extern.log4j.Log4j;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
@@ -28,6 +33,7 @@ import java.util.stream.Collectors;
|
|
|
* @since 2024-05-27 13:04:45
|
|
|
*/
|
|
|
@Service("wInventoryTransactionTaskService")
|
|
|
+@Slf4j
|
|
|
public class WInventoryTransactionTaskServiceImpl extends BaseServiceImpl implements WInventoryTransactionTaskService {
|
|
|
|
|
|
/**
|
|
@@ -159,5 +165,59 @@ public class WInventoryTransactionTaskServiceImpl extends BaseServiceImpl implem
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ @Transactional
|
|
|
+ public void callback(RequestData requestData) {
|
|
|
+ LambdaQueryWrapper<WInventoryTransactionChildTask> wrapper= Wrappers.lambdaQuery(WInventoryTransactionChildTask.class).eq(WInventoryTransactionChildTask::getChildTaskCode,requestData.getTaskNodeId());
|
|
|
+ WInventoryTransactionChildTask wInventoryTransactionChildTask = childTaskDao.selectOne(wrapper);
|
|
|
+ String vectorCode = wInventoryTransactionChildTask.getVectorCode();
|
|
|
+ Integer childTaskType = wInventoryTransactionChildTask.getChildTaskType();
|
|
|
+ if("Get".equals(requestData.getGetOrSend())){
|
|
|
+ wInventoryTransactionChildTask.setGetResult(1);
|
|
|
+ //取完成 表示任务执行中
|
|
|
+ wInventoryTransactionChildTask.setStatus(1);
|
|
|
+ }else if("Send".equals(requestData.getGetOrSend())){
|
|
|
+ wInventoryTransactionChildTask.setSendResult(1);
|
|
|
+ //放完成 表示任务已完成
|
|
|
+ wInventoryTransactionChildTask.setStatus(2);
|
|
|
+
|
|
|
+ //出库
|
|
|
+ if(childTaskType == 1){
|
|
|
+
|
|
|
+ //释放大小库位
|
|
|
+ String startPosition = wInventoryTransactionChildTask.getStartPosition();
|
|
|
+ WStorageLocationManagement storageLocation = storageLocationDao.getStorageLocation(startPosition);
|
|
|
+ updateStorageStatusFree(Status.UNUSED.getCode(),storageLocation.getLocationCode());
|
|
|
+ }else if(childTaskType == 2){
|
|
|
+
|
|
|
+ }else if(childTaskType == 3){
|
|
|
+
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ log.error("取放类型不能为空!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ //修改子任务状态和取 放动作状态
|
|
|
+ childTaskDao.updateById(wInventoryTransactionChildTask);
|
|
|
+
|
|
|
+ LambdaQueryWrapper<WInventoryTransactionChildTask> wr= Wrappers.lambdaQuery(WInventoryTransactionChildTask.class)
|
|
|
+ .eq(WInventoryTransactionChildTask::getWInventoryTransactionTaskId,wInventoryTransactionChildTask.getWInventoryTransactionTaskId())
|
|
|
+ .eq(WInventoryTransactionChildTask::getStatus,Status.COMPLETED.getCode());
|
|
|
+ Long taskCompleteCount = childTaskDao.selectCount(wr);
|
|
|
+
|
|
|
+ //修改主任务状态
|
|
|
+ WInventoryTransactionTask wInventoryTransactionTask=new WInventoryTransactionTask();
|
|
|
+ wInventoryTransactionTask.setId(wInventoryTransactionChildTask.getWInventoryTransactionTaskId());
|
|
|
+ if(taskCompleteCount == 0){
|
|
|
+ wInventoryTransactionTask.setStatus(Status.COMPLETED.getCode());
|
|
|
+
|
|
|
+
|
|
|
+ }else {
|
|
|
+ wInventoryTransactionTask.setStatus(Status.IN_PROGRESS_TASK.getCode());
|
|
|
+ }
|
|
|
+ taskDao.update(wInventoryTransactionTask);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|