//package com.example.controller; // //import cn.hutool.poi.excel.WorkbookUtil; //import com.example.config.annotation.IgnoreAuth; //import com.example.entity.OtnAreaEntity; //import com.example.entity.WzHouseContractCompareEntity; //import com.example.service.gdc.WzHouseContractCompareService; //import com.example.service.gdc.WzHouseContractTopService; //import com.example.service.gdc.WzOtnAreaService; //import com.example.utils.PageMap; //import com.example.utils.PageUtils; //import com.example.utils.R; //import org.apache.poi.ss.usermodel.Cell; //import org.apache.poi.ss.usermodel.Row; //import org.apache.poi.ss.usermodel.Sheet; //import org.apache.poi.ss.usermodel.Workbook; //import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.web.bind.annotation.PathVariable; //import org.springframework.web.bind.annotation.RequestMapping; //import org.springframework.web.bind.annotation.RestController; // //import java.io.File; //import java.text.DateFormat; //import java.text.SimpleDateFormat; //import java.util.ArrayList; //import java.util.List; // //import static com.example.utils.excel.ExcelTool.getCellValue; // ///** // * 房屋出租(合同管理) // */ //@RestController //@RequestMapping("/house-car/house/dist/api/wzOtnArea") //public class WzOtnAreaController { // // @Autowired // private WzOtnAreaService wzOtnAreaService; // @Autowired // private WzHouseContractTopService wzHouseContractTopService; // @Autowired // private WzHouseContractCompareService wzHouseContractCompareService; // // @RequestMapping("/list") // @IgnoreAuth // public R list(@RequestBody PageMap pageMap) { // //查询列表数据 // Query query = new Query(pageMap); // List list = wzOtnAreaService.queryList(query); // int total = wzOtnAreaService.queryTotal(query); // PageUtils pageUtil = new PageUtils(list, total, query.getLimit(), query.getPage()); // return R.ok().put("page", pageUtil); // } // // /** // * 查找所有的省份 // */ // @RequestMapping("/getCityOption/{id}") // @IgnoreAuth // public R getCityOption(@PathVariable("id") String id) { // List list=wzOtnAreaService.getCityOption(Long.valueOf(id)); // return R.ok().put("list",list); // } // // // /** // * 导入Excel // */ //// @PostMapping("/import") // @IgnoreAuth // public R importExcel(){ // DateFormat df = new SimpleDateFormat("yyyy-MM-dd"); // OtnAreaEntity sysConfig; // int errorIndex = 0; // try { // String[] title = new String[]{ // "使用单位层级","使用单位隶属的省级公司","使用单位隶属的地市级公司", // "使用单位隶属的区县级公司", "使用专业线","租入实际用途", // "租入其他用途说明","城市区域","地段","合同总金额(含税)(元)","租入建筑面积(平米)", "租期(年)","每平米月租金","","", // "合同编号","合同名称" // }; // File file=new File("C:\\Users\\PRO\\Desktop\\版本\\version3\\test1.xlsx"); // List list = new ArrayList(); // Workbook workbook = WorkbookUtil.createBook(file); // // 获取第一张工作表 // Sheet sheet = workbook.getSheetAt(0); // // 循环获取每一行数据 因为默认第一行为标题行,我们可以从 1 开始循环,如果需要读取标题行,从 0 开始 // // sheet.getRows() 获取总行数 // Row row; // for (int i = sheet.getFirstRowNum() + 1; i <= sheet.getLastRowNum(); i++) { // row = sheet.getRow(i); // System.out.println(i); // if (i >= 1 && row != null && row.getCell(0) != null && !row.getCell(0).toString().equals("")) { // String[] t = new String[title.length]; // for (int m = 0; m < title.length; m++) { // Cell cell = row.getCell(m); // t[m] = getCellValue(cell); // } // list.add(t); // } // } // for(int i=0;i