|
|
|
@ -1,33 +1,31 @@ |
|
|
|
|
package com.cjy.traceability.module.traceability.controller.admin.company; |
|
|
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
import javax.annotation.Resource; |
|
|
|
|
import org.springframework.validation.annotation.Validated; |
|
|
|
|
import org.springframework.security.access.prepost.PreAuthorize; |
|
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag; |
|
|
|
|
import io.swagger.v3.oas.annotations.Parameter; |
|
|
|
|
import io.swagger.v3.oas.annotations.Operation; |
|
|
|
|
|
|
|
|
|
import javax.validation.constraints.*; |
|
|
|
|
import javax.validation.*; |
|
|
|
|
import javax.servlet.http.*; |
|
|
|
|
import java.util.*; |
|
|
|
|
import java.io.IOException; |
|
|
|
|
|
|
|
|
|
import com.cjy.traceability.framework.common.pojo.CommonResult; |
|
|
|
|
import com.cjy.traceability.framework.common.pojo.PageParam; |
|
|
|
|
import com.cjy.traceability.framework.common.pojo.PageResult; |
|
|
|
|
import com.cjy.traceability.framework.common.pojo.CommonResult; |
|
|
|
|
import com.cjy.traceability.framework.common.util.object.BeanUtils; |
|
|
|
|
import static com.cjy.traceability.framework.common.pojo.CommonResult.success; |
|
|
|
|
|
|
|
|
|
import com.cjy.traceability.framework.excel.core.util.ExcelUtils; |
|
|
|
|
|
|
|
|
|
import com.cjy.traceability.framework.operatelog.core.annotations.OperateLog; |
|
|
|
|
import static com.cjy.traceability.framework.operatelog.core.enums.OperateTypeEnum.*; |
|
|
|
|
|
|
|
|
|
import com.cjy.traceability.module.traceability.controller.admin.company.vo.*; |
|
|
|
|
import com.cjy.traceability.module.traceability.controller.admin.company.vo.CompanyPageReqVO; |
|
|
|
|
import com.cjy.traceability.module.traceability.controller.admin.company.vo.CompanyRespVO; |
|
|
|
|
import com.cjy.traceability.module.traceability.controller.admin.company.vo.CompanySaveReqVO; |
|
|
|
|
import com.cjy.traceability.module.traceability.dal.dataobject.company.CompanyDO; |
|
|
|
|
import com.cjy.traceability.module.traceability.service.company.CompanyService; |
|
|
|
|
import io.swagger.v3.oas.annotations.Operation; |
|
|
|
|
import io.swagger.v3.oas.annotations.Parameter; |
|
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag; |
|
|
|
|
import org.springframework.security.access.prepost.PreAuthorize; |
|
|
|
|
import org.springframework.validation.annotation.Validated; |
|
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
|
import javax.validation.Valid; |
|
|
|
|
import java.io.IOException; |
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
import static com.cjy.traceability.framework.common.pojo.CommonResult.success; |
|
|
|
|
import static com.cjy.traceability.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; |
|
|
|
|
|
|
|
|
|
@Tag(name = "管理后台 - 企业信息 ") |
|
|
|
|
@RestController |
|
|
|
@ -84,12 +82,19 @@ public class CompanyController { |
|
|
|
|
@PreAuthorize("@ss.hasPermission('traceability:company:export')") |
|
|
|
|
@OperateLog(type = EXPORT) |
|
|
|
|
public void exportCompanyExcel(@Valid CompanyPageReqVO pageReqVO, |
|
|
|
|
HttpServletResponse response) throws IOException { |
|
|
|
|
HttpServletResponse response) throws IOException { |
|
|
|
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); |
|
|
|
|
List<CompanyDO> list = companyService.getCompanyPage(pageReqVO).getList(); |
|
|
|
|
// 导出 Excel
|
|
|
|
|
ExcelUtils.write(response, "企业信息 .xls", "数据", CompanyRespVO.class, |
|
|
|
|
BeanUtils.toBean(list, CompanyRespVO.class)); |
|
|
|
|
BeanUtils.toBean(list, CompanyRespVO.class)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@GetMapping("/all") |
|
|
|
|
@Operation(summary = "查询企业全部信息") |
|
|
|
|
public CommonResult<List<CompanyRespVO>> getCompanyList() { |
|
|
|
|
CompanyPageReqVO reqVO = new CompanyPageReqVO(); |
|
|
|
|
PageResult<CompanyDO> pageResult = companyService.getCompanyPage(reqVO); |
|
|
|
|
return success(BeanUtils.toBean(pageResult.getList(),CompanyRespVO.class)); |
|
|
|
|
} |
|
|
|
|
} |