|
@ -6,12 +6,16 @@ import cn.hutool.core.util.StrUtil; |
|
|
import com.alibaba.fastjson.JSON; |
|
|
import com.alibaba.fastjson.JSON; |
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
|
|
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
|
|
import lombok.RequiredArgsConstructor; |
|
|
import lombok.RequiredArgsConstructor; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
|
import nl.basjes.shaded.org.springframework.util.Assert; |
|
|
import org.nl.acs.AcsConfig; |
|
|
import org.nl.acs.AcsConfig; |
|
|
import org.nl.acs.common.IDriverService; |
|
|
import org.nl.acs.common.IDriverService; |
|
|
import org.nl.acs.device.domain.Device; |
|
|
import org.nl.acs.device.domain.Device; |
|
|
|
|
|
import org.nl.acs.device.domain.DeviceExtra; |
|
|
|
|
|
import org.nl.acs.device.service.DeviceExtraService; |
|
|
import org.nl.acs.device.service.DeviceService; |
|
|
import org.nl.acs.device.service.DeviceService; |
|
|
import org.nl.acs.device_driver.basedriver.hongxiang_conveyor.HongXiangStationDeviceDriver; |
|
|
import org.nl.acs.device_driver.basedriver.hongxiang_conveyor.HongXiangStationDeviceDriver; |
|
|
import org.nl.acs.device_driver.basedriver.hongxiang_device.HongXiangConveyorDeviceDriver; |
|
|
import org.nl.acs.device_driver.basedriver.hongxiang_device.HongXiangConveyorDeviceDriver; |
|
@ -36,14 +40,12 @@ import org.nl.system.service.param.ISysParamService; |
|
|
|
|
|
|
|
|
import org.nl.config.SpringContextHolder; |
|
|
import org.nl.config.SpringContextHolder; |
|
|
import org.slf4j.MDC; |
|
|
import org.slf4j.MDC; |
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.context.ApplicationContext; |
|
|
import org.springframework.context.ApplicationContext; |
|
|
import org.springframework.http.HttpStatus; |
|
|
import org.springframework.http.HttpStatus; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
import java.util.*; |
|
|
import java.util.HashMap; |
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
|
|
|
@Service |
|
|
@Service |
|
|
@RequiredArgsConstructor |
|
|
@RequiredArgsConstructor |
|
@ -59,6 +61,8 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { |
|
|
private final RouteLineService routeLineService; |
|
|
private final RouteLineService routeLineService; |
|
|
private final AcsToLiKuService acsToLiKuService; |
|
|
private final AcsToLiKuService acsToLiKuService; |
|
|
private final StorageCellMapper storageCellMapper; |
|
|
private final StorageCellMapper storageCellMapper; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private DeviceExtraService deviceExtraService; |
|
|
|
|
|
|
|
|
private String log_file_type = "log_file_type"; |
|
|
private String log_file_type = "log_file_type"; |
|
|
private String log_type = "LMS请求ACS"; |
|
|
private String log_type = "LMS请求ACS"; |
|
@ -466,14 +470,14 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { |
|
|
for (int i = 0; i < reqs.size(); i++) { |
|
|
for (int i = 0; i < reqs.size(); i++) { |
|
|
CreateTaskRequest req = reqs.get(i); |
|
|
CreateTaskRequest req = reqs.get(i); |
|
|
String task_code = req.getTask_code(); |
|
|
String task_code = req.getTask_code(); |
|
|
String task_id =req.getTask_id(); |
|
|
String task_id = req.getTask_id(); |
|
|
String start_device_code = req.getStart_device_code(); |
|
|
String start_device_code = req.getStart_device_code(); |
|
|
String next_device_code = req.getNext_device_code(); |
|
|
String next_device_code = req.getNext_device_code(); |
|
|
String priority = req.getPriority(); |
|
|
String priority = req.getPriority(); |
|
|
String vehicle_code = req.getVehicle_code(); |
|
|
String vehicle_code = req.getVehicle_code(); |
|
|
String vehicle_type = req.getVehicle_type(); |
|
|
String vehicle_type = req.getVehicle_type(); |
|
|
String task_type = req.getTask_type(); |
|
|
String task_type = req.getTask_type(); |
|
|
String agv_task_type=req.getAgv_task_type(); |
|
|
String agv_task_type = req.getAgv_task_type(); |
|
|
String remark = req.getRemark(); |
|
|
String remark = req.getRemark(); |
|
|
Map<String, String> params = req.getParams(); |
|
|
Map<String, String> params = req.getParams(); |
|
|
|
|
|
|
|
@ -577,7 +581,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
JSONObject jo = new JSONObject(); |
|
|
JSONObject jo = new JSONObject(); |
|
|
jo.put("ext_task_id",task_id); |
|
|
jo.put("ext_task_id", task_id); |
|
|
jo.put("task_code", task_code); |
|
|
jo.put("task_code", task_code); |
|
|
jo.put("task_id", IdUtil.simpleUUID()); |
|
|
jo.put("task_id", IdUtil.simpleUUID()); |
|
|
jo.put("start_point_code", start_point_code); |
|
|
jo.put("start_point_code", start_point_code); |
|
@ -631,29 +635,30 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { |
|
|
public JSONObject notifyAcs(JSONObject param) { |
|
|
public JSONObject notifyAcs(JSONObject param) { |
|
|
log.info("notifyAcs - 请求参数 {}", param); |
|
|
log.info("notifyAcs - 请求参数 {}", param); |
|
|
JSONObject result = new JSONObject(); |
|
|
JSONObject result = new JSONObject(); |
|
|
Integer type=param.getInteger("type"); |
|
|
Integer type = param.getInteger("type"); |
|
|
String device_code=param.getString("device_code"); |
|
|
String device_code = param.getString("device_code"); |
|
|
Device device = deviceAppService.findDeviceByCode(device_code);; |
|
|
Device device = deviceAppService.findDeviceByCode(device_code); |
|
|
switch(type){ |
|
|
; |
|
|
|
|
|
switch (type) { |
|
|
case 1: |
|
|
case 1: |
|
|
//LMS通知固化室极板已进满信号,开始固化
|
|
|
//LMS通知固化室极板已进满信号,开始固化
|
|
|
if (device.getDeviceDriver() instanceof GuhuashiSiteDeviceDriver) { |
|
|
if (device.getDeviceDriver() instanceof GuhuashiSiteDeviceDriver) { |
|
|
GuhuashiSiteDeviceDriver guhuashiSiteDeviceDriver = (GuhuashiSiteDeviceDriver) device.getDeviceDriver(); |
|
|
GuhuashiSiteDeviceDriver guhuashiSiteDeviceDriver = (GuhuashiSiteDeviceDriver) device.getDeviceDriver(); |
|
|
guhuashiSiteDeviceDriver.writing("VW70043",1); |
|
|
guhuashiSiteDeviceDriver.writing("VW70043", 1); |
|
|
} |
|
|
} |
|
|
break; |
|
|
break; |
|
|
case 2: |
|
|
case 2: |
|
|
//LMS通知固化室在下班时未进满信号,开始固化
|
|
|
//LMS通知固化室在下班时未进满信号,开始固化
|
|
|
if (device.getDeviceDriver() instanceof GuhuashiSiteDeviceDriver) { |
|
|
if (device.getDeviceDriver() instanceof GuhuashiSiteDeviceDriver) { |
|
|
GuhuashiSiteDeviceDriver guhuashiSiteDeviceDriver = (GuhuashiSiteDeviceDriver) device.getDeviceDriver(); |
|
|
GuhuashiSiteDeviceDriver guhuashiSiteDeviceDriver = (GuhuashiSiteDeviceDriver) device.getDeviceDriver(); |
|
|
guhuashiSiteDeviceDriver.writing("VW70045",1); |
|
|
guhuashiSiteDeviceDriver.writing("VW70045", 1); |
|
|
} |
|
|
} |
|
|
break; |
|
|
break; |
|
|
case 3: |
|
|
case 3: |
|
|
//LMS通知固化室极板已出完
|
|
|
//LMS通知固化室极板已出完
|
|
|
if (device.getDeviceDriver() instanceof GuhuashiSiteDeviceDriver) { |
|
|
if (device.getDeviceDriver() instanceof GuhuashiSiteDeviceDriver) { |
|
|
GuhuashiSiteDeviceDriver guhuashiSiteDeviceDriver = (GuhuashiSiteDeviceDriver) device.getDeviceDriver(); |
|
|
GuhuashiSiteDeviceDriver guhuashiSiteDeviceDriver = (GuhuashiSiteDeviceDriver) device.getDeviceDriver(); |
|
|
guhuashiSiteDeviceDriver.writing("VW70053",1); |
|
|
guhuashiSiteDeviceDriver.writing("VW70053", 1); |
|
|
} |
|
|
} |
|
|
break; |
|
|
break; |
|
|
default: |
|
|
default: |
|
@ -666,4 +671,31 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { |
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public Object updateRoute(JSONObject param) { |
|
|
|
|
|
Assert.notNull(param.getString("pointCode"), "参数Point不能为空"); |
|
|
|
|
|
String pointCode = param.getString("pointCode"); |
|
|
|
|
|
if (pointCode.contains(",")) { |
|
|
|
|
|
String[] split = pointCode.split(","); |
|
|
|
|
|
Arrays.stream(split).forEach(point -> { |
|
|
|
|
|
deviceExtraService.update(Wrappers.lambdaUpdate(DeviceExtra.class) |
|
|
|
|
|
.eq(DeviceExtra::getDevice_code, point) |
|
|
|
|
|
.eq(DeviceExtra::getExtra_name, "is_enter") |
|
|
|
|
|
.eq(DeviceExtra::getExtra_code, "is_enter") |
|
|
|
|
|
.set("0".equals(param.getString("status")),DeviceExtra::getExtra_value, "false") |
|
|
|
|
|
.set("1".equals(param.getString("status")),DeviceExtra::getExtra_value, "true") |
|
|
|
|
|
); |
|
|
|
|
|
}); |
|
|
|
|
|
} else { |
|
|
|
|
|
deviceExtraService.update(Wrappers.lambdaUpdate(DeviceExtra.class) |
|
|
|
|
|
.eq(DeviceExtra::getDevice_code, pointCode) |
|
|
|
|
|
.eq(DeviceExtra::getExtra_name, "is_enter") |
|
|
|
|
|
.eq(DeviceExtra::getExtra_code, "is_enter") |
|
|
|
|
|
.set("0".equals(param.getString("status")),DeviceExtra::getExtra_value, "false") |
|
|
|
|
|
.set("1".equals(param.getString("status")),DeviceExtra::getExtra_value, "true") |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
return null; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|