feat: 新增涂布完工检发送OA接口
This commit is contained in:
parent
d5988f3504
commit
48140efb22
@ -0,0 +1,48 @@
|
||||
package com.foreverwin.iep.integration.handler.def.oa;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.foreverwin.iep.integration.constant.Msg;
|
||||
import com.foreverwin.iep.integration.domain.InvokeRequest;
|
||||
import com.foreverwin.iep.integration.domain.InvokeResponse;
|
||||
import com.foreverwin.iep.integration.service.HandlerService;
|
||||
import com.foreverwin.iep.integration.utils.JS;
|
||||
import com.foreverwin.iep.qms.dto.QmsInspecJobDTO;
|
||||
import com.google.gson.Gson;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@AllArgsConstructor
|
||||
@Service("OA_TBWG_INSPEC")
|
||||
public class OaTbwgInspec implements HandlerService {
|
||||
@Override
|
||||
public InvokeResponse call(InvokeRequest invokeRequest) {
|
||||
JSONObject messageContentjsonObject = JS.parseObject(invokeRequest.getMessageContent());
|
||||
String jsonInputString = messageContentjsonObject.get(Msg.MESSAGE_CONTENT).toString();
|
||||
try {
|
||||
// 统一调用 OA 接口
|
||||
InvokeResponse invokeResponse = OAUtil.sendOA(jsonInputString);
|
||||
if(!"E".equals(invokeResponse.getResult())){
|
||||
// 请求处理成功
|
||||
JSONArray jsonArray = JS.parseArray(invokeResponse.getMessageContent());
|
||||
invokeResponse = new InvokeResponse();
|
||||
invokeResponse.setTransSid(invokeRequest.getTransSid());
|
||||
invokeResponse.setResult(Msg.S);
|
||||
invokeResponse.setMessageContent(Msg.SUCCESS);
|
||||
JSONObject jsonObject = jsonArray.getJSONObject(0);
|
||||
if (!jsonObject.getBoolean("status")) {
|
||||
invokeResponse.setResult(Msg.E);
|
||||
invokeResponse.setMessageContent(jsonObject.getString("msg"));
|
||||
}
|
||||
}
|
||||
return invokeResponse;
|
||||
} catch (Exception e) {
|
||||
return getDefaultInvoke().fail(invokeRequest.getTransSid(), e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String validation(InvokeRequest invokeRequest) {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user