添加任务完成时插入数据库库存的日志
This commit is contained in:
parent
eb2459bc91
commit
b82d89d214
|
|
@ -9,11 +9,13 @@ import com.ruoyi.common.utils.http.HttpUtils;
|
||||||
import com.ruoyi.common.utils.uuid.IdUtils;
|
import com.ruoyi.common.utils.uuid.IdUtils;
|
||||||
import com.ruoyi.system.service.ISysConfigService;
|
import com.ruoyi.system.service.ISysConfigService;
|
||||||
import io.netty.util.internal.ObjectUtil;
|
import io.netty.util.internal.ObjectUtil;
|
||||||
|
import org.apache.ibatis.javassist.compiler.ast.Variable;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
@ -161,7 +163,7 @@ public class TaskExecutor {
|
||||||
// return wcsStackerTaskRequest;
|
// return wcsStackerTaskRequest;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
@Transactional
|
||||||
public void completeWmsTask() {
|
public void completeWmsTask() {
|
||||||
// 查找 Wms 任务
|
// 查找 Wms 任务
|
||||||
AppTask appTask = new AppTask();
|
AppTask appTask = new AppTask();
|
||||||
|
|
@ -170,7 +172,7 @@ public class TaskExecutor {
|
||||||
if (appTasks == null || appTasks.isEmpty()) {
|
if (appTasks == null || appTasks.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
appTasks.forEach(task -> {
|
for(AppTask task : appTasks) {
|
||||||
if(task.getTaskType().compareTo(1) == 0) {
|
if(task.getTaskType().compareTo(1) == 0) {
|
||||||
// 从码盘表内拉出数据
|
// 从码盘表内拉出数据
|
||||||
AppPendingStorage appPendingStorage = new AppPendingStorage();
|
AppPendingStorage appPendingStorage = new AppPendingStorage();
|
||||||
|
|
@ -190,7 +192,7 @@ public class TaskExecutor {
|
||||||
appTaskService.deleteAppTaskByTaskId(task.getTaskId()); // 删除旧数据
|
appTaskService.deleteAppTaskByTaskId(task.getTaskId()); // 删除旧数据
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
appPendingStorages.forEach(pendingStorage -> {
|
for(AppPendingStorage pendingStorage : appPendingStorages) {
|
||||||
// 插入库存
|
// 插入库存
|
||||||
AppStock appStock = new AppStock();
|
AppStock appStock = new AppStock();
|
||||||
appStock.setStockId(pendingStorage.getListId());
|
appStock.setStockId(pendingStorage.getListId());
|
||||||
|
|
@ -212,9 +214,10 @@ public class TaskExecutor {
|
||||||
appStock.setCreateUser(pendingStorage.getCreatePerson());
|
appStock.setCreateUser(pendingStorage.getCreatePerson());
|
||||||
appStock.setUpdateBy(pendingStorage.getCreatePerson());
|
appStock.setUpdateBy(pendingStorage.getCreatePerson());
|
||||||
appStock.setRemark("");
|
appStock.setRemark("");
|
||||||
appStockService.insertAppStock(appStock);
|
int insertStockResult = appStockService.insertAppStock(appStock);
|
||||||
|
logger.info("插入库存:{},结果:{}", JSON.toJSONString(appStock), insertStockResult);
|
||||||
appPendingStorageService.deleteAppPendingStorageByRecordId(pendingStorage.getRecordId()); // 删除码盘数据
|
appPendingStorageService.deleteAppPendingStorageByRecordId(pendingStorage.getRecordId()); // 删除码盘数据
|
||||||
});
|
}
|
||||||
AppTask updateRemark = new AppTask();
|
AppTask updateRemark = new AppTask();
|
||||||
updateRemark.setTaskId(task.getTaskId());
|
updateRemark.setTaskId(task.getTaskId());
|
||||||
updateRemark.setRemark("已插入库存");
|
updateRemark.setRemark("已插入库存");
|
||||||
|
|
@ -240,6 +243,6 @@ public class TaskExecutor {
|
||||||
appTaskService.deleteAppTaskByTaskId(task.getTaskId()); // 删除旧数据
|
appTaskService.deleteAppTaskByTaskId(task.getTaskId()); // 删除旧数据
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<select id="selectAppPendingStorageList" parameterType="AppPendingStorage" resultMap="AppPendingStorageResult">
|
<select id="selectAppPendingStorageList" parameterType="AppPendingStorage" resultMap="AppPendingStorageResult">
|
||||||
<include refid="selectAppPendingStorageVo"/>
|
<include refid="selectAppPendingStorageVo"/>
|
||||||
<where>
|
<where>
|
||||||
|
<if test="recordId != null and recordId != ''"> and record_id = #{recordId}</if>
|
||||||
<if test="listId != null and listId != ''"> and list_id = #{listId}</if>
|
<if test="listId != null and listId != ''"> and list_id = #{listId}</if>
|
||||||
<if test="orderType != null "> and order_type = #{orderType}</if>
|
<if test="orderType != null "> and order_type = #{orderType}</if>
|
||||||
<if test="customerId != null and customerId != ''"> and customer_id = #{customerId}</if>
|
<if test="customerId != null and customerId != ''"> and customer_id = #{customerId}</if>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user