光电驱动fix&缓存区路线遮挡问题优化
This commit is contained in:
@@ -19,14 +19,14 @@ public class ItemProtocol {
|
|||||||
public static String item_pallet_type = "pallet_type";
|
public static String item_pallet_type = "pallet_type";
|
||||||
public static String item_to_command = "to_command";
|
public static String item_to_command = "to_command";
|
||||||
|
|
||||||
public static String open_time = "open_time";
|
// public static String open_time = "open_time";
|
||||||
public static String off_time = "off_time";
|
// public static String off_time = "off_time";
|
||||||
public static String standby_time1 = "standby_time1";
|
// public static String standby_time1 = "standby_time1";
|
||||||
public static String production_time1 = "production_time1";
|
// public static String production_time1 = "production_time1";
|
||||||
public static String error_time1 = "error_time1";
|
// public static String error_time1 = "error_time1";
|
||||||
public static String standby_time2 = "standby_time2";
|
// public static String standby_time2 = "standby_time2";
|
||||||
public static String production_time2 = "production_time2";
|
// public static String production_time2 = "production_time2";
|
||||||
public static String error_time2 = "error_time2";
|
// public static String error_time2 = "error_time2";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -128,18 +128,18 @@ public class ItemProtocol {
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<ItemDto> getReadableItemDtos4() {
|
// public static List<ItemDto> getReadableItemDtos4() {
|
||||||
ArrayList list = new ArrayList();
|
// ArrayList list = new ArrayList();
|
||||||
list.add(new ItemDto(open_time, "开机上报 ", "DB6.DTL770"));
|
// list.add(new ItemDto(open_time, "开机上报 ", "DB6.DTL770"));
|
||||||
list.add(new ItemDto(off_time, "关机上报", "DB6.DTL782"));
|
// list.add(new ItemDto(off_time, "关机上报", "DB6.DTL782"));
|
||||||
list.add(new ItemDto(standby_time1, "当前待机时间1", "DB6.DBD794"));
|
// list.add(new ItemDto(standby_time1, "当前待机时间1", "DB6.DBD794"));
|
||||||
list.add(new ItemDto(production_time1, "当前生产时间1", "DB6.DBD798"));
|
// list.add(new ItemDto(production_time1, "当前生产时间1", "DB6.DBD798"));
|
||||||
list.add(new ItemDto(error_time1, "当前故障时间1", "DB6.DBD802"));
|
// list.add(new ItemDto(error_time1, "当前故障时间1", "DB6.DBD802"));
|
||||||
list.add(new ItemDto(standby_time2, "当前待机时间2", "DB6.DBD806"));
|
// list.add(new ItemDto(standby_time2, "当前待机时间2", "DB6.DBD806"));
|
||||||
list.add(new ItemDto(production_time2, "当前生产时间2", "DB6.DBD810"));
|
// list.add(new ItemDto(production_time2, "当前生产时间2", "DB6.DBD810"));
|
||||||
list.add(new ItemDto(error_time2, "当前故障时间2", "DB6.DBD814"));
|
// list.add(new ItemDto(error_time2, "当前故障时间2", "DB6.DBD814"));
|
||||||
return list;
|
// return list;
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -67,9 +67,9 @@ public class SiteDefination implements OpcDeviceDriverDefination {
|
|||||||
return ItemProtocol.getReadableItemDtos3();
|
return ItemProtocol.getReadableItemDtos3();
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<ItemDto> getReadableItemDtos4() {
|
// public List<ItemDto> getReadableItemDtos4() {
|
||||||
return ItemProtocol.getReadableItemDtos4();
|
// return ItemProtocol.getReadableItemDtos4();
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -397,11 +397,22 @@ public class SiteDeviceDriver extends AbstractOpcDeviceDriver implements DeviceD
|
|||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
this.time = date;
|
this.time = date;
|
||||||
FeedBackTaskStatusRequest request = new FeedBackTaskStatusRequest();
|
JSONObject jsonObject = new JSONObject();
|
||||||
request.setDevice_code(device_code);
|
String device_code = this.device_code;
|
||||||
request.setRequest_medthod_code(String.valueOf(type));
|
jsonObject.put("device_code", device_code);
|
||||||
String resp = acsToWmsService.applyTask(request);
|
jsonObject.put("requestDate", new Date());
|
||||||
JSONObject res_jo = JSONObject.parseObject(resp);
|
jsonObject.put("vehicle_type",this.pallet_type);
|
||||||
|
jsonObject.put("requestNo", IdUtil.simpleUUID());
|
||||||
|
switch (type) {
|
||||||
|
case 7:
|
||||||
|
jsonObject.put("request_method_code", "TBXQKTask");
|
||||||
|
break;
|
||||||
|
case 8:
|
||||||
|
jsonObject.put("request_method_code", "KJQKTask");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
String result=acsToWmsService.applyTaskToWms(jsonObject);
|
||||||
|
JSONObject res_jo = JSONObject.parseObject(result);
|
||||||
if (StrUtil.equals(res_jo.getString("code"), "200")) {
|
if (StrUtil.equals(res_jo.getString("code"), "200")) {
|
||||||
this.writing(type);
|
this.writing(type);
|
||||||
this.setRequireSucess(true);
|
this.setRequireSucess(true);
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ import org.springframework.stereotype.Component;
|
|||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -147,24 +148,24 @@ public class GHCMLTask extends AbstractTask {
|
|||||||
// 查找相同批次
|
// 查找相同批次
|
||||||
// 最小排最小列,且列大于1(即不是等待位置,1不写死:使用子查询,寻找当排最小列序号的值)
|
// 最小排最小列,且列大于1(即不是等待位置,1不写死:使用子查询,寻找当排最小列序号的值)
|
||||||
// 多个数据选择一个:Limit 1, 还需要考虑任务数,尽量一排排满
|
// 多个数据选择一个:Limit 1, 还需要考虑任务数,尽量一排排满
|
||||||
SchBasePoint sameMaterialPoints = autoMapper.getZCSameMaterialPoint(jsonObject.getString("pcsn")
|
List<SchBasePoint> sameMaterialPoints = autoMapper.getZCSameMaterialPoint(jsonObject.getString("pcsn")
|
||||||
, jsonObject.getString("material_id"));
|
, jsonObject.getString("material_id"));
|
||||||
if (ObjectUtil.isNotEmpty(sameMaterialPoints)) {
|
SchBasePoint temp=null;
|
||||||
// 找到相同物料。分配等待点。
|
int row_num=0;
|
||||||
SchBasePoint point = pointService.getOne(new LambdaQueryWrapper<SchBasePoint>()
|
//检查当前列前面是否有货
|
||||||
.in(SchBasePoint::getRegion_code, nextRegionStr)
|
for(SchBasePoint schBasePoint:sameMaterialPoints){
|
||||||
.eq(SchBasePoint::getRow_num, sameMaterialPoints.getRow_num())
|
if(row_num==schBasePoint.getRow_num()){
|
||||||
.eq(SchBasePoint::getIs_used, true)
|
continue;
|
||||||
.eq(SchBasePoint::getPoint_status, PointStatusEnum.EMPTY_POINT.getCode())
|
}
|
||||||
// 当前执行的任务为空或者NULL,有数据表示锁住
|
if(PointStatusEnum.EMPTY_POINT.getCode().equals(schBasePoint.getPoint_status())){
|
||||||
.and(la -> la.isNull(SchBasePoint::getIng_task_code)
|
temp = schBasePoint;
|
||||||
.or()
|
}else{
|
||||||
.eq(SchBasePoint::getIng_task_code, ""))
|
row_num=schBasePoint.getRow_num();
|
||||||
.orderByAsc(SchBasePoint::getCol_num), false);
|
}
|
||||||
if (ObjectUtil.isNotEmpty(point)) {
|
}
|
||||||
return point;
|
if (ObjectUtil.isNotEmpty(temp)) {
|
||||||
|
return temp;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// 如果没有找到。或者分配等待点失败,就选择一个空列存放
|
// 如果没有找到。或者分配等待点失败,就选择一个空列存放
|
||||||
return autoMapper.getZCEmptyMaterialPoint(nextRegionStr.get(0), jsonObject.getString("material_id"));
|
return autoMapper.getZCEmptyMaterialPoint(nextRegionStr.get(0), jsonObject.getString("material_id"));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ public interface AutoMapper {
|
|||||||
|
|
||||||
List<SchBasePoint> getGHSExitMaterialList();
|
List<SchBasePoint> getGHSExitMaterialList();
|
||||||
|
|
||||||
SchBasePoint getZCSameMaterialPoint(String pcsn, String materialId);
|
List<SchBasePoint> getZCSameMaterialPoint(String pcsn, String materialId);
|
||||||
|
|
||||||
SchBasePoint getZCEmptyMaterialPoint(String regionCode, String materialId);
|
SchBasePoint getZCEmptyMaterialPoint(String regionCode, String materialId);
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,6 @@
|
|||||||
AND vg.group_bind_material_status = '2'
|
AND vg.group_bind_material_status = '2'
|
||||||
WHERE p.region_code = 'ZC'
|
WHERE p.region_code = 'ZC'
|
||||||
AND p.is_used = TRUE
|
AND p.is_used = TRUE
|
||||||
and p.point_status=1
|
|
||||||
and p.row_num in (
|
and p.row_num in (
|
||||||
SELECT p.row_num
|
SELECT p.row_num
|
||||||
FROM sch_base_point p
|
FROM sch_base_point p
|
||||||
@@ -40,8 +39,6 @@
|
|||||||
and RIGHT(vg.pcsn,8)=RIGHT(#{pcsn},8)
|
and RIGHT(vg.pcsn,8)=RIGHT(#{pcsn},8)
|
||||||
)
|
)
|
||||||
ORDER BY p.row_num, p.col_num
|
ORDER BY p.row_num, p.col_num
|
||||||
limit 1
|
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
<select id="getZCEmptyMaterialPoint" resultType="org.nl.wms.sch.point.service.dao.SchBasePoint">
|
<select id="getZCEmptyMaterialPoint" resultType="org.nl.wms.sch.point.service.dao.SchBasePoint">
|
||||||
SELECT p.*
|
SELECT p.*
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ import java.util.stream.Collectors;
|
|||||||
* @Date: 2023/12/1
|
* @Date: 2023/12/1
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Component("KJZCQKTask")
|
@Component("KJQKTask")
|
||||||
public class KJQKTask extends AbstractTask {
|
public class KJQKTask extends AbstractTask {
|
||||||
private static final String TASK_CONFIG_CODE = "KJQKTask";
|
private static final String TASK_CONFIG_CODE = "KJQKTask";
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|||||||
Reference in New Issue
Block a user