feat: 日志打印

This commit is contained in:
2024-06-05 09:47:14 +08:00
parent d5334c5017
commit 6b69aec61d

View File

@@ -7,6 +7,7 @@ import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.wql.WQL;
import org.nl.modules.wql.core.bean.WQLObject;
@@ -20,6 +21,7 @@ import org.springframework.stereotype.Component;
*
* @author zhangjiangwei
*/
@Slf4j
@RequiredArgsConstructor
@Component
public class HLSendMaterialTask extends AbstractAcsTask {
@@ -93,9 +95,11 @@ public class HLSendMaterialTask extends AbstractAcsTask {
JSONObject startPoint = point_table.query("point_code = '" + task.getString("point_code1") + "'").uniqueResult(0);
JSONObject nextPoint = null;
String deviceCode = startPoint.getString("device_code");
String taskCode = task.getString("task_code");
// 如果是高速混料机下料位就只能去液压机困料货位,如果不是高速混料机下料位优先去普通压机困料货位,
// 普通压机困料货位没有位置再去公用困料货位。
log.info("任务 {} 设备 {} 申请满料请求任务", taskCode, deviceCode);
String startPointType = startPoint.getString("point_type");
if ("1".equals(startPointType)) {
nextPoint = WQL.getWO("SEND_MATERIAL_TASK")
@@ -119,14 +123,18 @@ public class HLSendMaterialTask extends AbstractAcsTask {
.addParam("point_code", object.getString("associated_device"))
.process()
.uniqueResult(0);
log.info("任务 {} 设备 {} 有关联压机 {} ,查找等待的关联压机得到的数据 {}",
taskCode, deviceCode, object.getString("associated_device"), nextPoint);
if (ObjectUtil.isEmpty(nextPoint)) {
// 通过工单的关联压机送到对应位置,如果不满足就走以下流程
// 通过工单的关联压机送到对应的困料货架,如果不满足就走以下流程
flag = false;
nextPoint = WQL.getWO("SEND_MATERIAL_TASK")
.addParam("flag", "8")
.addParam("point_code", startPoint.getString("device_code"))
.addParam("point_code", deviceCode)
.process()
.uniqueResult(0);
log.info("任务 {} 设备 {} 有关联压机 {} ,查找等待的关联压机对应的困料货架的到的数据 {}",
taskCode, deviceCode, object.getString("associated_device"), nextPoint);
}
}
if (ObjectUtil.isEmpty(nextPoint) || ObjectUtil.isEmpty(nextPoint.get("point_code"))) {
@@ -137,6 +145,8 @@ public class HLSendMaterialTask extends AbstractAcsTask {
.addParam("material_id", task.getString("material_id"))
.process()
.uniqueResult(0);
log.info("任务 {} 设备 {} 查找等待的压机物料是 {} ,得到的数据 {}",
taskCode, deviceCode, task.getString("material_id"), nextPoint);
} else {
task.put("priority", "4");
}
@@ -148,12 +158,16 @@ public class HLSendMaterialTask extends AbstractAcsTask {
.addParam("material_id", task.getString("material_id"))
.process()
.uniqueResult(0);
log.info("任务 {} 设备 {} 满料去了普通压机的困料位,物料是 {} ,得到的数据 {}",
taskCode, deviceCode, task.getString("material_id"), nextPoint);
if (ObjectUtil.isEmpty(nextPoint)) {
// 公共货位
nextPoint = WQL.getWO("SEND_MATERIAL_TASK")
.addParam("flag", "5")
.process()
.uniqueResult(0);
log.info("任务 {} 设备 {} 满料去了公共货位,得到的数据 {}",
taskCode, deviceCode, nextPoint);
}
}
}
@@ -165,7 +179,7 @@ public class HLSendMaterialTask extends AbstractAcsTask {
task_table.update(task);
nextPoint.put("lock_type", LockType.TASK_LOCKED.value());
nextPoint.put("task_code", task.getString("task_code"));
nextPoint.put("task_code", taskCode);
TaskUtils.addAutoUpdateColum(nextPoint);
point_table.update(nextPoint);
}