@@ -72,7 +72,7 @@ public class AgvInstService {
|
||||
JSONObject cacheLine = WQLObject.getWQLObject("SCH_cacheLine_region_relation").query("region_code = '"+devicePoint.getRegion_code()+"'").uniqueResult(0);
|
||||
nextPoint = cacheLine.getString("cacheline_code");
|
||||
//满料请求:查询缓存线空载具列表
|
||||
cacheVehile = getEmpCacheVehile(nextPoint, null);
|
||||
cacheVehile = getCacheVehile(nextPoint, null);
|
||||
if (StringUtils.isBlank(cacheVehile)) {
|
||||
throw new BadRequestException("缓存线:"+nextPoint+"没有可用空载具");
|
||||
}
|
||||
@@ -96,13 +96,14 @@ public class AgvInstService {
|
||||
//3.agv根据对应载具列表行进扫码匹配:匹配到对应物料则创建点对点任务
|
||||
public void callMatter(JSONObject task){
|
||||
//参数
|
||||
String targetDevice = task.getString("next_point_code");
|
||||
String material_id = task.getString("material_id");
|
||||
JSONObject devicePoint = WQLObject.getWQLObject("SCH_BASE_Point").query("point_code = '" + targetDevice + "' and is_delete = 0 and is_used = 1").uniqueResult(0);
|
||||
JSONObject cacheLine = WQLObject.getWQLObject("SCH_cacheLine_region_relation").query("region_code = '"+devicePoint.getString("region_code")+"' and is_active = '"+StatusEnum.STATUS_TRUE.getCode()+"'").uniqueResult(0);
|
||||
Assert.notNull(cacheLine, String.format("区域%s对应缓存线信息不存在", devicePoint.getString("region_code")));
|
||||
//缓存线位置编码 :缺料请求获取缓存线满载具列表
|
||||
String startPoint = cacheLine.getString("cacheline_code");
|
||||
String cacheVehile = getEmpCacheVehile(startPoint, material_id);
|
||||
String cacheVehile = getCacheVehile(startPoint, material_id);
|
||||
if (StringUtils.isBlank(cacheVehile)) {
|
||||
throw new BadRequestException("缓存线:"+startPoint+"没有物料"+material_id+"对应可用载具");
|
||||
}
|
||||
@@ -121,9 +122,8 @@ public class AgvInstService {
|
||||
|
||||
}
|
||||
|
||||
public String getEmpCacheVehile(String cacheLine, String materialId){
|
||||
WQLObject taskTable = WQLObject.getWQLObject("sch_base_task");
|
||||
JSONArray runingTask = taskTable.query("point_code2 = '" + cacheLine + "' and task_status < '" + StatusEnum.TASK_FINISH.getCode() + "'").getResultJSONArray(0);
|
||||
public String getCacheVehile(String cacheLine,String materialId){
|
||||
JSONArray runingTask = WQLObject.getWQLObject("sch_base_task").query("point_code2 = '" + cacheLine + "' and task_status < '" + StatusEnum.TASK_FINISH.getCode() + "'").getResultJSONArray(0);
|
||||
String status = StringUtils.isBlank(materialId) ? StatusEnum.CACHE_VEL_EMT.getCode() : StatusEnum.CACHE_VEL_FULL.getCode();
|
||||
JSONArray result = WQL.getWO("sch_point").addParamMap(MapOf.of("flag", "6", "vehicle_status", status, "material_id", materialId)).process().getResultJSONArray(0);
|
||||
if (result.size()>0){
|
||||
|
||||
Reference in New Issue
Block a user