接口日志表

master
赵嘉伟 3 years ago
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 &gt;= #{integration.startDateTime}
</if>
<if test="integration.endDateTime != null">
AND REQUEST_DATE_TIME &lt;= #{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>

@ -1,12 +1,8 @@
package com.foreverwin.mesnac.integration.controller; package com.foreverwin.mesnac.integration.controller;
import com.foreverwin.mesnac.integration.model.IntegrationLog;
import com.foreverwin.mesnac.integration.service.IntegrationLogService; import com.foreverwin.mesnac.integration.service.IntegrationLogService;
import com.foreverwin.modular.core.util.R;
import org.springframework.beans.factory.annotation.Autowired; 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.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@ -21,9 +17,5 @@ public class IntegrationLogController {
@Autowired @Autowired
private IntegrationLogService integrationLogService; private IntegrationLogService integrationLogService;
@PostMapping("/findIntegrationLog")
public R findIntegrationLog(@RequestBody IntegrationLog integration){
return R.ok(integrationLogService.findIntegrationLog(integration));
}
} }

@ -1,12 +1,9 @@
package com.foreverwin.mesnac.integration.mapper; package com.foreverwin.mesnac.integration.mapper;
import com.foreverwin.mesnac.integration.model.IntegrationLog;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param; import com.foreverwin.mesnac.integration.model.IntegrationLog;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.List;
/** /**
* <p> * <p>
* Mapper * Mapper
@ -18,5 +15,4 @@ import java.util.List;
@Repository @Repository
public interface IntegrationLogMapper extends BaseMapper<IntegrationLog> { public interface IntegrationLogMapper extends BaseMapper<IntegrationLog> {
List<IntegrationLog> findIntegrationLog(@Param("integration") IntegrationLog integration);
} }

@ -3,8 +3,6 @@ package com.foreverwin.mesnac.integration.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.mesnac.integration.model.IntegrationLog; import com.foreverwin.mesnac.integration.model.IntegrationLog;
import java.util.List;
/** /**
* <p> * <p>
* *
@ -17,5 +15,4 @@ public interface IntegrationLogService extends IService<IntegrationLog> {
void saveIntegrationLog(IntegrationLog integrationLog); void saveIntegrationLog(IntegrationLog integrationLog);
List<IntegrationLog> findIntegrationLog(IntegrationLog integration);
} }

@ -4,14 +4,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.foreverwin.mesnac.integration.mapper.IntegrationLogMapper; import com.foreverwin.mesnac.integration.mapper.IntegrationLogMapper;
import com.foreverwin.mesnac.integration.model.IntegrationLog; import com.foreverwin.mesnac.integration.model.IntegrationLog;
import com.foreverwin.mesnac.integration.service.IntegrationLogService; import com.foreverwin.mesnac.integration.service.IntegrationLogService;
import com.foreverwin.modular.core.util.CommonMethods;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/** /**
* <p> * <p>
* *
@ -34,10 +31,5 @@ public class IntegrationLogServiceImpl extends ServiceImpl<IntegrationLogMapper,
integrationLogMapper.insert(integrationLog); integrationLogMapper.insert(integrationLog);
} }
@Override
public List<IntegrationLog> findIntegrationLog(IntegrationLog integration) {
String site = CommonMethods.getSite();
integration.setSite(site);
return integrationLogMapper.findIntegrationLog(integration);
}
} }

@ -462,30 +462,4 @@
</foreach>) </foreach>)
</delete> </delete>
<!-- BaseMapper标准查询/修改/删除 --> <!-- BaseMapper标准查询/修改/删除 -->
<select id="findIntegrationLog" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
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 &gt;= #{integration.startDateTime}
</if>
<if test="integration.endDateTime != null">
AND REQUEST_DATE_TIME &lt;= #{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> </mapper>

Loading…
Cancel
Save