安全距离3.8米;
停止接收任务启用;
订单作废;
修改任务状态提交apms;
This commit is contained in:
lgh 2022-11-28 17:02:29 +08:00
parent a002354d49
commit 63d251325f
4 changed files with 75 additions and 12 deletions

View File

@ -390,6 +390,13 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService
if (!status.equals(currTask.getStatus())) {
//修改为加工中,多步骤任务修改为加工中,查询缓存区,查询前置任务状态,并修改
if (status == 1) {
currTask.setStatus(1);
currTask.setIsIn(1);
currTask.setUpdaterId(99);
currTask.setUpdateTime(LocalDateTime.now());
currTask.setBeginTime(LocalDateTime.now());
//生产炉号
createStoveCode(currTask);
InStockInfo inStockInfo = inStockInfoServiceBiz.getOne(new QueryWrapper<InStockInfo>().eq(InStockInfo.TASK_ID, currTask.getId()));
if (inStockInfo != null) {
//更新库位状态为未占用
@ -420,6 +427,8 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService
currTask1.setUpdaterId(99);
currTask1.setUpdateTime(LocalDateTime.now());
currTaskServiceBiz.updateById(currTask1);
apmsEndProcess(currTask1);
apmsStartProcess(currTask);
} else if (currTask.getId().equals(autoExeTask.getThTaskId())) {
//该任务为自动任务第三条,修改自动任务第二条的状态
CurrTask currTask2 = currTaskServiceBiz.getById(autoExeTask.getFTaskId());
@ -429,15 +438,11 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService
currTask2.setUpdaterId(99);
currTask2.setUpdateTime(LocalDateTime.now());
currTaskServiceBiz.updateById(currTask2);
apmsEndProcess(currTask2);
apmsStartProcess(currTask);
}
}
currTask.setStatus(1);
currTask.setIsIn(1);
currTask.setUpdaterId(99);
currTask.setUpdateTime(LocalDateTime.now());
currTask.setBeginTime(LocalDateTime.now());
//生产炉号
createStoveCode(currTask);
currTaskServiceBiz.updateById(currTask);
logger.info("修改任务" + currTask.getId() + "状态为加工中成功");
}
@ -781,6 +786,51 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService
return true;
}
}
/**
* 上报apms开始加工
*
* @param currTask
* @return
*/
private Boolean apmsStartProcess(CurrTask currTask) {
String code = kilnInfoServiceBiz.getById(currTask.getKilnId()).getCode();
ApmsStartProcess apmsStartProcess = new ApmsStartProcess();
apmsStartProcess.setStartUser("QJJP03");
apmsStartProcess.setStartTime(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
apmsStartProcess.setTechName(currTask.getCraftCodeId().toString());
apmsStartProcess.setSheetNo(currTask.getSheetNo());
if (currTask.getStoveCode() != null) {
apmsStartProcess.setStoveCode(currTask.getStoveCode());
}
R<ApmsStartProcess> apmsStartProcessR = apmsControl.startProcess(apmsStartProcess);
if (apmsStartProcessR.getCode() != 0) {
logger.info("任务号" + currTask.getTaskCode() + "生产单号:" + currTask.getSheetNo() + "生产单开始生产上报apms失败");
return false;
}
logger.info("任务号" + currTask.getTaskCode() + "生产单号:" + currTask.getSheetNo() + "生产单开始生产上报apms成功");
return true;
}
/**
* 上报apms-end
*
* @param currTask
* @return
*/
private Boolean apmsEndProcess(CurrTask currTask) {
ApmsEndProcess apmsEndProcess = new ApmsEndProcess();
apmsEndProcess.setEndTime(currTask.getEndTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
apmsEndProcess.setEndUser("QJJP03");
apmsEndProcess.setSheetNo(currTask.getSheetNo());
R<ApmsEndProcessVo> apmsEndProcessVoR = apmsControl.endProcess(apmsEndProcess);
if (apmsEndProcessVoR.getCode() != 0) {
logger.info("任务号" + currTask.getTaskCode() + "生产单号:" + currTask.getSheetNo() + "生产单完成处理上报apms失败");
return false;
}
logger.info("任务号" + currTask.getTaskCode() + "生产单号:" + currTask.getSheetNo() + "生产单完成处理上报apms成功");
return true;
}
/**
* 生成炉号
* 多步骤任务除了第一步为清洗炉外,每步都生成炉号

View File

@ -119,6 +119,7 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic
.like(StringUtils.isNotBlank(param.getOrderNo()), OrderInfo.ORDER_NO, param.getOrderNo())
.like(StringUtils.isNotBlank(param.getCustomerName()),OrderInfo.CUSTOMER_NAME,param.getCustomerName())
.in(OrderInfo.STATUS,0,1)
.eq(OrderInfo.ORDER_VOID,1)
.orderByDesc(OrderInfo.CREATE_TIME);
Page<OrderInfo> page = orderInfoService.page(new Page<>(param.getCurrent(), param.getSize()), wrapper);
PageVo<OrderInfoVo> orderInfoVoPageVo = new PageVo<>(page, OrderInfoVo.class);
@ -219,7 +220,7 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic
@Override
public R<OrderInfoVo> getTaskInfoByIdenCardNum(String idenCardNum) {
QueryWrapper<OrderInfo> wrapper = new QueryWrapper<>();
wrapper.eq(OrderInfo.IDEN_CARD_NUM, idenCardNum).eq(OrderInfo.VALID, 1);
wrapper.eq(OrderInfo.IDEN_CARD_NUM, idenCardNum).eq(OrderInfo.VALID, 1).eq(OrderInfo.ORDER_VOID,1);
OrderInfo one = orderInfoService.getOne(wrapper);
Assert.notNull("未找到该标识卡信息!", one);
OrderInfoVo build = OrderInfoVo.builder().build();
@ -261,7 +262,7 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic
for (TaskCreateDetParam detParam : detParams)
{
QueryWrapper<OrderInfo> wrapper = new QueryWrapper<>();
wrapper.eq(OrderInfo.IDEN_CARD_NUM, detParam.getIdenCardNum()).eq(OrderInfo.VALID, 1);
wrapper.eq(OrderInfo.IDEN_CARD_NUM, detParam.getIdenCardNum()).eq(OrderInfo.VALID, 1).eq(OrderInfo.ORDER_VOID,1);
OrderInfo one = orderInfoService.getOne(wrapper);
Assert.notNull("错误,标识卡号" + detParam.getIdenCardNum() + "在订单中不存在!", one);
}

View File

@ -584,6 +584,9 @@ public class ScheduledTask extends BaseService {
if (vehicleInfos.size() > 0) {
return;
}
if (kilnStopRecTask(kilnInfo.getId())){
continue;
}
Boolean kilnReadyIn = false;
if (kilnInfo.getType() == 1) {
kilnReadyIn = kilnReadyIn(kilnInfo.getId());
@ -791,6 +794,15 @@ public class ScheduledTask extends BaseService {
return Boolean.valueOf(JSONObject.parseObject(result).get("result").toString());
}
private Boolean kilnStopRecTask(Long kilnId) {
PlcNameSpace nameSpace = plcNameSpaceServiceBiz.getOne(new QueryWrapper<PlcNameSpace>()
.eq(PlcNameSpace.EQ_TYPE, 0)
.eq(PlcNameSpace.EQ_ID, kilnId)
.eq(PlcNameSpace.TYPE, 0));
String nameSpaceNote = nameSpace.getName();
String result = readPlcToString(nameSpaceNote, "StopRecTask");
return Boolean.valueOf(JSONObject.parseObject(result).get("result").toString());
}
private Boolean kilnReadyIn(Long kilnId) {
PlcNameSpace nameSpace = plcNameSpaceServiceBiz.getOne(new QueryWrapper<PlcNameSpace>()
.eq(PlcNameSpace.EQ_TYPE, 0)

View File

@ -117,14 +117,14 @@ public class TaskDistanceUtils {
logger.info("min"+minDistance);
logger.info("max"+maxDistance);
logger.info("other"+otherNowPosition);
//另一辆小车在在小车路径上比如冲突不在小车路径上时判定一下安全距离4
//另一辆小车在在小车路径上比如冲突不在小车路径上时判定一下安全距离3.8
if (otherNowPosition>=minDistance&&otherNowPosition<=maxDistance){
return true;
}else {
if (Math.abs(otherNowPosition-maxDistance)<3.5){
if (Math.abs(otherNowPosition-maxDistance)<3.8){
return true;
}
if (Math.abs(otherNowPosition-minDistance)<3.5){
if (Math.abs(otherNowPosition-minDistance)<3.8){
return true;
}
return false;