opt:增加任务类型
This commit is contained in:
@@ -0,0 +1,32 @@
|
|||||||
|
package org.nl.acs.ext.wms.service;
|
||||||
|
|
||||||
|
import cn.hutool.http.HttpResponse;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
||||||
|
public interface AcsToZDWmsService {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务反馈
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
HttpResponse taskFeedback(JSONObject whereJson);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务取消
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
HttpResponse taskDeprecate(JSONObject whereJson);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备状态上传
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @return Map<String, Object>
|
||||||
|
*/
|
||||||
|
HttpResponse deviceStatusUpdate(JSONObject whereJson);
|
||||||
|
}
|
||||||
@@ -0,0 +1,112 @@
|
|||||||
|
package org.nl.acs.ext.wms.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.http.HttpRequest;
|
||||||
|
import cn.hutool.http.HttpResponse;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nl.acs.device.address.service.AddressService;
|
||||||
|
import org.nl.acs.device.address.service.dto.AddressDto;
|
||||||
|
import org.nl.acs.device.service.DeviceService;
|
||||||
|
import org.nl.acs.ext.wms.service.AcsToMesService;
|
||||||
|
import org.nl.acs.ext.wms.service.AcsToZDWmsService;
|
||||||
|
import org.nl.acs.opc.DeviceAppService;
|
||||||
|
import org.nl.config.server.AcsConfigService;
|
||||||
|
import org.nl.modules.logging.service.LogService;
|
||||||
|
import org.nl.modules.system.service.ParamService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Slf4j
|
||||||
|
public class AcsToZDWmsServiceImpl implements AcsToZDWmsService {
|
||||||
|
|
||||||
|
private final DeviceAppService deviceAppService;
|
||||||
|
@Autowired
|
||||||
|
ParamService paramService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
DeviceService deviceService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
AddressService addressService;
|
||||||
|
@Autowired
|
||||||
|
AcsConfigService acsConfigService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
LogService logServer;
|
||||||
|
|
||||||
|
//@Value("${acsTowms.token}")
|
||||||
|
public String token;
|
||||||
|
private String log_file_type="log_file_type";
|
||||||
|
private String log_type="ACS请求LMS";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResponse taskFeedback(JSONObject whereJson) {
|
||||||
|
//TODO:改成中鼎
|
||||||
|
String wmsUrl = null;
|
||||||
|
AddressDto addressDto = addressService.findByCode("feedAgvTaskStatus");
|
||||||
|
String methods_url = addressDto.getMethods_url();
|
||||||
|
String url = wmsUrl + methods_url;
|
||||||
|
HttpResponse result = null;
|
||||||
|
log.info("feedAgvTaskStatus----请求参数{}", whereJson);
|
||||||
|
try {
|
||||||
|
result = HttpRequest.post(url)
|
||||||
|
.body(String.valueOf(whereJson))
|
||||||
|
.execute();
|
||||||
|
System.out.println(result);
|
||||||
|
log.info("feedAgvTaskStatus----返回参数{}", result);
|
||||||
|
} catch (Exception e) {
|
||||||
|
String msg = e.getMessage();
|
||||||
|
//网络不通
|
||||||
|
log.info("错误原因{}",msg);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResponse taskDeprecate(JSONObject whereJson) {
|
||||||
|
String wmsUrl = "10.10.188.151:8098";
|
||||||
|
AddressDto addressDto = addressService.findByCode("acsCancelBack");
|
||||||
|
String methods_url = addressDto.getMethods_url();
|
||||||
|
String url = wmsUrl + methods_url;
|
||||||
|
HttpResponse result = null;
|
||||||
|
log.info("deprecateWmsTask----请求参数{}", whereJson);
|
||||||
|
try {
|
||||||
|
result = HttpRequest.post(url)
|
||||||
|
.body(String.valueOf(whereJson))
|
||||||
|
.execute();
|
||||||
|
System.out.println(result);
|
||||||
|
log.info("deprecateWmsTask----返回参数{}", result);
|
||||||
|
} catch (Exception e) {
|
||||||
|
String msg = e.getMessage();
|
||||||
|
//网络不通
|
||||||
|
//System.out.println(msg);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResponse deviceStatusUpdate(JSONObject whereJson) {
|
||||||
|
String wmsUrl = "10.10.188.151:8098";
|
||||||
|
AddressDto addressDto = addressService.findByCode("deviceStatusUpdate");
|
||||||
|
String methods_url = addressDto.getMethods_url();
|
||||||
|
String url = wmsUrl + methods_url;
|
||||||
|
HttpResponse result = null;
|
||||||
|
log.info("deviceStatusUpdate", whereJson);
|
||||||
|
try {
|
||||||
|
result = HttpRequest.post(url)
|
||||||
|
.body(String.valueOf(whereJson))
|
||||||
|
.execute();
|
||||||
|
System.out.println(result);
|
||||||
|
log.info("deviceStatusUpdate----返回参数{}", result);
|
||||||
|
} catch (Exception e) {
|
||||||
|
String msg = e.getMessage();
|
||||||
|
//网络不通
|
||||||
|
//System.out.println(msg);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user