Browse Source

修改导出财务薪资,不需要转译

seyason 2 years ago
parent
commit
1038d125a1

+ 20 - 7
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/FinanceServiceImpl.java

@@ -1417,7 +1417,8 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         try {
             Integer companyId = userMapper.selectById(request.getHeader("Token")).getCompanyId();
-            WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
+            TimeType timeType = timeTypeMapper.selectById(companyId);
+//            WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
             final List<FinanceTblcuscol> cusColList = financeTblcuscolMapper.selectList(new QueryWrapper<FinanceTblcuscol>().eq("company_id", companyId));
             List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId));
             Company company = companyMapper.selectById(companyId);
@@ -1436,6 +1437,9 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
 
             List<String> headList = new ArrayList<String>();
             //headList.add("姓名");
+            if (timeType.getFinanceJobnumEnabled() == 1) {
+                headList.add("工号");
+            }
             headList.add(MessageUtils.message("entry.name"));
             FinanceFixedcolname fixedItem = financeFixedcolnameService.getFixed(companyId);
             headList.add(fixedItem.getMonthCost()+"(元)");
@@ -1500,11 +1504,15 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
                     totalField3 = totalField3.add(field3Item);
                 }
                 List<String> rowData = new ArrayList<String>();
-                if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
-                    rowData.add("$userName="+(user.getCorpwxUserid()==null?"":user.getCorpwxUserid())+"$");
-                }else {
-                    rowData.add(f.getName());
+//                if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
+//                    rowData.add("$userName="+(user.getCorpwxUserid()==null?"":user.getCorpwxUserid())+"$");
+//                }else {
+//                    rowData.add(f.getName());
+//                }
+                if (timeType.getFinanceJobnumEnabled() == 1) {
+                    rowData.add(f.getJobNumber());
                 }
+                rowData.add(f.getName());
                 rowData.add(salary == null?"0":salary.setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString());
                 rowData.add(bonus == null?"0":bonus.setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString());
                 rowData.add(allowance == null?"0":allowance.setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString());
@@ -1547,7 +1555,11 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
             //合计
             List<String> sumRow = new ArrayList<String>();
             //sumRow.add("合计");;
-            sumRow.add(MessageUtils.message("entry.total"));;
+            sumRow.add(MessageUtils.message("entry.total"));
+            if (timeType.getFinanceJobnumEnabled() == 1) {
+                //多空出一行工号
+                sumRow.add("");
+            }
             sumRow.add(totalSalary.toString());
             sumRow.add(totalBonus.toString());
             sumRow.add(totalAllowance.toString());
@@ -1565,7 +1577,8 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
             //String fileName = "人员薪资_"+company.getCompanyName()+yearMonth+"_"+System.currentTimeMillis();
             String fileName = MessageUtils.message("fileName.perSal")+company.getCompanyName()+yearMonth+"_"+System.currentTimeMillis();
             try {
-                return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName , allList, path);
+                //不需要转译
+                return excelExportService.exportGeneralExcelByTitleAndList(null,fileName , allList, path);
             } catch (Exception e) {
                 e.printStackTrace();
             }