Pārlūkot izejas kodu

企业微信通讯录导出转译

yurk 2 gadi atpakaļ
vecāks
revīzija
3f2d53c407

+ 22 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ExpenseSheetServiceImpl.java

@@ -314,6 +314,28 @@ public class ExpenseSheetServiceImpl extends ServiceImpl<ExpenseSheetMapper, Exp
                 BigDecimal bigDecimal = new BigDecimal(0);
                 List<ExpenseItem> expenseItemList = new ArrayList<>();
                 int i=0;
+                String errorAboutProject="";
+                for (int rowIndex = 5; rowIndex <= rowNum; rowIndex++) {
+                    XSSFRow row = sheet.getRow(rowIndex);
+                    if (row == null) {
+                        continue;
+                    }
+                    //跳过空行
+                    if (ExcelUtil.isRowEmpty(row)) {
+                        continue;
+                    }
+                    //项目编号 费用日期 发拍种类 费用类型 费用金额 发票号 税率 税额 备注
+                    XSSFCell codeCell = row.getCell(0);
+                    if (codeCell != null) codeCell.setCellType(CellType.STRING);
+                    Optional<Project> project = projectList.stream().filter(pro ->(StringUtils.isEmpty(pro.getProjectCode())?"":pro.getProjectCode()).equals(codeCell.getStringCellValue())
+                            || (StringUtils.isEmpty(pro.getProjectName())?"":pro.getProjectName()).equals(codeCell.getStringCellValue())).findFirst();
+                    if (!project.isPresent()) {
+                        errorAboutProject+=codeCell.getStringCellValue()+"/";
+                    }
+                }
+                if(!errorAboutProject.equals("")){
+                    throw new Exception("项目编号/项目名称为[" +errorAboutProject+"]的项目不存在");
+                }
                 for (int rowIndex = 5; rowIndex <= rowNum; rowIndex++) {
                     XSSFRow row = sheet.getRow(rowIndex);
                     if (row == null) {
@@ -351,8 +373,6 @@ public class ExpenseSheetServiceImpl extends ServiceImpl<ExpenseSheetMapper, Exp
                             || (StringUtils.isEmpty(pro.getProjectName())?"":pro.getProjectName()).equals(codeCell.getStringCellValue())).findFirst();
                     if (project.isPresent()) {
                         expenseItem.setProjectId(project.get().getId());
-                    } else {
-                        throw new Exception("项目编号/项目名称为[" + codeCell.getStringCellValue() + "]的项目不存在");
                     }
                     expenseItem.setExpenseId(expenseSheet.getId());
                     if(happenDateCell!=null && !happenDateCell.toString().trim().equals("")){

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/UserServiceImpl.java

@@ -1499,7 +1499,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
             fos.close();
             if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
                 String mediaId = wxCorpInfoService.getTranslationMediaId(fileUrlSuffix);
-                String jobId = wxCorpInfoService.syncTranslation(mediaId,fileUrlSuffix, "pdf");
+                String jobId = wxCorpInfoService.syncTranslation(mediaId,fileUrlSuffix, null);
             /*if(jobId!=null&&!jobId.equals("")){
                 File file=new File(path + fileUrlSuffix);
                 if(file.exists()){

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/WxCorpInfoServiceImpl.java

@@ -157,7 +157,7 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
         jsonObject.put("auth_corpid",corpId);
         jsonObject.put("media_id_list",list);
         jsonObject.put("output_file_name",outPutFileName);
-        jsonObject.put("output_file_format",outputFileFormat);
+        /*jsonObject.put("output_file_format",outputFileFormat);*/
         HttpEntity<String> requestEntity = new HttpEntity<String>(jsonObject.toJSONString(), headers);
         ResponseEntity<String> responseEntity = this.restTemplate.exchange(url,
                 HttpMethod.POST, requestEntity, String.class);