fix:长短轴添加
This commit is contained in:
@@ -790,10 +790,10 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
|||||||
cutpointivtTypeMap.put("A1_TZZC03", "2");
|
cutpointivtTypeMap.put("A1_TZZC03", "2");
|
||||||
}
|
}
|
||||||
if (move3 == 1) {
|
if (move3 == 1) {
|
||||||
cutpointivtTypeMap.put("A1_TZZC04", "1");
|
cutpointivtTypeMap.put("A1_TZZC04", "2");
|
||||||
}
|
}
|
||||||
if (move4 == 1) {
|
if (move4 == 1) {
|
||||||
cutpointivtTypeMap.put("A1_TZZC04", "2");
|
cutpointivtTypeMap.put("A1_TZZC04", "1");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.nl.common.exception.BadRequestException;
|
import org.nl.common.exception.BadRequestException;
|
||||||
import org.nl.config.lucene.TagNameEnum;
|
import org.nl.config.lucene.TagNameEnum;
|
||||||
|
import org.nl.wms.ext.acs.service.WmsToAcsService;
|
||||||
import org.nl.wms.pda.st.service.NbjPdaService;
|
import org.nl.wms.pda.st.service.NbjPdaService;
|
||||||
import org.nl.wms.pdm.bi.dao.PdmBiSlittingproductionplan;
|
import org.nl.wms.pdm.bi.dao.PdmBiSlittingproductionplan;
|
||||||
import org.nl.wms.pdm.bi.service.IpdmBiSlittingproductionplanService;
|
import org.nl.wms.pdm.bi.service.IpdmBiSlittingproductionplanService;
|
||||||
@@ -26,6 +27,7 @@ import org.nl.wms.sch.task_manage.tasks.nbj.PdaSendShaftAGVTask;
|
|||||||
import org.nl.wms.sch.task_manage.tasks.nbj.SubRollDownAGVTask;
|
import org.nl.wms.sch.task_manage.tasks.nbj.SubRollDownAGVTask;
|
||||||
import org.nl.wms.util.PointUtils;
|
import org.nl.wms.util.PointUtils;
|
||||||
import org.nl.wms.util.TaskUtils;
|
import org.nl.wms.util.TaskUtils;
|
||||||
|
import org.nl.wms.util.URLEnum;
|
||||||
import org.slf4j.MDC;
|
import org.slf4j.MDC;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
@@ -65,6 +67,11 @@ public class NbjPdaServiceImpl implements NbjPdaService {
|
|||||||
private IBstIvtCutpointivtService bcutpointivtService;
|
private IBstIvtCutpointivtService bcutpointivtService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private PdaSendShaftAGVTask pdaSendShaftAGVTask;
|
private PdaSendShaftAGVTask pdaSendShaftAGVTask;
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private WmsToAcsService wmsToAcsService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JSONObject changeLiftStatus(JSONObject param) {
|
public JSONObject changeLiftStatus(JSONObject param) {
|
||||||
MDC.put(GeneralDefinition.MDC_KEY, TagNameEnum.SWITCH_STATUS_OF_LIFT.getTag());
|
MDC.put(GeneralDefinition.MDC_KEY, TagNameEnum.SWITCH_STATUS_OF_LIFT.getTag());
|
||||||
@@ -430,6 +437,7 @@ public class NbjPdaServiceImpl implements NbjPdaService {
|
|||||||
taskParam.put("vehicle_code", currentUpPlan.getQzzno());
|
taskParam.put("vehicle_code", currentUpPlan.getQzzno());
|
||||||
taskParam.put("vehicle_code2", currentDownPlan.getQzzno());
|
taskParam.put("vehicle_code2", currentDownPlan.getQzzno());
|
||||||
}
|
}
|
||||||
|
StIvtCutpointivt endPoint;
|
||||||
if (ObjectUtil.isEmpty(device)) {
|
if (ObjectUtil.isEmpty(device)) {
|
||||||
if (plans.size() == 0) {
|
if (plans.size() == 0) {
|
||||||
throw new BadRequestException("系统找不到对应的分切计划,请确保维护了点位信息,或者指定设备!");
|
throw new BadRequestException("系统找不到对应的分切计划,请确保维护了点位信息,或者指定设备!");
|
||||||
@@ -437,14 +445,40 @@ public class NbjPdaServiceImpl implements NbjPdaService {
|
|||||||
PdmBiSlittingproductionplan demoPlan = plans.get(0);
|
PdmBiSlittingproductionplan demoPlan = plans.get(0);
|
||||||
// 如果没有选择目的地,就是根据点位上维护的信息送
|
// 如果没有选择目的地,就是根据点位上维护的信息送
|
||||||
taskParam.put("is_flag", "1");
|
taskParam.put("is_flag", "1");
|
||||||
StIvtCutpointivt endPoint = stIvtCutpointivtService.getPintByExtCode(demoPlan.getResource_name(), false);
|
endPoint = stIvtCutpointivtService.getPintByExtCode(demoPlan.getResource_name(), false);
|
||||||
taskParam.put("point_code2", endPoint.getPoint_code());
|
taskParam.put("point_code2", endPoint.getPoint_code());
|
||||||
} else {
|
} else {
|
||||||
StIvtCutpointivt endPoint = stIvtCutpointivtService.getPintByExtCode(device, false);
|
endPoint = stIvtCutpointivtService.getPintByExtCode(device, false);
|
||||||
taskParam.put("point_code2", endPoint.getPoint_code());
|
taskParam.put("point_code2", endPoint.getPoint_code());
|
||||||
// 不需要修改点位信息
|
// 不需要修改点位信息
|
||||||
taskParam.put("is_flag", "0");
|
taskParam.put("is_flag", "0");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//校验终点和起点实际点位轴类型是否匹配
|
||||||
|
String endPointCode = (String) taskParam.get("point_code2");
|
||||||
|
String startPointCode = (String) taskParam.get("point_code1");
|
||||||
|
if (startPoint.getIvt_id().equals("3") || startPoint.getIvt_id().equals("4")) {
|
||||||
|
JSONArray acsArray = new JSONArray();
|
||||||
|
JSONObject acs = new JSONObject();
|
||||||
|
acs.put("device_code", endPointCode);
|
||||||
|
acs.put("product_area", URLEnum.ACS_URL_A1.getProduct_area());
|
||||||
|
acsArray.add(acs);
|
||||||
|
//acs查询缓存架类型
|
||||||
|
log.info("送轴,获取缓存架类型 - {}", acsArray);
|
||||||
|
JSONObject jsonObject = wmsToAcsService.getCutpointivtType(acsArray);
|
||||||
|
log.info("送轴,获取缓存架类型返回 - {}", jsonObject);
|
||||||
|
JSONObject message = (JSONObject) jsonObject.get("message");
|
||||||
|
if (message == null) {
|
||||||
|
throw new BadRequestException("获取缓存架类型失败!");
|
||||||
|
}
|
||||||
|
if (message.containsKey(startPointCode) && !endPoint.getPlan().equals(message.get(startPointCode))) {
|
||||||
|
throw new BadRequestException("请求搬运失败,缓存架气涨轴类型与分切机不匹配!");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
pdaSendShaftAGVTask.createTask(taskParam);
|
pdaSendShaftAGVTask.createTask(taskParam);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -133,7 +133,6 @@ public class OtherPdaServiceImpl implements OtherPdaService {
|
|||||||
taskService.updateById(nextTask);
|
taskService.updateById(nextTask);
|
||||||
}
|
}
|
||||||
// 通知ACS完成上一个任务
|
// 通知ACS完成上一个任务
|
||||||
// 通知ACS完成上一个任务
|
|
||||||
JSONArray acs = new JSONArray();
|
JSONArray acs = new JSONArray();
|
||||||
JSONObject result = new JSONObject();
|
JSONObject result = new JSONObject();
|
||||||
JSONObject acsParam = new JSONObject();
|
JSONObject acsParam = new JSONObject();
|
||||||
|
|||||||
@@ -53,16 +53,20 @@ public class StIvtHotpointivtServiceImpl extends ServiceImpl<StIvtHotpointivtMap
|
|||||||
? (String) whereJson.get("point_status") : null;
|
? (String) whereJson.get("point_status") : null;
|
||||||
String productArea = ObjectUtil.isNotEmpty(whereJson.get("product_area"))
|
String productArea = ObjectUtil.isNotEmpty(whereJson.get("product_area"))
|
||||||
? (String) whereJson.get("product_area") : null;
|
? (String) whereJson.get("product_area") : null;
|
||||||
String isUsed = ObjectUtil.isNotEmpty(whereJson.get("is_used"))
|
String isUsed = ObjectUtil.isNotEmpty(whereJson.get("is_used")
|
||||||
|
)
|
||||||
? (String) whereJson.get("is_used") : null;
|
? (String) whereJson.get("is_used") : null;
|
||||||
String pointLocation = ObjectUtil.isNotEmpty(whereJson.get("point_location"))
|
String pointLocation = ObjectUtil.isNotEmpty(whereJson.get("point_location"))
|
||||||
? (String) whereJson.get("point_location") : null;
|
? (String) whereJson.get("point_location") : null;
|
||||||
|
String container_name = ObjectUtil.isNotEmpty(whereJson.get("container_name"))
|
||||||
|
? (String) whereJson.get("container_name") : null;
|
||||||
IPage<StIvtHotpointivt> resultPage = new Page<>(page.getPage() + 1, page.getSize());
|
IPage<StIvtHotpointivt> resultPage = new Page<>(page.getPage() + 1, page.getSize());
|
||||||
LambdaQueryWrapper<StIvtHotpointivt> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<StIvtHotpointivt> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.like(ObjectUtil.isNotEmpty(pointCode), StIvtHotpointivt::getPoint_code, pointCode)
|
queryWrapper.like(ObjectUtil.isNotEmpty(pointCode), StIvtHotpointivt::getPoint_code, pointCode)
|
||||||
.eq(ObjectUtil.isNotEmpty(pointStatus), StIvtHotpointivt::getPoint_status, pointStatus)
|
.eq(ObjectUtil.isNotEmpty(pointStatus), StIvtHotpointivt::getPoint_status, pointStatus)
|
||||||
.eq(ObjectUtil.isNotEmpty(productArea), StIvtHotpointivt::getProduct_area, productArea)
|
.eq(ObjectUtil.isNotEmpty(productArea), StIvtHotpointivt::getProduct_area, productArea)
|
||||||
.eq(ObjectUtil.isNotEmpty(isUsed), StIvtHotpointivt::getIs_used, isUsed)
|
.eq(ObjectUtil.isNotEmpty(isUsed), StIvtHotpointivt::getIs_used, isUsed)
|
||||||
|
.like(ObjectUtil.isNotEmpty(container_name), StIvtHotpointivt::getContainer_name, container_name)
|
||||||
.eq(ObjectUtil.isNotEmpty(pointLocation), StIvtHotpointivt::getPoint_location, pointLocation).orderByDesc(StIvtHotpointivt::getInstorage_time);
|
.eq(ObjectUtil.isNotEmpty(pointLocation), StIvtHotpointivt::getPoint_location, pointLocation).orderByDesc(StIvtHotpointivt::getInstorage_time);
|
||||||
return stIvtHotpointivtMapper.selectPage(resultPage, queryWrapper);
|
return stIvtHotpointivtMapper.selectPage(resultPage, queryWrapper);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,12 +3,14 @@ package org.nl.wms.sch.task_manage.tasks.nbj;
|
|||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.nl.common.exception.BadRequestException;
|
import org.nl.common.exception.BadRequestException;
|
||||||
import org.nl.common.utils.CodeUtil;
|
import org.nl.common.utils.CodeUtil;
|
||||||
import org.nl.common.utils.SecurityUtils;
|
import org.nl.common.utils.SecurityUtils;
|
||||||
|
import org.nl.wms.ext.acs.service.WmsToAcsService;
|
||||||
import org.nl.wms.pdm.bi.dao.PdmBiSlittingproductionplan;
|
import org.nl.wms.pdm.bi.dao.PdmBiSlittingproductionplan;
|
||||||
import org.nl.wms.pdm.bi.service.IpdmBiSlittingproductionplanService;
|
import org.nl.wms.pdm.bi.service.IpdmBiSlittingproductionplanService;
|
||||||
import org.nl.wms.pdm.ivt.bcut.service.IBstIvtCutpointivtService;
|
import org.nl.wms.pdm.ivt.bcut.service.IBstIvtCutpointivtService;
|
||||||
@@ -25,6 +27,7 @@ import org.nl.wms.sch.task_manage.core.constant.GeneralDefinition;
|
|||||||
import org.nl.wms.sch.task_manage.core.enums.TaskFinishedTypeEnum;
|
import org.nl.wms.sch.task_manage.core.enums.TaskFinishedTypeEnum;
|
||||||
import org.nl.wms.util.PointUtils;
|
import org.nl.wms.util.PointUtils;
|
||||||
import org.nl.wms.util.TaskUtils;
|
import org.nl.wms.util.TaskUtils;
|
||||||
|
import org.nl.wms.util.URLEnum;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@@ -58,6 +61,7 @@ public class PdaSendShaftAGVTask extends AbstractTask {
|
|||||||
private ISchBasePointService pointService;
|
private ISchBasePointService pointService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IBstIvtCutpointivtService bcutpointivtService;
|
private IBstIvtCutpointivtService bcutpointivtService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void create() throws BadRequestException {
|
public void create() throws BadRequestException {
|
||||||
|
|
||||||
@@ -65,6 +69,7 @@ public class PdaSendShaftAGVTask extends AbstractTask {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String createTask(JSONObject form) {
|
public String createTask(JSONObject form) {
|
||||||
|
|
||||||
// 创建任务
|
// 创建任务
|
||||||
SchBaseTask task = new SchBaseTask();
|
SchBaseTask task = new SchBaseTask();
|
||||||
task.setTask_id(IdUtil.getSnowflake(1,1).nextIdStr());
|
task.setTask_id(IdUtil.getSnowflake(1,1).nextIdStr());
|
||||||
@@ -81,6 +86,7 @@ public class PdaSendShaftAGVTask extends AbstractTask {
|
|||||||
task.setHandle_class(THIS_CLASS);
|
task.setHandle_class(THIS_CLASS);
|
||||||
task.setTask_status(TaskStatus.START_AND_POINT.getCode());
|
task.setTask_status(TaskStatus.START_AND_POINT.getCode());
|
||||||
TaskUtils.setCreateByDefault(task);
|
TaskUtils.setCreateByDefault(task);
|
||||||
|
|
||||||
taskService.save(task);
|
taskService.save(task);
|
||||||
return task.getTask_id();
|
return task.getTask_id();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,28 +109,9 @@ public class SlitterDownAGVTask extends AbstractTask {
|
|||||||
acs.put("device_code", requestObj.getString("device_code"));
|
acs.put("device_code", requestObj.getString("device_code"));
|
||||||
acs.put("product_area", URLEnum.ACS_URL_A1.getProduct_area());
|
acs.put("product_area", URLEnum.ACS_URL_A1.getProduct_area());
|
||||||
acsArray.add(acs);
|
acsArray.add(acs);
|
||||||
//acs查询缓存架类型
|
//校验acs与lms气涨轴类型
|
||||||
log.info("获取缓存架类型 - {}", acsArray);
|
endPoint = checkType(acsArray, areaEmptyNotTaskPoint, endPoint);
|
||||||
JSONObject jsonObject = wmsToAcsService.getCutpointivtType(acsArray);
|
// endPoint = areaEmptyNotTaskPoint.get(0);
|
||||||
log.info("获取缓存架类型返回 - {}", jsonObject);
|
|
||||||
JSONObject message = (JSONObject)jsonObject.get("message");
|
|
||||||
if (message == null){
|
|
||||||
throw new BadRequestException("获取缓存架类型失败!");
|
|
||||||
}
|
|
||||||
for (BstIvtCutpointivt bstIvtCutpointivt : areaEmptyNotTaskPoint) {
|
|
||||||
if (message.containsKey(bstIvtCutpointivt.getPoint_code())){
|
|
||||||
if ( bstIvtCutpointivt.getPlan().equals(message.get(bstIvtCutpointivt.getPoint_code()))) {
|
|
||||||
endPoint = bstIvtCutpointivt;
|
|
||||||
} else {
|
|
||||||
throw new BadRequestException("请求搬运失败,缓存架光电信息不满足!");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
endPoint = bstIvtCutpointivt;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (endPoint == null) {
|
|
||||||
throw new BadRequestException("请求搬运失败,缓存架没有匹配的位置!");
|
|
||||||
}
|
|
||||||
task.setPoint_code2(endPoint.getPoint_code());
|
task.setPoint_code2(endPoint.getPoint_code());
|
||||||
// 设置气胀轴
|
// 设置气胀轴
|
||||||
task.setVehicle_code(currentUpPlan != null ? currentUpPlan.getQzzno() : "");
|
task.setVehicle_code(currentUpPlan != null ? currentUpPlan.getQzzno() : "");
|
||||||
@@ -150,6 +131,31 @@ public class SlitterDownAGVTask extends AbstractTask {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private BstIvtCutpointivt checkType(JSONArray acsArray, List<BstIvtCutpointivt> areaEmptyNotTaskPoint, BstIvtCutpointivt endPoint) {
|
||||||
|
log.info("分切下料,获取缓存架类型 - {}", acsArray);
|
||||||
|
JSONObject jsonObject = wmsToAcsService.getCutpointivtType(acsArray);
|
||||||
|
log.info("分切下料,获取缓存架类型返回 - {}", jsonObject);
|
||||||
|
JSONObject message = (JSONObject)jsonObject.get("message");
|
||||||
|
if (message == null){
|
||||||
|
throw new BadRequestException("获取缓存架类型失败!");
|
||||||
|
}
|
||||||
|
for (BstIvtCutpointivt bstIvtCutpointivt : areaEmptyNotTaskPoint) {
|
||||||
|
if (message.containsKey(bstIvtCutpointivt.getPoint_code())){
|
||||||
|
if ( bstIvtCutpointivt.getPlan().equals(message.get(bstIvtCutpointivt.getPoint_code()))) {
|
||||||
|
endPoint = bstIvtCutpointivt;
|
||||||
|
} else {
|
||||||
|
throw new BadRequestException("请求搬运失败,缓存架气涨轴类型与分切机不匹配!");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
endPoint = bstIvtCutpointivt;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (endPoint == null) {
|
||||||
|
throw new BadRequestException("请求搬运失败,缓存架没有匹配的位置!");
|
||||||
|
}
|
||||||
|
return endPoint;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void finishTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) {
|
public void finishTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) {
|
||||||
|
|||||||
Reference in New Issue
Block a user