Merge branch 'master_merge' into master_merge_0523

This commit is contained in:
zhouz
2025-12-11 10:33:51 +08:00
8 changed files with 1664 additions and 8 deletions

View File

@@ -155,6 +155,8 @@ public class SlitterServiceImpl implements SlitterService {
private TrussCallShaftManuallyTask trussCallShaftManuallyTask;
@Autowired
private StockAreaInOutTask stockAreaInOutTask;
@Autowired
private IBstIvtShafttubeivtService bstIvtShafttubeivtService;
@Override
public JSONObject acsRequestShaftLoadTube(JSONObject param) {
@@ -203,12 +205,42 @@ public class SlitterServiceImpl implements SlitterService {
if ("1".equals(autoSendEmpty.getValue()) && gxQtyList.size() == 0) {
con.put("is_bushing", SlitterConstant.TO_SHAFT_INFO_97);
} else {
// 管芯桁架对接位
List<GxQtyDto> hasNeedPoint = gxQtyList.stream()
.filter(gx -> "1".equals(gx.getPoint_type()) && gx.getQty() >= tubes.size())
.collect(Collectors.toList());
if (hasNeedPoint.size() > 0) {
// 1、判断点位类型有没有=1且数量大于等于所需数
con.put("is_bushing", SlitterConstant.SLITTER_YES);
// - 判断管芯类型与另一台机构的类型是否一样,如果剩下一根管芯且相同,则直送轴
try {
int sum = hasNeedPoint.stream()
.filter(p -> ObjectUtil.isNotEmpty(p.getQty()))
.mapToInt(GxQtyDto::getQty)
.sum();
if (sum == 1) {
BstIvtShafttubeivt one = bstIvtShafttubeivtService.getOne(new LambdaQueryWrapper<BstIvtShafttubeivt>()
.ne(BstIvtShafttubeivt::getPoint_code, point.getPoint_code())
.eq(BstIvtShafttubeivt::getPoint_location, point.getPoint_location())
.eq(BstIvtShafttubeivt::getPoint_type, point.getPoint_type())
.eq(BstIvtShafttubeivt::getIs_used, "1"));
if (ObjectUtil.isNotEmpty(one)) {
List<String> tubes2 = Stream.of(one.getTube_code1(), one.getTube_code2())
.filter(ObjectUtil::isNotEmpty)
.collect(Collectors.toList());
if ((ObjectUtil.isNotEmpty(one.getTube_code1()) && tubes2.contains(point.getTube_code1()))
|| (ObjectUtil.isNotEmpty(one.getTube_code2()) && tubes2.contains(point.getTube_code2()))) {
log.info("剩下一根管芯,避免竞争,只送空轴!");
stepTipLogs.add("剩下一根管芯,避免竞争,只送空轴!");
redisUtils.set("ERROR" + deviceCode, stepTipLogs);
con.put("is_bushing", SlitterConstant.TO_SHAFT_INFO_97);
}
}
}
} catch (Exception e) {
stepTipLogs.add("判断管芯类型与另一台机构的类型是否一样出错,请检查!");
redisUtils.set("ERROR" + deviceCode, stepTipLogs);
}
} else {
// 2、判断点位有没有任务010807->point3, 010808->point1
List<String> pointCodes = gxQtyList.stream()

View File

@@ -53,6 +53,13 @@ public class FeedingController {
return new ResponseEntity<>(feedingService.handleConfirm(whereJson), HttpStatus.OK);
}
@PostMapping("/moveContainer")
@Log("母卷转移")
public ResponseEntity<Object> moveContainer(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(feedingService.moveContainer(whereJson), HttpStatus.OK);
}
@PostMapping("/vehicleReturn")
@Log("空轴送回")

View File

@@ -37,6 +37,8 @@ public interface FeedingService {
*/
JSONObject handleConfirm(JSONObject whereJson);
JSONObject moveContainer(JSONObject whereJson);
/**
* 空轴送回
*

View File

@@ -23,6 +23,7 @@ import org.nl.wms.pda.mps.eum.RegionTypeEnum;
import org.nl.wms.pda.mps.service.FeedingService;
import org.nl.wms.sch.manage.AbstractAcsTask;
import org.nl.wms.sch.manage.TaskStatusEnum;
import org.nl.wms.sch.tasks.CallEmpReelTask;
import org.nl.wms.sch.tasks.CoolCutTask;
import org.nl.wms.sch.tasks.OutHotTask;
import org.nl.wms.st.inbill.service.CheckOutBillService;
@@ -305,7 +306,7 @@ public class FeedingServiceImpl implements FeedingService {
}
//创建AGV任务
JSONObject jo = new JSONObject();
if (StrUtil.equals("01", cut_jo.getString("empty_point_status"))) {
if (StrUtil.equals("01", cut_jo.getString("empty_point_status")) || (StrUtil.isNotEmpty(cut_jo.getString("point_type")) && StrUtil.equals("1", cut_jo.getString("point_type")))) {
jo.put("point_code1", cool_jo.getString("full_point_code"));
jo.put("point_code2", cut_jo.getString("full_point_code"));
jo.put("material_code", cool_jo.getString("container_name"));
@@ -544,6 +545,42 @@ public class FeedingServiceImpl implements FeedingService {
return result;
}
@Override
public JSONObject moveContainer(JSONObject form) {
String point_code = form.getString("point_code");
String container_name = form.getString("container_name");
JSONObject cool_jo = WQLObject.getWQLObject("st_ivt_coolpointivt").query("full_point_code = '" + point_code + "'").uniqueResult(0);
String reging_id = RegionTypeEnum.B1_HKZC.getId();
JSONObject cache_map = new JSONObject();
cache_map.put("flag", "4");
cache_map.put("reging_id", reging_id);
cache_map.put("point_location", cool_jo.getString("point_location"));
//只找入箱点位point_type : 4
cache_map.put("point_type", "4");
JSONObject point_code2_jo = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(cache_map).process().uniqueResult(0);
if (ObjectUtil.isEmpty(point_code2_jo)) {
// 找不到就找其他上下位置的
cache_map.put("point_location", cool_jo.getString("point_location").equals("0") ? "1" : "0");
point_code2_jo = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(cache_map).process().uniqueResult(0);
}
if (ObjectUtil.isEmpty(point_code2_jo)) {
throw new BadRequestException("未查询到可用的点位类型为入箱的烘箱对接位!");
}
// 起点和终点确定 生成任务
JSONObject param = new JSONObject();
param.put("point_code1",point_code);
param.put("point_code2", point_code2_jo.getString("point_code"));
param.put("task_type", "010107");
param.put("material_code", container_name);
param.put("product_area", cool_jo.getString("product_area"));
CallEmpReelTask callEmpReelTask = SpringContextHolder.getBean(CallEmpReelTask.class);
callEmpReelTask.createTask(param);
return null;
}
@Transactional(rollbackFor = Exception.class)
@Override
public JSONObject vehicleReturn(JSONObject form) {

View File

@@ -244,7 +244,7 @@ public class RawFoilServiceImpl implements RawFoilService {
param.put("material_code", jsonRaw.getString("container_name"));
param.put("product_area", jsonSb.getString("product_area"));
CallEmpReelTask callEmpReelTask = new CallEmpReelTask();
CallEmpReelTask callEmpReelTask = SpringContextHolder.getBean(CallEmpReelTask.class);
callEmpReelTask.createTask(param);
} else {
// 2.根据就近原则查对应空卷轴

View File

@@ -181,11 +181,55 @@ public class CallEmpReelTask extends AbstractAcsTask {
this.createTask(nextTaskParam);
}
} else {
// 取空
JSONObject jsonCoolIvt = ivtTab.query("empty_point_code = '" + point_code1 + "'").uniqueResult(0);
jsonCoolIvt.put("empty_point_status", "01");
jsonCoolIvt.put("empty_vehicle_code", "");
ivtTab.update(jsonCoolIvt);
if (jsonTask.getString("task_type").equals("010107")) {
JSONObject jsonIvt = ivtTab.query("full_point_code ='" + point_code1 + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonIvt)) {
throw new BadRequestException("未找到可用点位:" + point_code1);
}
// 更新冷却库存状态
jsonIvt.put("full_point_status", "01");
jsonIvt.put("full_vehicle_code", "");
jsonIvt.put("container_name", "");
ivtTab.update(jsonIvt);
// 校验终点是否存在
JSONObject jsonIvt2 = point_tab.query("point_code ='" + point_code2 + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonIvt2)) {
throw new BadRequestException("终点未找到可用点位:" + point_code2);
}
JSONObject cache_param = new JSONObject();
cache_param.put("flag", "4");
cache_param.put("point_location", jsonIvt.getString("point_location"));
cache_param.put("product_area", jsonIvt.getString("product_area"));
// 创建半条任务
JSONObject jo = new JSONObject();
jo.put("task_id", IdUtil.getLongId());
jo.put("task_code", IdUtil.getLongId());
jo.put("task_type", "010206");
jo.put("task_status", TaskStatusEnum.SURE_START.getCode());
jo.put("point_code1", point_code2);
jo.put("point_code2", "");
jo.put("material_code", jsonTask.getString("material_code"));
jo.put("product_area", jsonTask.getString("product_area"));
jo.put("handle_class", InHotTask.class.getName());
jo.put("remark", cache_param);
jo.put("type", "3");
jo.put("priority", "1");
jo.put("sort_seq", "1");
jo.put("create_time", DateUtil.now());
jo.put("acs_task_type", "6");
taskTab.insert(jo);
// 更新点位库存状态
jsonIvt2.put("point_status", "2");
jsonIvt2.put("material_code", jsonTask.getString("material_code"));
point_tab.update(jsonIvt2);
}else {
// 取空
JSONObject jsonCoolIvt = ivtTab.query("empty_point_code = '" + point_code1 + "'").uniqueResult(0);
jsonCoolIvt.put("empty_point_status", "01");
jsonCoolIvt.put("empty_vehicle_code", "");
ivtTab.update(jsonCoolIvt);
}
}
} else {
@@ -206,7 +250,7 @@ public class CallEmpReelTask extends AbstractAcsTask {
// 校验终点是否存在
JSONObject jsonIvt2 = point_tab.query("point_code ='" + point_code4 + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonIvt2)) {
throw new BadRequestException("终点未找到可用点位:" + point_code2);
throw new BadRequestException("终点未找到可用点位:" + point_code4);
}
/*//创建桁架任务将子卷搬运到桁架下的半成品缓存位