|
|
@ -90,7 +90,7 @@ public abstract class CJTOperateCallBackAbstract {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void preHandle(CJTEdiCallbackRequestVo req) {
|
|
|
|
public void preHandle(CJTEdiCallbackRequestVo req) {
|
|
|
|
if (req.getRetryCount() > 0) {
|
|
|
|
if (req.getRetryCount() > 0) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -109,22 +109,26 @@ public abstract class CJTOperateCallBackAbstract {
|
|
|
|
|
|
|
|
|
|
|
|
private void endHandle(CJTEdiCallbackRequestVo req) {
|
|
|
|
private void endHandle(CJTEdiCallbackRequestVo req) {
|
|
|
|
if (req.getTempId() != null) {
|
|
|
|
if (req.getTempId() != null) {
|
|
|
|
erpLarkTempRelationMapper.updateForCjt(FlagStatus.DELETED.getCode(), req.getTempId(), "");
|
|
|
|
erpLarkTempRelationMapper.updateForCjt(FlagStatus.DELETED.getCode(), req.getTempId());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void errorHandle(CJTEdiCallbackRequestVo req, Exception e) {
|
|
|
|
private void errorHandle(CJTEdiCallbackRequestVo req, Exception e) {
|
|
|
|
if (req.getTempId() != null) {
|
|
|
|
if (req.getTempId() != null) {
|
|
|
|
erpLarkTempRelationMapper.updateForCjt(FlagStatus.OK.getCode(), req.getTempId(), e.getMessage());
|
|
|
|
erpLarkTempRelationMapper.updateForCjtError(FlagStatus.OK.getCode(), req.getTempId(), e.getMessage());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void sync(CJTEdiCallbackRequestVo req) {
|
|
|
|
private void sync(CJTEdiCallbackRequestVo req) {
|
|
|
|
CjtAccountEnum cjtAccountEnum = req.getCjtAccountEnum();
|
|
|
|
CjtAccountEnum cjtAccountEnum = req.getCjtAccountEnum();
|
|
|
|
|
|
|
|
String msgType = req.getMsgType();
|
|
|
|
|
|
|
|
JSONObject jsonObject = null;
|
|
|
|
|
|
|
|
if (!msgType.contains("Delete")){
|
|
|
|
LarkCJTRequestBody cjtRequestBody = new LarkCJTRequestBody(req.getVoucherId());
|
|
|
|
LarkCJTRequestBody cjtRequestBody = new LarkCJTRequestBody(req.getVoucherId());
|
|
|
|
LarkCJTRequest cjtRequest = new LarkCJTRequest(getRequestUrl(), cjtAccountEnum.getAppKey(), cjtAccountEnum.getAppSecret(), generateToken(req), cjtRequestBody);
|
|
|
|
LarkCJTRequest cjtRequest = new LarkCJTRequest(getRequestUrl(), cjtAccountEnum.getAppKey(), cjtAccountEnum.getAppSecret(), generateToken(req), cjtRequestBody);
|
|
|
|
LarkOkHttpHelper.post(cjtRequest);
|
|
|
|
LarkOkHttpHelper.post(cjtRequest);
|
|
|
|
JSONObject jsonObject = requestCjt(cjtRequest);
|
|
|
|
jsonObject = requestCjt(cjtRequest);
|
|
|
|
|
|
|
|
}
|
|
|
|
syncRecord(req, jsonObject);
|
|
|
|
syncRecord(req, jsonObject);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|