考勤导入,多语言
This commit is contained in:
parent
29e81e03c2
commit
0a7334ddef
|
|
@ -6,6 +6,7 @@ import com.engine.salary.entity.datacollection.dto.AddUpDeductionDTO;
|
|||
import com.engine.salary.entity.datacollection.dto.AddUpDeductionRecordDTO;
|
||||
import com.engine.salary.entity.datacollection.param.AddUpDeductionQueryParam;
|
||||
import com.engine.salary.mapper.datacollection.AddUpDeductionMapper;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
|
|
@ -31,7 +32,8 @@ public class AddUpDeductionBiz extends BaseBean {
|
|||
try {
|
||||
AddUpDeductionMapper mapper = sqlSession.getMapper(AddUpDeductionMapper.class);
|
||||
List<AddUpDeductionDTO> list = mapper.list(param);
|
||||
list = encryptUtil.decryptList(list, AddUpDeductionDTO.class);
|
||||
encryptUtil.decryptList(list, AddUpDeductionDTO.class);
|
||||
SalaryI18nUtil.i18nList(list);
|
||||
return list;
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.engine.salary.entity.datacollection.dto.AttendQuoteDataBaseDTO;
|
|||
import com.engine.salary.entity.datacollection.param.AttendQuoteDataQueryParam;
|
||||
import com.engine.salary.entity.datacollection.po.AttendQuoteDataPO;
|
||||
import com.engine.salary.mapper.datacollection.AttendQuoteDataMapper;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
|
|
@ -17,7 +18,8 @@ public class AttendQuoteDataBiz {
|
|||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
AttendQuoteDataMapper mapper = sqlSession.getMapper(AttendQuoteDataMapper.class);
|
||||
return mapper.list(param);
|
||||
List<AttendQuoteDataBaseDTO> list = mapper.list(param);
|
||||
return SalaryI18nUtil.i18nList(list);
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ public class AddUpDeductionDTO {
|
|||
@ExcelProperty(index = 0)
|
||||
@SalaryTableColumn(text = "姓名", width = "10%", column = "username")
|
||||
@TableTitle(title = "姓名", dataIndex = "username", key = "username")
|
||||
@I18n
|
||||
private String username;
|
||||
|
||||
/**
|
||||
|
|
@ -64,6 +65,7 @@ public class AddUpDeductionDTO {
|
|||
@ExcelProperty(index = 2)
|
||||
@SalaryTableColumn(text = "部门", width = "10%", column = "departmentName")
|
||||
@TableTitle(title = "部门", dataIndex = "departmentName", key = "departmentName")
|
||||
@I18n
|
||||
private String departmentName;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.entity.datacollection.dto;
|
||||
|
||||
import com.engine.salary.annotation.I18n;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -34,11 +35,13 @@ public class AttendQuoteDataBaseDTO {
|
|||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@I18n
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 部门
|
||||
*/
|
||||
@I18n
|
||||
private String departmentName;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ import com.engine.salary.util.SalaryI18nUtil;
|
|||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.engine.salary.util.excel.ExcelComment;
|
||||
import com.engine.salary.util.excel.ExcelParseHelper;
|
||||
import com.engine.salary.util.excel.ExcelSupport;
|
||||
import com.engine.salary.util.excel.ExcelUtil;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.page.SalaryPageUtil;
|
||||
|
|
@ -54,6 +55,7 @@ import com.google.common.collect.Maps;
|
|||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.Validate;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.util.IOUtils;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import weaver.file.ImageFileManager;
|
||||
|
|
@ -67,6 +69,7 @@ import java.util.*;
|
|||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.engine.salary.constant.SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY;
|
||||
import static com.engine.salary.util.excel.ExcelSupport.EXCEL_TYPE_XLSX;
|
||||
|
||||
/**
|
||||
* 累计专项
|
||||
|
|
@ -700,12 +703,12 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
.map(TaxAgentManageRangeEmployeeDTO::getTaxAgentName).collect(Collectors.toList());
|
||||
String name = declareMonthStr + " " + StringUtils.join(taxAgentNames, ",");
|
||||
LoggerContext<AddUpDeduction> loggerContext = new LoggerContext<>();
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setTargetName(name);
|
||||
loggerContext.setOperateType(OperateTypeEnum.CLEAR.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "一键清空"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "累计专项附加扣除") + "-" + SalaryI18nUtil
|
||||
.getI18nLabel(0, "一键清空:") + name);
|
||||
loggerContext.setUser(user);
|
||||
SalaryElogConfig.addUpDeductionLoggerTemplate.write(loggerContext);
|
||||
}
|
||||
|
||||
|
|
@ -939,14 +942,17 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
Validate.notBlank(imageId, "imageId为空");
|
||||
|
||||
InputStream fileInputStream = null;
|
||||
|
||||
try {
|
||||
fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(imageId));
|
||||
List<AddUpDeductionDTO> addUpDeductions = ExcelParseHelper.parse2Map(fileInputStream, AddUpDeductionDTO.class, 0, 1, 14, "addUpDeductionTemplate.xlsx");
|
||||
apidatas.put("preview", addUpDeductions);
|
||||
Sheet sheet = ExcelSupport.parseFile(fileInputStream, 0, EXCEL_TYPE_XLSX);
|
||||
apidatas.put("headers", ExcelSupport.getSheetHeader(sheet, 0));
|
||||
apidatas.put("list", ExcelParseHelper.parse2List(sheet, 1, 0));
|
||||
return apidatas;
|
||||
|
||||
} finally {
|
||||
IOUtils.closeQuietly(fileInputStream);
|
||||
}
|
||||
return apidatas;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ import com.engine.salary.util.SalaryI18nUtil;
|
|||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.engine.salary.util.excel.ExcelComment;
|
||||
import com.engine.salary.util.excel.ExcelParseHelper;
|
||||
import com.engine.salary.util.excel.ExcelSupport;
|
||||
import com.engine.salary.util.excel.ExcelUtil;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.page.SalaryPageUtil;
|
||||
|
|
@ -48,6 +49,7 @@ import com.google.common.collect.Lists;
|
|||
import com.google.common.collect.Maps;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.util.IOUtils;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import weaver.file.ImageFileManager;
|
||||
|
|
@ -63,6 +65,7 @@ import java.util.*;
|
|||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.engine.salary.constant.SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY;
|
||||
import static com.engine.salary.util.excel.ExcelSupport.EXCEL_TYPE_XLSX;
|
||||
|
||||
public class AddUpSituationServiceImpl extends Service implements AddUpSituationService {
|
||||
private EncryptUtil encryptUtil = new EncryptUtil();
|
||||
|
|
@ -507,12 +510,13 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
|||
InputStream fileInputStream = null;
|
||||
try {
|
||||
fileInputStream = ImageFileManager.getInputStreamById(Integer.valueOf(imageId));
|
||||
List<AddUpSituationDTO> excelDates = ExcelParseHelper.parse2Map(fileInputStream, AddUpSituationDTO.class, 0, 1, 25, "template.xlsx");
|
||||
apidatas.put("preview", excelDates);
|
||||
Sheet sheet = ExcelSupport.parseFile(fileInputStream, 0, EXCEL_TYPE_XLSX);
|
||||
apidatas.put("headers", ExcelSupport.getSheetHeader(sheet, 0));
|
||||
apidatas.put("list", ExcelParseHelper.parse2List(sheet, 1, 0));
|
||||
return apidatas;
|
||||
} finally {
|
||||
IOUtils.closeQuietly(fileInputStream);
|
||||
}
|
||||
return apidatas;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ import com.engine.salary.util.SalaryI18nUtil;
|
|||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.engine.salary.util.excel.ExcelComment;
|
||||
import com.engine.salary.util.excel.ExcelParseHelper;
|
||||
import com.engine.salary.util.excel.ExcelSupport;
|
||||
import com.engine.salary.util.excel.ExcelUtil;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.page.SalaryPageUtil;
|
||||
|
|
@ -45,6 +46,7 @@ import com.google.common.collect.Maps;
|
|||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.Validate;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.util.IOUtils;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import weaver.file.ImageFileManager;
|
||||
|
|
@ -59,6 +61,7 @@ import java.util.*;
|
|||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.engine.salary.constant.SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY;
|
||||
import static com.engine.salary.util.excel.ExcelSupport.EXCEL_TYPE_XLSX;
|
||||
|
||||
public class OtherDeductionServiceImpl extends Service implements OtherDeductionService {
|
||||
private EncryptUtil encryptUtil = new EncryptUtil();
|
||||
|
|
@ -165,12 +168,13 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
|
|||
InputStream fileInputStream = null;
|
||||
try {
|
||||
fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(imageId));
|
||||
List<OtherDeductionListDTO> OtherDeductions = ExcelParseHelper.parse2Map(fileInputStream, OtherDeductionListDTO.class, 0, 1, 12, "OtherDeductionTemplate.xlsx");
|
||||
apidatas.put("preview", OtherDeductions);
|
||||
Sheet sheet = ExcelSupport.parseFile(fileInputStream, 0, EXCEL_TYPE_XLSX);
|
||||
apidatas.put("headers", ExcelSupport.getSheetHeader(sheet, 0));
|
||||
apidatas.put("list", ExcelParseHelper.parse2List(sheet, 1, 0));
|
||||
return apidatas;
|
||||
} finally {
|
||||
IOUtils.closeQuietly(fileInputStream);
|
||||
}
|
||||
return apidatas;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -472,7 +476,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
|
|||
public XSSFWorkbook export(OtherDeductionQueryParam param) {
|
||||
|
||||
//获取操作按钮资源
|
||||
List<List<Object>> rowList = getExcelRowList(param,true);
|
||||
List<List<Object>> rowList = getExcelRowList(param, true);
|
||||
|
||||
// 记录日志
|
||||
String name = SalaryI18nUtil.getI18nLabel(0, "导出");
|
||||
|
|
@ -1004,7 +1008,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
|
|||
// 1.工作簿名称
|
||||
String sheetName = SalaryI18nUtil.getI18nLabel(101604, "其他免税扣除导入模板");
|
||||
//获取操作按钮资源
|
||||
List<List<Object>> rowList = getExcelRowList(param,param.isHasData());
|
||||
List<List<Object>> rowList = getExcelRowList(param, param.isHasData());
|
||||
|
||||
// 4.注释
|
||||
List<ExcelComment> excelComments = Lists.newArrayList();
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ import com.engine.salary.util.SalaryEntityUtil;
|
|||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.engine.salary.util.excel.ExcelParseHelper;
|
||||
import com.engine.salary.util.excel.ExcelSupport;
|
||||
import com.engine.salary.util.excel.ExcelUtil;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.page.SalaryPageUtil;
|
||||
|
|
@ -44,6 +45,7 @@ import com.google.common.collect.Maps;
|
|||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.Validate;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.util.IOUtils;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import weaver.file.ImageFileManager;
|
||||
|
|
@ -57,6 +59,7 @@ import java.util.*;
|
|||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.engine.salary.constant.SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY;
|
||||
import static com.engine.salary.util.excel.ExcelSupport.EXCEL_TYPE_XLSX;
|
||||
|
||||
public class SpecialAddDeductionServiceImpl extends Service implements SpecialAddDeductionService {
|
||||
private EncryptUtil encryptUtil = new EncryptUtil();
|
||||
|
|
@ -162,14 +165,13 @@ public class SpecialAddDeductionServiceImpl extends Service implements SpecialAd
|
|||
InputStream fileInputStream = null;
|
||||
try {
|
||||
fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(imageId));
|
||||
List<SpecialAddDeductionListDTO> SpecialAddDeductions =
|
||||
ExcelParseHelper.parse2Map(fileInputStream, SpecialAddDeductionListDTO.class, 0, 1, 14,
|
||||
"SpecialAddDeductionTemplate.xlsx");
|
||||
apidatas.put("preview", SpecialAddDeductions);
|
||||
Sheet sheet = ExcelSupport.parseFile(fileInputStream, 0, EXCEL_TYPE_XLSX);
|
||||
apidatas.put("headers", ExcelSupport.getSheetHeader(sheet, 0));
|
||||
apidatas.put("list", ExcelParseHelper.parse2List(sheet, 1, 0));
|
||||
return apidatas;
|
||||
} finally {
|
||||
IOUtils.closeQuietly(fileInputStream);
|
||||
}
|
||||
return apidatas;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue