add:分切下料送轴问题处理
This commit is contained in:
@@ -31,9 +31,7 @@ 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;
|
||||
|
||||
@@ -64,6 +62,10 @@ public class SlitterDownAGVTask extends AbstractTask {
|
||||
|
||||
@Autowired
|
||||
private WmsToAcsService wmsToAcsService;
|
||||
|
||||
@Autowired
|
||||
private IstIvtCutpointivtService cutpointivtService;
|
||||
|
||||
@Override
|
||||
public void create() throws BadRequestException {
|
||||
|
||||
@@ -106,11 +108,15 @@ public class SlitterDownAGVTask extends AbstractTask {
|
||||
BstIvtCutpointivt endPoint = null;
|
||||
JSONArray acsArray = new JSONArray();
|
||||
JSONObject acs = new JSONObject();
|
||||
acs.put("device_code", requestObj.getString("device_code"));
|
||||
String deviceCode = requestObj.getString("device_code");
|
||||
acs.put("device_code", deviceCode);
|
||||
acs.put("product_area", URLEnum.ACS_URL_A1.getProduct_area());
|
||||
acsArray.add(acs);
|
||||
StIvtCutpointivt cutPoint = cutpointivtService.getOneByCode(deviceCode);
|
||||
|
||||
|
||||
//校验acs与lms气涨轴类型
|
||||
endPoint = checkType(acsArray, areaEmptyNotTaskPoint, endPoint);
|
||||
endPoint = checkType(acsArray, areaEmptyNotTaskPoint, endPoint, cutPoint);
|
||||
// endPoint = areaEmptyNotTaskPoint.get(0);
|
||||
task.setPoint_code2(endPoint.getPoint_code());
|
||||
// 设置气胀轴
|
||||
@@ -131,28 +137,34 @@ public class SlitterDownAGVTask extends AbstractTask {
|
||||
});
|
||||
}
|
||||
|
||||
private BstIvtCutpointivt checkType(JSONArray acsArray, List<BstIvtCutpointivt> areaEmptyNotTaskPoint, BstIvtCutpointivt endPoint) {
|
||||
private BstIvtCutpointivt checkType(JSONArray acsArray, List<BstIvtCutpointivt> areaEmptyNotTaskPoint, BstIvtCutpointivt endPoint, StIvtCutpointivt stIvtCutpointivt) {
|
||||
log.info("分切下料,获取缓存架类型 - {}", acsArray);
|
||||
JSONObject jsonObject = wmsToAcsService.getCutpointivtType(acsArray);
|
||||
log.info("分切下料,获取缓存架类型返回 - {}", jsonObject);
|
||||
JSONObject message = (JSONObject)jsonObject.get("message");
|
||||
if (message == null){
|
||||
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;
|
||||
if (endPoint.getPlan().equals("1")){
|
||||
endPoint.setPoint_code(endPoint.getPoint_code()+"_C");
|
||||
}
|
||||
if (endPoint.getPlan().equals("2")){
|
||||
endPoint.setPoint_code(endPoint.getPoint_code()+"_D");
|
||||
}
|
||||
} else {
|
||||
throw new BadRequestException("请求搬运失败,缓存架气涨轴类型与分切机不匹配!");
|
||||
for (BstIvtCutpointivt bstIvtCutpointivt : areaEmptyNotTaskPoint) {
|
||||
if (message.containsKey(bstIvtCutpointivt.getPoint_code())) {
|
||||
//起点和终点轴类型不相等,或者终点轴类型与实际光电不相等都不满足条件
|
||||
if (!bstIvtCutpointivt.getPlan().equals(message.get(bstIvtCutpointivt.getPoint_code()))){
|
||||
throw new BadRequestException("请求搬运失败,缓存架气涨轴类型与实际光电检测类型不匹配!");
|
||||
}
|
||||
if (!stIvtCutpointivt.getPlan().equals(bstIvtCutpointivt.getPlan())) {
|
||||
break;
|
||||
}
|
||||
|
||||
endPoint = bstIvtCutpointivt;
|
||||
if (endPoint.getPlan().equals("1")) {
|
||||
endPoint.setPoint_code(endPoint.getPoint_code() + "_C");
|
||||
}
|
||||
if (endPoint.getPlan().equals("2")) {
|
||||
endPoint.setPoint_code(endPoint.getPoint_code() + "_D");
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
endPoint = bstIvtCutpointivt;
|
||||
}
|
||||
@@ -174,8 +186,8 @@ public class SlitterDownAGVTask extends AbstractTask {
|
||||
// 终点设置数据
|
||||
String endPointCode = taskObj.getPoint_code2();
|
||||
//长短轴需要截取
|
||||
if (endPointCode.contains("_C") || endPointCode.contains("_D")){
|
||||
endPointCode = endPointCode.substring(0,9);
|
||||
if (endPointCode.contains("_C") || endPointCode.contains("_D")) {
|
||||
endPointCode = endPointCode.substring(0, 9);
|
||||
}
|
||||
BstIvtCutpointivt endPoint = bstIvtCutpointivtService.getPintByAgvCode(endPointCode, false);
|
||||
endPoint.setQzz_no1(taskObj.getVehicle_code());
|
||||
|
||||
Reference in New Issue
Block a user