| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.system.query.SysOperLogQuery; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/operlog") |
| | | @Api(tags = "操作日志记录") |
| | | public class SysOperlogController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysOperLogService operLogService; |
| | | |
| | | // @RequiresPermissions("system:operlog:list") |
| | | // @GetMapping("/list") |
| | | // public TableDataInfo list(SysOperLog operLog) |
| | | // { |
| | | // startPage(); |
| | | // List<SysOperLog> list = operLogService.selectOperLogList(operLog); |
| | | // return getDataTable(list); |
| | | // } |
| | | |
| | | @ApiOperation(value = "当前车辆操作日志查询") |
| | | @PostMapping("/list") |
| | | public AjaxResult list(@RequestBody SysOperLogQuery query) |
| | | @RequiresPermissions("system:operlog:list") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysOperLog operLog) |
| | | { |
| | | LambdaQueryWrapper<SysOperLog> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.like(SysOperLog::getTitle,"车辆管理"); |
| | | wrapper.ne(SysOperLog::getBusinessType,1); |
| | | List<SysOperLog> list = operLogService.list(wrapper); |
| | | Iterator<SysOperLog> iterator = list.iterator(); |
| | | while (iterator.hasNext()){ |
| | | SysOperLog sysOperLog = iterator.next(); |
| | | String operParam = sysOperLog.getOperParam(); |
| | | JSONObject jsonObject = JSONObject.parseObject(operParam); |
| | | String carId = jsonObject.getString("carId"); |
| | | if(StringUtils.isNotEmpty(carId) && Objects.nonNull(query.getCarId()) && !carId.equals(String.valueOf(query.getCarId()))){ |
| | | iterator.remove(); |
| | | startPage(); |
| | | List<SysOperLog> list = operLogService.selectOperLogList(operLog); |
| | | return getDataTable(list); |
| | | } |
| | | } |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | |
| | | |
| | | @Log(title = "操作日志", businessType = BusinessType.EXPORT) |