删除故障码
parent
b9991bf7f0
commit
06d10e2776
|
@ -1,136 +0,0 @@
|
|||
package com.god.base.server.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.nacos.api.model.v2.Result;
|
||||
|
||||
import com.god.base.common.domain.Breakdown;
|
||||
import com.god.base.common.domain.Fault;
|
||||
import com.god.base.common.domain.request.BreakdownRequest;
|
||||
import com.god.base.server.service.BreakdownService;
|
||||
import com.god.common.core.utils.poi.ExcelUtil;
|
||||
import com.god.common.core.web.page.TableDataInfo;
|
||||
import com.god.common.log.annotation.Log;
|
||||
import com.god.common.log.enums.BusinessType;
|
||||
import com.god.common.security.annotation.RequiresPermissions;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 车辆故障码controller
|
||||
*
|
||||
* @author ChenXinHai
|
||||
* @version 2023/11/20 - 19:31
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/Breakdown")
|
||||
@Log4j2
|
||||
public class BreakdownController {
|
||||
@Autowired
|
||||
private BreakdownService breakdownService;
|
||||
private HttpServletRequest request;
|
||||
|
||||
/**
|
||||
* 故障日志列表
|
||||
* @param breakdown
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("breakedown:breakedown:list")
|
||||
@GetMapping("/list")
|
||||
public Result<List<Breakdown>> breakdownList(Breakdown breakdown){
|
||||
log.info("名称:故障日志列表,请求URI:{},请求方法:{}",request.getRequestURI(),
|
||||
request.getMethod());
|
||||
Result<List<Breakdown>> result=breakdownService.breakdown(breakdown);
|
||||
log.info("名称:故障日志列表,请求URI:{},请求方法:{},响应方法:{}",request.getRequestURI(),
|
||||
request.getMethod(), JSONObject.toJSONString(result));
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出故障数据日志
|
||||
* @param response
|
||||
* @param breakdown
|
||||
*/
|
||||
@RequiresPermissions("breakdown:breakdown:export")
|
||||
@Log(title = "故障日志",businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, Breakdown breakdown){
|
||||
|
||||
Result<List<Breakdown>> list = breakdownService.breakdown(breakdown);
|
||||
ExcelUtil<Breakdown> util = new ExcelUtil<>(Breakdown.class);
|
||||
// 对list数据源将其里面的数据导入出来
|
||||
util.exportExcel(response,list.getData(),"车辆故障码");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取故障日志详细信息
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("breakdown:breakdown:query")
|
||||
@GetMapping("query")
|
||||
public Result query(Integer id){
|
||||
log.info("名称:获取日志详细信息,请求URI:{},请求方法:{}",request.getRequestURI(),
|
||||
request.getMethod(),JSONObject.toJSONString(id));
|
||||
breakdownService.query(id);
|
||||
Result result=Result.success();
|
||||
log.info("名称:获取日志详细信息,请求URI:{},请求方法:{},响应方法:{}",request.getRequestURI(),
|
||||
request.getMethod(),JSONObject.toJSONString(result));
|
||||
return result;
|
||||
}
|
||||
|
||||
@RequiresPermissions("breakdown:breakdown:breakdownAdd")
|
||||
@Log(title = "故障日志",businessType = BusinessType.INSERT)
|
||||
@PostMapping("breakdownAdd")
|
||||
public Result breakdown(@RequestBody Breakdown breakdown){
|
||||
log.info("名称:新增故障日志,请求URI:{},请求方法:{}",request.getRequestURI(),
|
||||
request.getMethod(),breakdown);
|
||||
breakdownService.breakdownAdd(breakdown);
|
||||
Result result=Result.success();
|
||||
log.info("名称:新增故障日志,请求URI:{},请求方法:{},响应方法:{}",request.getRequestURI(),
|
||||
request.getMethod(),JSONObject.toJSONString(result));
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改故障日志
|
||||
* @param breakdown
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("breakdown:breakdown:breakdownUpdate")
|
||||
@Log(title = "故障日志",businessType = BusinessType.UPDATE)
|
||||
@PostMapping("breakdownUpdate")
|
||||
public Result breakdownUpdate(@RequestBody Breakdown breakdown){
|
||||
log.info("名称:修改故障日志,请求URI:{},请求方法:{}",request.getRequestURI(),
|
||||
request.getMethod(),breakdown);
|
||||
breakdownService.breakdownUpdate(breakdown);
|
||||
Result result=Result.success();
|
||||
log.info("名称:修改故障日志,请求URI:{},请求方法:{},响应结果:{}",request.getRequestURI(),
|
||||
request.getMethod(),JSONObject.toJSONString(result));
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除故障日志
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("breakdown:breakdown:breakdownDelete")
|
||||
@Log(title = "故障日志",businessType = BusinessType.DELETE)
|
||||
@PostMapping("breakdownDelete")
|
||||
public Result breakdownDelete(Integer id){
|
||||
log.info("名称:删除故障日志,请求URI:{},请求方法:{}",request.getRequestURI(),
|
||||
request.getMethod(),JSONObject.toJSONString(id));
|
||||
breakdownService.breakdownDelete(id);
|
||||
Result result= Result.success();
|
||||
log.info("名称:删除故障日志,请求URI:{},请求方法:{},响应方法:{}",request.getRequestURI(),
|
||||
request.getMethod(),JSONObject.toJSONString(result));
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,126 +0,0 @@
|
|||
package com.god.base.server.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.nacos.api.model.v2.Result;
|
||||
|
||||
import com.god.base.common.domain.Breakdown;
|
||||
import com.god.base.common.domain.Fault;
|
||||
import com.god.base.common.domain.request.BreakdownRequest;
|
||||
import com.god.base.common.domain.request.FaultRequest;
|
||||
import com.god.base.server.service.FaultService;
|
||||
import com.god.common.core.utils.poi.ExcelUtil;
|
||||
import com.god.common.core.web.controller.BaseController;
|
||||
import com.god.common.core.web.page.TableDataInfo;
|
||||
import com.god.common.log.annotation.Log;
|
||||
import com.god.common.log.enums.BusinessType;
|
||||
import com.god.common.security.annotation.RequiresPermissions;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 故障表
|
||||
*
|
||||
* @author ChenXinHai
|
||||
* @version 2023/11/21 - 18:33
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/fault")
|
||||
@Log4j2
|
||||
public class FaultController extends BaseController {
|
||||
@Autowired
|
||||
private FaultService faultService;
|
||||
private HttpServletRequest request;
|
||||
/**
|
||||
*查询车辆故障码列表
|
||||
*/
|
||||
// @RequiresPermissions("fault:fault:list")
|
||||
@GetMapping("/list")
|
||||
public Result<List<Fault>> faultList(Fault fault){
|
||||
log.info("功能名称:故障码列表,请求URI:{},请求方法:{}",request.getRequestURI(),
|
||||
request.getMethod());
|
||||
Result<List<Fault>> result=faultService.faultList(fault);
|
||||
log.info("功能名称:故障码列表,请求URI:{},请求方法:{},响应结果:{}",request.getRequestURI(),
|
||||
request.getMethod(), JSONObject.toJSONString(result));
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出车辆故障码列表
|
||||
*/
|
||||
// @RequiresPermissions("fault:fault:export")
|
||||
@Log(title="车辆故障码",businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response,Fault fault){
|
||||
Result<List<Fault>> list=faultService.faultList(fault);
|
||||
ExcelUtil<Fault> util = new ExcelUtil<>(Fault.class);
|
||||
// 对list数据源将其里面的数据导入出来
|
||||
util.exportExcel(response,list.getData(),"车辆故障码");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加故障数据
|
||||
* @param fault
|
||||
* @return
|
||||
*/
|
||||
|
||||
// @RequiresPermissions("fault:fault:add")
|
||||
@Log(title = "车辆故障码",businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/faultAdd")
|
||||
public Result faultAdd(@RequestBody Fault fault){
|
||||
log.info("名称:添加故障数据,请求URI:{},请求方法:{}",request.getRequestURI(),
|
||||
request.getMethod(),fault);
|
||||
faultService.add(fault);
|
||||
Result result= Result.success();
|
||||
log.info("名称:添加故障数据,请求URI:{},请求方法:{},响应结果:{}",request.getRequestURI(),
|
||||
request.getMethod(),JSONObject.toJSONString(result));
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除故障数据
|
||||
* @param faultId
|
||||
* @return
|
||||
*/
|
||||
|
||||
// @RequiresPermissions("fault:fault:delete")
|
||||
@Log(title = "车辆故障码",businessType = BusinessType.EXPORT)
|
||||
@PostMapping("faultDelete")
|
||||
public Result faultDelete(Integer faultId){
|
||||
log.info("名称:删除故障编码,请求URI:{},请求方法:{}",request.getRequestURI(),
|
||||
request.getMethod(),JSONObject.toJSONString(faultId));
|
||||
faultService.faultDelete(faultId);
|
||||
Result result=Result.success();
|
||||
log.info("名称:删除故障数据,请求URI:{},请求方法:{},响应结果:{}",request.getRequestURI(),
|
||||
request.getMethod(),JSONObject.toJSONString(result));
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改故障数据
|
||||
* @param fault
|
||||
* @return
|
||||
*/
|
||||
// @RequiresPermissions("fault:fault:update")
|
||||
@Log(title = "车辆故障码",businessType = BusinessType.EXPORT)
|
||||
@PostMapping("faultUpdate")
|
||||
public Result faultUpdate(@RequestBody Fault fault){
|
||||
log.info("名称:修改故障数据,请求URI:{},请求方法:{}",request.getRequestURI(),
|
||||
request.getMethod(),fault);
|
||||
faultService.faultUpdate(fault);
|
||||
Result result=Result.success();
|
||||
log.info("名称:修改故障数据,请求URI:{},请求方法:{},响应结果:{}",request.getRequestURI(),
|
||||
request.getMethod(),JSONObject.toJSONString(result));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,54 +0,0 @@
|
|||
package com.god.base.server.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.nacos.api.model.v2.Result;
|
||||
import com.god.base.common.domain.Breakdown;
|
||||
import com.god.base.common.domain.Fault;
|
||||
import com.god.base.common.domain.Faultcodealarm;
|
||||
import com.god.base.common.domain.request.BreakdownRequest;
|
||||
import com.god.base.server.service.FaultcodealarmService;
|
||||
import com.god.common.core.web.page.TableDataInfo;
|
||||
import com.god.common.security.annotation.RequiresPermissions;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 故障码告警规则
|
||||
*
|
||||
* @author ChenXinHai
|
||||
* @version 2023/11/22 - 19:35
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/Faultcodealarm")
|
||||
@Log4j2
|
||||
public class FaultcodealarmController {
|
||||
|
||||
@Autowired
|
||||
private FaultcodealarmService faultcodealarmService;
|
||||
private HttpServletRequest request;
|
||||
|
||||
|
||||
@RequiresPermissions("faultcodealarm:faultcodealarm:list")
|
||||
@GetMapping("/list")
|
||||
public Result<List<Faultcodealarm>> faultcodealarmList(Faultcodealarm faultcodealarm){
|
||||
log.info("功能名称:故障告警列表,请求URI:{},请求方法:{}",request.getRequestURI(),
|
||||
request.getMethod());
|
||||
Result<List<Faultcodealarm>> result=faultcodealarmService.faultcodealarmList(faultcodealarm);
|
||||
log.info("功能名称:故障告警列表,请求URI:{},请求方法:{},响应结果:{}",request.getRequestURI(),
|
||||
request.getMethod(),JSONObject.toJSONString(result));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
package com.god.base.server.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.god.base.common.domain.Breakdown;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 车辆故障码mapper
|
||||
*
|
||||
* @author ChenXinHai
|
||||
* @version 2023/11/20 - 19:31
|
||||
*/
|
||||
@Mapper
|
||||
public interface BreakdownMapper extends BaseMapper<Breakdown> {
|
||||
List<Breakdown> breakdownList(Breakdown breakdown);
|
||||
|
||||
void query(Integer id);
|
||||
|
||||
void breakdownAdd(Breakdown breakdown);
|
||||
|
||||
void breakdownUpdate(Breakdown breakdown);
|
||||
|
||||
void breakdownDelete(Integer id);
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
package com.god.base.server.mapper;
|
||||
|
||||
import com.alibaba.nacos.api.model.v2.Result;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.god.base.common.domain.Breakdown;
|
||||
import com.god.base.common.domain.Fault;
|
||||
import com.god.base.common.domain.request.FaultRequest;
|
||||
import com.god.common.core.web.page.TableDataInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 故障Mapper
|
||||
*
|
||||
* @author ChenXinHai
|
||||
* @version 2023/11/21 - 18:33
|
||||
*/
|
||||
@Mapper
|
||||
public interface FaultMapper extends BaseMapper<Fault> {
|
||||
|
||||
|
||||
List<Fault> faultList(Fault fault);
|
||||
|
||||
void add(Fault fault);
|
||||
|
||||
void faultUpdate(Fault fault);
|
||||
|
||||
void faultDelete(Integer faultId);
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
package com.god.base.server.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.god.base.common.domain.Faultcodealarm;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 故障码告警Mapper
|
||||
*
|
||||
* @author ChenXinHai
|
||||
* @version 2023/11/22 - 19:35
|
||||
*/
|
||||
@Mapper
|
||||
public interface FaultcodealarmMapper extends BaseMapper<Faultcodealarm> {
|
||||
|
||||
|
||||
List<Faultcodealarm> faultcodealarmList(Faultcodealarm faultcodealarm);
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
//package com.god.base.server.mapper;
|
||||
//
|
||||
//import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
//import com.god.base.common.domain.RequestLog;
|
||||
//
|
||||
///**
|
||||
// * AOP
|
||||
// *
|
||||
// * @author ChenXinHai
|
||||
// * @version 2023/11/22 - 18:38
|
||||
// */
|
||||
//public interface RequestLogMapper extends BaseMapper<RequestLog> {
|
||||
//
|
||||
//}
|
|
@ -1,30 +0,0 @@
|
|||
package com.god.base.server.service;
|
||||
|
||||
import com.alibaba.nacos.api.model.v2.Result;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.god.base.common.domain.Breakdown;
|
||||
import com.god.base.common.domain.request.BreakdownRequest;
|
||||
import com.god.common.core.web.page.TableDataInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 车辆故障码service
|
||||
*
|
||||
* @author ChenXinHai
|
||||
* @version 2023/11/20 - 19:32
|
||||
*/
|
||||
public interface BreakdownService extends IService<Breakdown> {
|
||||
|
||||
|
||||
Result<List<Breakdown>> breakdown(Breakdown breakdown);
|
||||
|
||||
|
||||
void query(Integer id);
|
||||
|
||||
void breakdownAdd(Breakdown breakdown);
|
||||
|
||||
void breakdownUpdate(Breakdown breakdown);
|
||||
|
||||
void breakdownDelete(Integer id);
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
package com.god.base.server.service;
|
||||
|
||||
import com.alibaba.nacos.api.model.v2.Result;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.god.base.common.domain.Breakdown;
|
||||
import com.god.base.common.domain.Fault;
|
||||
import com.god.base.common.domain.request.FaultRequest;
|
||||
import com.god.common.core.web.page.TableDataInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 故障service
|
||||
*
|
||||
* @author ChenXinHai
|
||||
* @version 2023/11/21 - 18:33
|
||||
*/
|
||||
public interface FaultService extends IService<Fault> {
|
||||
|
||||
|
||||
Result<List<Fault>> faultList(Fault fault);
|
||||
|
||||
void add(Fault fault);
|
||||
|
||||
|
||||
|
||||
void faultUpdate(Fault fault);
|
||||
|
||||
|
||||
|
||||
void faultDelete(Integer faultId);
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
package com.god.base.server.service;
|
||||
|
||||
import com.alibaba.nacos.api.model.v2.Result;
|
||||
import com.god.base.common.domain.Faultcodealarm;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 故障码告警service
|
||||
*
|
||||
* @author ChenXinHai
|
||||
* @version 2023/11/22 - 19:37
|
||||
*/
|
||||
public interface FaultcodealarmService {
|
||||
Result<List<Faultcodealarm>> faultcodealarmList(Faultcodealarm faultcodealarm);
|
||||
}
|
|
@ -1,64 +0,0 @@
|
|||
package com.god.base.server.service.impl;
|
||||
|
||||
import com.alibaba.nacos.api.model.v2.Result;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.god.base.common.domain.Breakdown;
|
||||
import com.god.base.common.domain.request.BreakdownRequest;
|
||||
import com.god.base.server.mapper.BreakdownMapper;
|
||||
import com.god.base.server.service.BreakdownService;
|
||||
import com.god.common.core.utils.StringUtils;
|
||||
import com.god.common.core.web.page.TableDataInfo;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 车辆故障码serviceImpl
|
||||
*
|
||||
* @author ChenXinHai
|
||||
* @version 2023/11/20 - 19:32
|
||||
*/
|
||||
@Log4j2
|
||||
@Service
|
||||
public class BreakdownServiceImpl extends ServiceImpl<BreakdownMapper, Breakdown> implements BreakdownService {
|
||||
@Autowired
|
||||
private BreakdownMapper breakdownMapper;
|
||||
|
||||
/**
|
||||
* 故障日志列表
|
||||
* @param breakdown
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Result<List<Breakdown>> breakdown(Breakdown breakdown) {
|
||||
List<Breakdown> list=breakdownMapper.breakdownList(breakdown);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void query(Integer id) {
|
||||
breakdownMapper.query(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakdownAdd(Breakdown breakdown) {
|
||||
breakdownMapper.breakdownAdd(breakdown);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakdownUpdate(Breakdown breakdown) {
|
||||
breakdownMapper.breakdownUpdate(breakdown);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakdownDelete(Integer id) {
|
||||
breakdownMapper.breakdownDelete(id);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,59 +0,0 @@
|
|||
package com.god.base.server.service.impl;
|
||||
|
||||
import com.alibaba.nacos.api.model.v2.Result;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.god.base.common.domain.Breakdown;
|
||||
import com.god.base.common.domain.Fault;
|
||||
import com.god.base.common.domain.request.FaultRequest;
|
||||
import com.god.base.server.mapper.BreakdownMapper;
|
||||
import com.god.base.server.mapper.FaultMapper;
|
||||
import com.god.base.server.service.BreakdownService;
|
||||
import com.god.base.server.service.FaultService;
|
||||
import com.god.common.core.web.page.TableDataInfo;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
|
||||
/**
|
||||
* 故障serviceImpl
|
||||
*
|
||||
* @author ChenXinHai
|
||||
* @version 2023/11/21 - 18:34
|
||||
*/
|
||||
|
||||
@Service
|
||||
public class FaultServiceImpl extends ServiceImpl<FaultMapper, Fault> implements FaultService {
|
||||
@Autowired
|
||||
private FaultMapper faultMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public Result<List<Fault>> faultList(Fault fault) {
|
||||
List<Fault> list=faultMapper.faultList(fault);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(Fault fault) {
|
||||
faultMapper.add(fault);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void faultUpdate(Fault fault) {
|
||||
faultMapper.faultUpdate(fault);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void faultDelete(Integer faultId) {
|
||||
faultMapper.faultDelete(faultId);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
package com.god.base.server.service.impl;
|
||||
|
||||
import com.alibaba.nacos.api.model.v2.Result;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.god.base.common.domain.Breakdown;
|
||||
import com.god.base.common.domain.Fault;
|
||||
import com.god.base.common.domain.Faultcodealarm;
|
||||
import com.god.base.server.mapper.BreakdownMapper;
|
||||
import com.god.base.server.mapper.FaultcodealarmMapper;
|
||||
import com.god.base.server.service.BreakdownService;
|
||||
import com.god.base.server.service.FaultcodealarmService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 故障码告警serviceImpl
|
||||
*
|
||||
* @author ChenXinHai
|
||||
* @version 2023/11/22 - 19:37
|
||||
*/
|
||||
@Service
|
||||
public class FaultcodealarmServiceImpl extends ServiceImpl<FaultcodealarmMapper, Faultcodealarm> implements FaultcodealarmService {
|
||||
|
||||
@Autowired
|
||||
private FaultcodealarmMapper faultcodealarmMapper;
|
||||
@Override
|
||||
public Result<List<Faultcodealarm>> faultcodealarmList(Faultcodealarm faultcodealarm) {
|
||||
List<Faultcodealarm> list=faultcodealarmMapper.faultcodealarmList(faultcodealarm);
|
||||
return Result.success(list);
|
||||
}
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
//package com.god.base.server.service.impl;
|
||||
//
|
||||
//import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
//import com.god.base.common.domain.RequestLog;
|
||||
//import com.god.base.server.mapper.RequestLogMapper;
|
||||
//import com.god.base.server.service.RequestLogService;
|
||||
//import org.springframework.scheduling.annotation.Async;
|
||||
//import org.springframework.stereotype.Service;
|
||||
//
|
||||
///**
|
||||
// * AOP
|
||||
// *
|
||||
// * @author ChenXinHai
|
||||
// * @version 2023/11/22 - 18:43
|
||||
// */
|
||||
//@Service
|
||||
//public class RequestLogServiceImpl extends ServiceImpl<RequestLogMapper, RequestLog> implements RequestLogService {
|
||||
// @Async
|
||||
// @Override
|
||||
// public void asyncSave(RequestLog entity) {
|
||||
// super.save(entity);
|
||||
// }
|
||||
//}
|
|
@ -1,84 +0,0 @@
|
|||
//package com.god.base.server.service.impl;
|
||||
//
|
||||
//import com.god.base.common.domain.RequestLog;
|
||||
//import com.god.base.server.service.RequestLogService;
|
||||
//import com.god.common.log.aspect.LogAspect;
|
||||
//import org.aspectj.lang.JoinPoint;
|
||||
//import org.aspectj.lang.annotation.*;
|
||||
//import org.slf4j.Logger;
|
||||
//import org.slf4j.LoggerFactory;
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.stereotype.Component;
|
||||
//import org.springframework.web.context.request.RequestContextHolder;
|
||||
//import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
//
|
||||
//import javax.servlet.http.HttpServletRequest;
|
||||
//import java.time.LocalDateTime;
|
||||
//import java.util.Arrays;
|
||||
//
|
||||
///**
|
||||
// * AOP日志处理
|
||||
// *
|
||||
// * @author ChenXinHai
|
||||
// * @version 2023/11/22 - 18:45
|
||||
// */
|
||||
//@Aspect
|
||||
//@Component
|
||||
//public class asyncSave {
|
||||
// private static final Logger logger= LoggerFactory.getLogger(LogAspect.class);
|
||||
// @Autowired
|
||||
// private RequestLogService requestLogService;
|
||||
//
|
||||
// private long startTime;
|
||||
// private RequestLog requestLog;
|
||||
//
|
||||
// /**
|
||||
// * 切点声明
|
||||
// */
|
||||
// @Pointcut(value = "execution(* com.god.base.server.controller.*.*(..))")
|
||||
// public void pointcut(){
|
||||
// }
|
||||
// @Before(value = "pointcut()")
|
||||
// public void doBefore(JoinPoint joinPoint){
|
||||
// ServletRequestAttributes servletRequestAttributes
|
||||
// =(ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
// HttpServletRequest request=servletRequestAttributes.getRequest();
|
||||
//
|
||||
// // 获取请求参数
|
||||
// String requestUrl = request.getRequestURL().toString();
|
||||
// String ip = request.getRemoteAddr();
|
||||
// String userAgent = request.getHeader("User-Agent"); // 用户代理(客户端)
|
||||
// String declaringSignature=joinPoint.getSignature().getDeclaringTypeName()
|
||||
// +"."+joinPoint.getSignature().getName();
|
||||
// String args=(joinPoint.getArgs().length==0)?null: Arrays.toString(joinPoint.getArgs());
|
||||
//
|
||||
// // 设置请求参数
|
||||
// this.requestLog = new RequestLog();
|
||||
// this.requestLog.setUserName("admin");
|
||||
// this.requestLog.setUserAgent(userAgent);
|
||||
// this.requestLog.setRequestUrl(requestUrl);
|
||||
// this.requestLog.setIp(ip);
|
||||
// this.requestLog.setDeclaringSignature(declaringSignature);
|
||||
// this.requestLog.setArgs(args);
|
||||
// this.startTime=System.currentTimeMillis();
|
||||
// }
|
||||
// @AfterReturning(pointcut="pointcut()",returning = "returnedValue")
|
||||
// public void doAfterReturning(Object returnedValue){
|
||||
// Integer elapsedTime=(int) (System.currentTimeMillis()-this.startTime);
|
||||
// this.requestLog.setElapsedTime(elapsedTime);
|
||||
// this.requestLog.setException(null);
|
||||
// this.requestLog.setCreateTime(LocalDateTime.now());
|
||||
//
|
||||
// logger.info(this.requestLog.toString());
|
||||
// this.requestLogService.asyncSave(this.requestLog); // 异步保存到数据库
|
||||
// }
|
||||
//
|
||||
// @AfterThrowing(pointcut = "pointcut()",throwing = "throwable")
|
||||
// public void doAfterThrowing(Throwable throwable){
|
||||
// this.requestLog.setException(throwable.toString());
|
||||
// this.requestLog.setCreateTime(LocalDateTime.now());
|
||||
//
|
||||
// logger.error(this.requestLog.toString());
|
||||
// this.requestLogService.asyncSave(this.requestLog);
|
||||
// }
|
||||
//}
|
|
@ -1,7 +1,6 @@
|
|||
package com.god.base.server.util;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
|
@ -10,7 +9,6 @@ import org.springframework.context.annotation.Configuration;
|
|||
* @author 孙帅比
|
||||
*/
|
||||
@Configuration
|
||||
@MapperScan("com.god.base.server.mapper") //mapper持久层所在位置
|
||||
public class MyBatisPlusPageHelperConfig {
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue