Browse Source

财务核算成本下载模板不需要转译

seyason 2 years ago
parent
commit
39fd8d1253

+ 3 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/FinanceController.java

@@ -140,7 +140,7 @@ public class FinanceController {
 
         List<String> heads = new ArrayList<>();
         Company company = companyMapper.selectById(companyId);
-        WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
+//        WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
         //判断是否启用了工号模式
         TimeType timeType = timeTypeMapper.selectById(companyId);
         if (timeType.getFinanceJobnumEnabled() == 1) {
@@ -165,7 +165,8 @@ public class FinanceController {
         allList.add(heads);
         //String fileName = company.getCompanyName()+"_财务人员成本模板";
         String fileName = MessageUtils.message("fileName.financialCost",company.getCompanyName());
-        return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo, fileName, allList, path);
+        //导出模板不需要转译,不传wxCorpInfo
+        return excelExportService.exportGeneralExcelByTitleAndList(null, fileName, allList, path);
     }
     @RequestMapping("/batchRemove")
     public HttpRespMsg batchRemove(String ids){

+ 4 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/FinanceServiceImpl.java

@@ -207,7 +207,9 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
                 boolean includeJobNumber = (timeType.getFinanceJobnumEnabled() == 1);
                 if (includeJobNumber) {
                     jobNumberCell = row.getCell(0);
-                    jobNumberCell.setCellType(CellType.STRING);
+                    if (jobNumberCell != null) {
+                        jobNumberCell.setCellType(CellType.STRING);
+                    }
                     nameStartIndex = 1;
                 }
                 Cell nameCell = row.getCell(nameStartIndex + 0);
@@ -238,7 +240,7 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
                 finance.setCompanyId(companyId);
                 finance.setName(name);
                 if (includeJobNumber) {
-                    finance.setJobNumber(jobNumberCell.getStringCellValue());
+                    finance.setJobNumber(jobNumberCell!=null?jobNumberCell.getStringCellValue():null);
                     if (StringUtils.isEmpty(finance.getJobNumber())) {
                         msg.setError(MessageUtils.message("staff.jobNoNull"));
                         return msg;

BIN
fhKeeper/formulahousekeeper/management-platform/src/main/resources/upload/项目任务导入模板.xlsx