零部件分类树同步接口修改
This commit is contained in:
+4
-5
@@ -148,14 +148,13 @@ public class SrmsApiController {
|
||||
try {
|
||||
Result<String> re = srmsApiService.syncPartData(json,req);
|
||||
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());
|
||||
jsonResponses.put(RESULT,re.getResult());
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),jsonResponses);
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),null);
|
||||
}catch (Exception 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.jero.common.constant.CommonConstant;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author lqt
|
||||
* @version 1.0
|
||||
@@ -14,7 +16,9 @@ public class ResponsesUtil {
|
||||
public static JSONObject getJsonResult(Object jsonMessageHeader,JSONObject jsonResponses) {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("MessageHeader",jsonMessageHeader);
|
||||
json.put("Responses",jsonResponses);
|
||||
if(!Objects.isNull(jsonResponses)){
|
||||
json.put("Responses",jsonResponses);
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user