修复程序:1. 工作状态的判断改为只判断1状态。2. 修改发送入库与拣选任务的写法。
This commit is contained in:
parent
22fdaa6df3
commit
e60c80d7b8
|
|
@ -112,10 +112,6 @@ public class TaskController {
|
||||||
* 物料服务
|
* 物料服务
|
||||||
*/
|
*/
|
||||||
private final GoodsService goodsService;
|
private final GoodsService goodsService;
|
||||||
/**
|
|
||||||
* 流转中物料箱号数据
|
|
||||||
*/
|
|
||||||
private final OutsideVehiclesService outsideVehiclesService;
|
|
||||||
/**
|
/**
|
||||||
* 拣选任务记录服务
|
* 拣选任务记录服务
|
||||||
*/
|
*/
|
||||||
|
|
@ -132,10 +128,6 @@ public class TaskController {
|
||||||
* 工作站配置服务
|
* 工作站配置服务
|
||||||
*/
|
*/
|
||||||
private final WorkStationConfigService workStationConfigService;
|
private final WorkStationConfigService workStationConfigService;
|
||||||
/**
|
|
||||||
* 站台要料服务
|
|
||||||
*/
|
|
||||||
private final GoodsToStationService goodsToStationService;
|
|
||||||
/**
|
/**
|
||||||
* 非计划领料服务
|
* 非计划领料服务
|
||||||
*/
|
*/
|
||||||
|
|
@ -161,7 +153,6 @@ public class TaskController {
|
||||||
*/
|
*/
|
||||||
private final IWorkService workService;
|
private final IWorkService workService;
|
||||||
private final WorkFlowLastService workFlowLastService;// 服务
|
private final WorkFlowLastService workFlowLastService;// 服务
|
||||||
private final StandStackerTaskService standStackerTaskService;// 特殊服务
|
|
||||||
private final InventoryListService inventoryService;
|
private final InventoryListService inventoryService;
|
||||||
private final WorkSummaryService workSummaryService;
|
private final WorkSummaryService workSummaryService;
|
||||||
private final InventoryHistoryService inventoryHistoryService;
|
private final InventoryHistoryService inventoryHistoryService;
|
||||||
|
|
@ -642,7 +633,7 @@ public class TaskController {
|
||||||
response.setMessage("暂无可用库位!");
|
response.setMessage("暂无可用库位!");
|
||||||
return convertJsonString(response);
|
return convertJsonString(response);
|
||||||
} else {
|
} else {
|
||||||
Location nextLocation = locationService.getOne(new LambdaQueryWrapper<Location>().eq(Location::getLocationId, resultMap.get("nextLocationId")).last("limit 1"));
|
Location nextLocation = locationService.getById(resultMap.get("nextLocationId"));
|
||||||
if (Objects.equals(nextLocation.getLocationStatus(), LocationStatus.OCCUPY.getCode()) && nextLocation.getVehicleId().equals(wcsVehicleInRequest.getVehicleNo())) {
|
if (Objects.equals(nextLocation.getLocationStatus(), LocationStatus.OCCUPY.getCode()) && nextLocation.getVehicleId().equals(wcsVehicleInRequest.getVehicleNo())) {
|
||||||
nextLocationId = resultMap.get("nextLocationId");
|
nextLocationId = resultMap.get("nextLocationId");
|
||||||
break;
|
break;
|
||||||
|
|
@ -1584,7 +1575,7 @@ public class TaskController {
|
||||||
if (workFlowService.exists(new LambdaQueryWrapper<WorkFlow>()
|
if (workFlowService.exists(new LambdaQueryWrapper<WorkFlow>()
|
||||||
.eq(WorkFlow::getWorkStation, standId)
|
.eq(WorkFlow::getWorkStation, standId)
|
||||||
.in(WorkFlow::getGoodsId, goodsIdList)
|
.in(WorkFlow::getGoodsId, goodsIdList)
|
||||||
.notIn(WorkFlow::getWorkStatus, -1, 2))) {
|
.eq(WorkFlow::getWorkStatus, 1))) {
|
||||||
// 需要,不放行,返回前台提示信息
|
// 需要,不放行,返回前台提示信息
|
||||||
StandPickVo pickVoEntity = new StandPickVo();
|
StandPickVo pickVoEntity = new StandPickVo();
|
||||||
pickVoEntity.setTip("当前料箱还有其他物料需要拣货");
|
pickVoEntity.setTip("当前料箱还有其他物料需要拣货");
|
||||||
|
|
@ -1608,7 +1599,7 @@ public class TaskController {
|
||||||
// 判断是不是已经完成工作
|
// 判断是不是已经完成工作
|
||||||
if (workFlowService.exists(new LambdaQueryWrapper<WorkFlow>()
|
if (workFlowService.exists(new LambdaQueryWrapper<WorkFlow>()
|
||||||
.eq(WorkFlow::getWorkStation, standId)
|
.eq(WorkFlow::getWorkStation, standId)
|
||||||
.notIn(WorkFlow::getWorkStatus, -1, 2))) {
|
.eq(WorkFlow::getWorkStatus, 1))) {
|
||||||
// 当前站台工作未全部完成
|
// 当前站台工作未全部完成
|
||||||
standService.update(new LambdaUpdateWrapper<Stand>()
|
standService.update(new LambdaUpdateWrapper<Stand>()
|
||||||
.set(Stand::getLastUseTime, LocalDateTime.now())
|
.set(Stand::getLastUseTime, LocalDateTime.now())
|
||||||
|
|
@ -1647,7 +1638,7 @@ public class TaskController {
|
||||||
// 判断是不是已经完成工作
|
// 判断是不是已经完成工作
|
||||||
if (workFlowService.exists(new LambdaQueryWrapper<WorkFlow>()
|
if (workFlowService.exists(new LambdaQueryWrapper<WorkFlow>()
|
||||||
.eq(WorkFlow::getWorkStation, standId)
|
.eq(WorkFlow::getWorkStation, standId)
|
||||||
.notIn(WorkFlow::getWorkStatus, -1, 2))) {
|
.eq(WorkFlow::getWorkStatus, 1))) {
|
||||||
// 当前站台工作未全部完成
|
// 当前站台工作未全部完成
|
||||||
standService.update(new LambdaUpdateWrapper<Stand>()
|
standService.update(new LambdaUpdateWrapper<Stand>()
|
||||||
.set(Stand::getLastUseTime, LocalDateTime.now())
|
.set(Stand::getLastUseTime, LocalDateTime.now())
|
||||||
|
|
@ -1765,7 +1756,7 @@ public class TaskController {
|
||||||
if (workFlowService.exists(new LambdaQueryWrapper<WorkFlow>()
|
if (workFlowService.exists(new LambdaQueryWrapper<WorkFlow>()
|
||||||
.eq(WorkFlow::getWorkStation, targetStand.getStandId())
|
.eq(WorkFlow::getWorkStation, targetStand.getStandId())
|
||||||
.in(WorkFlow::getGoodsId, goodsIdList)
|
.in(WorkFlow::getGoodsId, goodsIdList)
|
||||||
.notIn(WorkFlow::getWorkStatus, -1, 2))) {
|
.eq(WorkFlow::getWorkStatus, 1))) {
|
||||||
// 更新站台信息
|
// 更新站台信息
|
||||||
standService.update(new LambdaUpdateWrapper<Stand>()
|
standService.update(new LambdaUpdateWrapper<Stand>()
|
||||||
.set(Stand::getPickGoods, "")
|
.set(Stand::getPickGoods, "")
|
||||||
|
|
@ -1787,7 +1778,7 @@ public class TaskController {
|
||||||
// 判断是不是已经完成工作
|
// 判断是不是已经完成工作
|
||||||
if (workFlowService.exists(new LambdaQueryWrapper<WorkFlow>()
|
if (workFlowService.exists(new LambdaQueryWrapper<WorkFlow>()
|
||||||
.eq(WorkFlow::getWorkStation, targetStand.getStandId())
|
.eq(WorkFlow::getWorkStation, targetStand.getStandId())
|
||||||
.notIn(WorkFlow::getWorkStatus, -1, 2))) {
|
.eq(WorkFlow::getWorkStatus, 1))) {
|
||||||
standService.update(new LambdaUpdateWrapper<Stand>()
|
standService.update(new LambdaUpdateWrapper<Stand>()
|
||||||
.set(Stand::getLastUseTime, LocalDateTime.now())
|
.set(Stand::getLastUseTime, LocalDateTime.now())
|
||||||
.set(Stand::getPickVehicle, "")
|
.set(Stand::getPickVehicle, "")
|
||||||
|
|
@ -1823,7 +1814,7 @@ public class TaskController {
|
||||||
// 判断是不是已经完成工作
|
// 判断是不是已经完成工作
|
||||||
if (workFlowService.exists(new LambdaQueryWrapper<WorkFlow>()
|
if (workFlowService.exists(new LambdaQueryWrapper<WorkFlow>()
|
||||||
.eq(WorkFlow::getWorkStation, targetStand.getStandId())
|
.eq(WorkFlow::getWorkStation, targetStand.getStandId())
|
||||||
.notIn(WorkFlow::getWorkStatus, -1, 2))) {
|
.eq(WorkFlow::getWorkStatus, 1))) {
|
||||||
// 当前站台工作未全部完成
|
// 当前站台工作未全部完成
|
||||||
standService.update(new LambdaUpdateWrapper<Stand>()
|
standService.update(new LambdaUpdateWrapper<Stand>()
|
||||||
.set(Stand::getLastUseTime, LocalDateTime.now())
|
.set(Stand::getLastUseTime, LocalDateTime.now())
|
||||||
|
|
@ -2209,8 +2200,6 @@ public class TaskController {
|
||||||
backTask.setCreateTime(LocalDateTime.now());
|
backTask.setCreateTime(LocalDateTime.now());
|
||||||
// 保存任务
|
// 保存任务
|
||||||
taskService.save(backTask);
|
taskService.save(backTask);
|
||||||
// 删除outsideVehicle表
|
|
||||||
outsideVehiclesService.remove(new LambdaQueryWrapper<OutsideVehicles>().eq(OutsideVehicles::getVehicleId, requestBackQuery.getVehicleId()));
|
|
||||||
// 设置库存状态为回库中
|
// 设置库存状态为回库中
|
||||||
stockService.update(new LambdaUpdateWrapper<Stock>()
|
stockService.update(new LambdaUpdateWrapper<Stock>()
|
||||||
.set(Stock::getStockStatus, StockStatus.BACK.getCode())
|
.set(Stock::getStockStatus, StockStatus.BACK.getCode())
|
||||||
|
|
@ -3336,7 +3325,7 @@ public class TaskController {
|
||||||
inventoryVo.setGoodsId(inventoryRequest.getGoodsId());
|
inventoryVo.setGoodsId(inventoryRequest.getGoodsId());
|
||||||
inventoryVo.setVehiclesQuantity(stockList.size());
|
inventoryVo.setVehiclesQuantity(stockList.size());
|
||||||
inventoryVo.setVehicleIds(stock.getVehicleId());
|
inventoryVo.setVehicleIds(stock.getVehicleId());
|
||||||
String vehicleStatus = "";
|
String vehicleStatus;
|
||||||
if (Objects.equals(StockStatus.OK.getCode(), stock.getStockStatus())) {
|
if (Objects.equals(StockStatus.OK.getCode(), stock.getStockStatus())) {
|
||||||
vehicleStatus = "在库中";
|
vehicleStatus = "在库中";
|
||||||
} else if (Objects.equals(StockStatus.OUT.getCode(), stock.getStockStatus())) {
|
} else if (Objects.equals(StockStatus.OUT.getCode(), stock.getStockStatus())) {
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
||||||
|
|
||||||
import static com.wms.config.InitLocalConfig.configMap;
|
import static com.wms.config.InitLocalConfig.configMap;
|
||||||
|
import static com.wms.utils.StringUtils.convertJsonString;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 普通任务发送定时器类
|
* 普通任务发送定时器类
|
||||||
|
|
@ -30,7 +31,6 @@ public class CommonTaskSender implements Job {
|
||||||
* @param jobExecutionContext 执行文本
|
* @param jobExecutionContext 执行文本
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public void execute(JobExecutionContext jobExecutionContext) {
|
public void execute(JobExecutionContext jobExecutionContext) {
|
||||||
try {
|
try {
|
||||||
String sendTask = configMap.get(ConfigMapKeyEnum.SEND_TASK.getConfigKey());
|
String sendTask = configMap.get(ConfigMapKeyEnum.SEND_TASK.getConfigKey());
|
||||||
|
|
@ -40,8 +40,7 @@ public class CommonTaskSender implements Job {
|
||||||
// 发送正常任务
|
// 发送正常任务
|
||||||
wmsJobService.sendCommonTasks();
|
wmsJobService.sendCommonTasks();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// 回滚事务
|
log.error("发送任务给wcs发生异常:{}", convertJsonString(e));
|
||||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,10 +6,9 @@ import com.wms.utils.StringUtils;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.quartz.*;
|
import org.quartz.*;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
|
||||||
|
|
||||||
import static com.wms.config.InitLocalConfig.configMap;
|
import static com.wms.config.InitLocalConfig.configMap;
|
||||||
|
import static com.wms.utils.StringUtils.convertJsonString;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@PersistJobDataAfterExecution
|
@PersistJobDataAfterExecution
|
||||||
|
|
@ -27,7 +26,6 @@ public class PickTaskSender implements Job {
|
||||||
* @param jobExecutionContext 执行上下文
|
* @param jobExecutionContext 执行上下文
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public void execute(JobExecutionContext jobExecutionContext) {
|
public void execute(JobExecutionContext jobExecutionContext) {
|
||||||
try {
|
try {
|
||||||
String sendTask = configMap.get(ConfigMapKeyEnum.SEND_TASK.getConfigKey());
|
String sendTask = configMap.get(ConfigMapKeyEnum.SEND_TASK.getConfigKey());
|
||||||
|
|
@ -37,8 +35,7 @@ public class PickTaskSender implements Job {
|
||||||
// 发送拣选任务
|
// 发送拣选任务
|
||||||
wmsJobService.sendPickTasks();
|
wmsJobService.sendPickTasks();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// 回滚事务
|
log.error("发送拣选任务任务给wcs发生异常:{}", convertJsonString(e));
|
||||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,8 @@ package com.wms.service.business;
|
||||||
public interface IWmsJobService {
|
public interface IWmsJobService {
|
||||||
/**
|
/**
|
||||||
* 执行普通任务
|
* 执行普通任务
|
||||||
* @throws Exception 异常用于回滚事务
|
|
||||||
*/
|
*/
|
||||||
void sendCommonTasks() throws Exception;
|
void sendCommonTasks();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 下发拣选出库任务
|
* 下发拣选出库任务
|
||||||
|
|
@ -18,9 +17,8 @@ public interface IWmsJobService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发送拣选任务
|
* 发送拣选任务
|
||||||
* @throws Exception 异常用于回滚事务
|
|
||||||
*/
|
*/
|
||||||
void sendPickTasks() throws Exception;
|
void sendPickTasks();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发送重复入库修正后的任务
|
* 发送重复入库修正后的任务
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,6 @@ import static com.wms.utils.StringUtils.convertJsonString;
|
||||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||||
public class WmsJobServiceImplements implements IWmsJobService {
|
public class WmsJobServiceImplements implements IWmsJobService {
|
||||||
private final Logger logger = LoggerFactory.getLogger(this.getClass());// 日志
|
private final Logger logger = LoggerFactory.getLogger(this.getClass());// 日志
|
||||||
private final String ROOT_PATH = "./file";
|
|
||||||
|
|
||||||
private final LogService logService;// 日志服务
|
private final LogService logService;// 日志服务
|
||||||
private final TaskService taskService;// 任务服务
|
private final TaskService taskService;// 任务服务
|
||||||
|
|
@ -72,8 +71,7 @@ public class WmsJobServiceImplements implements IWmsJobService {
|
||||||
* 发送正常的任务
|
* 发送正常的任务
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void sendCommonTasks() throws Exception {
|
public void sendCommonTasks() {
|
||||||
try {
|
|
||||||
// 检索任务表---新建未下发的任务
|
// 检索任务表---新建未下发的任务
|
||||||
LambdaQueryWrapper<Task> waitForDistributeTaskQuery = new LambdaQueryWrapper<Task>()
|
LambdaQueryWrapper<Task> waitForDistributeTaskQuery = new LambdaQueryWrapper<Task>()
|
||||||
.eq(Task::getTaskStatus, WmsTaskStatus.NEW.getCode());
|
.eq(Task::getTaskStatus, WmsTaskStatus.NEW.getCode());
|
||||||
|
|
@ -140,7 +138,7 @@ public class WmsJobServiceImplements implements IWmsJobService {
|
||||||
logger.error("保存发送任务的日志错误。");
|
logger.error("保存发送任务的日志错误。");
|
||||||
}
|
}
|
||||||
if (result == null) {
|
if (result == null) {
|
||||||
logger.error("发送任务异常。");
|
logger.error("发送堆垛机任务异常。");
|
||||||
} else {
|
} else {
|
||||||
if (Objects.equals(ResponseCode.OK.getCode(), result.getCode())) {
|
if (Objects.equals(ResponseCode.OK.getCode(), result.getCode())) {
|
||||||
logger.info("发送WCS任务成功。");
|
logger.info("发送WCS任务成功。");
|
||||||
|
|
@ -168,18 +166,13 @@ public class WmsJobServiceImplements implements IWmsJobService {
|
||||||
logger.error("WCS发送任务地址为空。");
|
logger.error("WCS发送任务地址为空。");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception exception) {
|
|
||||||
logger.error("向WCS发送任务时发生异常:{}", convertJsonString(exception));
|
|
||||||
throw new Exception("向WCS发送任务时发生异常。");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发送拣选任务
|
* 发送拣选任务
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void sendPickTasks() throws Exception {
|
public void sendPickTasks() {
|
||||||
try {
|
|
||||||
// 检索任务表---新建未下发的拣选任务
|
// 检索任务表---新建未下发的拣选任务
|
||||||
LambdaQueryWrapper<PickTask> waitForDistributePickTaskQuery = new LambdaQueryWrapper<PickTask>()
|
LambdaQueryWrapper<PickTask> waitForDistributePickTaskQuery = new LambdaQueryWrapper<PickTask>()
|
||||||
.eq(PickTask::getPickStatus, PickTaskStatusEnum.NEW.getCode());
|
.eq(PickTask::getPickStatus, PickTaskStatusEnum.NEW.getCode());
|
||||||
|
|
@ -225,7 +218,7 @@ public class WmsJobServiceImplements implements IWmsJobService {
|
||||||
try {
|
try {
|
||||||
logService.save(new WmsLog(WmsUtils.generateId("LOG_"), "向WCS发送拣选任务", "setConveyTask", convertJsonString(request), convertJsonString(result), url, LocalDateTime.now(), "WMS"));
|
logService.save(new WmsLog(WmsUtils.generateId("LOG_"), "向WCS发送拣选任务", "setConveyTask", convertJsonString(request), convertJsonString(result), url, LocalDateTime.now(), "WMS"));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("插入日志错误。");
|
logger.error("保存发送拣选任务日志错误。");
|
||||||
}
|
}
|
||||||
if (result != null && Objects.equals(ResponseCode.OK.getCode(), result.getCode())) {
|
if (result != null && Objects.equals(ResponseCode.OK.getCode(), result.getCode())) {
|
||||||
logger.info("发送拣选任务成功。");
|
logger.info("发送拣选任务成功。");
|
||||||
|
|
@ -240,10 +233,6 @@ public class WmsJobServiceImplements implements IWmsJobService {
|
||||||
logger.error("WCS发送拣选任务地址为空。");
|
logger.error("WCS发送拣选任务地址为空。");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception exception) {
|
|
||||||
logger.error("向WCS发送拣选任务时发生异常:{}", convertJsonString(exception));
|
|
||||||
throw new Exception("向WCS发送拣选任务时发生异常。");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -369,6 +358,7 @@ public class WmsJobServiceImplements implements IWmsJobService {
|
||||||
// 查询过期任务记录
|
// 查询过期任务记录
|
||||||
List<TaskRecord> expireTaskRecords = taskRecordService.list(new LambdaQueryWrapper<TaskRecord>()
|
List<TaskRecord> expireTaskRecords = taskRecordService.list(new LambdaQueryWrapper<TaskRecord>()
|
||||||
.lt(TaskRecord::getCreateTime, deleteTime));
|
.lt(TaskRecord::getCreateTime, deleteTime));
|
||||||
|
String ROOT_PATH = "./file";
|
||||||
if (expireTaskRecords != null && !expireTaskRecords.isEmpty()) {
|
if (expireTaskRecords != null && !expireTaskRecords.isEmpty()) {
|
||||||
List<String> needRemoveIds = new ArrayList<>();
|
List<String> needRemoveIds = new ArrayList<>();
|
||||||
List<DbOfTaskRecord> finishedExcelTemp = new ArrayList<>();
|
List<DbOfTaskRecord> finishedExcelTemp = new ArrayList<>();
|
||||||
|
|
@ -1096,7 +1086,7 @@ public class WmsJobServiceImplements implements IWmsJobService {
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
logger.error("WCS发送任务地址为空。");
|
logger.error("WCS发送站台出库任务地址为空。");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user