添加出库或移库完成后释放货位
This commit is contained in:
parent
18846446cb
commit
05652eb896
|
|
@ -2,6 +2,7 @@ package com.ruoyi.quartz.task;
|
|||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.ruoyi.app.domain.*;
|
||||
import com.ruoyi.app.mapper.AppLocationMapper;
|
||||
import com.ruoyi.quartz.domain.app.*;
|
||||
import com.ruoyi.app.service.*;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
|
|
@ -43,6 +44,8 @@ public class TaskExecutor {
|
|||
put(2, 2);// 出库
|
||||
put(3, 3);// 移库
|
||||
}};
|
||||
@Autowired
|
||||
private AppLocationMapper appLocationMapper;
|
||||
|
||||
/**
|
||||
* 解析wms任务
|
||||
|
|
@ -307,6 +310,19 @@ public class TaskExecutor {
|
|||
PmsCommonRes pmsCommonRes = JSON.parseObject(HttpUtils.sendPost(url, JSON.toJSONString(recordList)), PmsCommonRes.class);
|
||||
logger.info("pms出库反馈请求信息:{},结果:{}", JSON.toJSONString(recordList), JSON.toJSONString(pmsCommonRes));
|
||||
}
|
||||
AppStock appStockCheck = new AppStock();
|
||||
appStockCheck.setLocationId(task.getOrigin());
|
||||
List<AppStock> appStockCheckData = appStockService.selectAppStockList(appStockCheck);
|
||||
if(appStockCheckData == null) {
|
||||
return;
|
||||
}
|
||||
if(appStockCheckData.isEmpty()) {
|
||||
// 这个位置没有库存了,直接释放货位
|
||||
AppLocation location = new AppLocation();
|
||||
location.setLocationId(task.getOrigin());
|
||||
location.setLocationStatus(0);
|
||||
appLocationMapper.updateAppLocation(location);
|
||||
}
|
||||
}
|
||||
// 如果小于的话就不做处理
|
||||
return;
|
||||
|
|
@ -314,6 +330,12 @@ public class TaskExecutor {
|
|||
if (task.getTaskType().compareTo(9) == 0) { // 移库任务
|
||||
int updateNewLocation = appStockService.updateNewLocation(task.getOrigin(), task.getDestination());
|
||||
if(updateNewLocation > 0) {
|
||||
// 释放原库位
|
||||
AppLocation location = new AppLocation();
|
||||
location.setLocationId(task.getOrigin());
|
||||
location.setLocationStatus(0);
|
||||
appLocationMapper.updateAppLocation(location);
|
||||
|
||||
AppTask updateRemark = new AppTask();
|
||||
updateRemark.setTaskId(task.getTaskId());
|
||||
updateRemark.setRemark("移库完成");
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user