update:
安全距离3.8米; 停止接收任务启用; 订单作废; 修改任务状态提交apms;
This commit is contained in:
parent
a002354d49
commit
63d251325f
@ -390,6 +390,13 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService
|
|||||||
if (!status.equals(currTask.getStatus())) {
|
if (!status.equals(currTask.getStatus())) {
|
||||||
//修改为加工中,多步骤任务修改为加工中,查询缓存区,查询前置任务状态,并修改
|
//修改为加工中,多步骤任务修改为加工中,查询缓存区,查询前置任务状态,并修改
|
||||||
if (status == 1) {
|
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()));
|
InStockInfo inStockInfo = inStockInfoServiceBiz.getOne(new QueryWrapper<InStockInfo>().eq(InStockInfo.TASK_ID, currTask.getId()));
|
||||||
if (inStockInfo != null) {
|
if (inStockInfo != null) {
|
||||||
//更新库位状态为未占用
|
//更新库位状态为未占用
|
||||||
@ -420,6 +427,8 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService
|
|||||||
currTask1.setUpdaterId(99);
|
currTask1.setUpdaterId(99);
|
||||||
currTask1.setUpdateTime(LocalDateTime.now());
|
currTask1.setUpdateTime(LocalDateTime.now());
|
||||||
currTaskServiceBiz.updateById(currTask1);
|
currTaskServiceBiz.updateById(currTask1);
|
||||||
|
apmsEndProcess(currTask1);
|
||||||
|
apmsStartProcess(currTask);
|
||||||
} else if (currTask.getId().equals(autoExeTask.getThTaskId())) {
|
} else if (currTask.getId().equals(autoExeTask.getThTaskId())) {
|
||||||
//该任务为自动任务第三条,修改自动任务第二条的状态
|
//该任务为自动任务第三条,修改自动任务第二条的状态
|
||||||
CurrTask currTask2 = currTaskServiceBiz.getById(autoExeTask.getFTaskId());
|
CurrTask currTask2 = currTaskServiceBiz.getById(autoExeTask.getFTaskId());
|
||||||
@ -429,15 +438,11 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService
|
|||||||
currTask2.setUpdaterId(99);
|
currTask2.setUpdaterId(99);
|
||||||
currTask2.setUpdateTime(LocalDateTime.now());
|
currTask2.setUpdateTime(LocalDateTime.now());
|
||||||
currTaskServiceBiz.updateById(currTask2);
|
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);
|
currTaskServiceBiz.updateById(currTask);
|
||||||
logger.info("修改任务" + currTask.getId() + "状态为加工中成功");
|
logger.info("修改任务" + currTask.getId() + "状态为加工中成功");
|
||||||
}
|
}
|
||||||
@ -781,6 +786,51 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService
|
|||||||
return true;
|
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;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 生成炉号
|
* 生成炉号
|
||||||
* 多步骤任务除了第一步为清洗炉外,每步都生成炉号
|
* 多步骤任务除了第一步为清洗炉外,每步都生成炉号
|
||||||
|
@ -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.getOrderNo()), OrderInfo.ORDER_NO, param.getOrderNo())
|
||||||
.like(StringUtils.isNotBlank(param.getCustomerName()),OrderInfo.CUSTOMER_NAME,param.getCustomerName())
|
.like(StringUtils.isNotBlank(param.getCustomerName()),OrderInfo.CUSTOMER_NAME,param.getCustomerName())
|
||||||
.in(OrderInfo.STATUS,0,1)
|
.in(OrderInfo.STATUS,0,1)
|
||||||
|
.eq(OrderInfo.ORDER_VOID,1)
|
||||||
.orderByDesc(OrderInfo.CREATE_TIME);
|
.orderByDesc(OrderInfo.CREATE_TIME);
|
||||||
Page<OrderInfo> page = orderInfoService.page(new Page<>(param.getCurrent(), param.getSize()), wrapper);
|
Page<OrderInfo> page = orderInfoService.page(new Page<>(param.getCurrent(), param.getSize()), wrapper);
|
||||||
PageVo<OrderInfoVo> orderInfoVoPageVo = new PageVo<>(page, OrderInfoVo.class);
|
PageVo<OrderInfoVo> orderInfoVoPageVo = new PageVo<>(page, OrderInfoVo.class);
|
||||||
@ -219,7 +220,7 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic
|
|||||||
@Override
|
@Override
|
||||||
public R<OrderInfoVo> getTaskInfoByIdenCardNum(String idenCardNum) {
|
public R<OrderInfoVo> getTaskInfoByIdenCardNum(String idenCardNum) {
|
||||||
QueryWrapper<OrderInfo> wrapper = new QueryWrapper<>();
|
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);
|
OrderInfo one = orderInfoService.getOne(wrapper);
|
||||||
Assert.notNull("未找到该标识卡信息!", one);
|
Assert.notNull("未找到该标识卡信息!", one);
|
||||||
OrderInfoVo build = OrderInfoVo.builder().build();
|
OrderInfoVo build = OrderInfoVo.builder().build();
|
||||||
@ -261,7 +262,7 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic
|
|||||||
for (TaskCreateDetParam detParam : detParams)
|
for (TaskCreateDetParam detParam : detParams)
|
||||||
{
|
{
|
||||||
QueryWrapper<OrderInfo> wrapper = new QueryWrapper<>();
|
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);
|
OrderInfo one = orderInfoService.getOne(wrapper);
|
||||||
Assert.notNull("错误,标识卡号" + detParam.getIdenCardNum() + "在订单中不存在!", one);
|
Assert.notNull("错误,标识卡号" + detParam.getIdenCardNum() + "在订单中不存在!", one);
|
||||||
}
|
}
|
||||||
|
@ -584,6 +584,9 @@ public class ScheduledTask extends BaseService {
|
|||||||
if (vehicleInfos.size() > 0) {
|
if (vehicleInfos.size() > 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (kilnStopRecTask(kilnInfo.getId())){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
Boolean kilnReadyIn = false;
|
Boolean kilnReadyIn = false;
|
||||||
if (kilnInfo.getType() == 1) {
|
if (kilnInfo.getType() == 1) {
|
||||||
kilnReadyIn = kilnReadyIn(kilnInfo.getId());
|
kilnReadyIn = kilnReadyIn(kilnInfo.getId());
|
||||||
@ -791,6 +794,15 @@ public class ScheduledTask extends BaseService {
|
|||||||
return Boolean.valueOf(JSONObject.parseObject(result).get("result").toString());
|
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) {
|
private Boolean kilnReadyIn(Long kilnId) {
|
||||||
PlcNameSpace nameSpace = plcNameSpaceServiceBiz.getOne(new QueryWrapper<PlcNameSpace>()
|
PlcNameSpace nameSpace = plcNameSpaceServiceBiz.getOne(new QueryWrapper<PlcNameSpace>()
|
||||||
.eq(PlcNameSpace.EQ_TYPE, 0)
|
.eq(PlcNameSpace.EQ_TYPE, 0)
|
||||||
|
@ -117,14 +117,14 @@ public class TaskDistanceUtils {
|
|||||||
logger.info("min"+minDistance);
|
logger.info("min"+minDistance);
|
||||||
logger.info("max"+maxDistance);
|
logger.info("max"+maxDistance);
|
||||||
logger.info("other"+otherNowPosition);
|
logger.info("other"+otherNowPosition);
|
||||||
//另一辆小车在在小车路径上比如冲突,不在小车路径上时判定一下安全距离(4米)
|
//另一辆小车在在小车路径上比如冲突,不在小车路径上时判定一下安全距离(3.8米)
|
||||||
if (otherNowPosition>=minDistance&&otherNowPosition<=maxDistance){
|
if (otherNowPosition>=minDistance&&otherNowPosition<=maxDistance){
|
||||||
return true;
|
return true;
|
||||||
}else {
|
}else {
|
||||||
if (Math.abs(otherNowPosition-maxDistance)<3.5){
|
if (Math.abs(otherNowPosition-maxDistance)<3.8){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (Math.abs(otherNowPosition-minDistance)<3.5){
|
if (Math.abs(otherNowPosition-minDistance)<3.8){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user