Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -6,7 +6,6 @@ import io.swagger.annotations.Api;
|
|||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.nl.acs.ext.wms.log.OthersToInterfaceLog;
|
import org.nl.acs.ext.wms.log.OthersToInterfaceLog;
|
||||||
import org.nl.acs.ext.wms.service.AcsToNDCService;
|
|
||||||
import org.nl.acs.ext.wms.service.NDCToAcsService;
|
import org.nl.acs.ext.wms.service.NDCToAcsService;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
@@ -17,17 +16,17 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@Api(tags = "ndc接口")
|
@Api(tags = "acs套件回传接口")
|
||||||
@RequestMapping("/ndcToAcs")
|
@RequestMapping("/api/kitToAcs")
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class NDCToAcsController {
|
public class KitToAcsController {
|
||||||
|
|
||||||
private final NDCToAcsService ndcToAcsService;
|
private final NDCToAcsService ndcToAcsService;
|
||||||
|
|
||||||
|
|
||||||
@SaIgnore
|
@SaIgnore
|
||||||
@PostMapping("/agv/agvCallbackService/agvCallback")
|
@PostMapping("/agvCallback")
|
||||||
@OthersToInterfaceLog("NDC->ACS")
|
@OthersToInterfaceLog("kit->ACS")
|
||||||
public ResponseEntity<Object> agvCallback(@RequestBody JSONObject requestParam) throws Exception{
|
public ResponseEntity<Object> agvCallback(@RequestBody JSONObject requestParam) throws Exception{
|
||||||
return new ResponseEntity<>(ndcToAcsService.agvCallback(requestParam), HttpStatus.OK);
|
return new ResponseEntity<>(ndcToAcsService.agvCallback(requestParam), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
@@ -5,11 +5,9 @@ package org.nl.acs.ext.wms.rest;
|
|||||||
import cn.dev33.satoken.annotation.SaIgnore;
|
import cn.dev33.satoken.annotation.SaIgnore;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import jdk.nashorn.internal.ir.annotations.Ignore;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.nl.acs.ext.wms.liKuData.*;
|
import org.nl.acs.ext.wms.liKuData.*;
|
||||||
import org.nl.acs.ext.wms.service.AcsToLiKuService;
|
|
||||||
import org.nl.acs.ext.wms.service.LiKuToAcsService;
|
import org.nl.acs.ext.wms.service.LiKuToAcsService;
|
||||||
import org.nl.modules.logging.InterfaceLogType;
|
import org.nl.modules.logging.InterfaceLogType;
|
||||||
import org.nl.modules.logging.annotation.Log;
|
import org.nl.modules.logging.annotation.Log;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package org.nl.acs.ext.wms.service.impl;
|
|||||||
|
|
||||||
import cn.hutool.http.HttpRequest;
|
import cn.hutool.http.HttpRequest;
|
||||||
import cn.hutool.http.HttpResponse;
|
import cn.hutool.http.HttpResponse;
|
||||||
|
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 lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@@ -11,6 +12,7 @@ import org.nl.acs.device.address.service.AddressService;
|
|||||||
import org.nl.acs.device.address.service.dto.AddressDto;
|
import org.nl.acs.device.address.service.dto.AddressDto;
|
||||||
import org.nl.acs.device.service.DeviceService;
|
import org.nl.acs.device.service.DeviceService;
|
||||||
import org.nl.acs.device.service.impl.DeviceServiceImpl;
|
import org.nl.acs.device.service.impl.DeviceServiceImpl;
|
||||||
|
import org.nl.acs.ext.wms.IpUtil;
|
||||||
import org.nl.acs.ext.wms.NdcHttpUtil;
|
import org.nl.acs.ext.wms.NdcHttpUtil;
|
||||||
import org.nl.acs.ext.wms.UnifiedResponse;
|
import org.nl.acs.ext.wms.UnifiedResponse;
|
||||||
import org.nl.acs.ext.wms.service.AcsToNDCService;
|
import org.nl.acs.ext.wms.service.AcsToNDCService;
|
||||||
@@ -74,19 +76,35 @@ public class AcsToNDCServiceImpl implements AcsToNDCService {
|
|||||||
String wmsurl = paramService.findByCode(AcsConfig.WCSURL).getValue();
|
String wmsurl = paramService.findByCode(AcsConfig.WCSURL).getValue();
|
||||||
AddressDto addressDto = addressService.findByCode("applyTaskToWcs");
|
AddressDto addressDto = addressService.findByCode("applyTaskToWcs");
|
||||||
String url = wmsurl + addressDto.getMethods_url();
|
String url = wmsurl + addressDto.getMethods_url();
|
||||||
|
LuceneLogDto logDto =
|
||||||
|
LuceneLogDto.builder()
|
||||||
|
.logType("接口日志")
|
||||||
|
.request_url(wmsurl)
|
||||||
|
.request_direction("post")
|
||||||
|
.request_param(JSON.toJSONString(jo))
|
||||||
|
.method(addressDto.getMethods_url())
|
||||||
|
.content("开始请求")
|
||||||
|
.build();
|
||||||
|
luceneExecuteLogService.interfaceExecuteLog(logDto);
|
||||||
|
long start = System.currentTimeMillis();
|
||||||
HttpResponse result = HttpRequest.post(url)
|
HttpResponse result = HttpRequest.post(url)
|
||||||
//表单内容
|
//表单内容
|
||||||
.body(String.valueOf(jo))
|
.body(String.valueOf(jo))
|
||||||
//超时,毫秒
|
//超时,毫秒
|
||||||
.timeout(20000)
|
.timeout(20000)
|
||||||
.execute();
|
.execute();
|
||||||
LuceneLogDto logDto1 = LuceneLogDto.builder()
|
LuceneLogDto logResult =
|
||||||
.device_code("下发科聪任务")
|
LuceneLogDto.builder()
|
||||||
.content("任务号:" + instruction.getTask_code() + ",指令号:" + instruction.getInstruction_code() + ",下发wcs任务序列反馈参数:" + jo)
|
.logType("接口日志")
|
||||||
.build();
|
.request_url(wmsurl)
|
||||||
logDto1.setLog_level(4);
|
.request_direction("post")
|
||||||
luceneExecuteLogService.deviceExecuteLog(logDto1);
|
.request_param(JSON.toJSONString(jo))
|
||||||
|
.method(addressDto.getMethods_url())
|
||||||
|
.response_param(JSON.toJSONString(result))
|
||||||
|
.executeTime(System.currentTimeMillis() - start)
|
||||||
|
.content("响应请求")
|
||||||
|
.build();
|
||||||
|
luceneExecuteLogService.deviceExecuteLog(logResult);
|
||||||
log.info("任务号:{},指令号{},状态{},下发agv订单序列反馈:{}", instruction.getTask_code(), instruction.getInstruction_code(), result.getStatus(), result.body());
|
log.info("任务号:{},指令号{},状态{},下发agv订单序列反馈:{}", instruction.getTask_code(), instruction.getInstruction_code(), result.getStatus(), result.body());
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ public interface LuceneExecuteLogService {
|
|||||||
*
|
*
|
||||||
* @param luceneLogDto 日志结果对象
|
* @param luceneLogDto 日志结果对象
|
||||||
*/
|
*/
|
||||||
void interfaceExecuteLog(LuceneLogDto luceneLogDto) throws IOException;
|
void interfaceExecuteLog(LuceneLogDto luceneLogDto);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设备执行日志,会保留历史记录
|
* 设备执行日志,会保留历史记录
|
||||||
|
|||||||
@@ -42,12 +42,12 @@ public class LuceneExecuteLogServiceImpl implements LuceneExecuteLogService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void interfaceExecuteLog(LuceneLogDto luceneLogDto) throws IOException {
|
public void interfaceExecuteLog(LuceneLogDto luceneLogDto) {
|
||||||
luceneLogDto.setLogType(LogTypeEnum.INTERFACE_LOG.getDesc());
|
luceneLogDto.setLogType(LogTypeEnum.INTERFACE_LOG.getDesc());
|
||||||
addIndex(luceneLogDto);
|
addIndex(luceneLogDto);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addIndex(LuceneLogDto luceneLogDto) throws IOException {
|
private void addIndex(LuceneLogDto luceneLogDto) {
|
||||||
IndexWriter indexWriter = LuceneIndexWriter.getIndexWriter();
|
IndexWriter indexWriter = LuceneIndexWriter.getIndexWriter();
|
||||||
//创建一个Document对象
|
//创建一个Document对象
|
||||||
Document document = new Document();
|
Document document = new Document();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
server:
|
server:
|
||||||
port: 8010
|
port: 8011
|
||||||
#配置数据源
|
#配置数据源
|
||||||
spring:
|
spring:
|
||||||
datasource:
|
datasource:
|
||||||
|
|||||||
Reference in New Issue
Block a user