bug修改
This commit is contained in:
parent
22c6288659
commit
52dfdc9c7f
@ -2,6 +2,7 @@ package com.mt.wms.empty.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.mt.wms.basic.service.KilnInfoService;
|
||||
import com.mt.wms.basic.vo.KilnInfoVo;
|
||||
import com.mt.wms.core.base.BaseController;
|
||||
|
@ -114,6 +114,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
runTaskServiceBiz.updateById(runTask);
|
||||
//更新currTask表状态
|
||||
currTask.setIsIn(1);
|
||||
currTask.setStatus(1);
|
||||
currTask.setRunTaskId(runTask.getId());
|
||||
currTask.setUpdateTime(LocalDateTime.now());
|
||||
currTask.setBeginTime(LocalDateTime.now());
|
||||
@ -132,6 +133,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
AutoExeTask autoExeTask = autoExeTaskServiceBiz.getOne(new QueryWrapper<AutoExeTask>().eq(AutoExeTask.T_TASK_ID, currTaskId));
|
||||
CurrTask firstCurrTask = currTaskServiceBiz.getById(autoExeTask.getFTaskId());
|
||||
firstCurrTask.setIsIn(2);
|
||||
firstCurrTask.setStatus(2);
|
||||
currTaskServiceBiz.updateById(firstCurrTask);
|
||||
apmsEndProcess(firstCurrTask);
|
||||
//再上报第二步开始处理
|
||||
@ -143,6 +145,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
AutoExeTask autoExeTask = autoExeTaskServiceBiz.getOne(new QueryWrapper<AutoExeTask>().eq(AutoExeTask.TH_TASK_ID, currTaskId));
|
||||
CurrTask secondCurrTask = currTaskServiceBiz.getById(autoExeTask.getFTaskId());
|
||||
secondCurrTask.setIsIn(2);
|
||||
secondCurrTask.setStatus(2);
|
||||
currTaskServiceBiz.updateById(secondCurrTask);
|
||||
apmsEndProcess(secondCurrTask);
|
||||
//再上报第三步开始处理
|
||||
@ -207,6 +210,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
locationServiceBiz.updateById(location);
|
||||
//更新currTask表状态
|
||||
currTask.setIsIn(1);
|
||||
currTask.setStatus(1);
|
||||
currTask.setRunTaskId(runTask.getId());
|
||||
currTask.setUpdateTime(LocalDateTime.now());
|
||||
currTask.setBeginTime(LocalDateTime.now());
|
||||
@ -318,11 +322,13 @@ public class AsynRunTaskService extends BaseService {
|
||||
AutoExeTask autoExeTask = autoExeTaskServiceBiz.getOne(new QueryWrapper<AutoExeTask>().eq(AutoExeTask.T_TASK_ID, currTaskId));
|
||||
CurrTask firstCurrTask = currTaskServiceBiz.getById(autoExeTask.getFTaskId());
|
||||
firstCurrTask.setIsIn(2);
|
||||
firstCurrTask.setStatus(2);
|
||||
currTaskServiceBiz.updateById(firstCurrTask);
|
||||
}else {
|
||||
AutoExeTask autoExeTask = autoExeTaskServiceBiz.getOne(new QueryWrapper<AutoExeTask>().eq(AutoExeTask.TH_TASK_ID, currTaskId));
|
||||
CurrTask secondCurrTask = currTaskServiceBiz.getById(autoExeTask.getThTaskId());
|
||||
CurrTask secondCurrTask = currTaskServiceBiz.getById(autoExeTask.getTTaskId());
|
||||
secondCurrTask.setIsIn(2);
|
||||
secondCurrTask.setStatus(2);
|
||||
currTaskServiceBiz.updateById(secondCurrTask);
|
||||
}
|
||||
}
|
||||
@ -387,7 +393,9 @@ public class AsynRunTaskService extends BaseService {
|
||||
currTask.setIsOut(2);
|
||||
currTask.setUpdateTime(LocalDateTime.now());
|
||||
currTask.setStatus(2);
|
||||
currTask.setEndTime(LocalDateTime.now());
|
||||
currTask.setIsIn(2);
|
||||
currTask.setUpdateTime(LocalDateTime.now());
|
||||
logger.info("修改currTask任务状态");
|
||||
currTaskServiceBiz.updateById(currTask);
|
||||
//更新in_stock_info表
|
||||
inStockInfo.setStatus(2);
|
||||
@ -397,12 +405,17 @@ public class AsynRunTaskService extends BaseService {
|
||||
vehicle.setStatus(0);
|
||||
vehicleInfoServiceBiz.updateById(vehicle);
|
||||
//任务为非自动任务上报apms-end-finish
|
||||
if (currTask.getIsOut()==0) {
|
||||
if (currTask.getIsAuto()==0) {
|
||||
//上报apms完成处理
|
||||
logger.info("此任务为单步骤任务,任务结束,上报apms-end-finish");
|
||||
apmsEndProcess(currTask);
|
||||
apmsFinishProcess(currTask);
|
||||
} else {
|
||||
int firstSetp = autoExeTaskServiceBiz.count(new QueryWrapper<AutoExeTask>().eq(AutoExeTask.F_TASK_ID, currTaskId));
|
||||
if (firstSetp>0){
|
||||
//当前任务为自动任务的第一步
|
||||
apmsEndProcess(currTask);
|
||||
}
|
||||
int secondSetp = autoExeTaskServiceBiz.count(new QueryWrapper<AutoExeTask>().eq(AutoExeTask.T_TASK_ID, currTaskId));
|
||||
if (secondSetp>0){
|
||||
AutoExeTask autoExeTask = autoExeTaskServiceBiz.getOne(new QueryWrapper<AutoExeTask>().eq(AutoExeTask.T_TASK_ID, currTaskId));
|
||||
@ -412,6 +425,9 @@ public class AsynRunTaskService extends BaseService {
|
||||
apmsEndProcess(currTask);
|
||||
//再上报apms-finishProcess
|
||||
apmsFinishProcess(currTask);
|
||||
}else {
|
||||
//当前任务为三步中的第二步
|
||||
apmsEndProcess(currTask);
|
||||
}
|
||||
}
|
||||
int threeSetp = autoExeTaskServiceBiz.count(new QueryWrapper<AutoExeTask>().eq(AutoExeTask.TH_TASK_ID, currTaskId));
|
||||
@ -422,9 +438,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
//再上报apms-finishProcess
|
||||
apmsFinishProcess(currTask);
|
||||
}
|
||||
logger.info("此任务为为自动任务里的第一步或第二步,任务结束,上报apms-end-finish");
|
||||
//为自动任务的非第三步
|
||||
apmsEndProcess(currTask);
|
||||
|
||||
}
|
||||
} else {
|
||||
runTask.setStatus(3);
|
||||
@ -520,6 +534,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
//更新库位状态
|
||||
location.setStatus(0);
|
||||
locationServiceBiz.updateById(location);
|
||||
|
||||
//更新车辆状态
|
||||
VehicleInfo vehicleInfo = vehicleInfoServiceBiz.getById(vehicleId);
|
||||
vehicleInfo.setStatus(0);
|
||||
@ -1253,7 +1268,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
* @return 单步骤任务true,多步骤任务第一步true,其他false
|
||||
*/
|
||||
public Boolean isFirstTask(CurrTask currTask){
|
||||
if (currTask.getIsOut()==1){
|
||||
if (currTask.getIsAuto()==1){
|
||||
int count = autoExeTaskServiceBiz.count(new QueryWrapper<AutoExeTask>().eq(AutoExeTask.F_TASK_ID, currTask.getId()));
|
||||
return count>0;
|
||||
}else {
|
||||
|
@ -221,9 +221,9 @@ public class RunTaskUtils {
|
||||
Long thTaskId = autoExeTask.getThTaskId();
|
||||
CurrTask currTaskThree = currTaskServiceBiz.getById(thTaskId);
|
||||
try {
|
||||
logger.info("自动任务第二步:"+currTask.getTaskCode()+"已执行完成。开始执行第三步任务:"+currTaskThree);
|
||||
logger.info("自动任务第二步:"+currTask.getTaskCode()+"已执行完成。开始执行第三步任务:"+currTaskThree.getId());
|
||||
// 2022/2/27 websocket推送到页面显示
|
||||
webSocketServer.sendtoAll("自动任务第二步:"+currTask.getTaskCode()+"已执行完成。开始执行第三步任务:"+currTaskThree);
|
||||
webSocketServer.sendtoAll("自动任务第二步:"+currTask.getTaskCode()+"已执行完成。开始执行第三步任务:"+currTaskThree.getId());
|
||||
return runTaskForInKiln(thTaskId);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
@ -231,7 +231,6 @@ public class RunTaskUtils {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
//查询缓存区库位是否已满
|
||||
|
@ -74,9 +74,20 @@ public class ScheduledTask extends BaseService {
|
||||
private CurrTaskDetServiceBiz currTaskDetServiceBiz;
|
||||
@Resource
|
||||
private OrderInfoServiceBiz orderInfoServiceBiz;
|
||||
@Resource
|
||||
private AutoExeTaskServiceBiz autoExeTaskServiceBiz;
|
||||
|
||||
//@Scheduled(fixedDelay = 1000*20)
|
||||
@Test
|
||||
public void test() throws IOException {
|
||||
CurrTask currTask = currTaskServiceBiz.getById(342);
|
||||
if (currTask.getIsOut()==1){
|
||||
int count = autoExeTaskServiceBiz.count(new QueryWrapper<AutoExeTask>().eq(AutoExeTask.F_TASK_ID, currTask.getId()));
|
||||
System.out.println(count>0);;
|
||||
}else {
|
||||
System.out.println(true);
|
||||
}
|
||||
|
||||
}
|
||||
//@Scheduled(fixedDelay = 1000*60)
|
||||
public void testWebsocket() throws IOException {
|
||||
@ -488,7 +499,7 @@ public class ScheduledTask extends BaseService {
|
||||
}
|
||||
//查询炉子是否allowIn
|
||||
Boolean kilnAllowIn = kilnAllowIn(kilnInfo.getId());
|
||||
if (kilnReadyIn||kilnAllowIn){
|
||||
if (kilnReadyIn&&kilnAllowIn){
|
||||
//缓存区是否有目标位置为工业炉的待加工任务
|
||||
List<InStockInfo> inStockInfoList = inStockInfoServiceBiz.list(new QueryWrapper<InStockInfo>()
|
||||
.eq(InStockInfo.TYPE, 1)
|
||||
|
Loading…
Reference in New Issue
Block a user