财务导出调整
This commit is contained in:
parent
6aee0e7ce9
commit
78c21667a1
@ -30,6 +30,16 @@ public @interface Excel
|
||||
*/
|
||||
public String name() default "";
|
||||
|
||||
/**
|
||||
* 是否在全部表展示, 默认true
|
||||
*/
|
||||
public boolean showAllSheet() default true;
|
||||
/**
|
||||
* 是否在第一页显示, 默认false
|
||||
*/
|
||||
public boolean showViewHome() default true;
|
||||
|
||||
|
||||
/**
|
||||
* 日期格式, 如: yyyy-MM-dd
|
||||
*/
|
||||
|
||||
@ -334,7 +334,10 @@ public class ExcelUtilSs<T>{
|
||||
for (int i = 0; i < fields2.size();i++){
|
||||
Object[] os = fields2.get(i);
|
||||
Excel excel = (Excel) os[1];
|
||||
this.createCell(excel, row, column++,index);
|
||||
Boolean show = excel.showAllSheet() ? true : (index == 0 && excel.showViewHome()) || (index != 0 && !excel.showViewHome());
|
||||
if(show){
|
||||
this.createCell(excel, row, column++,index);
|
||||
}
|
||||
}
|
||||
// 产生一行
|
||||
Integer lastIndex = (index == 0 ? list.size() :this.lists.get(index-1).size())+5;
|
||||
@ -411,9 +414,12 @@ public class ExcelUtilSs<T>{
|
||||
for (Object[] os : fields2){
|
||||
Field field = (Field) os[0];
|
||||
Excel excel = (Excel) os[1];
|
||||
// 设置实体类私有属性可访问
|
||||
field.setAccessible(true);
|
||||
this.addCell(excel, row, vo, field, column++,index);
|
||||
Boolean show = excel.showAllSheet() ? true : (index == 0 && excel.showViewHome()) || (index != 0 && !excel.showViewHome());
|
||||
if(show){
|
||||
// 设置实体类私有属性可访问
|
||||
field.setAccessible(true);
|
||||
this.addCell(excel, row, vo, field, column++,index);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,32 +10,25 @@ public class SalaryVo {
|
||||
|
||||
@Excel(name = "部门名称")
|
||||
private String deptName;
|
||||
|
||||
@Excel(name = "人数", showAllSheet = false)
|
||||
private Integer peopleNum;
|
||||
|
||||
/** 员工姓名 */
|
||||
@Excel(name = "员工姓名")
|
||||
@Excel(name = "员工姓名", showAllSheet = false, showViewHome = false)
|
||||
private String name;
|
||||
/** 员工姓名 */
|
||||
@Excel(name = "公司名称")
|
||||
@Excel(name = "公司名称", showAllSheet = false,showViewHome = false)
|
||||
private String companyName;
|
||||
// @Excel(name = "工资月份")
|
||||
// private String month;
|
||||
/** 基本工资 */
|
||||
@Excel(name = "月工资")
|
||||
private BigDecimal monthSalary;
|
||||
/** 应出勤(小时) */
|
||||
@Excel(name = "应出勤(小时)")
|
||||
@Excel(name = "应出勤(小时)", showAllSheet = false, showViewHome = false)
|
||||
private BigDecimal shouldAttendance;
|
||||
/** 实出勤(小时) */
|
||||
@Excel(name = "实出勤(小时)")
|
||||
@Excel(name = "实出勤(小时)", showAllSheet = false, showViewHome = false)
|
||||
private BigDecimal realAttendance;
|
||||
// /** 基本工资 */
|
||||
// @Excel(name = "基本工资")
|
||||
// private BigDecimal basicSalary;
|
||||
// /** 岗位工资 */
|
||||
// @Excel(name = "岗位工资")
|
||||
// private BigDecimal jobSalary;
|
||||
// /** 加班工资 */
|
||||
// @Excel(name = "加班工资")
|
||||
// private BigDecimal overtimeSalary;
|
||||
/** 学历补助 */
|
||||
@Excel(name = "学历补助")
|
||||
private BigDecimal levelSubsidies;
|
||||
|
||||
@ -243,7 +243,9 @@ public class RzSalaryDetailServiceImpl extends ServiceImpl<RzSalaryDetailMapper,
|
||||
List<String> sheetCompanyNames = Collections.asList(companyDataList.keySet()).stream().sorted((x,y) -> {
|
||||
if(x.equals("河北伊特")){
|
||||
return -1;
|
||||
}else{
|
||||
}else if(y.equals("河北伊特")){
|
||||
return 1;
|
||||
}else {
|
||||
return x.compareTo(y);
|
||||
}
|
||||
}).collect(Collectors.toList());
|
||||
@ -265,6 +267,7 @@ public class RzSalaryDetailServiceImpl extends ServiceImpl<RzSalaryDetailMapper,
|
||||
List<SalaryVo> depts = deptDataList.get(sheetDeptName);
|
||||
SalaryVo result = sumSalaryVo(depts);
|
||||
result.setDeptName(sheetDeptName);
|
||||
result.setPeopleNum(depts.size());
|
||||
allList.add(result);
|
||||
SalaryVo hjResult = new SalaryVo();
|
||||
BeanUtils.copyProperties(result,hjResult);
|
||||
@ -274,17 +277,29 @@ public class RzSalaryDetailServiceImpl extends ServiceImpl<RzSalaryDetailMapper,
|
||||
deptLists.add(depts);
|
||||
}
|
||||
SalaryVo result = sumSalaryVo(allList);
|
||||
result.setDeptName("小计");
|
||||
allList.add(result);
|
||||
}else{
|
||||
SalaryVo result = sumSalaryVo(dataList);
|
||||
result.setDeptName(sheetCompanyName+"总计");
|
||||
result.setPeopleNum(dataList.size());
|
||||
allList.add(result);
|
||||
|
||||
SalaryVo hjResult = new SalaryVo();
|
||||
BeanUtils.copyProperties(result,hjResult);
|
||||
//处理公司的合计
|
||||
hjResult.setDeptName("合计");
|
||||
hjResult.setPeopleNum(dataList.size());
|
||||
List<SalaryVo> sortList = dataList.stream().sorted((x,y) -> {return x.getDeptName().compareTo(y.getDeptName()); }).collect(Collectors.toList());
|
||||
sortList.add(hjResult);
|
||||
companyLists.add(sortList);
|
||||
}else{
|
||||
SalaryVo result = sumSalaryVo(dataList);
|
||||
result.setDeptName(sheetCompanyName+"总计");
|
||||
result.setPeopleNum(dataList.size());
|
||||
allList.add(result);
|
||||
|
||||
SalaryVo hjResult = new SalaryVo();
|
||||
BeanUtils.copyProperties(result,hjResult);
|
||||
//处理公司的合计
|
||||
hjResult.setDeptName("合计");
|
||||
hjResult.setPeopleNum(dataList.size());
|
||||
dataList.add(hjResult);
|
||||
companyLists.add(dataList);
|
||||
}
|
||||
@ -293,7 +308,7 @@ public class RzSalaryDetailServiceImpl extends ServiceImpl<RzSalaryDetailMapper,
|
||||
SalaryVo result = sumSalaryVo(allList.stream().filter(d->!d.getDeptName().equals("小计")).collect(Collectors.toList()));
|
||||
result.setDeptName("总计");
|
||||
allList.add(result);
|
||||
allSheetNames.remove("河北伊特");
|
||||
// allSheetNames.remove("河北伊特");
|
||||
companyLists.addAll(deptLists);
|
||||
return util.exportExcel(allList,companyLists,"总表", allSheetNames, new SimpleDateFormat("yyyy-MM").format(rzSalaryDetail.getMonth())+"月工资汇总表", "制表: "+"审核: "+"经理签字: "+"总经理签字:");
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user