fix
This commit is contained in:
@@ -189,6 +189,8 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
//(不需要WCS反馈)
|
//(不需要WCS反馈)
|
||||||
if (phase == 0x67) {
|
if (phase == 0x67) {
|
||||||
device = deviceAppService.findDeviceByCode(Integer.toString(arr[27]));
|
device = deviceAppService.findDeviceByCode(Integer.toString(arr[27]));
|
||||||
|
} else if (phase == 0x50 || phase == 0x51){
|
||||||
|
device = deviceAppService.findDeviceByCode(Integer.toString(arr[19]));
|
||||||
} else {
|
} else {
|
||||||
device = deviceAppService.findDeviceByCode(Integer.toString(arr[20]));
|
device = deviceAppService.findDeviceByCode(Integer.toString(arr[20]));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
add(form);
|
add(form);
|
||||||
}});
|
}});
|
||||||
|
|
||||||
if (HttpStatus.HTTP_OK == result.getIntValue("status")) {
|
if (20000 == result.getIntValue("code")) {
|
||||||
wcsFlag = true;
|
wcsFlag = true;
|
||||||
} else {
|
} else {
|
||||||
String resultMessage = result.getString("message");
|
String resultMessage = result.getString("message");
|
||||||
@@ -209,7 +209,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
add(form);
|
add(form);
|
||||||
}});
|
}});
|
||||||
|
|
||||||
if (HttpStatus.HTTP_OK == result.getIntValue("status")) {
|
if (20000 == result.getIntValue("code")) {
|
||||||
wmsFlag = true;
|
wmsFlag = true;
|
||||||
} else {
|
} else {
|
||||||
String resultMessage = result.getString("message");
|
String resultMessage = result.getString("message");
|
||||||
@@ -245,7 +245,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
add(form);
|
add(form);
|
||||||
}});
|
}});
|
||||||
|
|
||||||
if (HttpStatus.HTTP_OK == result.getIntValue("status")) {
|
if (20000 == result.getIntValue("code")) {
|
||||||
flag = true;
|
flag = true;
|
||||||
} else {
|
} else {
|
||||||
String resultMessage = result.getString("message");
|
String resultMessage = result.getString("message");
|
||||||
@@ -293,7 +293,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
JSONObject result = acsToWmsService.feedAgvTaskStatus(new JSONArray() {{
|
JSONObject result = acsToWmsService.feedAgvTaskStatus(new JSONArray() {{
|
||||||
add(form);
|
add(form);
|
||||||
}});
|
}});
|
||||||
if (HttpStatus.HTTP_OK == result.getIntValue("status")) {
|
if (20000 == result.getIntValue("code")) {
|
||||||
flag = true;
|
flag = true;
|
||||||
} else {
|
} else {
|
||||||
String resultMessage = result.getString("message");
|
String resultMessage = result.getString("message");
|
||||||
@@ -381,7 +381,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
add(form);
|
add(form);
|
||||||
}});
|
}});
|
||||||
|
|
||||||
if (HttpStatus.HTTP_OK == result.getIntValue("status")) {
|
if (20000 == result.getIntValue("code")) {
|
||||||
wcsFlag = true;
|
wcsFlag = true;
|
||||||
} else {
|
} else {
|
||||||
String resultMessage = result.getString("message");
|
String resultMessage = result.getString("message");
|
||||||
@@ -406,7 +406,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
add(form);
|
add(form);
|
||||||
}});
|
}});
|
||||||
|
|
||||||
if (HttpStatus.HTTP_OK == result.getIntValue("status")) {
|
if (20000 == result.getIntValue("code")) {
|
||||||
wmsFlag = true;
|
wmsFlag = true;
|
||||||
} else {
|
} else {
|
||||||
String resultMessage = result.getString("message");
|
String resultMessage = result.getString("message");
|
||||||
@@ -442,7 +442,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
add(form);
|
add(form);
|
||||||
}});
|
}});
|
||||||
|
|
||||||
if (HttpStatus.HTTP_OK == result.getIntValue("status")) {
|
if (20000 == result.getIntValue("code")) {
|
||||||
flag = true;
|
flag = true;
|
||||||
} else {
|
} else {
|
||||||
String resultMessage = result.getString("message");
|
String resultMessage = result.getString("message");
|
||||||
@@ -490,7 +490,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
JSONObject result = acsToWmsService.feedAgvTaskStatus(new JSONArray() {{
|
JSONObject result = acsToWmsService.feedAgvTaskStatus(new JSONArray() {{
|
||||||
add(form);
|
add(form);
|
||||||
}});
|
}});
|
||||||
if (HttpStatus.HTTP_OK == result.getIntValue("status")) {
|
if (20000 == result.getIntValue("code")) {
|
||||||
flag = true;
|
flag = true;
|
||||||
} else {
|
} else {
|
||||||
String resultMessage = result.getString("message");
|
String resultMessage = result.getString("message");
|
||||||
@@ -575,7 +575,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
add(form);
|
add(form);
|
||||||
}});
|
}});
|
||||||
|
|
||||||
if (HttpStatus.HTTP_OK == result.getIntValue("status")) {
|
if (20000 == result.getIntValue("code")) {
|
||||||
wcsFlag = true;
|
wcsFlag = true;
|
||||||
} else {
|
} else {
|
||||||
String resultMessage = result.getString("message");
|
String resultMessage = result.getString("message");
|
||||||
@@ -600,7 +600,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
add(form);
|
add(form);
|
||||||
}});
|
}});
|
||||||
|
|
||||||
if (HttpStatus.HTTP_OK == result.getIntValue("status")) {
|
if (20000 == result.getIntValue("code")) {
|
||||||
wmsFlag = true;
|
wmsFlag = true;
|
||||||
} else {
|
} else {
|
||||||
String resultMessage = result.getString("message");
|
String resultMessage = result.getString("message");
|
||||||
@@ -636,7 +636,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
add(form);
|
add(form);
|
||||||
}});
|
}});
|
||||||
|
|
||||||
if (HttpStatus.HTTP_OK == result.getIntValue("status")) {
|
if (20000 == result.getIntValue("code")) {
|
||||||
flag = true;
|
flag = true;
|
||||||
} else {
|
} else {
|
||||||
String resultMessage = result.getString("message");
|
String resultMessage = result.getString("message");
|
||||||
@@ -682,7 +682,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
JSONObject result = acsToWmsService.feedAgvTaskStatus(new JSONArray() {{
|
JSONObject result = acsToWmsService.feedAgvTaskStatus(new JSONArray() {{
|
||||||
add(form);
|
add(form);
|
||||||
}});
|
}});
|
||||||
if (HttpStatus.HTTP_OK == result.getIntValue("status")) {
|
if (20000 == result.getIntValue("code")) {
|
||||||
flag = true;
|
flag = true;
|
||||||
} else {
|
} else {
|
||||||
String resultMessage = result.getString("message");
|
String resultMessage = result.getString("message");
|
||||||
@@ -761,7 +761,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
add(form);
|
add(form);
|
||||||
}});
|
}});
|
||||||
|
|
||||||
if (HttpStatus.HTTP_OK == result.getIntValue("status")) {
|
if (20000 == result.getIntValue("code")) {
|
||||||
wcsFlag = true;
|
wcsFlag = true;
|
||||||
} else {
|
} else {
|
||||||
String resultMessage = result.getString("message");
|
String resultMessage = result.getString("message");
|
||||||
@@ -786,7 +786,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
add(form);
|
add(form);
|
||||||
}});
|
}});
|
||||||
|
|
||||||
if (HttpStatus.HTTP_OK == result.getIntValue("status")) {
|
if (20000 == result.getIntValue("code")) {
|
||||||
wmsFlag = true;
|
wmsFlag = true;
|
||||||
} else {
|
} else {
|
||||||
String resultMessage = result.getString("message");
|
String resultMessage = result.getString("message");
|
||||||
@@ -822,7 +822,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
add(form);
|
add(form);
|
||||||
}});
|
}});
|
||||||
|
|
||||||
if (HttpStatus.HTTP_OK == result.getIntValue("status")) {
|
if (20000 == result.getIntValue("code")) {
|
||||||
flag = true;
|
flag = true;
|
||||||
} else {
|
} else {
|
||||||
String resultMessage = result.getString("message");
|
String resultMessage = result.getString("message");
|
||||||
@@ -870,7 +870,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
JSONObject result = acsToWmsService.feedAgvTaskStatus(new JSONArray() {{
|
JSONObject result = acsToWmsService.feedAgvTaskStatus(new JSONArray() {{
|
||||||
add(form);
|
add(form);
|
||||||
}});
|
}});
|
||||||
if (HttpStatus.HTTP_OK == result.getIntValue("status")) {
|
if (20000 == result.getIntValue("code")) {
|
||||||
flag = true;
|
flag = true;
|
||||||
} else {
|
} else {
|
||||||
String resultMessage = result.getString("message");
|
String resultMessage = result.getString("message");
|
||||||
@@ -952,16 +952,16 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
|
|
||||||
if (driver.getMode() != 0) {
|
if (driver.getMode() != 0) {
|
||||||
if ("1".equals(paramService.findByCode(AcsConfig.HASWMS).getValue())
|
if ("1".equals(paramService.findByCode(AcsConfig.HASWMS).getValue())
|
||||||
&& "true".equals(device.getExtraValue().get("reqWms"))) {
|
) {
|
||||||
JSONObject form = new JSONObject();
|
JSONObject form = new JSONObject();
|
||||||
form.put("vehicle_code", inst.getVehicle_code());
|
form.put("vehicle_code", "");
|
||||||
form.put("status", 5);
|
form.put("status", 5);
|
||||||
form.put("device_code", device_code);
|
form.put("device_code", device_code);
|
||||||
form.put("task_code", inst.getTask_code());
|
form.put("task_code", "");
|
||||||
JSONObject result = acsToWmsService.feedAgvTaskStatus(new JSONArray() {{
|
JSONObject result = acsToWmsService.feedAgvTaskStatus(new JSONArray() {{
|
||||||
add(form);
|
add(form);
|
||||||
}});
|
}});
|
||||||
if (HttpStatus.HTTP_OK == result.getIntValue("status")) {
|
if (20000 == result.getIntValue("code")) {
|
||||||
flag = true;
|
flag = true;
|
||||||
} else {
|
} else {
|
||||||
String resultMessage = result.getString("message");
|
String resultMessage = result.getString("message");
|
||||||
@@ -1026,16 +1026,16 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
|
|
||||||
if (driver.getMode() != 0) {
|
if (driver.getMode() != 0) {
|
||||||
if ("1".equals(paramService.findByCode(AcsConfig.HASWMS).getValue())
|
if ("1".equals(paramService.findByCode(AcsConfig.HASWMS).getValue())
|
||||||
&& "true".equals(device.getExtraValue().get("reqWms"))) {
|
) {
|
||||||
JSONObject form = new JSONObject();
|
JSONObject form = new JSONObject();
|
||||||
form.put("vehicle_code", inst.getVehicle_code());
|
form.put("vehicle_code", "");
|
||||||
form.put("status", 6);
|
form.put("status", 6);
|
||||||
form.put("device_code", device_code);
|
form.put("device_code", device_code);
|
||||||
form.put("task_code", inst.getTask_code());
|
form.put("task_code", "");
|
||||||
JSONObject result = acsToWmsService.feedAgvTaskStatus(new JSONArray() {{
|
JSONObject result = acsToWmsService.feedAgvTaskStatus(new JSONArray() {{
|
||||||
add(form);
|
add(form);
|
||||||
}});
|
}});
|
||||||
if (HttpStatus.HTTP_OK == result.getIntValue("status")) {
|
if (20000 == result.getIntValue("code")) {
|
||||||
flag = true;
|
flag = true;
|
||||||
} else {
|
} else {
|
||||||
String resultMessage = result.getString("message");
|
String resultMessage = result.getString("message");
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ public class EmptyVehicleStackingPositionDeviceDriver extends AbstractOpcDeviceD
|
|||||||
int last_mode = 0;
|
int last_mode = 0;
|
||||||
int last_move = 0;
|
int last_move = 0;
|
||||||
int last_error = 0;
|
int last_error = 0;
|
||||||
|
int last_number = 0;
|
||||||
|
|
||||||
String device_code;
|
String device_code;
|
||||||
|
|
||||||
@@ -116,6 +117,19 @@ public class EmptyVehicleStackingPositionDeviceDriver extends AbstractOpcDeviceD
|
|||||||
}
|
}
|
||||||
if (error != last_error) {
|
if (error != last_error) {
|
||||||
}
|
}
|
||||||
|
if(number != last_number){
|
||||||
|
String hasGoods;
|
||||||
|
if(number<8){
|
||||||
|
hasGoods="0";
|
||||||
|
}else{
|
||||||
|
hasGoods="1";
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
acsToWmsService.feedbackAgvDeviceStatus(device_code, hasGoods);
|
||||||
|
}catch (Exception e){
|
||||||
|
log.error("反馈碟盘机是否有货失败{}{}",e,e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!this.itemProtocol.getIsonline()) {
|
if (!this.itemProtocol.getIsonline()) {
|
||||||
|
|||||||
@@ -122,5 +122,13 @@ public interface AcsToWmsService {
|
|||||||
*/
|
*/
|
||||||
JSONObject feedWcsAgvTaskStatus(JSONArray from);
|
JSONObject feedWcsAgvTaskStatus(JSONArray from);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 反馈AGV设备状态
|
||||||
|
*
|
||||||
|
* @param device_code
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
HttpResponse feedbackAgvDeviceStatus(String device_code, String hasGoods);
|
||||||
|
|
||||||
JSONObject test(JSONObject form);
|
JSONObject test(JSONObject form);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
result = HttpRequest
|
result = HttpRequest
|
||||||
.post(url)
|
.post(url)
|
||||||
.header("Content-Type", "application/json;charset=UTF-8")
|
.header("Content-Type", "application/json;charset=UTF-8")
|
||||||
.header("Authorization", String.valueOf(redisUtils.get("wms_token")))
|
.basicAuth("INFOR","Aa123456@@!!")
|
||||||
.body(JSON.toJSONString(data))
|
.body(JSON.toJSONString(data))
|
||||||
.timeout(3000)
|
.timeout(3000)
|
||||||
.execute();
|
.execute();
|
||||||
@@ -567,6 +567,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
HttpResponse response = HttpRequest
|
HttpResponse response = HttpRequest
|
||||||
.post(url)
|
.post(url)
|
||||||
.body(from.toString())
|
.body(from.toString())
|
||||||
|
.basicAuth("INFOR","Aa123456@@!!")
|
||||||
.execute();
|
.execute();
|
||||||
log.info("feedAgvTaskStatus - 返回参数 {}", response.body());
|
log.info("feedAgvTaskStatus - 返回参数 {}", response.body());
|
||||||
return JSONObject.parseObject(response.body());
|
return JSONObject.parseObject(response.body());
|
||||||
@@ -619,6 +620,36 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResponse feedbackAgvDeviceStatus(String device_code, String hasGoods) {
|
||||||
|
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
||||||
|
|
||||||
|
JSONObject json = new JSONObject();
|
||||||
|
json.put("device_code", device_code);
|
||||||
|
json.put("is_have", hasGoods);
|
||||||
|
|
||||||
|
AddressDto addressDto = addressService.findByCode("feedbackAgvDeviceStatus");
|
||||||
|
String methods_url = addressDto.getMethods_url();
|
||||||
|
String url = wmsUrl + methods_url;
|
||||||
|
HttpResponse result = null;
|
||||||
|
log.info("feedbackAgvDeviceStatus----请求参数{}", json);
|
||||||
|
|
||||||
|
try {
|
||||||
|
result = HttpRequest.post(url)
|
||||||
|
.body(String.valueOf(json))
|
||||||
|
.basicAuth("INFOR","Aa123456@@!!")
|
||||||
|
.execute();
|
||||||
|
System.out.println(result);
|
||||||
|
log.info("feedbackAgvDeviceStatus----返回参数{}", result);
|
||||||
|
} catch (Exception e) {
|
||||||
|
String msg = e.getMessage();
|
||||||
|
//网络不通
|
||||||
|
//System.out.println(msg);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JSONObject test(JSONObject form) {
|
public JSONObject test(JSONObject form) {
|
||||||
this.getTokenFromWms();
|
this.getTokenFromWms();
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package org.nl.acs.opc;
|
package org.nl.acs.opc;
|
||||||
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ public class TaskFeedbackServiceImpl implements TaskFeedbackService {
|
|||||||
TaskFeedbackDto dto = this.findById(id);
|
TaskFeedbackDto dto = this.findById(id);
|
||||||
TaskDto entity = taskService.findById(dto.getTask_id());
|
TaskDto entity = taskService.findById(dto.getTask_id());
|
||||||
JSONObject feed_jo = new JSONObject();
|
JSONObject feed_jo = new JSONObject();
|
||||||
feed_jo.put("task_id", entity.getTask_id());
|
// feed_jo.put("task_id", entity.getTask_id());
|
||||||
feed_jo.put("task_code", entity.getTask_code());
|
feed_jo.put("task_code", entity.getTask_code());
|
||||||
feed_jo.put("task_status", entity.getTask_status());
|
feed_jo.put("task_status", entity.getTask_status());
|
||||||
JSONArray ja = new JSONArray();
|
JSONArray ja = new JSONArray();
|
||||||
|
|||||||
@@ -817,7 +817,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
|||||||
TaskFeedbackDto feefbackdto = taskFeedbackService.findByCode(entity.getTask_code());
|
TaskFeedbackDto feefbackdto = taskFeedbackService.findByCode(entity.getTask_code());
|
||||||
System.out.println(feefbackdto == null);
|
System.out.println(feefbackdto == null);
|
||||||
JSONObject feed_jo = new JSONObject();
|
JSONObject feed_jo = new JSONObject();
|
||||||
feed_jo.put("task_id", entity.getTask_id());
|
// feed_jo.put("task_id", entity.getTask_id());
|
||||||
feed_jo.put("task_code", entity.getTask_code());
|
feed_jo.put("task_code", entity.getTask_code());
|
||||||
feed_jo.put("task_status", entity.getTask_status());
|
feed_jo.put("task_status", entity.getTask_status());
|
||||||
JSONArray ja = new JSONArray();
|
JSONArray ja = new JSONArray();
|
||||||
@@ -951,7 +951,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
|||||||
String hasWms = paramService.findByCode(AcsConfig.HASWMS).getValue();
|
String hasWms = paramService.findByCode(AcsConfig.HASWMS).getValue();
|
||||||
if (!StrUtil.startWith(entity.getTask_code(), "-") && StrUtil.equals(hasWms, "1")) {
|
if (!StrUtil.startWith(entity.getTask_code(), "-") && StrUtil.equals(hasWms, "1")) {
|
||||||
JSONObject feed_jo = new JSONObject();
|
JSONObject feed_jo = new JSONObject();
|
||||||
feed_jo.put("task_id", entity.getTask_id());
|
// feed_jo.put("task_id", entity.getTask_id());
|
||||||
feed_jo.put("task_code", entity.getTask_code());
|
feed_jo.put("task_code", entity.getTask_code());
|
||||||
feed_jo.put("task_status", entity.getTask_status());
|
feed_jo.put("task_status", entity.getTask_status());
|
||||||
JSONArray ja = new JSONArray();
|
JSONArray ja = new JSONArray();
|
||||||
|
|||||||
@@ -100,6 +100,11 @@
|
|||||||
<el-switch v-model="form.manual_create_task" />
|
<el-switch v-model="form.manual_create_task" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="是否请求wms" label-width="150px">
|
||||||
|
<el-switch v-model="form.reqWms" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-row>
|
<el-row>
|
||||||
|
|||||||
@@ -93,6 +93,11 @@
|
|||||||
<el-switch v-model="form.manual_create_task" />
|
<el-switch v-model="form.manual_create_task" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="是否请求wms" label-width="150px">
|
||||||
|
<el-switch v-model="form.reqWms" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-row>
|
<el-row>
|
||||||
|
|||||||
Reference in New Issue
Block a user