代码修改
This commit is contained in:
@@ -5,6 +5,7 @@ import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.system.service.impl.ParamServiceImpl;
|
||||
import org.nl.utils.SpringContextHolder;
|
||||
import org.springframework.http.HttpStatus;
|
||||
@@ -12,6 +13,7 @@ import org.springframework.http.HttpStatus;
|
||||
/**
|
||||
* ACS连接工具类:
|
||||
*/
|
||||
@Slf4j
|
||||
public class AcsUtil {
|
||||
public static JSONObject notifyAcs(String api, JSONArray list) {
|
||||
//判断是否连接ACS系统
|
||||
@@ -27,6 +29,7 @@ public class AcsUtil {
|
||||
String acsUrl = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("ACS_URL").getValue();
|
||||
|
||||
String url = acsUrl + api;
|
||||
log.info("下发acs任务的参数为:{}", list.toString());
|
||||
try {
|
||||
String resultMsg = HttpRequest.post(url)
|
||||
.body(String.valueOf(list))
|
||||
|
||||
@@ -77,7 +77,7 @@ public class AutoCreateTask {
|
||||
});
|
||||
String api = "api/wms/task";
|
||||
|
||||
log.info("下发acs任务的参数为:{}", arr.toString());
|
||||
|
||||
JSONObject result = AcsUtil.notifyAcs(api, arr);
|
||||
log.info("下发acs任务的返回结果为:{}", result.toString());
|
||||
|
||||
@@ -103,8 +103,8 @@ public class AutoCreateTask {
|
||||
JSONObject taskObj = new JSONObject();
|
||||
taskObj.put("task_id", item.getExt_task_uuid());
|
||||
//下发失败,改状态为了重新下发
|
||||
taskObj.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
|
||||
// taskObj.put("task_status", TaskStatusEnum.ISSUE.getCode());
|
||||
// taskObj.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
|
||||
taskObj.put("task_status", TaskStatusEnum.ISSUE.getCode());
|
||||
taskObj.put("remark", "下发失败:" + message);
|
||||
taskObj.put("update_time", DateUtil.now());
|
||||
taskTab.update(taskObj);
|
||||
|
||||
Reference in New Issue
Block a user