#
Junjie
2025-02-14 ac4341ea6b66ae02427d39d35f41d42d78b2eb2e
zy-asrs-framework/src/main/resources/templates/vue/Controller.txt
@@ -1,4 +1,4 @@
package com.zy.asrs.wms.system.controller;
package @{COMPANYNAME}.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -10,6 +10,7 @@
import com.zy.asrs.wms.common.domain.PageParam;
import @{COMPANYNAME}.entity.@{ENTITYNAME};
import @{COMPANYNAME}.service.@{ENTITYNAME}Service;
import @{ROOTPACKAGEPATH}.system.controller.BaseController;
import com.zy.asrs.wms.utils.ExcelUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
@@ -95,7 +96,11 @@
    @PreAuthorize("hasAuthority('@{ITEMNAME}:@{SIMPLEENTITYNAME}:list')")
    @PostMapping("/@{SIMPLEENTITYNAME}/export")
    public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception {
        ExcelUtil.build(ExcelUtil.create(@{SIMPLEENTITYNAME}Service.list(), @{ENTITYNAME}.class), response);
        BaseParam baseParam = buildParam(map, BaseParam.class);
        PageParam<@{ENTITYNAME}, BaseParam> pageParam = new PageParam<>(baseParam, @{ENTITYNAME}.class);
        List<@{ENTITYNAME}> data = @{SIMPLEENTITYNAME}Service.list(pageParam.buildWrapper(true));
        ExcelUtil.build(ExcelUtil.create(data, @{ENTITYNAME}.class), response);
    }
}