上线版本
This commit is contained in:
@@ -331,12 +331,17 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
//工位编码
|
||||
String device_code = whereJson.getString("device_code");
|
||||
//条码
|
||||
String barcode = whereJson.getString("barcode");
|
||||
StringBuilder barcodeBuilder = new StringBuilder(StrUtil.isBlank(whereJson.getString("barcode")) ? "" : whereJson.getString("barcode"));
|
||||
//是否是第一个工位
|
||||
String is_first = whereJson.getString("is_first");
|
||||
WQLObject wo = WQLObject.getWQLObject("sch_base_point");
|
||||
WQLObject wo_ivt = WQLObject.getWQLObject("ST_IVT_StructIvt");
|
||||
MaterialbaseDto materialbaseDto = null;
|
||||
for (int i = barcodeBuilder.length(); i < 4; i++) {
|
||||
barcodeBuilder.insert(0, "0");
|
||||
}
|
||||
String barcode = barcodeBuilder.toString();
|
||||
|
||||
//Long material_id = null;
|
||||
//首先判断条码变化的是不是第一个满料盅缓存位
|
||||
//如果是的话说明困料区来的 先去库存表查询对应的条码的物料信息 并将对应的物料信息保存在redis中
|
||||
@@ -354,7 +359,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
String ivt_qty = ObjectUtil.isEmpty(redis_ivt_qty) ? "0" : String.valueOf(redis_ivt_qty);
|
||||
Long materialId = null;
|
||||
String point_status = "2";
|
||||
if (StrUtil.equals("0", barcode)) {
|
||||
if (StrUtil.equals("0000", barcode)) {
|
||||
point_status = "1";
|
||||
}
|
||||
if (StrUtil.isNotEmpty(material_id)) {
|
||||
|
||||
@@ -15,6 +15,7 @@ import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.nl.wms.ext.acs.service.WmsToAcsService;
|
||||
import org.nl.wms.ext.acs.service.impl.WmsToAcsServiceImpl;
|
||||
import org.nl.wms.sch.SchTaskDto;
|
||||
import org.nl.wms.sch.manage.AbstractAcsTask;
|
||||
@@ -103,19 +104,19 @@ public class YljCallMaterialTask extends AbstractAcsTask {
|
||||
|
||||
//修改起点库存
|
||||
JSONObject ivtStart = ivtTab.query("point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||
ivtStart.put("vehicle_type", "");
|
||||
ivtStart.put("vehicle_code", "");
|
||||
ivtStart.put("material_id", "");
|
||||
// ivtStart.put("vehicle_type", "");
|
||||
// ivtStart.put("vehicle_code", "");
|
||||
// ivtStart.put("material_id", "");
|
||||
ivtStart.put("instorage_time", DateUtil.now());
|
||||
ivtTab.update(ivtStart);
|
||||
|
||||
//解锁起点
|
||||
jsonStart.put("lock_type", "1");
|
||||
jsonStart.put("point_status", "1");
|
||||
// jsonStart.put("point_status", "1");
|
||||
jsonStart.put("task_id", "");
|
||||
jsonStart.put("vehicle_type", "");
|
||||
jsonStart.put("vehicle_code", "");
|
||||
jsonStart.put("material_id", "");
|
||||
// jsonStart.put("vehicle_type", "");
|
||||
// jsonStart.put("vehicle_code", "");
|
||||
// jsonStart.put("material_id", "");
|
||||
jsonStart.put("update_time", DateUtil.now());
|
||||
pointTab.update(jsonStart);
|
||||
|
||||
@@ -233,7 +234,26 @@ public class YljCallMaterialTask extends AbstractAcsTask {
|
||||
//判断当前点是否有未完成的任务
|
||||
JSONObject taskObj = taskTab.query("is_delete='0' and point_code2 = '" + point_code2 + "' and task_status <> '" + TaskStatusEnum.FINISHED.getCode() + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(taskObj)) throw new BadRequestException("当前点位" + point_code2 + "存在未完成的任务");
|
||||
|
||||
JSONObject yljTask = taskTab.query("is_delete='0' and (point_code1 LIKE 'YLJ%' OR point_code2 LIKE 'YLJ%') and task_status <> '" + TaskStatusEnum.FINISHED.getCode() + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(yljTask)) {
|
||||
throw new BadRequestException("有其他压机正在执行叫料任务");
|
||||
}
|
||||
JSONObject taskObj1 = taskTab.query("is_delete='0' and (point_code1 = 'GT04' OR point_code2 = 'GT04') and task_status <> '" + TaskStatusEnum.FINISHED.getCode() + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(taskObj1)) {
|
||||
throw new BadRequestException("[GT04]存在未完成的任务");
|
||||
}
|
||||
JSONObject gt03Status = SpringContextHolder.getBean(WmsToAcsService.class).queryGT03Status();
|
||||
if (!gt03Status.getBooleanValue("GT03")) {
|
||||
throw new BadRequestException("满料盅输送线正在滚动");
|
||||
}
|
||||
String vehicle_code = WQLObject
|
||||
.getWQLObject("st_ivt_structivt")
|
||||
.query("point_code = 'GT04'")
|
||||
.uniqueResult(0)
|
||||
.getString("vehicle_code");
|
||||
if (StrUtil.isNotBlank(vehicle_code)) {
|
||||
throw new BadRequestException("[GT04]上有载具");
|
||||
}
|
||||
JSONObject workOrderObj = workOrderTab.query("device_code = '" + workDevice + "' and order_status = '3' and is_delete ='0'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(workOrderObj)) throw new BadRequestException("该设备当前未生产或者已删除");
|
||||
|
||||
|
||||
@@ -279,18 +279,18 @@ public class HandlingTask extends AbstractAcsTask {
|
||||
pointTab.update(jsonEnd);
|
||||
|
||||
//修改起点库存
|
||||
ivtStart.put("vehicle_type", "");
|
||||
ivtStart.put("vehicle_code", "");
|
||||
ivtStart.put("material_id", "");
|
||||
// ivtStart.put("vehicle_type", "");
|
||||
// ivtStart.put("vehicle_code", "");
|
||||
// ivtStart.put("material_id", "");
|
||||
ivtStart.put("instorage_time", DateUtil.now());
|
||||
ivtTab.update(ivtStart);
|
||||
|
||||
jsonStart.put("lock_type", "1");
|
||||
jsonStart.put("task_id", "");
|
||||
jsonStart.put("vehicle_type", "");
|
||||
jsonStart.put("vehicle_code", "");
|
||||
jsonStart.put("material_id", "");
|
||||
jsonStart.put("point_status", "1");
|
||||
// jsonStart.put("vehicle_type", "");
|
||||
// jsonStart.put("vehicle_code", "");
|
||||
// jsonStart.put("material_id", "");
|
||||
// jsonStart.put("point_status", "1");
|
||||
jsonStart.put("update_time", DateUtil.now());
|
||||
pointTab.update(jsonStart);
|
||||
}
|
||||
@@ -315,25 +315,20 @@ public class HandlingTask extends AbstractAcsTask {
|
||||
|
||||
//任务表【SCH_BASE_Task】
|
||||
//判断当前点是否有未完成的任务
|
||||
JSONObject taskObj2;
|
||||
if ("GT04".equals(next_point_code)) {
|
||||
taskObj2 = taskTab.query("is_delete='0' and point_code2 = '" + next_point_code + "' and task_status <> '" + TaskStatusEnum.FINISHED.getCode() + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(taskObj2)) {
|
||||
throw new BadRequestException("[" + next_point_code + "]存在未完成的任务");
|
||||
}
|
||||
taskObj2 = taskTab.query("is_delete='0' and point_code1 = '" + next_point_code + "' and task_status <> '" + TaskStatusEnum.FINISHED.getCode() + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(taskObj2) && "GT01".equals(taskObj2.getString("point_code2"))) {
|
||||
throw new BadRequestException("请等待[GT04 -> GT01]的任务完成");
|
||||
}
|
||||
} else {
|
||||
taskObj2 = taskTab.query("is_delete='0' and (point_code2 = '" + next_point_code + "' OR point_code1 = '" + next_point_code + "') and task_status <> '" + TaskStatusEnum.FINISHED.getCode() + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(taskObj2))
|
||||
throw new BadRequestException("[" + next_point_code + "]存在未完成的任务");
|
||||
}
|
||||
JSONObject taskObj2 = taskTab.query("is_delete='0' and (point_code2 = '" + next_point_code + "' OR point_code1 = '" + next_point_code + "') and task_status <> '" + TaskStatusEnum.FINISHED.getCode() + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(taskObj2))
|
||||
throw new BadRequestException("终点[" + next_point_code + "]存在未完成的任务");
|
||||
|
||||
JSONObject taskObj1 = taskTab.query("is_delete='0' and (point_code1 = '" + start_point_code + "' OR point_code2 = '" + start_point_code + "') and task_status <> '" + TaskStatusEnum.FINISHED.getCode() + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(taskObj1))
|
||||
throw new BadRequestException("[" + start_point_code + "]存在未完成的任务");
|
||||
throw new BadRequestException("起点[" + start_point_code + "]存在未完成的任务");
|
||||
|
||||
if ("GT04".equals(next_point_code) || "GT04".equals(start_point_code)) {
|
||||
JSONObject yljTask = taskTab.query("is_delete='0' and (point_code1 LIKE 'YLJ%' OR point_code2 LIKE 'YLJ%') and task_status <> '" + TaskStatusEnum.FINISHED.getCode() + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(yljTask)) {
|
||||
throw new BadRequestException("有压机正在执行叫料任务");
|
||||
}
|
||||
}
|
||||
|
||||
JSONObject jsonObject = ivtTab.query("point_code = '" + start_point_code + "'").uniqueResult(0);
|
||||
|
||||
@@ -342,7 +337,7 @@ public class HandlingTask extends AbstractAcsTask {
|
||||
if ("1".equals(jsonStart.getString("point_status"))) {
|
||||
throw new BadRequestException("起点[" + start_point_code + "]是空位");
|
||||
}
|
||||
if (!"1".equals(jsonEnd.getString("point_status")) && !"GT04".equals(next_point_code)) {
|
||||
if (!"1".equals(jsonEnd.getString("point_status"))) {
|
||||
throw new BadRequestException("终点[" + next_point_code + "]不是空位");
|
||||
}
|
||||
String region_codeS = jsonStart.getString("region_code");
|
||||
@@ -358,11 +353,11 @@ public class HandlingTask extends AbstractAcsTask {
|
||||
}
|
||||
Long material_id = jsonObject.getLong("material_id");
|
||||
if (StrUtil.equals(region_codeS, RegionTypeEnum.HNJQ.getCode()) || StrUtil.equals(region_codeS, RegionTypeEnum.YLJQ.getCode())) {
|
||||
if (StrUtil.equals(region_codeS, RegionTypeEnum.YLJQ.getCode())) {
|
||||
workDevice = start_point_code;
|
||||
if (StrUtil.equals(region_codeE, RegionTypeEnum.YLJQ.getCode())) {
|
||||
workDevice = next_point_code;
|
||||
}
|
||||
JSONObject workOrderObj = workOrderTab.query("device_code = '" + workDevice + "' and order_status = '3' and is_delete ='0'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(workOrderObj)) throw new BadRequestException("该设备当前未生产或者已删除");
|
||||
if (ObjectUtil.isEmpty(workOrderObj)) throw new BadRequestException("设备[" + workDevice + "]当前未生产或者已删除");
|
||||
material_id = workOrderObj.getLong("material_id");
|
||||
}
|
||||
|
||||
|
||||
@@ -234,14 +234,18 @@ public class KzdjwSendEmpVehicleTask extends AbstractAcsTask {
|
||||
//判断当前点是否有未完成的任务
|
||||
JSONObject taskObj = taskTab.query("is_delete='0' and (point_code1 = '" + point_code1 + "' OR point_code2 = '" + point_code1 + "') and task_status <> '" + TaskStatusEnum.FINISHED.getCode() + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(taskObj))
|
||||
throw new BadRequestException("当前点位" + point_code1 + "存在未完成的任务");
|
||||
throw new BadRequestException("[" + point_code1 + "]存在未完成的任务");
|
||||
JSONObject yljTask = taskTab.query("is_delete='0' and (point_code1 LIKE 'YLJ%' OR point_code2 LIKE 'YLJ%') and task_status <> '" + TaskStatusEnum.FINISHED.getCode() + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(yljTask)) {
|
||||
throw new BadRequestException("有压机正在执行叫料任务");
|
||||
}
|
||||
String vehicle_code = WQLObject
|
||||
.getWQLObject("st_ivt_structivt")
|
||||
.query("point_code = '" + point_code1 + "'")
|
||||
.uniqueResult(0)
|
||||
.getString("vehicle_code");
|
||||
if (StrUtil.isBlank(vehicle_code)) {
|
||||
throw new BadRequestException("当前点位[" + point_code1 + "]上没有载具");
|
||||
throw new BadRequestException("[" + point_code1 + "]上没有载具");
|
||||
}
|
||||
|
||||
SchTaskDto dto = SchTaskDto.builder()
|
||||
|
||||
@@ -355,6 +355,15 @@ public class HnjSendMaterialTask extends AbstractAcsTask {
|
||||
//任务表【SCH_BASE_Task】
|
||||
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||
|
||||
JSONObject gt01Task = taskTab.query("is_delete='0' and (point_code1 = 'GT01' OR point_code2 = 'GT01') and task_status <> '" + TaskStatusEnum.FINISHED.getCode() + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(gt01Task)) {
|
||||
throw new BadRequestException("[GT01]存在未完成的任务");
|
||||
}
|
||||
JSONObject gt01Status = SpringContextHolder.getBean(WmsToAcsService.class).queryGT01Status();
|
||||
if (!gt01Status.getBooleanValue("GT01")) {
|
||||
throw new BadRequestException("当前一号接驳滚筒区不允许放料盅");
|
||||
}
|
||||
|
||||
//判断当前点是否有未完成的起点任务
|
||||
JSONObject taskObj = taskTab.query("is_delete='0' and point_code1 = '" + point_code1 + "' and task_status <> '" + TaskStatusEnum.FINISHED.getCode() + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(taskObj)) throw new BadRequestException("当前点位" + point_code1 + "存在未完成的起点任务");
|
||||
|
||||
@@ -171,13 +171,9 @@ public class TimingSendMaterialTask extends AbstractAcsTask {
|
||||
|
||||
//任务表【SCH_BASE_Task】
|
||||
//判断当前点是否有未完成的任务
|
||||
JSONObject taskObj = taskTab.query("is_delete='0' and point_code2 = '" + point_code2 + "' and task_status <> '" + TaskStatusEnum.FINISHED.getCode() + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(taskObj))
|
||||
throw new BadRequestException("当前点位" + point_code2 + "存在未完成的任务");
|
||||
|
||||
JSONObject taskObj2 = taskTab.query("is_delete='0' and point_code1 = '" + point_code1 + "' and task_status <> '" + TaskStatusEnum.FINISHED.getCode() + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(taskObj2))
|
||||
throw new BadRequestException("当前点位" + point_code1 + "存在未完成的任务");
|
||||
JSONObject taskObj1 = taskTab.query("is_delete='0' and (point_code1 = '" + point_code1 + "' OR point_code2 = '" + point_code1 + "') and task_status <> '" + TaskStatusEnum.FINISHED.getCode() + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(taskObj1))
|
||||
throw new BadRequestException("起点[" + point_code1 + "]存在未完成的任务");
|
||||
|
||||
|
||||
SchTaskDto dto = SchTaskDto.builder()
|
||||
@@ -336,7 +332,7 @@ public class TimingSendMaterialTask extends AbstractAcsTask {
|
||||
public void autoCreate() {
|
||||
WQLObject wo_ivt = WQLObject.getWQLObject("ST_IVT_StructIvt");
|
||||
WQLObject wo_point = WQLObject.getWQLObject("sch_base_point");
|
||||
JSONObject jsonObject = wo_ivt.query("region_code = '" + RegionTypeEnum.KLZHCQ.getCode() + "' and (vehicle_code <> '' or vehicle_code is not null) and (material_id <> '' or material_id is not null) ").uniqueResult(0);
|
||||
JSONObject jsonObject = wo_ivt.query("region_code = '" + RegionTypeEnum.KLZHCQ.getCode() + "' and vehicle_code <> '' and vehicle_code is not null and material_id <> '' and material_id is not null ").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(jsonObject)) {
|
||||
Long material_id = jsonObject.getLong("material_id");
|
||||
String point_id = jsonObject.getString("point_id");
|
||||
|
||||
Reference in New Issue
Block a user