| package com.doumee.api.business; | 
|   | 
| import com.doumee.api.BaseController; | 
| import com.doumee.core.annotation.excel.ExcelExporter; | 
| import com.doumee.core.annotation.pr.PreventRepeat; | 
| import com.doumee.core.model.ApiResponse; | 
| import com.doumee.core.model.PageData; | 
| import com.doumee.core.model.PageWrap; | 
| import com.doumee.core.utils.DateUtil; | 
| import com.doumee.dao.business.model.ActionLog; | 
| import com.doumee.dao.business.vo.GoodsorderExportVO; | 
| import com.doumee.service.business.ActionLogService; | 
| import io.swagger.annotations.Api; | 
| import io.swagger.annotations.ApiOperation; | 
| import org.apache.shiro.authz.annotation.RequiresPermissions; | 
| import org.springframework.beans.factory.annotation.Autowired; | 
| import org.springframework.web.bind.annotation.*; | 
|   | 
| import javax.servlet.http.HttpServletResponse; | 
| import java.util.ArrayList; | 
| import java.util.List; | 
|   | 
| /** | 
|  * @author 江蹄蹄 | 
|  * @date 2023/09/27 18:06 | 
|  */ | 
| @Api(tags = "系统行为操作记录表") | 
| @RestController | 
| @RequestMapping("/business/actionLog") | 
| public class ActionLogController extends BaseController { | 
|   | 
|     @Autowired | 
|     private ActionLogService actionLogService; | 
|   | 
|     @PreventRepeat | 
|     @ApiOperation("新建") | 
|     @PostMapping("/create") | 
|     @RequiresPermissions("business:actionlog:create") | 
|     public ApiResponse create(@RequestBody ActionLog actionLog) { | 
|         return ApiResponse.success(actionLogService.create(actionLog)); | 
|     } | 
|   | 
|     @ApiOperation("根据ID删除") | 
|     @GetMapping("/delete/{id}") | 
|     @RequiresPermissions("business:actionlog:delete") | 
|     public ApiResponse deleteById(@PathVariable String id) { | 
|         actionLogService.deleteById(id); | 
|         return ApiResponse.success(null); | 
|     } | 
|   | 
|     @ApiOperation("批量删除") | 
|     @GetMapping("/delete/batch") | 
|     @RequiresPermissions("business:actionlog:delete") | 
|     public ApiResponse deleteByIdInBatch(@RequestParam String ids) { | 
|         String [] idArray = ids.split(","); | 
|         List<String> idList = new ArrayList<>(); | 
|         for (String id : idArray) { | 
|             idList.add(id); | 
|         } | 
|         actionLogService.deleteByIdInBatch(idList); | 
|         return ApiResponse.success(null); | 
|     } | 
|   | 
|     @ApiOperation("根据ID修改") | 
|     @PostMapping("/updateById") | 
|     @RequiresPermissions("business:actionlog:update") | 
|     public ApiResponse updateById(@RequestBody ActionLog actionLog) { | 
|         actionLogService.updateById(actionLog); | 
|         return ApiResponse.success(null); | 
|     } | 
|   | 
|     @ApiOperation("分页查询") | 
|     @PostMapping("/page") | 
|     @RequiresPermissions("business:actionlog:query") | 
|     public ApiResponse<PageData<ActionLog>> findPage (@RequestBody PageWrap<ActionLog> pageWrap) { | 
|         return ApiResponse.success(actionLogService.findPage(pageWrap)); | 
|     } | 
|     @ApiOperation("分页查询") | 
|     @PostMapping("/findRidePae") | 
|     @RequiresPermissions("business:actionlog:query") | 
|     public ApiResponse<PageData<ActionLog>> findRidePae (@RequestBody PageWrap<ActionLog> pageWrap) { | 
|         return ApiResponse.success(actionLogService.findRidePae(pageWrap)); | 
|     } | 
|   | 
|     @ApiOperation("导出Excel") | 
|     @PostMapping("/exportExcel") | 
|     @RequiresPermissions("business:actionlog:exportExcel") | 
|     public void exportExcel (@RequestBody PageWrap<ActionLog> pageWrap, HttpServletResponse response) { | 
|         ExcelExporter.build(ActionLog.class).export(actionLogService.findPage(pageWrap).getRecords(), "系统行为操作记录表", response); | 
|     } | 
|     @ApiOperation("导出调整记录Excel") | 
|     @PostMapping("/exportRideExcel") | 
|     @RequiresPermissions("business:actionlog:exportExcel") | 
|     public void exportRideExcel (@RequestBody PageWrap<ActionLog> pageWrap, HttpServletResponse response) { | 
|         ExcelExporter.build(ActionLog.class).exportWithFirstAndEnd(actionLogService.findRidePae(pageWrap).getRecords(), "调整记录_"+System.currentTimeMillis(),"调整记录_"+ DateUtil.getPlusTime2(DateUtil.getCurrentDate()),null, response); | 
|   | 
|     } | 
|   | 
|     @ApiOperation("根据ID查询") | 
|     @GetMapping("/{id}") | 
|     @RequiresPermissions("business:actionlog:query") | 
|     public ApiResponse findById(@PathVariable String id) { | 
|         return ApiResponse.success(actionLogService.findById(id)); | 
|     } | 
| } |