|
|
|
@ -15,8 +15,6 @@ import com.dxhy.erp.service.RequestRecordService; |
|
|
|
|
import com.dxhy.erp.service.SNPushCheckRecordService; |
|
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.context.ApplicationContext; |
|
|
|
|
import org.springframework.http.ResponseEntity; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
import org.springframework.transaction.annotation.Propagation; |
|
|
|
@ -24,7 +22,10 @@ import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
|
import java.lang.reflect.Method; |
|
|
|
|
import java.util.*; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.Date; |
|
|
|
|
import java.util.LinkedHashMap; |
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
@Slf4j |
|
|
|
|
@Service |
|
|
|
@ -213,36 +214,19 @@ public class RequestRecordServiceImpl extends MpBaseServiceImpl<RequestRecordDao |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void setResponse(RequestRecord record, String activeCallRecallResponse, String recallResponseDetail) { |
|
|
|
|
HashMap<String, String> activeCallrecallMap = JSONObject.parseObject(record.getRecallResponseDetail(),HashMap.class); |
|
|
|
|
HashMap<String, String> reCallMap = JSONObject.parseObject(record.getRecallResponseDetail(),HashMap.class); |
|
|
|
|
LinkedHashMap<String, String> activeCallrecallMap = JSONObject.parseObject(record.getRecallResponseDetail(), LinkedHashMap.class); |
|
|
|
|
LinkedHashMap<String, String> reCallMap = JSONObject.parseObject(record.getRecallResponseDetail(), LinkedHashMap.class); |
|
|
|
|
if (record.getRetryTimes() == 0) { |
|
|
|
|
activeCallrecallMap = new HashMap<>(); |
|
|
|
|
reCallMap = new HashMap<>(); |
|
|
|
|
activeCallrecallMap = new LinkedHashMap<>(); |
|
|
|
|
reCallMap = new LinkedHashMap<>(); |
|
|
|
|
activeCallrecallMap.put("第1次主动调用重调返回结果", activeCallRecallResponse); |
|
|
|
|
activeCallrecallMap.put("第1次重调返回结果", recallResponseDetail); |
|
|
|
|
} else { |
|
|
|
|
reCallMap.put("第"+ record.getRetryTimes() + 1+"次重调结果", recallResponseDetail); |
|
|
|
|
activeCallrecallMap.put("第"+ record.getRetryTimes() + 1+"次主动调用重调结果", activeCallRecallResponse); |
|
|
|
|
reCallMap.put("第" + (record.getRetryTimes() + 1) + "次重调结果", recallResponseDetail); |
|
|
|
|
activeCallrecallMap.put("第" + (record.getRetryTimes() + 1) + "次主动调用重调结果", activeCallRecallResponse); |
|
|
|
|
} |
|
|
|
|
record.setActiveCallRecallResponse(JSONObject.toJSONString(activeCallrecallMap)); |
|
|
|
|
record.setRecallResponseDetail(JSONObject.toJSONString(reCallMap)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// @Override
|
|
|
|
|
// @DataSource(name = "business_business_write")
|
|
|
|
|
// @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = BaseException.class)
|
|
|
|
|
// public int saveTestRequestRecord(RequestRecord record, Integer isRecall, String responseDetail, String failedReason) throws BaseException{
|
|
|
|
|
// record.setFailedTimes(1);
|
|
|
|
|
// record.setStatus(1);
|
|
|
|
|
// record.setResponseDetail(responseDetail);
|
|
|
|
|
// record.setFailedReason(failedReason);
|
|
|
|
|
// record.setIsRecall(isRecall);
|
|
|
|
|
// log.info("接口调用记录正在保存,调用记录详情:{}",JSONObject.toJSONString(record));
|
|
|
|
|
//
|
|
|
|
|
// int insert = super.getBaseMapper().insert(record);
|
|
|
|
|
// throw new BaseException("测试用");
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|