fix: connector上下层取货放货顺序优化,添加点位页面修改锁功能
This commit is contained in:
@@ -120,32 +120,6 @@ public class PlcToAgvDeviceDriver extends AbstractOpcDeviceDriver implements Dev
|
|||||||
last_heartbeat = heartbeat;
|
last_heartbeat = heartbeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 多个信号一起下发电气
|
|
||||||
*
|
|
||||||
* @param map
|
|
||||||
*/
|
|
||||||
public void writing(Map<String, Object> map) throws Exception {
|
|
||||||
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
|
|
||||||
Map<String, Object> itemMap = new LinkedHashMap<>();
|
|
||||||
map.forEach((key, value) -> {
|
|
||||||
if (ObjectUtil.isNotEmpty(value)) {
|
|
||||||
itemMap.put(getToParam() + key, value);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (ObjectUtil.isNotEmpty(itemMap)) {
|
|
||||||
this.checkcontrol(itemMap);
|
|
||||||
logServer.deviceExecuteLog(this.getDevice().getDevice_code(), "", "", "下发多个电气信号:" + itemMap);
|
|
||||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
|
||||||
.device_code(device_code)
|
|
||||||
.content("下发多个电气信号" + itemMap)
|
|
||||||
.build();
|
|
||||||
logDto.setLog_level(3);
|
|
||||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void writing(String param, String value) {
|
public void writing(String param, String value) {
|
||||||
if (!"heartbeat".equals(param)) {
|
if (!"heartbeat".equals(param)) {
|
||||||
String to_param = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
|
String to_param = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
|
||||||
@@ -199,6 +173,32 @@ public class PlcToAgvDeviceDriver extends AbstractOpcDeviceDriver implements Dev
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void writing(Map<String, Object> map) {
|
||||||
|
if (!"heartbeat".equals(map.get("heartbeat"))) {
|
||||||
|
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
|
||||||
|
Map<String, Object> itemMap = new LinkedHashMap<>();
|
||||||
|
map.forEach((key, value) -> {
|
||||||
|
if (ObjectUtil.isNotEmpty(value)) {
|
||||||
|
itemMap.put(getToParam() + key, value);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (ObjectUtil.isNotEmpty(itemMap)) {
|
||||||
|
try {
|
||||||
|
this.checkcontrol(itemMap);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
logServer.deviceExecuteLog(this.getDevice().getDevice_code(), "", "", "下发多个电气信号:" + itemMap);
|
||||||
|
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||||
|
.device_code(device_code)
|
||||||
|
.content("下发多个电气信号" + itemMap)
|
||||||
|
.build();
|
||||||
|
logDto.setLog_level(3);
|
||||||
|
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public String getToParam() {
|
public String getToParam() {
|
||||||
return this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() + ".";
|
return this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() + ".";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package org.nl.acs.device_driver.driver;
|
package org.nl.acs.device_driver.driver;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.nl.acs.opc.*;
|
import org.nl.acs.opc.*;
|
||||||
import org.nl.acs.udw.UnifiedDataAccessor;
|
import org.nl.acs.udw.UnifiedDataAccessor;
|
||||||
import org.nl.acs.udw.UnifiedDataAccessorFactory;
|
import org.nl.acs.udw.UnifiedDataAccessorFactory;
|
||||||
@@ -12,8 +11,11 @@ import org.openscada.opc.lib.da.ItemState;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
import java.util.concurrent.CompletionException;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
import java.util.concurrent.TimeoutException;
|
||||||
|
|
||||||
@Slf4j
|
|
||||||
public class AbstractOpcDeviceDriver extends AbstractDeviceDriver implements OpcDeviceDriver {
|
public class AbstractOpcDeviceDriver extends AbstractDeviceDriver implements OpcDeviceDriver {
|
||||||
UnifiedDataAccessor opcUdw;
|
UnifiedDataAccessor opcUdw;
|
||||||
|
|
||||||
@@ -37,11 +39,14 @@ public class AbstractOpcDeviceDriver extends AbstractDeviceDriver implements Opc
|
|||||||
|
|
||||||
|
|
||||||
public void checkcontrol(Map<String, Object> itemValues) throws Exception {
|
public void checkcontrol(Map<String, Object> itemValues) throws Exception {
|
||||||
|
|
||||||
|
CompletableFuture<String> future = CompletableFuture.supplyAsync(() -> {
|
||||||
|
try {
|
||||||
Group group = opcServerService.getServer(this.getOpcServer());
|
Group group = opcServerService.getServer(this.getOpcServer());
|
||||||
Map<String, Object> write = new HashMap();
|
Map<String, Object> write = new HashMap();
|
||||||
Map<String, Item> readitems = new LinkedHashMap();
|
Map<String, Item> readitems = new LinkedHashMap();
|
||||||
List<String> itemsString = new ArrayList();
|
List<String> itemsString = new ArrayList();
|
||||||
itemsString = new ArrayList<> (itemValues.keySet());
|
itemsString = new ArrayList<>(itemValues.keySet());
|
||||||
Iterator is = itemsString.iterator();
|
Iterator is = itemsString.iterator();
|
||||||
|
|
||||||
while (is.hasNext()) {
|
while (is.hasNext()) {
|
||||||
@@ -53,56 +58,127 @@ public class AbstractOpcDeviceDriver extends AbstractDeviceDriver implements Opc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while(true) {
|
while (true) {
|
||||||
//下发信号
|
//下发信号
|
||||||
control( itemValues);
|
|
||||||
|
try {
|
||||||
|
if (i == 0) {
|
||||||
|
control(itemValues);
|
||||||
|
} else {
|
||||||
|
controlByNewConn(itemValues);
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
Map<String, Object> read = new HashMap();
|
Map<String, Object> read = new HashMap();
|
||||||
Map<Item, ItemState> itemStatus = group.read(true, (Item[])readitems.values().toArray(new Item[0]));
|
Map<Item, ItemState> itemStatus = null;
|
||||||
|
boolean check = true;
|
||||||
|
try {
|
||||||
|
if (i > 0) {
|
||||||
|
group = opcServerService.getServer(this.getOpcServer());
|
||||||
|
itemsString = new ArrayList<>(itemValues.keySet());
|
||||||
|
Iterator nis = itemsString.iterator();
|
||||||
|
|
||||||
|
while (nis.hasNext()) {
|
||||||
|
String string = (String) nis.next();
|
||||||
|
try {
|
||||||
|
readitems.put(string, group.addItem(string));
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
itemStatus = group.read(true, (Item[]) readitems.values().toArray(new Item[0]));
|
||||||
|
|
||||||
|
} else {
|
||||||
|
itemStatus = group.read(true, (Item[]) readitems.values().toArray(new Item[0]));
|
||||||
|
}
|
||||||
Set<Item> items = itemStatus.keySet();
|
Set<Item> items = itemStatus.keySet();
|
||||||
Iterator var15 = items.iterator();
|
Iterator var15 = items.iterator();
|
||||||
|
while (var15.hasNext()) {
|
||||||
while(var15.hasNext()) {
|
Item item = (Item) var15.next();
|
||||||
Item item = (Item)var15.next();
|
ItemState itemState = (ItemState) itemStatus.get(item);
|
||||||
ItemState itemState = (ItemState)itemStatus.get(item);
|
|
||||||
Object value = OpcUtl.getValue(item, itemState);
|
Object value = OpcUtl.getValue(item, itemState);
|
||||||
read.put(item.getId(), value);
|
read.put(item.getId(), value);
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean check = true;
|
|
||||||
Iterator var24 = itemsString.iterator();
|
Iterator var24 = itemsString.iterator();
|
||||||
|
|
||||||
while(var24.hasNext()) {
|
while (var24.hasNext()) {
|
||||||
String itemString = (String)var24.next();
|
String itemString = (String) var24.next();
|
||||||
if (!ObjectUtl.isEquals(itemValues.get(itemString), JsonUtl.parse(read.get(itemString)))) {
|
if (!ObjectUtl.isEquals(String.valueOf(itemValues.get(itemString)), String.valueOf(read.get(itemString)))) {
|
||||||
check = false;
|
check = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
check = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (check) {
|
if (check) {
|
||||||
return;
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
ThreadUtl.sleep(300L);
|
ThreadUtl.sleep(100L);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i > 3) {
|
if (i >= 3) {
|
||||||
|
// log.info("写入次数超过3次而失败");
|
||||||
throw new RuntimeException("写入次数超过3次而失败");
|
throw new RuntimeException("写入次数超过3次而失败");
|
||||||
}
|
}
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
Thread.currentThread().interrupt();
|
||||||
|
throw new IllegalStateException("Interrupted", e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
String result = future.get(2, TimeUnit.SECONDS); // 设置超时时间为2秒
|
||||||
|
System.out.println(result);
|
||||||
|
} catch (CompletionException e) {
|
||||||
|
Throwable cause = e.getCause();
|
||||||
|
if (cause instanceof TimeoutException) {
|
||||||
|
System.out.println("Operation timed out");
|
||||||
|
} else {
|
||||||
|
throw e; // rethrow other exceptions
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public boolean control(Map<String, Object> itemValues) {
|
public boolean controlByNewConn (Map < String, Object > itemValues){
|
||||||
|
|
||||||
Iterator<Map.Entry<String, Object>> it = itemValues.entrySet().iterator();
|
Iterator<Map.Entry<String, Object>> it = itemValues.entrySet().iterator();
|
||||||
|
|
||||||
ItemValue p2[];
|
ItemValue[] p2;
|
||||||
p2 = new ItemValue[itemValues.size()];
|
p2 = new ItemValue[itemValues.size()];
|
||||||
int i=0;
|
int i = 0;
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
Map.Entry<String, Object> entry = it.next();
|
Map.Entry<String, Object> entry = it.next();
|
||||||
log.info("即将写入值:"+entry.getKey() + ":" + entry.getValue());
|
System.out.println("即将写入值:" + entry.getKey() + ":" + entry.getValue());
|
||||||
|
p2[i] = new ItemValue();
|
||||||
|
p2[i].setItem_code(entry.getKey());
|
||||||
|
p2[i].setItem_value(entry.getValue());
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.controlByNewConn(p2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean control (Map < String, Object > itemValues){
|
||||||
|
|
||||||
|
Iterator<Map.Entry<String, Object>> it = itemValues.entrySet().iterator();
|
||||||
|
|
||||||
|
ItemValue[] p2;
|
||||||
|
p2 = new ItemValue[itemValues.size()];
|
||||||
|
int i = 0;
|
||||||
|
while (it.hasNext()) {
|
||||||
|
Map.Entry<String, Object> entry = it.next();
|
||||||
|
System.out.println("即将写入值:" + entry.getKey() + ":" + entry.getValue());
|
||||||
p2[i] = new ItemValue();
|
p2[i] = new ItemValue();
|
||||||
p2[i].setItem_code(entry.getKey());
|
p2[i].setItem_code(entry.getKey());
|
||||||
p2[i].setItem_value(entry.getValue());
|
p2[i].setItem_value(entry.getValue());
|
||||||
@@ -113,8 +189,7 @@ public class AbstractOpcDeviceDriver extends AbstractDeviceDriver implements Opc
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public boolean control (ItemValue[]itemValues){
|
||||||
public boolean control(ItemValue[] itemValues) {
|
|
||||||
if (itemValues != null && itemValues.length != 0) {
|
if (itemValues != null && itemValues.length != 0) {
|
||||||
String this_items = JsonUtl.parseWithoutException(itemValues);
|
String this_items = JsonUtl.parseWithoutException(itemValues);
|
||||||
boolean need_write = false;
|
boolean need_write = false;
|
||||||
@@ -134,7 +209,7 @@ public class AbstractOpcDeviceDriver extends AbstractDeviceDriver implements Opc
|
|||||||
if (!need_write && !UnifiedDataAppService.isEquals(udw_value, write_value)) {
|
if (!need_write && !UnifiedDataAppService.isEquals(udw_value, write_value)) {
|
||||||
need_write = true;
|
need_write = true;
|
||||||
} else {
|
} else {
|
||||||
log.info("下发信号点位{} 当前写入值:{} 与系统内存值:{} 相同,不再写入 ", code, write_value, udw_value );
|
//log.warn("下发信号点位{} 当前写入值:{} 与系统内存值:{} 相同,不再写入 ", code, write_value, udw_value );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// need_write = true;
|
// need_write = true;
|
||||||
@@ -172,4 +247,60 @@ public class AbstractOpcDeviceDriver extends AbstractDeviceDriver implements Opc
|
|||||||
throw new RuntimeException("下发 无内容");
|
throw new RuntimeException("下发 无内容");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public boolean controlByNewConn (ItemValue[]itemValues){
|
||||||
|
if (itemValues != null && itemValues.length != 0) {
|
||||||
|
String this_items = JsonUtl.parseWithoutException(itemValues);
|
||||||
|
boolean need_write = false;
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
ItemValue[] var5 = itemValues;
|
||||||
|
int var6 = itemValues.length;
|
||||||
|
// for (int var7 = 0; var7 < var6; ++var7) {
|
||||||
|
// ItemValue itemValue = var5[var7];
|
||||||
|
// String code = itemValue.getItem_code();
|
||||||
|
// Object udw_value = this.getUdwValue(code);
|
||||||
|
// Object write_value = itemValue.getItem_value();
|
||||||
|
// sb.append(code);
|
||||||
|
// sb.append(":");
|
||||||
|
// sb.append(JsonUtl.parseWithoutException(udw_value));
|
||||||
|
// sb.append(";");
|
||||||
|
// if (!need_write && !UnifiedDataAppService.isEquals(udw_value, write_value)) {
|
||||||
|
// need_write = true;
|
||||||
|
// } else {
|
||||||
|
// log.warn("下发信号点位{} 当前写入值:{} 与系统内存值:{} 相同,不再写入 ", code, write_value, udw_value );
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
need_write = true;
|
||||||
|
if (need_write) {
|
||||||
|
Date date = new Date();
|
||||||
|
/*if (StringUtl.isEqual(this_items, this.last_items) && date.getTime() - this.sendTime.getTime() < (long) WcsConfig.opc_write_repeat_check) {
|
||||||
|
log.trace("发送时间因为小于{}毫秒,而被无视", WcsConfig.opc_write_repeat_check);
|
||||||
|
return false;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
this.last_items = this_items;
|
||||||
|
this.sendTime = date;
|
||||||
|
OpcServerService opcServerService = SpringContextHolder.getBean(OpcServerServiceImpl.class);
|
||||||
|
|
||||||
|
opcServerService.writeIntegerByNewConn(this.getOpcServer(), itemValues);
|
||||||
|
|
||||||
|
|
||||||
|
UnifiedDataAccessor opcValueAccessor = this.getOpcValueAccessor();
|
||||||
|
ItemValue[] var17 = itemValues;
|
||||||
|
int var18 = itemValues.length;
|
||||||
|
|
||||||
|
for (int var19 = 0; var19 < var18; ++var19) {
|
||||||
|
ItemValue itemValue = var17[var19];
|
||||||
|
String code = itemValue.getItem_code();
|
||||||
|
Object value = itemValue.getItem_value();
|
||||||
|
opcValueAccessor.setValue(code, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
throw new RuntimeException("下发 无内容");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,56 +1,57 @@
|
|||||||
//package org.nl.config.saconfig;
|
/*
|
||||||
//
|
package org.nl.config.saconfig;
|
||||||
//import org.springframework.core.annotation.Order;
|
|
||||||
//import org.springframework.stereotype.Component;
|
import org.springframework.core.annotation.Order;
|
||||||
//import org.springframework.web.cors.CorsConfiguration;
|
import org.springframework.stereotype.Component;
|
||||||
//
|
import org.springframework.web.cors.CorsConfiguration;
|
||||||
//import javax.servlet.*;
|
|
||||||
//import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.*;
|
||||||
//import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
//import java.io.IOException;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
//
|
import java.io.IOException;
|
||||||
///**
|
|
||||||
// * 跨域过滤器
|
*/
|
||||||
// * @author kong
|
/**
|
||||||
// */
|
* 跨域过滤器
|
||||||
//@Component
|
* @author kong
|
||||||
//@Order(-200)
|
*//*
|
||||||
//public class CorsFilter implements Filter {
|
|
||||||
//
|
@Component
|
||||||
// static final String OPTIONS = "OPTIONS";
|
@Order(-200)
|
||||||
//
|
public class CorsFilter implements Filter {
|
||||||
// @Override
|
|
||||||
// public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
|
static final String OPTIONS = "OPTIONS";
|
||||||
// throws IOException, ServletException {
|
|
||||||
// HttpServletRequest request = (HttpServletRequest) req;
|
@Override
|
||||||
// HttpServletResponse response = (HttpServletResponse) res;
|
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
|
||||||
// // 允许指定域访问跨域资源
|
throws IOException, ServletException {
|
||||||
// response.setHeader("Access-Control-Allow-Origin", "*");
|
HttpServletRequest request = (HttpServletRequest) req;
|
||||||
// // 允许所有请求方式
|
HttpServletResponse response = (HttpServletResponse) res;
|
||||||
// response.setHeader("Access-Control-Allow-Methods", "*");
|
// 允许指定域访问跨域资源
|
||||||
// // 有效时间
|
response.setHeader("Access-Control-Allow-Origin", "*");
|
||||||
// response.setHeader("Access-Control-Max-Age", "3600");
|
// 允许所有请求方式
|
||||||
// // 允许的header参数
|
response.setHeader("Access-Control-Allow-Methods", "*");
|
||||||
// response.setHeader("Access-Control-Allow-Headers", "*");
|
// 有效时间
|
||||||
// response.setHeader("Access-Control-Allow-Credentials", "true");
|
response.setHeader("Access-Control-Max-Age", "3600");
|
||||||
//
|
// 允许的header参数
|
||||||
// // 如果是预检请求,直接返回
|
response.setHeader("Access-Control-Allow-Headers", "*");
|
||||||
// if (OPTIONS.equals(request.getMethod())) {
|
response.setHeader("Access-Control-Allow-Credentials", "true");
|
||||||
// System.out.println("=======================浏览器发来了OPTIONS预检请求==========");
|
|
||||||
// response.getWriter().print("");
|
// 如果是预检请求,直接返回
|
||||||
// return;
|
if (OPTIONS.equals(request.getMethod())) {
|
||||||
// }
|
System.out.println("=======================浏览器发来了OPTIONS预检请求==========");
|
||||||
//
|
response.getWriter().print("");
|
||||||
// // System.out.println("*********************************过滤器被使用**************************");
|
return;
|
||||||
// chain.doFilter(req, res);
|
}
|
||||||
// }
|
|
||||||
//
|
// System.out.println("*********************************过滤器被使用**************************");
|
||||||
// @Override
|
chain.doFilter(req, res);
|
||||||
// public void init(FilterConfig filterConfig) {
|
}
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
@Override
|
||||||
// public void destroy() {
|
public void destroy() {
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
//}
|
}
|
||||||
|
*/
|
||||||
|
|||||||
@@ -516,8 +516,15 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
schBaseVehiclematerialgroup.setOrder_code(connectorDto.getProductionOrder());
|
schBaseVehiclematerialgroup.setOrder_code(connectorDto.getProductionOrder());
|
||||||
schBaseVehiclematerialgroup.setCreate_name("Connector");
|
schBaseVehiclematerialgroup.setCreate_name("Connector");
|
||||||
iSchBaseVehiclematerialgroupService.create(schBaseVehiclematerialgroup);
|
iSchBaseVehiclematerialgroupService.create(schBaseVehiclematerialgroup);
|
||||||
taskService.update(Wrappers.lambdaUpdate(SchBaseTask.class).eq(SchBaseTask::getTask_code, schBaseTask.getTask_code())
|
if ("Y".equals(connectorDto.getFinished())) {
|
||||||
.set(SchBaseTask::getJob_name, connectorDto.getJobname()));
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("cJobName",connectorDto.getJobname());
|
||||||
|
try {
|
||||||
|
sortingService.applyFinishJobName(jsonObject);
|
||||||
|
}catch (Exception e){
|
||||||
|
log.info("wms反馈sorting->JobName完成,失败{}",e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new BadRequestException("LMS向Connector请求取货");
|
throw new BadRequestException("LMS向Connector请求取货");
|
||||||
|
|||||||
@@ -116,7 +116,6 @@ public class FabServiceImpl {
|
|||||||
callEmptyTask.apply(param);
|
callEmptyTask.apply(param);
|
||||||
iSchBasePointService.update(Wrappers.lambdaUpdate(SchBasePoint.class)
|
iSchBasePointService.update(Wrappers.lambdaUpdate(SchBasePoint.class)
|
||||||
.eq(SchBasePoint::getPoint_code, callEmpVo.getDevice_code())
|
.eq(SchBasePoint::getPoint_code, callEmpVo.getDevice_code())
|
||||||
.set(SchBasePoint::getPoint_status, GoodsEnum.EMPTY_PALLETS.getValue())
|
|
||||||
.set(SchBasePoint::getIs_lock, true));
|
.set(SchBasePoint::getIs_lock, true));
|
||||||
break;
|
break;
|
||||||
case "smt":
|
case "smt":
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package org.nl.wms.ext.handheld.service.impl;
|
package org.nl.wms.ext.handheld.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
@@ -10,7 +9,6 @@ import com.alibaba.fastjson.JSONObject;
|
|||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import nl.basjes.shaded.org.springframework.util.Assert;
|
import nl.basjes.shaded.org.springframework.util.Assert;
|
||||||
import org.nl.common.enums.GoodsEnum;
|
import org.nl.common.enums.GoodsEnum;
|
||||||
import org.nl.common.enums.VehicleEnum;
|
|
||||||
import org.nl.common.enums.VehicleTypeEnum;
|
import org.nl.common.enums.VehicleTypeEnum;
|
||||||
import org.nl.common.enums.region.RegionEnum;
|
import org.nl.common.enums.region.RegionEnum;
|
||||||
import org.nl.common.exception.BadRequestException;
|
import org.nl.common.exception.BadRequestException;
|
||||||
@@ -25,7 +23,6 @@ import org.nl.wms.database.vehicle.service.IMdBaseVehicleService;
|
|||||||
import org.nl.wms.database.vehicle.service.dao.MdBaseVehicle;
|
import org.nl.wms.database.vehicle.service.dao.MdBaseVehicle;
|
||||||
import org.nl.wms.ext.acs.service.WmsToAcsService;
|
import org.nl.wms.ext.acs.service.WmsToAcsService;
|
||||||
import org.nl.wms.ext.connector.service.WmsToConnectorService;
|
import org.nl.wms.ext.connector.service.WmsToConnectorService;
|
||||||
import org.nl.wms.ext.handheld.handheldEnum.RouteEnum;
|
|
||||||
import org.nl.wms.ext.handheld.service.HandheldService;
|
import org.nl.wms.ext.handheld.service.HandheldService;
|
||||||
import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService;
|
import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService;
|
||||||
import org.nl.wms.sch.group.service.dao.SchBaseVehiclematerialgroup;
|
import org.nl.wms.sch.group.service.dao.SchBaseVehiclematerialgroup;
|
||||||
@@ -44,6 +41,8 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author LENOVO
|
* @author LENOVO
|
||||||
@@ -248,10 +247,10 @@ public class HandheldServiceImpl implements HandheldService {
|
|||||||
Assert.noNullElements(new Object[]{param.getString("device_code"), param.getString("vehicle_code")},
|
Assert.noNullElements(new Object[]{param.getString("device_code"), param.getString("vehicle_code")},
|
||||||
"当前点位或目的地不能为空!");
|
"当前点位或目的地不能为空!");
|
||||||
SchBasePoint schBasePoint = iSchBasePointService.selectByPointCode(param.getString("device_code"));
|
SchBasePoint schBasePoint = iSchBasePointService.selectByPointCode(param.getString("device_code"));
|
||||||
if (ObjectUtil.isEmpty(schBasePoint)) throw new BadRequestException("设备点位不存在!");
|
/*if (ObjectUtil.isEmpty(schBasePoint)) throw new BadRequestException("设备点位不存在!");
|
||||||
if (schBasePoint.getIs_lock()) {
|
if (schBasePoint.getIs_lock()) {
|
||||||
throw new BadRequestException("该点位正在执行任务,请稍后再试!");
|
throw new BadRequestException("该点位正在执行任务,请稍后再试!");
|
||||||
}
|
}*/
|
||||||
String region_code = param.getString("region_code");
|
String region_code = param.getString("region_code");
|
||||||
String device_code = param.getString("device_code");
|
String device_code = param.getString("device_code");
|
||||||
String vehicle_code = param.getString("vehicle_code");
|
String vehicle_code = param.getString("vehicle_code");
|
||||||
@@ -329,10 +328,9 @@ public class HandheldServiceImpl implements HandheldService {
|
|||||||
if (material_code) {
|
if (material_code) {
|
||||||
((LinkedHashMap) material2).remove("material_code");
|
((LinkedHashMap) material2).remove("material_code");
|
||||||
}
|
}
|
||||||
String replace = StrUtil.replace(StrUtil.toString(material2), "=", ":");
|
cn.hutool.json.JSONObject jsonObject = JSONUtil.parseObj(material2);
|
||||||
JSONObject jsonObject = JSONObject.parseObject(replace);
|
map.put("order_code", jsonObject.get("order_code"));
|
||||||
map.put("order_code", jsonObject.getString("order_code"));
|
map.put("qty", jsonObject.get("material_qty"));
|
||||||
map.put("qty", jsonObject.getString("material_qty"));
|
|
||||||
jsonArray.add(map);
|
jsonArray.add(map);
|
||||||
});
|
});
|
||||||
json.put("vehicle_code", vehicle_code);
|
json.put("vehicle_code", vehicle_code);
|
||||||
@@ -341,16 +339,21 @@ public class HandheldServiceImpl implements HandheldService {
|
|||||||
JSONObject json1 = wmsToConnectorService.applyRegionAndDueDate(json);
|
JSONObject json1 = wmsToConnectorService.applyRegionAndDueDate(json);
|
||||||
if (ObjectUtil.isNotEmpty(json1) && json1.getInteger("status") == 200) {
|
if (ObjectUtil.isNotEmpty(json1) && json1.getInteger("status") == 200) {
|
||||||
JSONArray date = json1.getJSONArray("data");
|
JSONArray date = json1.getJSONArray("data");
|
||||||
date.stream().forEach(date1 -> {
|
date.stream().map(date1 -> JSONObject.parseObject(StrUtil.toString(date1))).forEach(json2 -> {
|
||||||
JSONObject json2 = JSONObject.parseObject(StrUtil.toString(date1));
|
List<cn.hutool.json.JSONObject> updatedMaterials = materials.stream()
|
||||||
materials.stream().forEach(material -> {
|
.map(material -> {
|
||||||
String replace = StrUtil.replace(StrUtil.toString(material), "=", ":");
|
cn.hutool.json.JSONObject jsonObject = JSONUtil.parseObj(material);
|
||||||
JSONObject jsonObject = JSONObject.parseObject(replace);
|
if (jsonObject.get("order_code").equals(json2.getString("order_code"))) {
|
||||||
if (jsonObject.getString("order_code").equals(json2.getString("order_code"))) {
|
jsonObject.putOpt("due_date", json2.getString("due_date"));
|
||||||
jsonObject.put("due_date", json2.getString("due_date"));
|
jsonObject.putOpt("region_code", json2.getString("next_region_code"));
|
||||||
jsonObject.put("region_code", json2.getString("next_region_code"));
|
return jsonObject; // 更新的对象
|
||||||
|
} else {
|
||||||
|
return jsonObject; // 其他对象保持不变
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
materials.clear();
|
||||||
|
materials.addAll(updatedMaterials);
|
||||||
});
|
});
|
||||||
region_code = JSONObject.parseObject(StrUtil.toString(date.get(0))).getString("region_code");
|
region_code = JSONObject.parseObject(StrUtil.toString(date.get(0))).getString("region_code");
|
||||||
jo.put("region_code", region_code);
|
jo.put("region_code", region_code);
|
||||||
@@ -373,25 +376,15 @@ public class HandheldServiceImpl implements HandheldService {
|
|||||||
.eq(SchBaseVehiclematerialgroup::getVehicle_code, vehicle_code));
|
.eq(SchBaseVehiclematerialgroup::getVehicle_code, vehicle_code));
|
||||||
String finalRegion_code = region_code;
|
String finalRegion_code = region_code;
|
||||||
materials.stream().forEach(material -> {
|
materials.stream().forEach(material -> {
|
||||||
String replace = StrUtil.replace(StrUtil.toString(material), "=", ":");
|
cn.hutool.json.JSONObject jsonObject = JSONUtil.parseObj(material);
|
||||||
replace = replace.replaceAll("material_code:,", "");
|
|
||||||
// 使用 Hutool 的 JSONUtil 解析 JSON 字符串
|
|
||||||
cn.hutool.json.JSONObject jsonObject1 = JSONUtil.parseObj(replace);
|
|
||||||
// 判断 material_code 是否为空
|
|
||||||
if (replace.contains("OR")) {
|
|
||||||
Object materialCode = jsonObject1.get("order_code");
|
|
||||||
jsonObject1.put("order_code", materialCode.toString());
|
|
||||||
replace = jsonObject1.toString();
|
|
||||||
}
|
|
||||||
JSONObject jsonObject = JSONObject.parseObject(replace);
|
|
||||||
SchBaseVehiclematerialgroup schBaseVehiclematerialgroup = new SchBaseVehiclematerialgroup();
|
SchBaseVehiclematerialgroup schBaseVehiclematerialgroup = new SchBaseVehiclematerialgroup();
|
||||||
schBaseVehiclematerialgroup.setVehicle_code(vehicle_code);
|
schBaseVehiclematerialgroup.setVehicle_code(vehicle_code);
|
||||||
schBaseVehiclematerialgroup.setMaterial_qty(jsonObject.getInteger("material_qty"));
|
schBaseVehiclematerialgroup.setMaterial_qty(jsonObject.getInt("material_qty"));
|
||||||
schBaseVehiclematerialgroup.setMaterial_code(jsonObject.getString("material_code"));
|
schBaseVehiclematerialgroup.setMaterial_code(jsonObject.getStr("material_code"));
|
||||||
schBaseVehiclematerialgroup.setOrder_code(jsonObject.getString("order_code"));
|
schBaseVehiclematerialgroup.setOrder_code(jsonObject.getStr("order_code"));
|
||||||
schBaseVehiclematerialgroup.setDue_date(jsonObject.getString("due_date"));
|
schBaseVehiclematerialgroup.setDue_date(jsonObject.getStr("due_date"));
|
||||||
schBaseVehiclematerialgroup.setCreate_name(SecurityUtils.getCurrentNickName());
|
schBaseVehiclematerialgroup.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||||
schBaseVehiclematerialgroup.setRegion_code(StrUtil.isBlank(finalRegion_code) ? jsonObject.getString("region_code") : finalRegion_code);
|
schBaseVehiclematerialgroup.setRegion_code(StrUtil.isBlank(finalRegion_code) ? jsonObject.getStr("region_code") : finalRegion_code);
|
||||||
iSchBaseVehiclematerialgroupService.create(schBaseVehiclematerialgroup);
|
iSchBaseVehiclematerialgroupService.create(schBaseVehiclematerialgroup);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,4 +28,13 @@ public class WmsToSortingService {
|
|||||||
AcsResponse acsResponse = ConnectorUtil.notifyEextSystem("api/external/wms/agv", json, GeneralDefinition.SORTING_URL);
|
AcsResponse acsResponse = ConnectorUtil.notifyEextSystem("api/external/wms/agv", json, GeneralDefinition.SORTING_URL);
|
||||||
return acsResponse;
|
return acsResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 反馈Sorting jobname完成
|
||||||
|
* @param json
|
||||||
|
*/
|
||||||
|
public void applyFinishJobName(JSONObject json) {
|
||||||
|
AcsResponse acsResponse = ConnectorUtil.notifyEextSystem("api/external/jobif/updatejobstatus", json, GeneralDefinition.SORTING_URL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ public interface ISchBasePointService extends IService<SchBasePoint> {
|
|||||||
* @param vehicle_type
|
* @param vehicle_type
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
SchBasePoint selectByGroundPoint(String region_code, String pointStatus, String vehicle_type, int seq);
|
SchBasePoint selectByGroundPoint(String region_code, String pointStatus, String vehicle_type, int seq,int point_type);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
WHERE p.point_code = #{id}
|
WHERE p.point_code = #{id}
|
||||||
FOR UPDATE
|
FOR UPDATE
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getStructList" resultType="org.nl.wms.ext.fab.service.dto.OrderMater">
|
<select id="getStructList" resultType="org.nl.wms.ext.fab.service.dto.OrderMater">
|
||||||
SELECT
|
SELECT
|
||||||
sch_base_point.point_code,
|
sch_base_point.point_code,
|
||||||
@@ -46,11 +47,13 @@
|
|||||||
AND sch_base_vehiclematerialgroup.region_code = #{region_code}
|
AND sch_base_vehiclematerialgroup.region_code = #{region_code}
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectByRegionCode" resultType="java.lang.String">
|
<select id="selectByRegionCode" resultType="java.lang.String">
|
||||||
select sbp.point_code
|
select sbp.point_code
|
||||||
from sch_base_point sbp
|
from sch_base_point sbp
|
||||||
where sbp.region_code = #{region_code}
|
where sbp.region_code = #{region_code}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectJobDevice" resultType="java.util.Map">
|
<select id="selectJobDevice" resultType="java.util.Map">
|
||||||
select sbp.point_code, sbp.point_name
|
select sbp.point_code, sbp.point_name
|
||||||
from sch_base_point sbp
|
from sch_base_point sbp
|
||||||
@@ -58,6 +61,7 @@
|
|||||||
and region_code = 'GZQ'
|
and region_code = 'GZQ'
|
||||||
and region_points is not null
|
and region_points is not null
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectPointByRegion" resultType="com.alibaba.fastjson.JSONObject"
|
<select id="selectPointByRegion" resultType="com.alibaba.fastjson.JSONObject"
|
||||||
parameterType="java.lang.String">
|
parameterType="java.lang.String">
|
||||||
select point_code, point_name, point_status
|
select point_code, point_name, point_status
|
||||||
@@ -65,4 +69,5 @@
|
|||||||
where region_code = #{regionCode}
|
where region_code = #{regionCode}
|
||||||
and point_type is null
|
and point_type is null
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -269,8 +269,8 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
|||||||
pointMapper.updateById(schBasePoint);
|
pointMapper.updateById(schBasePoint);
|
||||||
return schBasePoint;
|
return schBasePoint;
|
||||||
}
|
}
|
||||||
SchBasePoint schBasePoint1 = pointMapper.selectList(Wrappers.lambdaQuery(SchBasePoint.class).eq(SchBasePoint::getRegion_code, region_code)).get(0);
|
/*SchBasePoint schBasePoint1 = pointMapper.selectList(Wrappers.lambdaQuery(SchBasePoint.class).eq(SchBasePoint::getRegion_code, region_code)).get(0);
|
||||||
if (ObjectUtil.isEmpty(schBasePoint1)) throw new BadRequestException("不存在该区域!");
|
if (ObjectUtil.isEmpty(schBasePoint1)) throw new BadRequestException("不存在该区域!");*/
|
||||||
//分配载具类型相同的站点
|
//分配载具类型相同的站点
|
||||||
List<SchBasePoint> schBasePoints1 = pointMapper.selectList(Wrappers.lambdaQuery(SchBasePoint.class)
|
List<SchBasePoint> schBasePoints1 = pointMapper.selectList(Wrappers.lambdaQuery(SchBasePoint.class)
|
||||||
.eq(SchBasePoint::getIs_lock, false)
|
.eq(SchBasePoint::getIs_lock, false)
|
||||||
@@ -280,7 +280,7 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
|||||||
.eq(SchBasePoint::getIs_used, true)
|
.eq(SchBasePoint::getIs_used, true)
|
||||||
.eq(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue()));
|
.eq(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue()));
|
||||||
if (CollUtil.isNotEmpty(schBasePoints1) && schBasePoints1.size() > 0) {
|
if (CollUtil.isNotEmpty(schBasePoints1) && schBasePoints1.size() > 0) {
|
||||||
schBasePoints1.stream().sorted(Comparator.comparingInt(schBasePoint -> Math.abs(schBasePoint1.getRegion_seq() - schBasePoint.getRegion_seq())));
|
/*schBasePoints1.stream().sorted(Comparator.comparingInt(schBasePoint -> Math.abs(schBasePoint1.getRegion_seq() - schBasePoint.getRegion_seq())));*/
|
||||||
SchBasePoint schBasePoint = schBasePoints1.get(0);
|
SchBasePoint schBasePoint = schBasePoints1.get(0);
|
||||||
schBasePoint.setIs_lock(true);
|
schBasePoint.setIs_lock(true);
|
||||||
PointUtils.setUpdateByAcs(schBasePoint);
|
PointUtils.setUpdateByAcs(schBasePoint);
|
||||||
@@ -389,13 +389,13 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SchBasePoint selectByGroundPoint(String region_code, String pointStatus, String vehicle_type, int seq) {
|
public SchBasePoint selectByGroundPoint(String region_code, String pointStatus, String vehicle_type, int seq,int point_type) {
|
||||||
List<SchBasePoint> schBasePoints = pointMapper.selectList(Wrappers.lambdaQuery(SchBasePoint.class)
|
List<SchBasePoint> schBasePoints = pointMapper.selectList(Wrappers.lambdaQuery(SchBasePoint.class)
|
||||||
.eq(SchBasePoint::getIs_lock, false)
|
.eq(SchBasePoint::getIs_lock, false)
|
||||||
.eq(SchBasePoint::getIs_used, true)
|
.eq(SchBasePoint::getIs_used, true)
|
||||||
.eq(SchBasePoint::getPoint_status, pointStatus)
|
.eq(SchBasePoint::getPoint_status, pointStatus)
|
||||||
.eq(!vehicle_type.equals("G01"), SchBasePoint::getPoint_type, "1")
|
.eq(!vehicle_type.equals("G01"), SchBasePoint::getPoint_type, "1")
|
||||||
.eq(vehicle_type.equals("G01"), SchBasePoint::getPoint_type, "0")
|
.eq(vehicle_type.equals("G01"), SchBasePoint::getPoint_type,point_type )
|
||||||
.eq(StrUtil.isNotBlank(vehicle_type), SchBasePoint::getCan_vehicle_type, vehicle_type)
|
.eq(StrUtil.isNotBlank(vehicle_type), SchBasePoint::getCan_vehicle_type, vehicle_type)
|
||||||
.isNull(seq == 2, SchBasePoint::getVehicles)
|
.isNull(seq == 2, SchBasePoint::getVehicles)
|
||||||
.isNull(seq == 1, SchBasePoint::getVehicle_code)
|
.isNull(seq == 1, SchBasePoint::getVehicle_code)
|
||||||
@@ -413,7 +413,8 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
|||||||
.eq(SchBasePoint::getIs_used, true)
|
.eq(SchBasePoint::getIs_used, true)
|
||||||
.eq(SchBasePoint::getPoint_status, pointStatus)
|
.eq(SchBasePoint::getPoint_status, pointStatus)
|
||||||
.eq(SchBasePoint::getCan_vehicle_type, vehicle_type)
|
.eq(SchBasePoint::getCan_vehicle_type, vehicle_type)
|
||||||
.isNotNull(SchBasePoint::getVehicle_code));
|
.isNotNull(SchBasePoint::getVehicle_code)
|
||||||
|
.orderByDesc(SchBasePoint::getIn_order_seq));
|
||||||
if (CollUtil.isNotEmpty(schBasePoints) && schBasePoints.size() > 0) {
|
if (CollUtil.isNotEmpty(schBasePoints) && schBasePoints.size() > 0) {
|
||||||
SchBasePoint schBasePoint = schBasePoints.get(0);
|
SchBasePoint schBasePoint = schBasePoints.get(0);
|
||||||
schBasePoint.setIs_lock(true);
|
schBasePoint.setIs_lock(true);
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ public class CNTTask extends AbstractTask {
|
|||||||
task.setVehicle_type(schBasePoint.getCan_vehicle_type());
|
task.setVehicle_type(schBasePoint.getCan_vehicle_type());
|
||||||
task.setRemark("");
|
task.setRemark("");
|
||||||
task.setTask_status(TaskStatus.CREATED.getCode());
|
task.setTask_status(TaskStatus.CREATED.getCode());
|
||||||
if (task.getPoint_code1().endsWith("1")) {
|
if (task.getPoint_code1().endsWith("1") || task.getPoint_code1().endsWith("3")) {
|
||||||
task.setAcs_trace_id("4");
|
task.setAcs_trace_id("4");
|
||||||
}
|
}
|
||||||
taskService.updateById(task);
|
taskService.updateById(task);
|
||||||
|
|||||||
@@ -67,10 +67,10 @@ public class BlankingTask extends AbstractTask {
|
|||||||
SchBasePoint schBasePoint = null;
|
SchBasePoint schBasePoint = null;
|
||||||
if (ObjectUtil.isEmpty(task.getRegion_code())) {
|
if (ObjectUtil.isEmpty(task.getRegion_code())) {
|
||||||
schBasePoint = schBasePointService.selectByGroundPoint(null,
|
schBasePoint = schBasePointService.selectByGroundPoint(null,
|
||||||
GoodsEnum.OUT_OF_STOCK.getValue(), mdBaseVehicle.getVehicle_type(), 1);
|
GoodsEnum.OUT_OF_STOCK.getValue(), mdBaseVehicle.getVehicle_type(), 1,1);
|
||||||
} else {
|
} else {
|
||||||
schBasePoint = schBasePointService.selectByGroundPoint(task.getRegion_code(),
|
schBasePoint = schBasePointService.selectByGroundPoint(task.getRegion_code(),
|
||||||
GoodsEnum.OUT_OF_STOCK.getValue(), mdBaseVehicle.getVehicle_type(), 1);
|
GoodsEnum.OUT_OF_STOCK.getValue(), mdBaseVehicle.getVehicle_type(), 1,1);
|
||||||
}
|
}
|
||||||
if (ObjectUtil.isEmpty(schBasePoint)) {
|
if (ObjectUtil.isEmpty(schBasePoint)) {
|
||||||
task.setRemark("未找到所需点位!");
|
task.setRemark("未找到所需点位!");
|
||||||
|
|||||||
@@ -63,7 +63,8 @@ public class CallEmptyTask extends AbstractTask {
|
|||||||
NoticeTypeEnum.WARN.getCode());
|
NoticeTypeEnum.WARN.getCode());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
SchBasePoint schBasePoint = schBasePointService.selectByGroundPoint(task.getRegion_code(), GoodsEnum.OUT_OF_STOCK.getValue(), mdBaseVehicle.getVehicle_type(), 1);
|
SchBasePoint schBasePoint = schBasePointService.selectByGroundPoint(task.getRegion_code(), GoodsEnum.OUT_OF_STOCK.getValue()
|
||||||
|
, mdBaseVehicle.getVehicle_type(), 1,1);
|
||||||
if (ObjectUtil.isEmpty(schBasePoint)) {
|
if (ObjectUtil.isEmpty(schBasePoint)) {
|
||||||
task.setRemark("未找到所需点位!");
|
task.setRemark("未找到所需点位!");
|
||||||
taskService.updateById(task);
|
taskService.updateById(task);
|
||||||
|
|||||||
@@ -75,22 +75,22 @@ public class EmptyCageTask extends AbstractTask {
|
|||||||
case "R01":
|
case "R01":
|
||||||
//RO1空料容
|
//RO1空料容
|
||||||
schBasePoint = schBasePointService.selectByGroundPoint(RegionEnum.DDLK.getRegion_code(),
|
schBasePoint = schBasePointService.selectByGroundPoint(RegionEnum.DDLK.getRegion_code(),
|
||||||
GoodsEnum.OUT_OF_STOCK.getValue(), VehicleTypeEnum.FRAME_R01.getVehicleCode(), 2);
|
GoodsEnum.OUT_OF_STOCK.getValue(), VehicleTypeEnum.FRAME_R01.getVehicleCode(), 2,1);
|
||||||
break;
|
break;
|
||||||
case "R02":
|
case "R02":
|
||||||
//RO2空料容
|
//RO2空料容
|
||||||
schBasePoint = schBasePointService.selectByGroundPoint(RegionEnum.DDLK.getRegion_code(),
|
schBasePoint = schBasePointService.selectByGroundPoint(RegionEnum.DDLK.getRegion_code(),
|
||||||
GoodsEnum.OUT_OF_STOCK.getValue(), VehicleTypeEnum.FRAME_R02.getVehicleCode(), 2);
|
GoodsEnum.OUT_OF_STOCK.getValue(), VehicleTypeEnum.FRAME_R02.getVehicleCode(), 2,1);
|
||||||
break;
|
break;
|
||||||
case "S04":
|
case "S04":
|
||||||
//RO2空料容
|
//RO2空料容
|
||||||
schBasePoint = schBasePointService.selectByGroundPoint(RegionEnum.DDLK.getRegion_code(),
|
schBasePoint = schBasePointService.selectByGroundPoint(RegionEnum.DDLK.getRegion_code(),
|
||||||
GoodsEnum.OUT_OF_STOCK.getValue(), VehicleTypeEnum.RACKS_S04.getVehicleCode(), 2);
|
GoodsEnum.OUT_OF_STOCK.getValue(), VehicleTypeEnum.RACKS_S04.getVehicleCode(), 2,1);
|
||||||
break;
|
break;
|
||||||
case "S06":
|
case "S06":
|
||||||
//RO2空料容
|
//RO2空料容
|
||||||
schBasePoint = schBasePointService.selectByGroundPoint(RegionEnum.DDLK.getRegion_code(),
|
schBasePoint = schBasePointService.selectByGroundPoint(RegionEnum.DDLK.getRegion_code(),
|
||||||
GoodsEnum.OUT_OF_STOCK.getValue(), VehicleTypeEnum.RACKS_S06.getVehicleCode(), 2);
|
GoodsEnum.OUT_OF_STOCK.getValue(), VehicleTypeEnum.RACKS_S06.getVehicleCode(), 2,1);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ public class MtTask extends AbstractTask {
|
|||||||
for (SchBaseTask task : tasks) {
|
for (SchBaseTask task : tasks) {
|
||||||
String vehicle_type = task.getVehicle_type();
|
String vehicle_type = task.getVehicle_type();
|
||||||
SchBasePoint schBasePoint = schBasePointService.selectByGroundPoint(RegionEnum.NBJG.getRegion_code(),
|
SchBasePoint schBasePoint = schBasePointService.selectByGroundPoint(RegionEnum.NBJG.getRegion_code(),
|
||||||
GoodsEnum.OUT_OF_STOCK.getValue(), null, 2);
|
GoodsEnum.OUT_OF_STOCK.getValue(), null, 2,1);
|
||||||
if (ObjectUtil.isEmpty(schBasePoint)) {
|
if (ObjectUtil.isEmpty(schBasePoint)) {
|
||||||
task.setRemark("未找到所需点位!");
|
task.setRemark("未找到所需点位!");
|
||||||
taskService.updateById(task);
|
taskService.updateById(task);
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ public class RackTask extends AbstractTask {
|
|||||||
regionCode = RegionEnum.LAG_ROBOT_BEANDING_CELL.getRegion_code();
|
regionCode = RegionEnum.LAG_ROBOT_BEANDING_CELL.getRegion_code();
|
||||||
}
|
}
|
||||||
SchBasePoint schBasePoint = schBasePointService.selectByGroundPoint(regionCode,
|
SchBasePoint schBasePoint = schBasePointService.selectByGroundPoint(regionCode,
|
||||||
GoodsEnum.OUT_OF_STOCK.getValue(), vehicle_type, 1);
|
GoodsEnum.OUT_OF_STOCK.getValue(), vehicle_type, 1,0);
|
||||||
if (ObjectUtil.isEmpty(schBasePoint)) {
|
if (ObjectUtil.isEmpty(schBasePoint)) {
|
||||||
task.setRemark("未找到所需点位!");
|
task.setRemark("未找到所需点位!");
|
||||||
taskService.updateById(task);
|
taskService.updateById(task);
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ import org.nl.common.enums.GoodsEnum;
|
|||||||
import org.nl.common.enums.wms.PointStatusEnum;
|
import org.nl.common.enums.wms.PointStatusEnum;
|
||||||
import org.nl.common.exception.BadRequestException;
|
import org.nl.common.exception.BadRequestException;
|
||||||
import org.nl.system.service.notice.ISysNoticeService;
|
import org.nl.system.service.notice.ISysNoticeService;
|
||||||
|
import org.nl.wms.database.vehicle.service.IMdBaseVehicleService;
|
||||||
|
import org.nl.wms.database.vehicle.service.dao.MdBaseVehicle;
|
||||||
import org.nl.wms.ext.acs.service.dto.to.BaseResponse;
|
import org.nl.wms.ext.acs.service.dto.to.BaseResponse;
|
||||||
import org.nl.wms.ext.fab.service.dto.SendMaterVo;
|
import org.nl.wms.ext.fab.service.dto.SendMaterVo;
|
||||||
import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService;
|
import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService;
|
||||||
@@ -52,6 +54,8 @@ public class ProcessingSMTTask extends AbstractTask {
|
|||||||
private ISchBasePointService schBasePointService;
|
private ISchBasePointService schBasePointService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISchBaseVehiclematerialgroupService schBaseVehiclematerialgroupService;
|
private ISchBaseVehiclematerialgroupService schBaseVehiclematerialgroupService;
|
||||||
|
@Autowired
|
||||||
|
private IMdBaseVehicleService mdBaseVehicleService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void create() throws BadRequestException {
|
protected void create() throws BadRequestException {
|
||||||
@@ -134,7 +138,6 @@ public class ProcessingSMTTask extends AbstractTask {
|
|||||||
SchBasePoint schBasePoint = pointService.selectByPointCode(startPoint);
|
SchBasePoint schBasePoint = pointService.selectByPointCode(startPoint);
|
||||||
// 起点清空
|
// 起点清空
|
||||||
if (ObjectUtil.isNotEmpty(schBasePoint)) {
|
if (ObjectUtil.isNotEmpty(schBasePoint)) {
|
||||||
PointUtils.updateByIngTaskCode(schBasePoint);
|
|
||||||
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class)
|
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class)
|
||||||
.eq(SchBasePoint::getPoint_code, startPoint)
|
.eq(SchBasePoint::getPoint_code, startPoint)
|
||||||
.set(SchBasePoint::getVehicle_code, null)
|
.set(SchBasePoint::getVehicle_code, null)
|
||||||
@@ -144,11 +147,19 @@ public class ProcessingSMTTask extends AbstractTask {
|
|||||||
String point_code2 = taskObj.getPoint_code2();
|
String point_code2 = taskObj.getPoint_code2();
|
||||||
SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2);
|
SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2);
|
||||||
if (ObjectUtil.isNotEmpty(schBasePoint2)) {
|
if (ObjectUtil.isNotEmpty(schBasePoint2)) {
|
||||||
PointUtils.updateByIngTaskCode(schBasePoint2);
|
String point_status = GoodsEnum.IN_STOCK.getValue();
|
||||||
|
Boolean point_type = false;
|
||||||
|
if (point_code2.contains("NBJGKLLDJW")) {
|
||||||
|
point_status = GoodsEnum.EMPTY_PALLETS.getValue();
|
||||||
|
point_type = true;
|
||||||
|
}
|
||||||
|
MdBaseVehicle mdBaseVehicle = mdBaseVehicleService.selectByVehicleCode(taskObj.getVehicle_code());
|
||||||
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class)
|
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class)
|
||||||
.eq(SchBasePoint::getPoint_code, point_code2)
|
.eq(SchBasePoint::getPoint_code, point_code2)
|
||||||
.set(SchBasePoint::getVehicle_code, taskObj.getVehicle_code())
|
.set(SchBasePoint::getVehicle_code, taskObj.getVehicle_code())
|
||||||
.set(SchBasePoint::getPoint_status, GoodsEnum.IN_STOCK.getValue())
|
.set(point_type, SchBasePoint::getCan_vehicle_type, mdBaseVehicle.getVehicle_type())
|
||||||
|
.set(point_type, SchBasePoint::getIn_order_seq, 5)
|
||||||
|
.set(SchBasePoint::getPoint_status, point_status)
|
||||||
.set(SchBasePoint::getIs_lock, false));
|
.set(SchBasePoint::getIs_lock, false));
|
||||||
}
|
}
|
||||||
// 任务完成
|
// 任务完成
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ window.g = {
|
|||||||
VUE_APP_BASE_API: 'http://127.0.0.1:8010'
|
VUE_APP_BASE_API: 'http://127.0.0.1:8010'
|
||||||
},
|
},
|
||||||
prod: {
|
prod: {
|
||||||
VUE_APP_BASE_API: 'http://127.0.0.1:8010'
|
VUE_APP_BASE_API: 'http://192.168.101.1:8010'
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,7 +101,7 @@
|
|||||||
@change="hand"
|
@change="hand"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="锁定类型">
|
<el-form-item label="是否锁定">
|
||||||
<el-switch
|
<el-switch
|
||||||
v-model="query.lock_type"
|
v-model="query.lock_type"
|
||||||
:active-value="true"
|
:active-value="true"
|
||||||
@@ -228,11 +228,25 @@
|
|||||||
<el-form-item label="父类编码" prop="vehicle_code">
|
<el-form-item label="父类编码" prop="vehicle_code">
|
||||||
<el-input v-model="form.parent_point_code" clearable style="width: 370px;" @focus="getParentPoint" />
|
<el-input v-model="form.parent_point_code" clearable style="width: 370px;" @focus="getParentPoint" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="form.point_status !== '0'" label="载具编码" prop="vehicle_code">
|
<el-form-item label="载具编码" prop="vehicle_code">
|
||||||
<el-input v-model="form.vehicle_code" clearable style="width: 370px;" />
|
<el-input v-model="form.vehicle_code" clearable style="width: 370px;" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="form.point_status !== '0'" label="允许载具类型" prop="vehicle_type">
|
<el-form-item label="允许载具类型" prop="can_vehicle_type">
|
||||||
<el-input v-model="form.vehicle_type" clearable style="width: 370px;" />
|
<el-select
|
||||||
|
v-model="form.can_vehicle_type"
|
||||||
|
size="mini"
|
||||||
|
placeholder="允许载具类型"
|
||||||
|
class="filter-item"
|
||||||
|
style="width: 370px;"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in dict.can_vehicle_type"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
<!-- <el-input v-model="form.can_vehicle_type" clearable style="width: 370px;" /> -->
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- <el-form-item label="可放载具类型" prop="can_vehicle_types">
|
<!-- <el-form-item label="可放载具类型" prop="can_vehicle_types">
|
||||||
<el-select v-model="form.can_vehicle_types" multiple placeholder="请选择" clearable style="width: 370px;">
|
<el-select v-model="form.can_vehicle_types" multiple placeholder="请选择" clearable style="width: 370px;">
|
||||||
@@ -263,11 +277,11 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="是否有工单">
|
<el-form-item label="是否锁定">
|
||||||
<el-radio v-for="item in dict.TrueOrFalse" :key="item.id" v-model="form.is_has_workder" :label="item.value">{{ item.label }}</el-radio>
|
<el-radio v-for="item in dict.TrueOrFalse" :key="item.id" v-model="form.is_lock" :label="item.value">{{ item.label }}</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="是否自动">
|
<el-form-item label="是否启用">
|
||||||
<el-radio v-for="item in dict.TrueOrFalse" :key="item.id" v-model="form.is_auto" :label="item.value">{{ item.label }}</el-radio>
|
<el-radio v-for="item in dict.TrueOrFalse" :key="item.id" v-model="form.is_used" :label="item.value">{{ item.label }}</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="备注">
|
<el-form-item label="备注">
|
||||||
<el-input v-model="form.remark" style="width: 370px;" rows="2" type="textarea" />
|
<el-input v-model="form.remark" style="width: 370px;" rows="2" type="textarea" />
|
||||||
@@ -397,11 +411,12 @@ const defaultForm = {
|
|||||||
is_auto: 'true',
|
is_auto: 'true',
|
||||||
remark: null,
|
remark: null,
|
||||||
is_used: 'true',
|
is_used: 'true',
|
||||||
|
is_lock: 'true',
|
||||||
can_vehicle_types: null
|
can_vehicle_types: null
|
||||||
}
|
}
|
||||||
export default {
|
export default {
|
||||||
name: 'SchBasePoint',
|
name: 'SchBasePoint',
|
||||||
dicts: ['vehicle_type', 'TrueOrFalse'],
|
dicts: ['vehicle_type', 'TrueOrFalse', 'can_vehicle_type'],
|
||||||
components: { PointDialog, ViewDialog, pagination, crudOperation, rrOperation, udOperation },
|
components: { PointDialog, ViewDialog, pagination, crudOperation, rrOperation, udOperation },
|
||||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||||
cruds() {
|
cruds() {
|
||||||
@@ -483,8 +498,8 @@ export default {
|
|||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
[CRUD.HOOK.beforeToCU]() {
|
[CRUD.HOOK.beforeToCU]() {
|
||||||
this.form.is_has_workder = this.form.is_has_workder.toString()
|
this.form.is_lock = this.form.is_lock.toString()
|
||||||
this.form.is_auto = this.form.is_auto.toString()
|
this.form.is_used = this.form.is_used.toString()
|
||||||
},
|
},
|
||||||
[CRUD.HOOK.afterToCU]() {
|
[CRUD.HOOK.afterToCU]() {
|
||||||
if (this.form.region_code) {
|
if (this.form.region_code) {
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ module.exports = {
|
|||||||
lintOnSave: process.env.NODE_ENV === 'development',
|
lintOnSave: process.env.NODE_ENV === 'development',
|
||||||
productionSourceMap: false,
|
productionSourceMap: false,
|
||||||
devServer: {
|
devServer: {
|
||||||
|
allowedHosts: ['all'],
|
||||||
|
disableHostCheck: true,
|
||||||
port: port,
|
port: port,
|
||||||
open: false,
|
open: false,
|
||||||
overlay: {
|
overlay: {
|
||||||
|
|||||||
Reference in New Issue
Block a user