零部件分类树同步接口修改
This commit is contained in:
+4
-5
@@ -148,14 +148,13 @@ public class SrmsApiController {
|
|||||||
try {
|
try {
|
||||||
Result<String> re = srmsApiService.syncPartData(json,req);
|
Result<String> re = srmsApiService.syncPartData(json,req);
|
||||||
if(!re.isSuccess()){
|
if(!re.isSuccess()){
|
||||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),ResponsesUtil.getJsonErrUpper(re.getMessage(),re.getCode()));
|
log.error("零部件分类树同步接口同步失败",re.getMessage());
|
||||||
|
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),null);
|
||||||
}
|
}
|
||||||
JSONObject jsonResponses = ResponsesUtil.getJsonOkUpper(re.getMessage());
|
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),null);
|
||||||
jsonResponses.put(RESULT,re.getResult());
|
|
||||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),jsonResponses);
|
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
log.error("零部件分类树同步接口异常:",e);
|
log.error("零部件分类树同步接口异常:",e);
|
||||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),ResponsesUtil.getJsonErrUpper("操作失败",CommonConstant.SC_INTERNAL_SERVER_ERROR_500));
|
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
-1
@@ -3,6 +3,8 @@ package com.jero.modules.docking.utils;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.jero.common.constant.CommonConstant;
|
import com.jero.common.constant.CommonConstant;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author lqt
|
* @author lqt
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
@@ -14,7 +16,9 @@ public class ResponsesUtil {
|
|||||||
public static JSONObject getJsonResult(Object jsonMessageHeader,JSONObject jsonResponses) {
|
public static JSONObject getJsonResult(Object jsonMessageHeader,JSONObject jsonResponses) {
|
||||||
JSONObject json = new JSONObject();
|
JSONObject json = new JSONObject();
|
||||||
json.put("MessageHeader",jsonMessageHeader);
|
json.put("MessageHeader",jsonMessageHeader);
|
||||||
json.put("Responses",jsonResponses);
|
if(!Objects.isNull(jsonResponses)){
|
||||||
|
json.put("Responses",jsonResponses);
|
||||||
|
}
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user