fix:分切下料修改

This commit is contained in:
ls
2025-02-11 11:00:19 +08:00
parent 880df8de9e
commit d5338d3fa5
10 changed files with 521 additions and 4 deletions

View File

@@ -43,4 +43,10 @@ public interface WmsToAcsService {
* @return /
*/
JSONObject toAcsGxInStorage(JSONArray param);
/**
* 获取分切下料缓存架类型
*/
JSONObject getCutpointivtType(JSONArray param);
}

View File

@@ -58,4 +58,9 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
return AcsUtil.notifyAcs4("api/wms/getTubeMsg", param);
}
@Override
public JSONObject getCutpointivtType(JSONArray param) {
return AcsUtil.notifyAcs4("api/wms/getCutpointivtType", param);
}
}

View File

@@ -15,6 +15,7 @@ import org.nl.wms.pdm.ivt.bcut.service.IBstIvtCutpointivtService;
import org.nl.wms.pdm.ivt.bcut.service.dao.BstIvtCutpointivt;
import org.nl.wms.pdm.ivt.cut.service.IstIvtCutpointivtService;
import org.nl.wms.pdm.ivt.cut.service.dao.StIvtCutpointivt;
import org.nl.wms.sch.point.service.ISchBasePointService;
import org.nl.wms.sch.point.service.dao.SchBasePoint;
import org.nl.wms.sch.task.service.ISchBaseTaskService;
import org.nl.wms.sch.task.service.dao.SchBaseTask;
@@ -32,6 +33,7 @@ import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import static org.nl.wms.util.PointUtils.clearPoint;
import static org.nl.wms.util.TaskUtils.checkTaskOptionStatus;
import static org.nl.wms.util.TaskUtils.updateOptMessageBySlitterPlan;
@@ -52,6 +54,10 @@ public class PdaSendShaftAGVTask extends AbstractTask {
private IstIvtCutpointivtService stIvtCutpointivtService;
@Autowired
private IpdmBiSlittingproductionplanService slittingproductionplanService;
@Autowired
private ISchBasePointService pointService;
@Autowired
private IBstIvtCutpointivtService bcutpointivtService;
@Override
public void create() throws BadRequestException {
@@ -84,7 +90,19 @@ public class PdaSendShaftAGVTask extends AbstractTask {
public void finishTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) {
checkTaskOptionStatus(taskObj);
String endPointCode = taskObj.getPoint_code2();
String startPointCode = taskObj.getPoint_code1();
StIvtCutpointivt endPoint = stIvtCutpointivtService.getOneByCode(endPointCode);
BstIvtCutpointivt startPoint = bcutpointivtService.getPintByAgvCode(startPointCode, false);
//起点点位清空
startPoint.setQzz_no1("");
startPoint.setQzz_no2("");
startPoint.setUp_gx1("");
startPoint.setUp_gx2("");
startPoint.setDown_gx1("");
startPoint.setDown_gx2("");
startPoint.setPoint_status("1");
PointUtils.setBCutUpdateByType(startPoint, taskFinishedType);
bcutpointivtService.updateById(startPoint);
List<String> collect = Stream.of(taskObj.getVehicle_code(), taskObj.getVehicle_code2()).filter(ObjectUtil::isNotEmpty).collect(Collectors.toList());
// 有工单则需要将工单设置入站完成05
if (collect.size() > 0) {

View File

@@ -10,6 +10,7 @@ import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.nl.common.exception.BadRequestException;
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.service.IpdmBiSlittingproductionplanService;
import org.nl.wms.pdm.ivt.bcut.service.IBstIvtCutpointivtService;
@@ -24,12 +25,15 @@ 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.tasks.nbj.SendShaftAGVTask;
import org.nl.wms.util.PointUtils;
import org.nl.wms.util.URLEnum;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@@ -57,6 +61,9 @@ public class SlitterDownAGVTask extends AbstractTask {
private SendShaftAGVTask sendShaftAGVTask;
@Autowired
private IstIvtCutpointivtService stIvtCutpointivtService;
@Autowired
private WmsToAcsService wmsToAcsService;
@Override
public void create() throws BadRequestException {
@@ -90,16 +97,36 @@ public class SlitterDownAGVTask extends AbstractTask {
.orElse(null);
task.setPoint_code1(requestObj.getString("device_code"));
// 查找终点,在内包间的区域找个空位.
// 校验acs点位信息与终点点位信息是否匹配
// 光电信号校验acs点位信息与终点点位信息是否匹配
List<BstIvtCutpointivt> areaEmptyNotTaskPoint = bstIvtCutpointivtService.getAreaNotTaskPointByStatus("1",
"1", "0", "1");
if (areaEmptyNotTaskPoint.size() == 0) {
throw new BadRequestException("请求搬运失败,内包间没有可存放位置!");
}
BstIvtCutpointivt endPoint = null;
JSONArray acsArray = new JSONArray();
JSONObject acs = new JSONObject();
acs.put("device_code", requestObj.getString("device_code"));
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("获取缓存架类型失败!");
}
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("请求搬运失败,缓存架没有匹配的位置!");