|
|
@ -2,16 +2,21 @@ package com.dxhy.erp.controller; |
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.dxhy.common.controller.AbstractController; |
|
|
|
import com.dxhy.common.controller.AbstractController; |
|
|
|
|
|
|
|
import com.dxhy.common.utils.R; |
|
|
|
import com.dxhy.erp.entity.RequestRecord; |
|
|
|
import com.dxhy.erp.entity.RequestRecord; |
|
|
|
import com.dxhy.erp.service.RequestRecordService; |
|
|
|
import com.dxhy.erp.service.RequestRecordService; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.http.ResponseEntity; |
|
|
|
import org.springframework.http.ResponseEntity; |
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody; |
|
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
|
import org.springframework.web.bind.annotation.RequestMethod; |
|
|
|
import org.springframework.web.bind.annotation.RequestMethod; |
|
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import javax.annotation.Resource; |
|
|
|
|
|
|
|
import java.util.Date; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
|
|
|
@SuppressWarnings("AlibabaMethodTooLong") |
|
|
|
@SuppressWarnings("AlibabaMethodTooLong") |
|
|
|
@RequestMapping("/recall") |
|
|
|
@RequestMapping("/recall") |
|
|
@ -25,7 +30,7 @@ public class RequestRecallController extends AbstractController { |
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "重调接口入口", notes = "重调接口入口") |
|
|
|
@ApiOperation(value = "重调接口入口", notes = "重调接口入口") |
|
|
|
@RequestMapping(path = "/requestRecordRecall", method = {RequestMethod.POST}) |
|
|
|
@RequestMapping(path = "/requestRecordRecall", method = {RequestMethod.POST}) |
|
|
|
public ResponseEntity<?> recall(RequestRecord requestRecord) { |
|
|
|
public ResponseEntity<?> recall(@RequestBody RequestRecord requestRecord) { |
|
|
|
log.info("重调用接口调用开始"); |
|
|
|
log.info("重调用接口调用开始"); |
|
|
|
log.info("重调用接口入参:{}", JSONObject.toJSONString(requestRecord)); |
|
|
|
log.info("重调用接口入参:{}", JSONObject.toJSONString(requestRecord)); |
|
|
|
ResponseEntity responseEntity = requestRecordService.reCall(requestRecord); |
|
|
|
ResponseEntity responseEntity = requestRecordService.reCall(requestRecord); |
|
|
@ -33,5 +38,24 @@ public class RequestRecallController extends AbstractController { |
|
|
|
return responseEntity; |
|
|
|
return responseEntity; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "接口记录查询", notes = "接口记录查询") |
|
|
|
|
|
|
|
@RequestMapping(path = "/requestRecordBatch", method = {RequestMethod.POST}) |
|
|
|
|
|
|
|
public ResponseEntity<?> batchRequestRecord(@RequestBody Map<String, Object> params) { |
|
|
|
|
|
|
|
String portName = (String) params.get("portName"); |
|
|
|
|
|
|
|
Date startTime = (Date) params.get("startTime"); |
|
|
|
|
|
|
|
Date endTime = (Date) params.get("endTime"); |
|
|
|
|
|
|
|
Integer status = (Integer) params.get("status"); |
|
|
|
|
|
|
|
String methodName = (String) params.get("startTime"); |
|
|
|
|
|
|
|
Integer pageNumber = (Integer) params.get("pageNumber"); |
|
|
|
|
|
|
|
Integer pageSize = (Integer) params.get("pageSize"); |
|
|
|
|
|
|
|
List<RequestRecord> recordList = requestRecordService.getRecordList(portName, startTime, endTime, status, methodName, pageNumber, pageSize); |
|
|
|
|
|
|
|
R data = new R(1000, "default success"); |
|
|
|
|
|
|
|
if (recordList != null &&recordList.size()>0) { |
|
|
|
|
|
|
|
data.put("查询成功",recordList); |
|
|
|
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(data)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
data.put("查询结果为空",""); |
|
|
|
|
|
|
|
return ResponseEntity.ok(JSONObject.toJSONString(data)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|