This commit is contained in:
15066119699 2025-03-06 09:20:39 +08:00
commit 419dc90a28
2 changed files with 25 additions and 2 deletions

View File

@ -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;
@ -46,6 +47,8 @@ public class TaskExecutor {
put(2, 2);// 出库
put(3, 3);// 移库
}};
@Autowired
private AppLocationMapper appLocationMapper;
/**
* 解析wms任务
@ -209,8 +212,8 @@ public class TaskExecutor {
appStock.setOriginNum(pendingStorage.getGoodsNum());
appStock.setBatchNo("-");
appStock.setInvAge(0L);
appStock.setGoodsStatus(0L);
appStock.setStockStatus(0L);
appStock.setGoodsStatus(0);
appStock.setStockStatus(0);
appStock.setCreateTime(new Date());
appStock.setUpdateTime(new Date());
appStock.setCreateUser(pendingStorage.getCreatePerson());
@ -310,6 +313,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;
@ -317,6 +333,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("移库完成");

View File

@ -135,6 +135,7 @@ public class AppPmsOrderInServiceImpl implements IAppPmsOrderInService
appPendingStorage.setVehicleNo(request.getVehicleNo());
appPendingStorage.setGoodsNum(pmsInDatum.getGoodsNum());
appPendingStorage.setStatus(1);
appPendingStorage.setStorageType(2);
appPendingStorage.setCreateTime(DateUtils.getNowDate());
appPendingStorage.setUpdateTime(DateUtils.getNowDate());
appPendingStorage.setCreatePerson("PDA");