Merge remote-tracking branch 'origin/master_merge' into master_merge
This commit is contained in:
@@ -97,5 +97,12 @@ public class ProductOutTwoController {
|
||||
return new ResponseEntity<>(productOutTwoService.outExcepionPointPass(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/vehicleUnbind")
|
||||
@Log("空托盘解绑")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> vehicleUnbind(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(productOutTwoService.vehicleUnbind(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -92,4 +92,6 @@ public interface ProductOutTwoService {
|
||||
JSONObject boxOut(JSONObject whereJson);
|
||||
|
||||
JSONObject outExcepionPointPass(JSONObject whereJson);
|
||||
|
||||
JSONObject vehicleUnbind(JSONObject whereJson);
|
||||
}
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
package org.nl.b_lms.pda.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.druid.util.StringUtils;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.pda.service.ProductOutTwoService;
|
||||
import org.nl.b_lms.pdm.info.dao.PdmBiOrderbominfo;
|
||||
import org.nl.b_lms.pdm.info.service.IPdmBiOrderbominfoService;
|
||||
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
|
||||
import org.nl.b_lms.pdm.subpackagerelation.service.IpdmBiSubpackagerelationService;
|
||||
import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||
import org.nl.b_lms.sch.task.service.IschBaseTaskService;
|
||||
import org.nl.b_lms.storage_manage.database.service.IBstIvtBoxinfoService;
|
||||
import org.nl.b_lms.storage_manage.database.service.IBstIvtBoxlashboundService;
|
||||
import org.nl.b_lms.storage_manage.database.service.dao.BstIvtBoxlashbound;
|
||||
@@ -52,6 +58,12 @@ public class ProductOutTwoServiceImpl implements ProductOutTwoService {
|
||||
@Autowired
|
||||
private OutBoxManageService outBoxManageService;
|
||||
|
||||
@Autowired
|
||||
private IpdmBiSubpackagerelationService ipdmBiSubpackagerelationService;
|
||||
|
||||
@Autowired
|
||||
private IschBaseTaskService ischBaseTaskService;
|
||||
|
||||
|
||||
@Override
|
||||
public JSONObject ivtQuery(JSONObject whereJson) {
|
||||
@@ -238,4 +250,64 @@ public class ProductOutTwoServiceImpl implements ProductOutTwoService {
|
||||
result.put("message", "成功放行!");
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject vehicleUnbind(JSONObject whereJson) {
|
||||
String vehicle_code = whereJson.getString("vehicle_code");
|
||||
|
||||
if (ObjectUtil.isEmpty(vehicle_code)) {
|
||||
throw new BadRequestException("托盘号不能为空!");
|
||||
}
|
||||
|
||||
WQLObject vehicle_ext = WQLObject.getWQLObject("md_pb_storagevehicleext");
|
||||
|
||||
JSONObject vehicle_info = vehicle_ext.query("storagevehicle_code = '" + vehicle_code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(vehicle_info)) {
|
||||
throw new BadRequestException("未查询到载具【" + vehicle_code + "】对应的绑定关系");
|
||||
}
|
||||
|
||||
String box_no = vehicle_info.getString("pcsn");
|
||||
if (StringUtils.isEmpty(box_no)) {
|
||||
throw new BadRequestException("载具【" + vehicle_code + "】上未绑定木箱!");
|
||||
}
|
||||
|
||||
List<PdmBiSubpackagerelation> list = ipdmBiSubpackagerelationService.list(new LambdaQueryWrapper<PdmBiSubpackagerelation>().eq(PdmBiSubpackagerelation::getPackage_box_sn, box_no));
|
||||
if (ObjectUtil.isNotEmpty(list)) {
|
||||
boolean anyMatch = list.stream().anyMatch(sub -> sub.getStatus().equals("1") || sub.getStatus().equals("2"));
|
||||
if (anyMatch) {
|
||||
throw new BadRequestException("载具上木箱【" + box_no + "】的包装关系为包装或者入库状态!");
|
||||
}
|
||||
}
|
||||
|
||||
String collect = list.stream().map(sub -> sub.getContainer_name()).collect(Collectors.joining("','"));
|
||||
|
||||
JSONArray ivt_arr = WQLObject.getWQLObject("st_ivt_structivt").query("pcsn IN ('" + collect + "')").getResultJSONArray(0);
|
||||
if (ObjectUtil.isNotEmpty(ivt_arr)) {
|
||||
throw new BadRequestException("载具【" + vehicle_code + "】上绑定的木箱【" + box_no + "】存在库存,不能进行解绑!");
|
||||
}
|
||||
|
||||
int hasTask = ischBaseTaskService.count(new QueryWrapper<SchBaseTask>()
|
||||
.eq("is_delete", "0")
|
||||
.eq("vehicle_code2", vehicle_code)
|
||||
.lt("task_status", TaskStatusEnum.FINISHED.getCode()));
|
||||
|
||||
if (hasTask > 0) {
|
||||
throw new BadRequestException("该托盘【" + vehicle_code + "】存在正在执行中的任务,不能进行解绑!");
|
||||
}
|
||||
|
||||
int hasTask2 = ischBaseTaskService.count(new QueryWrapper<SchBaseTask>()
|
||||
.eq("is_delete", "0")
|
||||
.eq("vehicle_code", box_no)
|
||||
.lt("task_status", TaskStatusEnum.FINISHED.getCode()));
|
||||
|
||||
if (hasTask2 > 0) {
|
||||
throw new BadRequestException("该木箱【" + box_no + "】存在正在执行中的任务,不能进行解绑!");
|
||||
}
|
||||
|
||||
vehicle_info.put("pcsn", "");
|
||||
vehicle_ext.update(vehicle_info);
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("message", "操作成功!");
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package org.nl.b_lms.pdm.screen.contorller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import org.nl.b_lms.pdm.screen.store.InMemoryStore;
|
||||
import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(path = "/api/faults", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public class FaultController {
|
||||
private final InMemoryStore store;
|
||||
|
||||
public FaultController(InMemoryStore store) {
|
||||
this.store = store;
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
@SaIgnore
|
||||
public JSONArray getFaults(@RequestParam(required = false) Integer limit) {
|
||||
return store.findFaults();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package org.nl.b_lms.pdm.screen.contorller;
|
||||
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import org.nl.b_lms.pdm.screen.store.InMemoryStore;
|
||||
import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(path = "/api/tasks", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public class ScreenTaskController {
|
||||
private final InMemoryStore store;
|
||||
|
||||
public ScreenTaskController(InMemoryStore store) { this.store = store; }
|
||||
|
||||
@GetMapping
|
||||
@SaIgnore
|
||||
public List<SchBaseTask> getTasks() {
|
||||
List<SchBaseTask> tasks = store.findTasks();
|
||||
return tasks;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package org.nl.b_lms.pdm.screen.model;
|
||||
|
||||
public class Fault {
|
||||
private Long id;
|
||||
|
||||
private String deviceId;
|
||||
|
||||
private String deviceType;
|
||||
|
||||
private String faultContent;
|
||||
|
||||
private Long occurTs;
|
||||
private String severity; // info/warn/error
|
||||
|
||||
public Fault() {}
|
||||
|
||||
public Fault(Long id, String deviceId, String deviceType, String faultContent, Long occurTs, String severity) {
|
||||
this.id = id; this.deviceId = deviceId; this.deviceType = deviceType; this.faultContent = faultContent;
|
||||
this.occurTs = occurTs; this.severity = severity;
|
||||
}
|
||||
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
public String getDeviceId() { return deviceId; }
|
||||
public void setDeviceId(String deviceId) { this.deviceId = deviceId; }
|
||||
public String getDeviceType() { return deviceType; }
|
||||
public void setDeviceType(String deviceType) { this.deviceType = deviceType; }
|
||||
public String getFaultContent() { return faultContent; }
|
||||
public void setFaultContent(String faultContent) { this.faultContent = faultContent; }
|
||||
public Long getOccurTs() { return occurTs; }
|
||||
public void setOccurTs(Long occurTs) { this.occurTs = occurTs; }
|
||||
public String getSeverity() { return severity; }
|
||||
public void setSeverity(String severity) { this.severity = severity; }
|
||||
}
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
package org.nl.b_lms.pdm.screen.model;
|
||||
|
||||
|
||||
public class ScreenTask {
|
||||
private Long id;
|
||||
|
||||
private String name;
|
||||
|
||||
private String type; // AGV搬运/堆垛机操作
|
||||
|
||||
private String status; // pending, running, completed, failed, paused
|
||||
private String priority; // high/medium/low
|
||||
private Integer progress; // 0-100
|
||||
private String startLocation;
|
||||
private String endLocation;
|
||||
private String creator;
|
||||
|
||||
private Long createTs; // epoch millis
|
||||
private String description;
|
||||
|
||||
public ScreenTask() {}
|
||||
|
||||
public ScreenTask(Long id, String name, String type, String status, String priority, Integer progress,
|
||||
String startLocation, String endLocation, String creator, Long createTs, String description) {
|
||||
this.id = id; this.name = name; this.type = type; this.status = status; this.priority = priority;
|
||||
this.progress = progress; this.startLocation = startLocation; this.endLocation = endLocation;
|
||||
this.creator = creator; this.createTs = createTs; this.description = description;
|
||||
}
|
||||
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
public String getName() { return name; }
|
||||
public void setName(String name) { this.name = name; }
|
||||
public String getType() { return type; }
|
||||
public void setType(String type) { this.type = type; }
|
||||
public String getStatus() { return status; }
|
||||
public void setStatus(String status) { this.status = status; }
|
||||
public String getPriority() { return priority; }
|
||||
public void setPriority(String priority) { this.priority = priority; }
|
||||
public Integer getProgress() { return progress; }
|
||||
public void setProgress(Integer progress) { this.progress = progress; }
|
||||
public String getStartLocation() { return startLocation; }
|
||||
public void setStartLocation(String startLocation) { this.startLocation = startLocation; }
|
||||
public String getEndLocation() { return endLocation; }
|
||||
public void setEndLocation(String endLocation) { this.endLocation = endLocation; }
|
||||
public String getCreator() { return creator; }
|
||||
public void setCreator(String creator) { this.creator = creator; }
|
||||
public Long getCreateTs() { return createTs; }
|
||||
public void setCreateTs(Long createTs) { this.createTs = createTs; }
|
||||
public String getDescription() { return description; }
|
||||
public void setDescription(String description) { this.description = description; }
|
||||
}
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
package org.nl.b_lms.pdm.screen.see;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import org.nl.b_lms.pdm.screen.store.InMemoryStore;
|
||||
import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
@Component
|
||||
public class SseBroadcaster {
|
||||
private final InMemoryStore store;
|
||||
private final CopyOnWriteArrayList<SseEmitter> taskEmitters = new CopyOnWriteArrayList<>();
|
||||
private final CopyOnWriteArrayList<SseEmitter> faultEmitters = new CopyOnWriteArrayList<>();
|
||||
|
||||
public SseBroadcaster(InMemoryStore store) {
|
||||
this.store = store;
|
||||
}
|
||||
|
||||
public SseEmitter registerTasksEmitter() {
|
||||
SseEmitter emitter = new SseEmitter(Long.MAX_VALUE);
|
||||
taskEmitters.add(emitter);
|
||||
emitter.onCompletion(() -> taskEmitters.remove(emitter));
|
||||
emitter.onTimeout(() -> taskEmitters.remove(emitter));
|
||||
return emitter;
|
||||
}
|
||||
|
||||
public SseEmitter registerFaultsEmitter() {
|
||||
SseEmitter emitter = new SseEmitter(Long.MAX_VALUE);
|
||||
faultEmitters.add(emitter);
|
||||
emitter.onCompletion(() -> faultEmitters.remove(emitter));
|
||||
emitter.onTimeout(() -> faultEmitters.remove(emitter));
|
||||
return emitter;
|
||||
}
|
||||
|
||||
public void pushTasksSnapshot() {
|
||||
List<SchBaseTask> snapshot = store.findTasks();
|
||||
pushTasks(snapshot);
|
||||
}
|
||||
|
||||
public void pushFaultsSnapshot() {
|
||||
JSONArray snapshot = store.findFaults();
|
||||
pushFaults(snapshot);
|
||||
}
|
||||
|
||||
public void pushTasks(List<SchBaseTask> tasks) {
|
||||
if (taskEmitters.isEmpty()) return;
|
||||
for (SseEmitter emitter : taskEmitters) {
|
||||
try {
|
||||
emitter.send(SseEmitter.event().name("tasks").data(tasks));
|
||||
} catch (IOException e) {
|
||||
emitter.completeWithError(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void pushFaults(JSONArray faults) {
|
||||
if (faultEmitters.isEmpty()) return;
|
||||
for (SseEmitter emitter : faultEmitters) {
|
||||
try {
|
||||
emitter.send(SseEmitter.event().name("faults").data(faults));
|
||||
} catch (IOException e) {
|
||||
emitter.completeWithError(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package org.nl.b_lms.pdm.screen.see.aop;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import static java.lang.annotation.ElementType.METHOD;
|
||||
import static java.lang.annotation.ElementType.TYPE;
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
/**
|
||||
* 在方法或类上标注该注解,被执行后推送最新 SSE 快照。
|
||||
* 可通过参数控制推送的通道(任务/故障)。
|
||||
*/
|
||||
@Target({TYPE, METHOD})
|
||||
@Retention(RUNTIME)
|
||||
@Documented
|
||||
public @interface PushSseSnapshot {
|
||||
boolean tasks() default true;
|
||||
boolean faults() default true;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
package org.nl.b_lms.pdm.screen.see.aop;
|
||||
|
||||
import org.aspectj.lang.JoinPoint;
|
||||
import org.aspectj.lang.annotation.AfterReturning;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.aspectj.lang.reflect.MethodSignature;
|
||||
import org.nl.b_lms.pdm.screen.see.SseBroadcaster;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.support.TransactionSynchronization;
|
||||
import org.springframework.transaction.support.TransactionSynchronizationManager;
|
||||
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
/**
|
||||
* 注解驱动的 SSE 推送切面:
|
||||
* - 方法或类标注 {@link PushSseSnapshot},在成功返回后推送最新快照;
|
||||
* - 若处于事务中,则在事务提交后推送,确保前端拿到已提交的数据;
|
||||
* - 否则立即推送。
|
||||
*/
|
||||
@Aspect
|
||||
@Component
|
||||
public class TaskUpdateBroadcastAspect {
|
||||
private final SseBroadcaster broadcaster;
|
||||
|
||||
// 非阻塞并发保护:同一时刻仅允许一次推送执行,其他并发调用直接跳过
|
||||
private final ReentrantLock pushLock = new ReentrantLock();
|
||||
|
||||
public TaskUpdateBroadcastAspect(SseBroadcaster broadcaster) {
|
||||
this.broadcaster = broadcaster;
|
||||
}
|
||||
|
||||
// 方法级注解:执行成功后触发推送
|
||||
@AfterReturning(value = "@annotation(pushAnn)", argNames = "jp,pushAnn")
|
||||
public void afterAnnotatedMethod(JoinPoint jp, PushSseSnapshot pushAnn) {
|
||||
broadcastAfterCommitOrNow(pushAnn);
|
||||
}
|
||||
|
||||
// 类级注解:类中任意方法成功返回后触发推送
|
||||
@AfterReturning(value = "@within(org.nl.b_lms.pdm.screen.see.aop.PushSseSnapshot)")
|
||||
public void afterAnnotatedClass(JoinPoint jp) {
|
||||
// 若方法本身也标注了注解,则交由方法级 advice 处理,避免重复推送
|
||||
MethodSignature sig = (MethodSignature) jp.getSignature();
|
||||
if (sig.getMethod().isAnnotationPresent(PushSseSnapshot.class)) {
|
||||
return;
|
||||
}
|
||||
PushSseSnapshot classAnn = jp.getTarget().getClass()
|
||||
.getAnnotation(PushSseSnapshot.class);
|
||||
if (classAnn != null) {
|
||||
broadcastAfterCommitOrNow(classAnn);
|
||||
}
|
||||
}
|
||||
|
||||
// 任一写操作成功后,推送最新快照(替代定时器)
|
||||
private void broadcastAfterCommitOrNow(PushSseSnapshot ann) {
|
||||
Runnable doPushGuarded = () -> {
|
||||
// 非阻塞尝试获取锁:失败则直接跳过本次推送
|
||||
if (!pushLock.tryLock()) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
if (ann.tasks()) {
|
||||
broadcaster.pushTasksSnapshot();
|
||||
}
|
||||
if (ann.faults()) {
|
||||
try { broadcaster.pushFaultsSnapshot(); } catch (Throwable ignored) {}
|
||||
}
|
||||
} finally {
|
||||
pushLock.unlock();
|
||||
}
|
||||
};
|
||||
if (TransactionSynchronizationManager.isSynchronizationActive()) {
|
||||
TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() {
|
||||
@Override
|
||||
public void afterCommit() { doPushGuarded.run(); }
|
||||
});
|
||||
} else {
|
||||
doPushGuarded.run();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package org.nl.b_lms.pdm.screen.see.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import org.nl.b_lms.pdm.screen.see.SseBroadcaster;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/sse")
|
||||
@CrossOrigin
|
||||
public class SseController {
|
||||
private final SseBroadcaster broadcaster;
|
||||
|
||||
public SseController(SseBroadcaster broadcaster) { this.broadcaster = broadcaster; }
|
||||
|
||||
@GetMapping(value = "/tasks", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
|
||||
@SaIgnore
|
||||
public SseEmitter streamTasks() {
|
||||
SseEmitter emitter = broadcaster.registerTasksEmitter();
|
||||
// 首帧:推送最新快照
|
||||
broadcaster.pushTasksSnapshot();
|
||||
return emitter;
|
||||
}
|
||||
|
||||
@GetMapping(value = "/faults", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
|
||||
@SaIgnore
|
||||
public SseEmitter streamFaults() {
|
||||
SseEmitter emitter = broadcaster.registerFaultsEmitter();
|
||||
// 首帧:推送最新快照
|
||||
broadcaster.pushFaultsSnapshot();
|
||||
return emitter;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package org.nl.b_lms.pdm.screen.store;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||
import org.nl.b_lms.sch.task.service.IschBaseTaskService;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.nl.wms.ext.acs.service.impl.WmsToAcsServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
public class InMemoryStore {
|
||||
|
||||
@Autowired
|
||||
private IschBaseTaskService ischBaseTaskService;
|
||||
|
||||
public List<SchBaseTask> findTasks() {
|
||||
List<String> targetType = Arrays.asList(
|
||||
"010702", "010703", "010704", "010706", "010710", "010712", "010714", "010715",
|
||||
"010901", "010902", "010903", "010904", "010905", "010906", "010907", "010908",
|
||||
"010909", "010910", "010911", "010912", "010913", "010914", "010915"
|
||||
);
|
||||
return ischBaseTaskService.list(new LambdaQueryWrapper<SchBaseTask>()
|
||||
.eq(SchBaseTask::getIs_delete, false)
|
||||
.in(SchBaseTask::getTask_type, targetType)
|
||||
.lt(SchBaseTask::getTask_status, "07")
|
||||
.select(SchBaseTask::getTask_code,
|
||||
SchBaseTask::getTask_type,
|
||||
SchBaseTask::getCreate_name,
|
||||
SchBaseTask::getPoint_code1,
|
||||
SchBaseTask::getPoint_code2,
|
||||
SchBaseTask::getPoint_code3,
|
||||
SchBaseTask::getPoint_code4,
|
||||
SchBaseTask::getVehicle_code,
|
||||
SchBaseTask::getTask_status,
|
||||
SchBaseTask::getCreate_time
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
public JSONArray findFaults() {
|
||||
JSONArray blk_rows = WQLObject.getWQLObject("em_bi_monitordevice").query("product_area = 'BLK' AND is_crux = '1' AND region_code IN ('RK','NBJ','DDJ')").getResultJSONArray(0);
|
||||
List<String> blkList = new ArrayList<>();
|
||||
for (int i = 0; i < blk_rows.size(); i++) {
|
||||
JSONObject row = blk_rows.getJSONObject(i);
|
||||
blkList.add(row.getString("device_code"));
|
||||
}
|
||||
|
||||
|
||||
WmsToAcsServiceImpl bean = SpringContextHolder.getBean(WmsToAcsServiceImpl.class);
|
||||
JSONObject result2;
|
||||
try {
|
||||
result2 = bean.getDeviceErrorInfo(blkList, "BLK");
|
||||
} catch (Exception e) {
|
||||
result2 = new JSONObject();
|
||||
log.info(e.getMessage());
|
||||
}
|
||||
// 调用acs接口获取设备
|
||||
JSONArray blk_data = result2.getJSONArray("data");
|
||||
return ObjectUtil.isEmpty(blk_data) ? blk_data : new JSONArray();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -491,7 +491,6 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
||||
boxAttr.put("lock_type", IOSEnum.LOCK_TYPE.code("出库锁"));
|
||||
attrTab.update(boxAttr);
|
||||
twoOutBoxTask.createTask(jsonTaskParam);
|
||||
twoOutBoxTask.immediateNotifyAcs(null);
|
||||
PdmProductSpecServiceImpl.doRecord(SpecEnum.ZXRK, null, Boolean.TRUE, null, containerList);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.nl.b_lms.sch.tasks;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import org.nl.b_lms.pdm.screen.see.aop.PushSseSnapshot;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
@@ -47,6 +48,7 @@ import static org.nl.wms.util.TaskUtil.getRoutePlanCode;
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
@PushSseSnapshot
|
||||
public class TwoOutBoxTask extends AbstractAcsTask {
|
||||
|
||||
/**
|
||||
@@ -100,19 +102,9 @@ public class TwoOutBoxTask extends AbstractAcsTask {
|
||||
if (浅Attr.getString("lock_type").equals(IOSEnum.LOCK_TYPE.code("未锁定"))) {
|
||||
// 判断浅货位木箱和深货位木箱是否相同规格
|
||||
outBoxManageService.createBoxMove(浅Attr);
|
||||
} else if (浅Attr.getString("lock_type").equals(IOSEnum.LOCK_TYPE.code("验箱出库锁"))) {
|
||||
List<SchBaseTask> list = ischBaseTaskService.list(new QueryWrapper<SchBaseTask>()
|
||||
.eq("is_delete", "0")
|
||||
.eq("point_code1", 浅Attr.getString("struct_code"))
|
||||
.lt("task_status", TaskStatusEnum.FINISHED.getCode()));
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
json.put("remark", "当前仓位对应的浅货位【" + 浅Attr.getString("struct_code") + "有正在执行中的任务,任务完成后才能下发!】");
|
||||
WQLObject.getWQLObject("SCH_BASE_Task").update(json);
|
||||
continue;
|
||||
} else {
|
||||
outBoxManageService.createBoxMove(浅Attr);
|
||||
}
|
||||
} else {
|
||||
json.put("remark", "当前仓位对应的浅货位【" + 浅Attr.getString("struct_code") + "被锁定!】");
|
||||
WQLObject.getWQLObject("SCH_BASE_Task").update(json);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -179,11 +171,6 @@ public class TwoOutBoxTask extends AbstractAcsTask {
|
||||
packageInfo.put("ivt_status", PackageInfoIvtEnum.IVT_STATUS.code("空载具"));
|
||||
packageInfo.put("container_name", jsonTask.getString("vehicle_code"));
|
||||
packageinfoivt.update(packageInfo);
|
||||
RedissonUtils.lock(c -> {
|
||||
if (status.equals(TaskStatusEnum.FINISHED.getCode())) {
|
||||
immediateNotifyAcs(null);
|
||||
}
|
||||
}, "zjInBound", 20, this);
|
||||
}
|
||||
// 取消
|
||||
if (status.equals(IOSEnum.IS_NOTANDYES.code("否"))) {
|
||||
|
||||
@@ -100,7 +100,7 @@ public class TwoOutExceptionalTask extends AbstractAcsTask {
|
||||
// 判断任务是否被标记
|
||||
if (jsonTask.getString("is_auto_issue").equals(IOSEnum.IS_SEND.code("否"))) {
|
||||
// 创建出库任务
|
||||
JSONObject jsonDis = disTab.query("iostorinv_id = '" + jsonTask.getString("table_fk") + "' and struct_code = '" + jsonTask.getString("point_code1") + "'").uniqueResult(0);
|
||||
JSONObject jsonDis = disTab.query("iostorinv_id = '" + jsonTask.getString("car_no") + "' and struct_code = '" + jsonTask.getString("point_code1") + "'").uniqueResult(0);
|
||||
|
||||
JSONObject jsonPoint = pointTab.query("region_id = '" + RegionTypeEnum.TWO_OUT01.getId() + "' and is_delete = '0' and is_used = '1'").uniqueResult(0);
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.b_lms.pdm.screen.see.aop.PushSseSnapshot;
|
||||
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
|
||||
import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService;
|
||||
import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||
@@ -46,6 +47,7 @@ import java.util.stream.Collectors;
|
||||
@Service()
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
@PushSseSnapshot(faults = false)
|
||||
public class DjqTask extends AbstractAcsTask {
|
||||
@Resource
|
||||
private IschBaseTaskService taskService;
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.nl.b_lms.pdm.screen.see.aop.PushSseSnapshot;
|
||||
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
|
||||
import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService;
|
||||
import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||
@@ -44,6 +45,7 @@ import java.util.stream.Collectors;
|
||||
@Service()
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
@PushSseSnapshot(faults = false)
|
||||
public class DjqToKzjhcwTask extends AbstractAcsTask {
|
||||
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.pdm.screen.see.aop.PushSseSnapshot;
|
||||
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
|
||||
import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService;
|
||||
import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||
@@ -40,6 +41,8 @@ import java.util.List;
|
||||
@Service()
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
@PushSseSnapshot(faults = false)
|
||||
|
||||
public class GzqTask extends AbstractAcsTask {
|
||||
|
||||
private final String THIS_CLASS = GzqTask.class.getName();
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.pdm.screen.see.aop.PushSseSnapshot;
|
||||
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
|
||||
import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService;
|
||||
import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||
@@ -40,6 +41,7 @@ import java.util.List;
|
||||
@Service()
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
@PushSseSnapshot(faults = false)
|
||||
public class GzqToKzjhcwTask extends AbstractAcsTask {
|
||||
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.b_lms.pdm.bi.slittingproductionplan.service.IPdmBiSlittingproductionplanService;
|
||||
import org.nl.b_lms.pdm.bi.slittingproductionplan.service.dao.PdmBiSlittingproductionplan;
|
||||
import org.nl.b_lms.pdm.screen.see.aop.PushSseSnapshot;
|
||||
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
|
||||
import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService;
|
||||
import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||
@@ -50,6 +51,7 @@ import java.util.stream.Stream;
|
||||
@Service()
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
@PushSseSnapshot(faults = false)
|
||||
public class MzhcwTask extends AbstractAcsTask {
|
||||
|
||||
private final String THIS_CLASS = MzhcwTask.class.getName();
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.pdm.screen.see.aop.PushSseSnapshot;
|
||||
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
|
||||
import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService;
|
||||
import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||
@@ -40,6 +41,7 @@ import java.util.List;
|
||||
@Service()
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
@PushSseSnapshot(faults = false)
|
||||
public class SendDjqKzjTask extends AbstractAcsTask {
|
||||
@Resource
|
||||
private IschBaseTaskService taskService;
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.pdm.screen.see.aop.PushSseSnapshot;
|
||||
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
|
||||
import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService;
|
||||
import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||
@@ -39,6 +40,7 @@ import java.util.List;
|
||||
@Service()
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
@PushSseSnapshot(faults = false)
|
||||
public class SendGzqKzjTask extends AbstractAcsTask {
|
||||
@Resource
|
||||
private IschBaseTaskService taskService;
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.pdm.screen.see.aop.PushSseSnapshot;
|
||||
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
|
||||
import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService;
|
||||
import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||
@@ -39,6 +40,7 @@ import java.util.List;
|
||||
@Service()
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
@PushSseSnapshot(faults = false)
|
||||
public class ShiftingTask extends AbstractAcsTask {
|
||||
|
||||
private final String THIS_CLASS = ShiftingTask.class.getName();
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.b_lms.pdm.screen.see.aop.PushSseSnapshot;
|
||||
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
|
||||
import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService;
|
||||
import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||
@@ -40,6 +41,7 @@ import java.util.List;
|
||||
@Service()
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
@PushSseSnapshot(faults = false)
|
||||
public class SsxDjwTask extends AbstractAcsTask {
|
||||
|
||||
private final String THIS_CLASS = SsxDjwTask.class.getName();
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.pdm.bi.slittingproductionplan.service.IPdmBiSlittingproductionplanService;
|
||||
import org.nl.b_lms.pdm.bi.slittingproductionplan.service.dao.PdmBiSlittingproductionplan;
|
||||
import org.nl.b_lms.pdm.screen.see.aop.PushSseSnapshot;
|
||||
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
|
||||
import org.nl.b_lms.pdm.subpackagerelation.service.IpdmBiSubpackagerelationService;
|
||||
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
|
||||
@@ -51,6 +52,7 @@ import java.util.concurrent.TimeUnit;
|
||||
*/
|
||||
@Service()
|
||||
@Slf4j
|
||||
@PushSseSnapshot(faults = false)
|
||||
public class ZxDjwTask extends AbstractAcsTask {
|
||||
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.pdm.bi.slittingproductionplan.service.dao.PdmBiSlittingproductionplan;
|
||||
import org.nl.b_lms.pdm.bi.slittingproductionplan.service.dao.mapper.PdmBiSlittingproductionplanMapper;
|
||||
import org.nl.b_lms.pdm.screen.see.aop.PushSseSnapshot;
|
||||
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
|
||||
import org.nl.b_lms.pdm.subpackagerelation.service.IpdmBiSubpackagerelationService;
|
||||
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
|
||||
@@ -49,6 +50,7 @@ import java.util.List;
|
||||
@Service()
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
@PushSseSnapshot(faults = false)
|
||||
public class ZxqTask extends AbstractAcsTask {
|
||||
|
||||
@Resource
|
||||
|
||||
@@ -0,0 +1,118 @@
|
||||
package org.nl.b_lms.sch.tasks.first_floor_area.auto;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.sch.tasks.TwoOutBoxTask;
|
||||
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.service.OutBoxManageService;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.sch.AcsTaskDto;
|
||||
import org.nl.wms.sch.AcsUtil;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import static org.nl.wms.util.TaskUtil.getRoutePlanCode;
|
||||
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class AutoIssueOutEmptyTask {
|
||||
|
||||
private final String TASK_CLASS = TwoOutBoxTask.class.getName();
|
||||
|
||||
@Autowired
|
||||
private OutBoxManageService outBoxManageService;
|
||||
|
||||
//自动执行等待的桁架任务
|
||||
public void run() {
|
||||
try {
|
||||
this.execute();
|
||||
} catch (Exception ex) {
|
||||
log.error(ex.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
public void execute() {
|
||||
/*
|
||||
* 下发给ACS时需要特殊处理
|
||||
*/
|
||||
// 判断当前有多少个正在执行中的任务
|
||||
int num = WQLObject.getWQLObject("SCH_BASE_Task").query("handle_class = '" + TASK_CLASS + "' and task_status IN ('05','06') and is_delete ='0'")
|
||||
.getResultJSONArray(0).size();
|
||||
// 如果缓存了4个箱子则不下发任务
|
||||
if (num >= 2) {
|
||||
return;
|
||||
}
|
||||
|
||||
JSONArray arr = WQLObject.getWQLObject("SCH_BASE_Task").query("handle_class = '" + TASK_CLASS + "' and task_status = '" + TaskStatusEnum.START_AND_POINT.getCode() + "' and is_delete ='0' order by create_time").getResultJSONArray(0);
|
||||
for (int i = 0; i < arr.size(); i++) {
|
||||
if (num >= 2) {
|
||||
break;
|
||||
}
|
||||
ArrayList<AcsTaskDto> resultList = new ArrayList<>();
|
||||
JSONObject json = arr.getJSONObject(i);
|
||||
WQLObject attrTab = WQLObject.getWQLObject("st_ivt_structattr");
|
||||
JSONObject attr = attrTab.query("struct_code = '" + json.getString("point_code1") + "'").uniqueResult(0);
|
||||
|
||||
if (attr.getString("zdepth").equals(IOSEnum.ZDEPTH_STRUCT.code("深"))) {
|
||||
JSONObject 浅Attr = attrTab
|
||||
.query("zdepth = '1' and row_num = '" + attr.getString("row_num") + "' and col_num = '" + attr.getString("col_num") + "' and layer_num = '" + attr.getString("layer_num") + "'")
|
||||
.uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(浅Attr.getString("storagevehicle_code"))) {
|
||||
if (!浅Attr.getString("lock_type").equals(IOSEnum.LOCK_TYPE.code("未锁定"))) {
|
||||
json.put("remark", "当前仓位对应的浅货位【" + 浅Attr.getString("struct_code") + "被锁定无法下发任务!】");
|
||||
WQLObject.getWQLObject("SCH_BASE_Task").update(json);
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
if (浅Attr.getString("lock_type").equals(IOSEnum.LOCK_TYPE.code("未锁定"))) {
|
||||
// 判断浅货位木箱和深货位木箱是否相同规格
|
||||
outBoxManageService.createBoxMove(浅Attr);
|
||||
} else {
|
||||
json.put("remark", "当前仓位对应的浅货位【" + 浅Attr.getString("struct_code") + "有正在执行中的任务,任务完成后才能下发!】");
|
||||
WQLObject.getWQLObject("SCH_BASE_Task").update(json);
|
||||
continue;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
json.put("remark", e.getMessage());
|
||||
WQLObject.getWQLObject("SCH_BASE_Task").update(json);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
char dtl_type = json.getString("task_type").charAt(json.getString("task_type").length() - 1);
|
||||
AcsTaskDto dto = AcsTaskDto.builder()
|
||||
.ext_task_id(json.getString("task_id"))
|
||||
.task_code(json.getString("task_code"))
|
||||
.route_plan_code(getRoutePlanCode(json.getString("point_code1")))
|
||||
.task_type(json.getString("acs_task_type"))
|
||||
.start_device_code(json.getString("point_code1"))
|
||||
.next_device_code(json.getString("point_code2"))
|
||||
.vehicle_code(json.getString("vehicle_code2"))
|
||||
.vehicle_code2(json.getString("vehicle_code"))
|
||||
.interaction_json(json.getJSONObject("request_param"))
|
||||
.priority(json.getString("priority"))
|
||||
.class_type(json.getString("task_type"))
|
||||
.dtl_type(String.valueOf(dtl_type))
|
||||
.product_area(IOSEnum.PRODUCT_AREA.code("BLK"))
|
||||
.remark(json.getString("remark"))
|
||||
.build();
|
||||
resultList.add(dto);
|
||||
JSONArray list = JSONArray.parseArray(JSON.toJSONString(resultList));
|
||||
AcsUtil.notifyAcs("api/wms/task", list);
|
||||
num += 1;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package org.nl.b_lms.storage_manage.database.controller;
|
||||
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
@@ -10,6 +11,7 @@ import org.nl.b_lms.storage_manage.database.service.IMdpbBoxtypeService;
|
||||
import org.nl.b_lms.storage_manage.database.service.IMdpbSameBoxService;
|
||||
import org.nl.b_lms.storage_manage.database.service.dao.MdpbBoxtype;
|
||||
import org.nl.b_lms.storage_manage.database.service.dao.MdpbSameBox;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
@@ -46,6 +48,9 @@ public class MdpbSameBoxController {
|
||||
List<MdpbSameBox> list = mdpbSameBoxService.list(new LambdaQueryWrapper<MdpbSameBox>().eq(MdpbSameBox::getBox_code, whereJson.getString("box_code")));
|
||||
MdpbSameBox mdpbSameBox = new MdpbSameBox();
|
||||
MdpbBoxtype boxtype = mdpbBoxtypeService.getOne(new LambdaQueryWrapper<MdpbBoxtype>().eq(MdpbBoxtype::getBox_type, whereJson.getString("box_code")));
|
||||
if (ObjectUtil.isEmpty(boxtype)) {
|
||||
throw new BadRequestException("库内未查询到木箱编码为【"+whereJson.getString("box_code")+"】的信息!");
|
||||
}
|
||||
|
||||
mdpbSameBox.setSame_box_code(boxtype.getBox_type());
|
||||
mdpbSameBox.setSame_box_name(boxtype.getBox_name());
|
||||
|
||||
@@ -717,7 +717,7 @@ public class InBoxManageServiceImpl implements InBoxManageService {
|
||||
|
||||
JSONObject jsonAttr = new JSONObject();
|
||||
|
||||
RLock lock = redissonClient.getLock("getEmptyBox-----"+block_num);
|
||||
RLock lock = redissonClient.getLock("getEmptyBox");
|
||||
boolean tryLock = lock.tryLock(0, TimeUnit.SECONDS);
|
||||
try {
|
||||
if (tryLock) {
|
||||
|
||||
@@ -128,7 +128,6 @@ public class OutBoxManageServiceImpl implements OutBoxManageService {
|
||||
request_param.put("containerType", jsonAttr.getString("storagevehicle_type"));
|
||||
jsonTaskParam.put("request_param", request_param.toString());
|
||||
twoOutBoxTask.createTask(jsonTaskParam);
|
||||
twoOutBoxTask.immediateNotifyAcs(null);
|
||||
// 锁定起点
|
||||
jsonAttr.put("lock_type", IOSEnum.LOCK_TYPE.code("验箱出库锁"));
|
||||
attrTab.update(jsonAttr);
|
||||
@@ -840,7 +839,7 @@ public class OutBoxManageServiceImpl implements OutBoxManageService {
|
||||
.findFirst().orElse(null);
|
||||
|
||||
if (ObjectUtil.isEmpty(jsonExtMove)) {
|
||||
throw new BadRequestException("此移库木箱【"+jsonExtMove.getString("storagevehicle_code")+"】没有绑定托盘,请核查");
|
||||
throw new BadRequestException("此移库木箱【"+item.getString("storagevehicle_code")+"】没有绑定托盘,请核查");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.pda.mps.rest;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -25,7 +26,7 @@ public class BakingController {
|
||||
|
||||
@PostMapping("/ovenInAndOut")
|
||||
@Log("烘箱出入")
|
||||
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> queryRawFoil(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(bakingService.ovenInAndOut(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -555,6 +555,10 @@ public class RawFoilServiceImpl implements RawFoilService {
|
||||
String container_name = jsonRaw.getString("container_name");
|
||||
JSONObject task_jo = WQLObject.getWQLObject("SCH_BASE_Task").query("material_code = '" + container_name + "' and task_status <> '07' AND is_delete = '0'").uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isEmpty(task_jo)) {
|
||||
throw new BadRequestException("当前母卷AGV搬运任务不存在或已被强制完成!");
|
||||
}
|
||||
|
||||
// 查询生箔点位库存表
|
||||
JSONObject jsonSb = stIvtSbpointivtService.query("ext_code = '" + jsonRaw.getString("resource_name") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonSb)) {
|
||||
@@ -602,6 +606,10 @@ public class RawFoilServiceImpl implements RawFoilService {
|
||||
String container_name = jsonRaw.getString("container_name");
|
||||
JSONObject task_jo = WQLObject.getWQLObject("SCH_BASE_Task").query("material_code = '" + container_name + "' and task_status <> '07' AND is_delete = '0'").uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isEmpty(task_jo)) {
|
||||
throw new BadRequestException("当前母卷AGV搬运任务不存在或已被强制完成!");
|
||||
}
|
||||
|
||||
// 查询生箔点位库存表
|
||||
JSONObject jsonSb = WQLObject.getWQLObject("st_ivt_sbpointivt").query("ext_code = '" + jsonRaw.getString("resource_name") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonSb)) {
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
IFNULL(po.material_code,'') = ''
|
||||
ENDOPTION
|
||||
OPTION 输入.mater_flag = "1"
|
||||
IFNULL(po.material_code,'') = ''
|
||||
IFNULL(po.material_code,'') = ''
|
||||
ENDOPTION
|
||||
UNION
|
||||
SELECT
|
||||
@@ -308,6 +308,9 @@
|
||||
ENDOPTION
|
||||
OPTION 输入.point_type <> ""
|
||||
p.point_type = 输入.point_type
|
||||
ENDOPTION
|
||||
OPTION 输入.cant_location <> ""
|
||||
p.point_location not in 输入.cant_location
|
||||
ENDOPTION
|
||||
AND p.point_type = '4'
|
||||
AND p.point_status = '1'
|
||||
|
||||
@@ -61,15 +61,16 @@ public class ComPareUtil {
|
||||
}
|
||||
//查询子卷入库配置
|
||||
IPdmBiContainerinboundService iPdmBiContainerinboundService = SpringContextHolder.getBean(IPdmBiContainerinboundService.class);
|
||||
PdmBiContainerinbound pdmBiContainerinbound = iPdmBiContainerinboundService.getOne(new QueryWrapper<PdmBiContainerinbound>()
|
||||
.eq("box", sub.getPackage_box_sn()));
|
||||
PdmBiContainerinbound pdmBiContainerinbound = iPdmBiContainerinboundService.list(new QueryWrapper<PdmBiContainerinbound>()
|
||||
.eq("box", sub.getPackage_box_sn())
|
||||
.orderByDesc("id")).get(0);
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("compaer_result", compaer_result);
|
||||
json.put("box_no", sub.getPackage_box_sn());
|
||||
json.put("box_weight", sub.getBox_weight().intValue());
|
||||
json.put("current_weight", new BigDecimal(current_weight).intValue());
|
||||
json.put("containers", list.stream().map(a->a.getContainer_name()).collect(Collectors.toList()));
|
||||
json.put("inbound", (pdmBiContainerinbound != null ? pdmBiContainerinbound.getInbound():false));
|
||||
json.put("containers", list.stream().map(a -> a.getContainer_name()).collect(Collectors.toList()));
|
||||
json.put("inbound", (pdmBiContainerinbound != null ? pdmBiContainerinbound.getInbound() : false));
|
||||
return json;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user