现场调试修改
This commit is contained in:
@@ -100,7 +100,7 @@ public class AgvController extends BaseController {
|
||||
//取消rcs中指定的agv任务
|
||||
CancelTaskResponse cancelTaskResponse = apiService.cancelTask(cancelTaskRequest);
|
||||
|
||||
if(cancelTaskResponse.getCode() == 0 && "成功".equals(cancelTaskResponse.getMessage()) && cancelTaskResponse.getReqCode() == cancelTaskRequest.getReqCode()){
|
||||
if(cancelTaskResponse.getCode() == 0 && "成功".equals(cancelTaskResponse.getMsg()) && cancelTaskResponse.getReqCode() == cancelTaskRequest.getReqCode()){
|
||||
return AjaxResult.success("AGV任务队列取消成功!", cancelTaskResponse);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.ruoyi.api.controller;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.ruoyi.api.domain.RequestLog;
|
||||
import com.ruoyi.api.domain.wcs2wms.JobParam;
|
||||
import com.ruoyi.api.domain.wcs2wms.ReceiveJob;
|
||||
import com.ruoyi.api.domain.wcs2wms.stockout.StockoutReceive;
|
||||
import com.ruoyi.api.service.IApiService;
|
||||
import com.ruoyi.api.service.IRequestLogService;
|
||||
import com.ruoyi.bas.port.domain.WcsPort;
|
||||
import com.ruoyi.bas.port.service.IWcsPortService;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
@@ -20,6 +23,8 @@ public class Wcs2WmsController {
|
||||
private IApiService apiService;
|
||||
@Autowired
|
||||
private IWcsPortService wcsPortService;
|
||||
@Autowired
|
||||
IRequestLogService requestLogService;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ public class ResponseBase {
|
||||
/**
|
||||
* 返回消息
|
||||
*/
|
||||
private String message;
|
||||
private String msg;
|
||||
/**
|
||||
* 自定义返回
|
||||
*/
|
||||
|
||||
@@ -3,12 +3,18 @@ package com.ruoyi.api.domain.wcs2wms;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import reactor.util.annotation.Nullable;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ReceiveJob {
|
||||
|
||||
/**
|
||||
* 请求码
|
||||
*/
|
||||
private String reqCode;
|
||||
|
||||
/**
|
||||
* 作业号
|
||||
*/
|
||||
@@ -25,16 +31,19 @@ public class ReceiveJob {
|
||||
private String cargoSpaceId;
|
||||
|
||||
/** 货位(移库使用) */
|
||||
@Nullable
|
||||
private String targetCargoSpaceId;
|
||||
|
||||
/**
|
||||
* 入口
|
||||
*/
|
||||
@Nullable
|
||||
private String entranceId;
|
||||
|
||||
/**
|
||||
* 出口
|
||||
*/
|
||||
@Nullable
|
||||
private String exitId;
|
||||
|
||||
/**
|
||||
@@ -50,6 +59,7 @@ public class ReceiveJob {
|
||||
/**
|
||||
* 巷道号
|
||||
*/
|
||||
@Nullable
|
||||
private String roadwayId;
|
||||
|
||||
|
||||
|
||||
@@ -7,12 +7,6 @@ import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 入库请求返回
|
||||
*
|
||||
* 【常见错误】
|
||||
* 任务类型不可为空 未传 taskTypeCode
|
||||
* 该任务类型未配置 taskTypeCode 在系统中不存在
|
||||
* 该任务类型无点位配置信息 任务类型缺少点位模板
|
||||
* 该任务类型未开启 任务类型状态为禁用
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@@ -44,5 +38,10 @@ public class StockinReceive {
|
||||
*/
|
||||
private String cargoSpaceId;
|
||||
|
||||
/**
|
||||
* 任务类型
|
||||
*/
|
||||
private String inOrOut;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -76,16 +76,16 @@ public interface IApiService
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 入库请求生成作业
|
||||
*/
|
||||
AjaxResult createInMydoJob(Map<String, Object> param);
|
||||
|
||||
/**
|
||||
* @@@ FT568 入库请求生成作业 处理了请求响应,适应wms的自定义响应格式
|
||||
*/
|
||||
AjaxResult createMydoJobForStockin(Map<String, Object> param);
|
||||
|
||||
/**
|
||||
* 入库请求wms参数 - 作业号、货位
|
||||
*/
|
||||
// AjaxResult requestMydoJobParamForWms(Map<String, Object> param);
|
||||
|
||||
/**
|
||||
* 入库请求作业异常反馈(扫码失败、外形、称重等异常)
|
||||
*/
|
||||
@@ -93,12 +93,32 @@ public interface IApiService
|
||||
|
||||
AjaxResult selectMydoJobByNoTrayCode(Map<String, Object> param);
|
||||
|
||||
/**
|
||||
* 接受出库作业
|
||||
* @param receiveJob
|
||||
* @return
|
||||
*/
|
||||
AjaxResult receiveOutMydoJob(ReceiveJob receiveJob);
|
||||
|
||||
/**
|
||||
* 接受入库作业
|
||||
* @param receiveJob
|
||||
* @return
|
||||
*/
|
||||
AjaxResult receiveInMydoJob(ReceiveJob receiveJob);
|
||||
|
||||
/**
|
||||
* 接受移库作业
|
||||
* @param receiveJob
|
||||
* @return
|
||||
*/
|
||||
AjaxResult receiveMoveMydoJob(ReceiveJob receiveJob);
|
||||
|
||||
/**
|
||||
* 接收盘点作业
|
||||
* @param receiveInventoryJob
|
||||
* @return
|
||||
*/
|
||||
AjaxResult receiveInventoryMydoJob(ReceiveJob receiveInventoryJob);
|
||||
|
||||
AjaxResult selectMydoJobByTrayCodeAndEntranceId(HashMap<String, Object> paramMap);
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.ruoyi.api.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.api.domain.RequestLog;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
|
||||
/**
|
||||
* 接口记录Service接口
|
||||
@@ -83,6 +84,16 @@ public interface IRequestLogService
|
||||
public RequestLog getRequestLog(String param, String endPoint);
|
||||
|
||||
|
||||
/**
|
||||
* 接收接口记录
|
||||
*
|
||||
* @param param
|
||||
* @param remark
|
||||
* @return
|
||||
*/
|
||||
public RequestLog getRequestLog(String param, String remark, AjaxResult ajaxResult);
|
||||
|
||||
|
||||
RequestLog getRequestLog2(String url, String param, String endPoint);
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,6 +4,8 @@ import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.ruoyi.api.domain.InterfaceReceive;
|
||||
@@ -18,7 +20,6 @@ import com.ruoyi.api.domain.agv.genAgvSchedulingTask.GenAgvSchedulingTaskRespons
|
||||
import com.ruoyi.api.domain.agv.genAgvSchedulingTask.PositionCodeData;
|
||||
import com.ruoyi.api.domain.wcs2wms.JobParam;
|
||||
import com.ruoyi.api.domain.wcs2wms.ReceiveJob;
|
||||
import com.ruoyi.api.domain.wcs2wms.ResponseResult;
|
||||
import com.ruoyi.api.service.IApiService;
|
||||
import com.ruoyi.bas.cargospace.domain.BasCargoSpace;
|
||||
import com.ruoyi.bas.cargospace.service.IBasCargoSpaceService;
|
||||
@@ -42,7 +43,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.ruoyi.common.Constant.*;
|
||||
import static com.ruoyi.common.ConvType.ROADWAY1_EXIT;
|
||||
import static com.ruoyi.common.ConvType.*;
|
||||
import static com.ruoyi.common.TaskStatusCode.TASK_EP_CREATED;
|
||||
import static com.ruoyi.common.TaskStatusCode.TASK_STATUS_CREATED;
|
||||
|
||||
@@ -115,24 +116,9 @@ public class ApiServiceImpl implements IApiService {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 请求wms获取入库任务参数
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult createInMydoJob(Map<String, Object> param) {
|
||||
RequestLog requestLog = requestLogService.getRequestLog(WMS_STOCKIN_MYDOJOB, "入库请求生成作业", JSONUtil.toJsonStr(param));
|
||||
if ("1".equals(requestLog.getIsSuccessful())) {
|
||||
InterfaceReceive bean = JSONUtil.toBean(requestLog.getResponseBody(), InterfaceReceive.class);
|
||||
return AjaxResult.success(bean.getData());
|
||||
} else {
|
||||
return AjaxResult.error();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @@@ FT568 请求wms获取入库任务参数 - 适应wms的自定义请求响应格式
|
||||
* 请求wms获取入库任务参数
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@@ -140,13 +126,15 @@ public class ApiServiceImpl implements IApiService {
|
||||
public AjaxResult createMydoJobForStockin(Map<String, Object> param) {
|
||||
RequestLog requestLog = requestLogService.getRequestLog(WMS_STOCKIN_MYDOJOB, "入库请求生成作业", JSONUtil.toJsonStr(param));
|
||||
if ("1".equals(requestLog.getIsSuccessful())) {
|
||||
ResponseResult bean = JSONUtil.toBean(requestLog.getResponseBody(), ResponseResult.class);
|
||||
return AjaxResult.success(bean.getResult());
|
||||
// ResponseResult bean = JSONUtil.toBean(requestLog.getResponseBody(), ResponseResult.class);
|
||||
// return AjaxResult.success(bean.getResult());
|
||||
return AjaxResult.success(requestLog.getResponseBody());
|
||||
} else {
|
||||
return AjaxResult.error();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @@@ FT568 入库请求作业异常反馈(扫码失败、外形、称重等异常)
|
||||
* @param param
|
||||
@@ -176,49 +164,39 @@ public class ApiServiceImpl implements IApiService {
|
||||
|
||||
// -------------------------检查推送的任务参数-------------------------
|
||||
log.info(
|
||||
"【wms推送出库】作业号:{},wms任务号:{},推送出库货位:{},推送类型:出库【{}】",stockoutReceive.getJobId(), stockoutReceive.getTaskNo(), stockoutReceive.getCargoSpaceId(), stockoutReceive.getInOrOut()
|
||||
"【wms推送出库】作业号:{},推送出库货位:{},推送类型:出库【{}】",stockoutReceive.getJobId(), stockoutReceive.getCargoSpaceId(), stockoutReceive.getInOrOut()
|
||||
);
|
||||
|
||||
BasCargoSpace cargoSpace = basCargoSpaceService.selectBasCargoSpaceByCargoSpaceId(stockoutReceive.getCargoSpaceId());
|
||||
|
||||
// 0.检查货位参数是否合法
|
||||
if(stockoutReceive.getCargoSpaceId() == null || stockoutReceive.getCargoSpaceId() == ""){
|
||||
if(StrUtil.isBlank(stockoutReceive.getCargoSpaceId())){
|
||||
log.info("【请求错误】wms推送出库任务失败,参数错误,推送作业号:{},推送出库货位:{}", stockoutReceive.getJobId(), stockoutReceive.getCargoSpaceId());
|
||||
return AjaxResult.error("【请求错误】wms推送出库任务失败,参数错误,推送作业号:{}" + stockoutReceive.getJobId() + ",推送出库货位:" + stockoutReceive.getCargoSpaceId());
|
||||
}else{
|
||||
//排号检查
|
||||
if (cargoSpace.getThePlatoon() > 2 || cargoSpace.getThePlatoon() < 0){
|
||||
log.info("【请求错误】wms推送出库任务失败,参数错误,推送作业号:{},推送排:{}", stockoutReceive.getJobId(), cargoSpace.getThePlatoon());
|
||||
return AjaxResult.error("【请求错误】wms推送出库任务失败,错误,推送任务号:" + stockoutReceive.getJobId() + ",推送出库排号:" + cargoSpace.getThePlatoon() + ",仓库中不存在该位置!");
|
||||
}
|
||||
|
||||
//列号检查
|
||||
if (cargoSpace.getTheColumn() > 33 || cargoSpace.getTheColumn() < 0){
|
||||
log.info("【请求错误】wms推送出库任务失败,参数错误,推送作业号:{},推送列:{}", stockoutReceive.getJobId(), cargoSpace.getTheColumn());
|
||||
return AjaxResult.error("【请求错误】wms推送出库任务失败,错误,推送任务号:" + stockoutReceive.getJobId() + ",推送出库列号:" + cargoSpace.getTheColumn() + ",仓库中不存在该位置!");
|
||||
}
|
||||
|
||||
//层号检查
|
||||
if (cargoSpace.getTheFloor() > 6 || cargoSpace.getTheFloor() < 0){
|
||||
log.info("【请求错误】wms推送出库任务失败,参数错误,推送作业号:{},推送层:{}", stockoutReceive.getJobId(), cargoSpace.getThePlatoon());
|
||||
return AjaxResult.error("【请求错误】wms推送出库任务失败,错误,推送任务号:" + stockoutReceive.getJobId() + ",推送出库层号:" + cargoSpace.getThePlatoon() + ",仓库中不存在该位置!");
|
||||
}
|
||||
return AjaxResult.error("【请求错误】wms推送出库任务失败,参数错误,推送作业号:" + stockoutReceive.getJobId() + ",推送出库货位:" + stockoutReceive.getCargoSpaceId());
|
||||
}
|
||||
|
||||
// 1.wms推送的作业号是否重复
|
||||
MydoJob job = new MydoJob().builder().jobId(stockoutReceive.getJobId()).build();
|
||||
List<MydoJob> tasks = mydoJobService.selectMydoJobList(job);
|
||||
if (tasks.size() != 0) {
|
||||
log.info("【请求错误】wms下发出库任务失败,该任务已存在,推送作业号号:{},推送出库货位:{}", stockoutReceive.getJobId(), stockoutReceive.getCargoSpaceId());
|
||||
return AjaxResult.error("【请求错误】wms下发出库任务失败,该任务已存在,推送作业号:{}" + stockoutReceive.getJobId() + ",推送出库货位:" + stockoutReceive.getCargoSpaceId());
|
||||
log.info("【提示】wms下发出库任务失败,该任务已存在,wms作业号:{}", stockoutReceive.getJobId());
|
||||
return AjaxResult.error("【提示】wms下发出库任务失败,该任务已存在,wms作业号:{}" + stockoutReceive.getJobId());
|
||||
}
|
||||
|
||||
// 2.wms推送的出库货位是否已经有任务
|
||||
job = new MydoJob().builder().cargoSpaceId(stockoutReceive.getCargoSpaceId()).build();
|
||||
tasks = mydoJobService.selectMydoJobList(job);
|
||||
if (tasks.size() != 0) {
|
||||
log.info("【请求错误】wms下发出库任务失败,已经存在该货位的出库任务,推送任务号:{},推送出库货位:{}", stockoutReceive.getJobId(), stockoutReceive.getCargoSpaceId());
|
||||
return AjaxResult.error("【请求错误】wms下发出库任务失败,已经存在该货位的出库任务,推送任务号:{}" + stockoutReceive.getJobId() + ",推送出库货位:" + stockoutReceive.getCargoSpaceId());
|
||||
log.info("【提示】wms下发出库任务失败,已经存在该货位的出库任务,wms作业号:{},推送出库货位:{}", stockoutReceive.getJobId(), stockoutReceive.getCargoSpaceId());
|
||||
return AjaxResult.error("【提示】wms下发出库任务失败,已经存在该货位的出库任务,wms作业号:{}" + stockoutReceive.getJobId() + ",推送出库货位:" + stockoutReceive.getCargoSpaceId());
|
||||
}
|
||||
|
||||
// 3.wms推送的出托盘号是否已经有任务
|
||||
job = new MydoJob().builder().cargoSpaceId(stockoutReceive.getTrayCode()).build();
|
||||
tasks = mydoJobService.selectMydoJobList(job);
|
||||
if (tasks.size() != 0) {
|
||||
log.info("【提示】wms下发出库任务失败,已经存在该托盘的出库任务,wms作业号:{},推送托盘号:{}", stockoutReceive.getJobId(), stockoutReceive.getTrayCode());
|
||||
return AjaxResult.error("【提示】wms下发出库任务失败,已经存在该货位的出库任务,wms作业号:{}" + stockoutReceive.getJobId() + ",推送托盘号:" + stockoutReceive.getTrayCode());
|
||||
}
|
||||
|
||||
//生成出库作业
|
||||
@@ -226,27 +204,29 @@ public class ApiServiceImpl implements IApiService {
|
||||
mydoJob = BeanUtil.copyProperties(stockoutReceive, MydoJob.class);
|
||||
// mydoJob.setJobId(stockoutReceive.getJobId());
|
||||
// mydoJob.setTaskNo(stockoutReceive.getTaskNo());
|
||||
//// mydoJob.setWmsTaskNo(stockoutReceive.getTaskCode());
|
||||
// mydoJob.setWmsTaskNo(stockoutReceive.getTaskCode());
|
||||
// mydoJob.setCargoSpaceId(stockoutReceive.getCargoSpaceId());
|
||||
mydoJob.setInOrOut(stockoutReceive.getInOrOut());
|
||||
//
|
||||
mydoJob.setTraySize(GoodsType.TYPE_DEFAULT);//默认
|
||||
mydoJob.setStatus(TASK_STATUS_CREATED);
|
||||
mydoJob.setPriority(Long.valueOf(10));
|
||||
//todo 可能需要查本地库存信息获取条码?
|
||||
// mydoJob.setTrayCode(receiveOutJob.getTrayCode());
|
||||
mydoJob.setRoadwayId(
|
||||
basCargoSpaceService.selectBasCargoSpaceByCargoSpaceId(stockoutReceive.getCargoSpaceId()).getRoadwayId()
|
||||
);
|
||||
mydoJob.setExitId(ROADWAY1_EXIT);//todo 需要判断两个双向输送口是否空闲
|
||||
mydoJob.setInOrOut(stockoutReceive.getInOrOut());
|
||||
mydoJob.setTraySize(mydoJobService.getTraytypeByTrayCode(mydoJob.getTrayCode()));
|
||||
mydoJob.setStatus(TASK_STATUS_CREATED);
|
||||
mydoJob.setPriority(10);
|
||||
mydoJob.setRoadwayId(cargoSpace.getRoadwayId());
|
||||
String exitId;
|
||||
if (cargoSpace.getCargoAreaId().equals("02")){
|
||||
exitId = ROADWAY2_PORTCONV_2;
|
||||
}else if (cargoSpace.getCargoAreaId().equals("03")){
|
||||
exitId = ROADWAY2_PORTCONV_3;
|
||||
}else if (cargoSpace.getCargoAreaId().equals("04")){
|
||||
exitId = ROADWAY3_EXIT;
|
||||
}else{
|
||||
// exitId = ROADWAY1_EXIT;
|
||||
exitId = ROADWAY1_ENTRANCE;
|
||||
}
|
||||
mydoJob.setExitId(exitId);
|
||||
mydoJob.setCreateTime(DateUtils.getNowDate());
|
||||
mydoJob.setExecutionPhase(TASK_EP_CREATED);
|
||||
// mydoJob.setTraySize(receiveOutJob.getDepartmentId());
|
||||
|
||||
if (mydoJobService.selectMydoJobByJobId(mydoJob.getJobId()) != null){
|
||||
log.info("【任务警告】生成作业失败,已存在的作业号:{}", mydoJob.getJobId() + "(此条可忽略)");
|
||||
return AjaxResult.error("【请求警告】生成作业失败,已存在的作业号:{}" + mydoJob.getJobId() + "(此条可忽略)");
|
||||
}
|
||||
|
||||
int i = mydoJobService.insertMydoJob(mydoJob);
|
||||
// boolean success = mydoJobService.saveOrUpdate(mydoJob);
|
||||
@@ -305,7 +285,7 @@ public class ApiServiceImpl implements IApiService {
|
||||
// mydoJob.setTraySize(GoodsType.TYPE_DEFAULT);
|
||||
// mydoJob.setInOrOut("1");
|
||||
mydoJob.setStatus(TASK_STATUS_CREATED);
|
||||
mydoJob.setPriority(Long.valueOf(10));
|
||||
mydoJob.setPriority(10);
|
||||
mydoJob.setCreateTime(DateUtils.getNowDate());
|
||||
mydoJob.setExecutionPhase(TASK_EP_CREATED);
|
||||
// mydoJob.setTraySize(receiveOutJob.getDepartmentId());
|
||||
@@ -372,7 +352,7 @@ public class ApiServiceImpl implements IApiService {
|
||||
// mydoJob.setTraySize(GoodsType.TYPE_DEFAULT);
|
||||
// mydoJob.setInOrOut("1");
|
||||
mydoJob.setStatus(TASK_STATUS_CREATED);
|
||||
mydoJob.setPriority(Long.valueOf(10));
|
||||
mydoJob.setPriority(0);
|
||||
mydoJob.setCreateTime(DateUtils.getNowDate());
|
||||
mydoJob.setExecutionPhase(TASK_EP_CREATED);
|
||||
// mydoJob.setTraySize(receiveOutJob.getDepartmentId());
|
||||
@@ -440,7 +420,7 @@ public class ApiServiceImpl implements IApiService {
|
||||
// mydoJob.setTraySize(GoodsType.TYPE_DEFAULT);
|
||||
mydoJob.setInOrOut("3");
|
||||
mydoJob.setStatus(TASK_STATUS_CREATED);
|
||||
mydoJob.setPriority(Long.valueOf(10));
|
||||
mydoJob.setPriority(10);
|
||||
//todo 可能需要查本地库存信息获取条码?
|
||||
|
||||
mydoJob.setCreateTime(DateUtils.getNowDate());
|
||||
@@ -599,11 +579,12 @@ public class ApiServiceImpl implements IApiService {
|
||||
//todo 需要调试
|
||||
GenAgvSchedulingTaskResponse response = new GenAgvSchedulingTaskResponse();
|
||||
response.setCode(500);
|
||||
response.setMessage("请求失败");
|
||||
response.setMsg("请求失败");
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* agv执行状态返回接口
|
||||
*
|
||||
@@ -653,7 +634,7 @@ public class ApiServiceImpl implements IApiService {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
||||
return AjaxResult.error(response.getMessage());
|
||||
return AjaxResult.error(response.getMsg());
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ import cn.hutool.http.HttpUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.ruoyi.api.domain.InterfaceReceive;
|
||||
import com.ruoyi.api.domain.wcs2wms.ResponseResult;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -249,7 +250,7 @@ public class RequestLogServiceImpl implements IRequestLogService
|
||||
// String resStr = HttpUtil.post(url, param, header, 3000);
|
||||
String resStr = HttpRequest.post(url)
|
||||
.body(param)
|
||||
.header("X-Service-Secret", HEADER_TOKEN) // 向wms请求头必需添加的token
|
||||
// .header("X-Service-Secret", HEADER_TOKEN) // 向wms请求头必需添加的token
|
||||
.execute()
|
||||
.body();
|
||||
requestLog.setResponseBody(resStr);
|
||||
@@ -302,6 +303,32 @@ public class RequestLogServiceImpl implements IRequestLogService
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 插入请求日志
|
||||
*
|
||||
* @return requestLog
|
||||
*/
|
||||
@Override
|
||||
public RequestLog getRequestLog(String param, String remark,AjaxResult ajaxResult) {
|
||||
RequestLog requestLog = new RequestLog();
|
||||
requestLog.setRequestTime(DateUtil.formatDateTime(new Date()));
|
||||
requestLog.setRequestBody(param);
|
||||
requestLog.setSourceSystem("wcs");
|
||||
requestLog.setTargetSystem("wms");
|
||||
requestLog.setEndpoint(remark);
|
||||
requestLog.setRequestMethod("post");
|
||||
requestLog.setResponseTime(DateUtil.formatDateTime(new Date()));
|
||||
requestLog.setDuration(Convert.toStr(DateUtil.between(Convert.toDate(requestLog.getRequestTime()), Convert.toDate(requestLog.getResponseTime()), DateUnit.MS)));
|
||||
requestLog.setResponseStatus("1");
|
||||
if (ajaxResult.isSuccess()){
|
||||
requestLog.setIsSuccessful("1");
|
||||
}else {
|
||||
requestLog.setIsSuccessful("0");
|
||||
}
|
||||
requestLog.setResponseBody(Convert.toStr(ajaxResult.get("msg")));
|
||||
return requestLog;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @@@ FT568 将wms自定义的响应格式解析为本地响应格式(减少其他改动)
|
||||
|
||||
Reference in New Issue
Block a user