接口日志表
parent
eafc1225a5
commit
f522d7d7db
@ -0,0 +1,33 @@
|
|||||||
|
package com.foreverwin.mesnac.anomaly.controller;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description TODO
|
||||||
|
* @Author zhaojiawei
|
||||||
|
* @Since 2021-08-23
|
||||||
|
*/
|
||||||
|
|
||||||
|
import com.foreverwin.mesnac.anomaly.service.ReportService;
|
||||||
|
import com.foreverwin.mesnac.integration.model.IntegrationLog;
|
||||||
|
import com.foreverwin.modular.core.util.R;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/REPORT")
|
||||||
|
public class Report {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public ReportService reportService;
|
||||||
|
|
||||||
|
@PostMapping("/findIntegrationLog")
|
||||||
|
public R findIntegrationLog(@RequestBody IntegrationLog integration){
|
||||||
|
try{
|
||||||
|
return R.ok(reportService.findIntegrationLog(integration));
|
||||||
|
}catch(Exception e){
|
||||||
|
return R.failed(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
package com.foreverwin.mesnac.anomaly.mapper;
|
||||||
|
|
||||||
|
import com.foreverwin.mesnac.integration.model.IntegrationLog;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description TODO
|
||||||
|
* @Author zhaojiawei
|
||||||
|
* @Since 2021-08-23
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public interface ReportMapper {
|
||||||
|
|
||||||
|
List<Map<String,Object>> findIntegrationLog(@Param("integration") IntegrationLog integration);
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
package com.foreverwin.mesnac.anomaly.service;
|
||||||
|
|
||||||
|
import com.foreverwin.mesnac.integration.model.IntegrationLog;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description TODO
|
||||||
|
* @Author zhaojiawei
|
||||||
|
* @Since 2021-08-23
|
||||||
|
*/
|
||||||
|
public interface ReportService {
|
||||||
|
List<Map<String,Object>> findIntegrationLog(IntegrationLog integration);
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package com.foreverwin.mesnac.anomaly.service.impl;
|
||||||
|
|
||||||
|
import com.foreverwin.mesnac.anomaly.mapper.ReportMapper;
|
||||||
|
import com.foreverwin.mesnac.anomaly.service.ReportService;
|
||||||
|
import com.foreverwin.mesnac.integration.model.IntegrationLog;
|
||||||
|
import com.foreverwin.modular.core.util.CommonMethods;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description TODO
|
||||||
|
* @Author zhaojiawei
|
||||||
|
* @Since 2021-08-23
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public class ReportServiceImpl implements ReportService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ReportMapper reportMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Map<String,Object>> findIntegrationLog(IntegrationLog integration) {
|
||||||
|
String site = CommonMethods.getSite();
|
||||||
|
integration.setSite(site);
|
||||||
|
return reportMapper.findIntegrationLog(integration);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.foreverwin.mesnac.anomaly.mapper.ReportMapper">
|
||||||
|
|
||||||
|
<select id="findIntegrationLog" resultType="map">
|
||||||
|
SELECT INTEGRATION_TYPE, CATEGORY, INTEGRATION_WAY,STATUS,REQUEST_DATE_TIME,TO_CHAR(RESULT_MESSAGE) RESULT_MESSAGE,TO_CHAR(PARAM) PARAM
|
||||||
|
FROM Z_INTEGRATION_LOG
|
||||||
|
<where>
|
||||||
|
SITE = #{integration.site}
|
||||||
|
<if test="integration.integrationType != null and integration.integrationType != ''">
|
||||||
|
AND INTEGRATION_TYPE = #{integration.integrationType}
|
||||||
|
</if>
|
||||||
|
<if test="integration.integrationWay != null and integration.integrationWay != ''">
|
||||||
|
AND INTEGRATION_WAY = #{integration.integrationWay}
|
||||||
|
</if>
|
||||||
|
<if test="integration.status != null and integration.status != ''">
|
||||||
|
AND STATUS = #{integration.status}
|
||||||
|
</if>
|
||||||
|
<if test="integration.startDateTime != null">
|
||||||
|
AND REQUEST_DATE_TIME >= #{integration.startDateTime}
|
||||||
|
</if>
|
||||||
|
<if test="integration.endDateTime != null">
|
||||||
|
AND REQUEST_DATE_TIME <= #{integration.endDateTime}
|
||||||
|
</if>
|
||||||
|
<if test="integration.param != null and integration.param != ''">
|
||||||
|
AND PARAM LIKE '%${integration.param}%'
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
ORDER BY REQUEST_DATE_TIME DESC
|
||||||
|
</select>
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue