diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/ding/controller/DingInfoPullController.java b/pmapi/src/main/java/com/ningdatech/pmapi/ding/controller/DingInfoPullController.java index 2ae4310..617b0a5 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/ding/controller/DingInfoPullController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/ding/controller/DingInfoPullController.java @@ -4,6 +4,8 @@ import cn.hutool.core.util.StrUtil; import cn.hutool.crypto.SecureUtil; import cn.hutool.crypto.digest.HMac; import cn.hutool.crypto.digest.MD5; +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.google.common.collect.Maps; import com.ningdatech.irs.service.IRefreshTokenService; import com.ningdatech.pmapi.common.util.CryptUtils; @@ -20,16 +22,24 @@ import com.sun.crypto.provider.HmacMD5KeyGenerator; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.springframework.beans.factory.annotation.Value; import org.springframework.http.ResponseEntity; import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; +import org.springframework.util.Assert; import org.springframework.web.bind.annotation.*; import org.springframework.web.client.RestTemplate; import javax.annotation.Resource; -import java.io.UnsupportedEncodingException; +import java.io.*; import java.nio.charset.StandardCharsets; import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; +import java.time.LocalDateTime; import java.util.Objects; /** @@ -119,9 +129,93 @@ public class DingInfoPullController { return procDefManage.initByArea(areaCode); } - @ApiOperation(value = "测试项目详情推送", notes = "测试项目详情推送") - @GetMapping("/test-push-project") - public String testPushProject(@ModelAttribute ProjectDTO projectDto) throws Exception { - return appIrsManage.pushProjectDetail(projectDto); + @ApiOperation(value = "项目详情推送", notes = "项目详情推送") + @GetMapping("/push-project") + public String pushProject() throws Exception { + File f = new File("/temp/遂昌归集项目信息(需补).xlsx"); +// File f = new File("C:\\Users\\PoffyZhang\\Desktop\\遂昌归集项目信息(需补).xlsx"); + Workbook wb = readExcel(new FileInputStream(f),f.getName()); + Assert.notNull(wb,"文件流为空"); + Row row; + Integer sucessNum = 0; + if(wb != null){ + //获取第一个sheet + Sheet sheet = wb.getSheetAt(0); + //获取最大行数 + int rownum = sheet.getPhysicalNumberOfRows(); + //获取第一行 + row = sheet.getRow(0); + //获取最大列数 + for (int i = 1; i