使用的springboot 直接访问端口号
http://dev.job.audit.cnooc:8099/test
上代码:
使用的jar包:
<dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> <version>3.15</version> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml-schemas</artifactId> <version>3.15</version> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml</artifactId> <version>3.15</version> </dependency>
Controller类:
package com.cnooc.audit.job.controller; import com.alibaba.fastjson.JSONObject; import com.cnooc.audit.job.client.ORGPersonClient; import com.cnooc.audit.job.model.TestDomain; import com.cnooc.audit.job.service.AuditedOrgService; import com.cnooc.audit.utilstools.MD5Util; import org.apache.cxf.common.util.CollectionUtils; import org.apache.poi.ss.util.CellRangeAddress; import org.apache.poi.xssf.streaming.SXSSFRow; import org.apache.poi.xssf.streaming.SXSSFSheet; import org.apache.poi.xssf.streaming.SXSSFWorkbook; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.net.URLEncoder; import java.util.ArrayList; import java.util.List; import java.util.Map; @Controller @RequestMapping("/") public class TestController { @Autowired private AuditedOrgService auditedOrgService; @Autowired private ORGPersonClient orgPersonClient; @Value("${spring.application.name}") protected String APPID; @Value("${spring.application.