| | |
| | | @ApiImplicitParam(paramType = "form", name = "file", value = "文件对象", required = true, dataType = "__file") |
| | | public R<String> importContracts(@RequestPart("file") MultipartFile file) { |
| | | ImportParams params = new ImportParams(); |
| | | params.setTitleRows(1);//标题行数 |
| | | // params.setTitleRows(1);//标题行数 |
| | | params.setHeadRows(1); //表头行数 |
| | | try { |
| | | InputStream inputStream = file.getInputStream(); |
| | |
| | | List<String> errors = new ArrayList<>(); |
| | | for (TContract tContract : contractList) { |
| | | try{ |
| | | tContract.setStartTime(DateUtils.stringToLocalDateTime(tContract.getStartTimeStr() + " 00:00:00")); |
| | | tContract.setEndTime(DateUtils.stringToLocalDateTime(tContract.getEndTimeStr() + " 23:59:59")); |
| | | tContract.setStartPayTime(DateUtils.stringToLocalDateTime(tContract.getStartPayTimeStr() + " 00:00:00")); |
| | | tContract.setSignTime(DateUtils.stringToLocalDateTime(tContract.getSignTimeStr() + " 00:00:00")); |
| | | contractService.save(tContract); |
| | | if(tContract.getStatus().equals("2")){ |
| | | //发起合同新增审批 |
| | |
| | | return stringApiResult; |
| | | } catch (Exception e) { |
| | | System.out.println("合同导入失败!" + e.getMessage()); |
| | | e.printStackTrace(); |
| | | } |
| | | return R.ok(); |
| | | } |