fix: 混碾<>压机优先级调制

This commit is contained in:
2024-03-28 15:21:27 +08:00
parent 7404047f8f
commit be0749833b
5 changed files with 26 additions and 6 deletions

View File

@@ -35,6 +35,9 @@ import org.nl.wms.util.MapOf;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/** /**
* @author 张江玮 * @author 张江玮
* @date 2022/12/02 10:04 * @date 2022/12/02 10:04
@@ -445,6 +448,8 @@ public class PdaServiceImpl implements PdaService {
public void vehicleBind(String point_code, String vehicle_type, String vehicle_code, String point_status) { public void vehicleBind(String point_code, String vehicle_type, String vehicle_code, String point_status) {
JSONObject point_update = new JSONObject(); JSONObject point_update = new JSONObject();
JSONObject vd = WQLObject.getWQLObject("st_ivt_vehicle_detail").query("is_delete = '0' AND vehicle_type = '" + vehicle_type + "' AND vehicle_code = '" + vehicle_code + "'").uniqueResult(0); JSONObject vd = WQLObject.getWQLObject("st_ivt_vehicle_detail").query("is_delete = '0' AND vehicle_type = '" + vehicle_type + "' AND vehicle_code = '" + vehicle_code + "'").uniqueResult(0);
point_update.put("vehicle_type", vehicle_type);
point_update.put("vehicle_code", vehicle_code);
if ("2".equals(point_status)) { if ("2".equals(point_status)) {
// 空载具 // 空载具
point_update.put("vd_id", ""); point_update.put("vd_id", "");
@@ -454,21 +459,32 @@ public class PdaServiceImpl implements PdaService {
TaskUtils.addCurrentUpdateColum(vd); TaskUtils.addCurrentUpdateColum(vd);
WQLObject.getWQLObject("st_ivt_vehicle_detail").update(vd); WQLObject.getWQLObject("st_ivt_vehicle_detail").update(vd);
} }
} else { } else if ("3".equals(point_status)){
// 存在组盘信息才能设置有货 // 存在组盘信息才能设置有货
if (ObjectUtil.isNotEmpty(vd)) { if (ObjectUtil.isNotEmpty(vd)) {
point_update.put("vd_id", vd.getString("vd_id")); point_update.put("vd_id", vd.getString("vd_id"));
} else { } else {
throw new BadRequestException("[" + vehicle_code + "] 组盘信息不存在!"); throw new BadRequestException("[" + vehicle_code + "] 组盘信息不存在!");
} }
} else {
if (!containsSL(point_code)) {
throw new BadRequestException("[" + point_code + "] 不是压机上料位不能设置「等待」状态!");
}
point_update.put("vehicle_type", "");
point_update.put("vehicle_code", "");
} }
point_update.put("point_status", point_status); point_update.put("point_status", point_status);
point_update.put("vehicle_type", vehicle_type);
point_update.put("vehicle_code", vehicle_code);
TaskUtils.addCurrentUpdateColum(point_update); TaskUtils.addCurrentUpdateColum(point_update);
WQLObject.getWQLObject("sch_base_point").update(point_update, "point_code = '" + point_code + "'"); WQLObject.getWQLObject("sch_base_point").update(point_update, "point_code = '" + point_code + "'");
} }
public static boolean containsSL(String input) {
String regex = ".*SL.*";
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(input);
return matcher.matches();
}
@Override @Override
public void vehicleUnbind(String point_code) { public void vehicleUnbind(String point_code) {
JSONObject point_update = new JSONObject(); JSONObject point_update = new JSONObject();

View File

@@ -109,7 +109,8 @@ public class YZSendEmptyTask extends AbstractAcsTask {
point_table.update(jsonObject); point_table.update(jsonObject);
task2.put("task_status", TaskStatus.START_AND_END.value()); task2.put("task_status", TaskStatus.START_AND_END.value());
task2.put("point_code2", task.getString("point_code1")); task2.put("point_code1", task.getString("point_code1"));
task2.put("priority", "4");
task2.put("remark", ""); task2.put("remark", "");
TaskUtils.addAutoUpdateColum(task2); TaskUtils.addAutoUpdateColum(task2);
task_table.update(task2); task_table.update(task2);

View File

@@ -132,6 +132,8 @@ public class HLSendMaterialTask extends AbstractAcsTask {
.process() .process()
.uniqueResult(0); .uniqueResult(0);
} }
} else {
task.put("priority", "4");
} }
} }
} }

View File

@@ -183,7 +183,7 @@ public class YZSendMaterialTask extends AbstractAcsTask {
point_table.update(point2, "point_code = '" + point_code2 + "'"); point_table.update(point2, "point_code = '" + point_code2 + "'");
} }
WQLObject.getWQLObject("das_produce_number").delete("data_id = " + task.getLongValue("table_fk_id")); // WQLObject.getWQLObject("das_produce_number").delete("data_id = " + task.getLongValue("table_fk_id"));
} }
} }

View File

@@ -194,13 +194,14 @@
p.* p.*
FROM FROM
sch_base_point p sch_base_point p
LEFT JOIN pdm_bd_workorder w ON p.device_code = w.device_code AND w.order_status = '3'
WHERE WHERE
p.is_used = '1' p.is_used = '1'
AND p.lock_type = '1' AND p.lock_type = '1'
AND p.point_status = '4' AND p.point_status = '4'
AND p.region_code = 'YZ' AND p.region_code = 'YZ'
AND p.point_type = '2' AND p.point_type = '2'
AND p.remark = 输入.material_id AND w.material_id = 输入.material_id
ENDSELECT ENDSELECT
ENDQUERY ENDQUERY
ENDIF ENDIF