下载模板时带出数据
This commit is contained in:
parent
a70a2061a5
commit
417c9f703d
|
|
@ -6,6 +6,7 @@ import com.engine.salary.entity.datacollection.dto.AddUpSituationDTO;
|
|||
import com.engine.salary.entity.datacollection.dto.AddUpSituationRecordDTO;
|
||||
import com.engine.salary.entity.datacollection.param.AddUpSituationQueryParam;
|
||||
import com.engine.salary.mapper.datacollection.AddUpSituationMapper;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
|
|
@ -30,7 +31,8 @@ public class AddUpSituationBiz extends BaseBean {
|
|||
try {
|
||||
AddUpSituationMapper mapper = sqlSession.getMapper(AddUpSituationMapper.class);
|
||||
List<AddUpSituationDTO> list = mapper.list(param);
|
||||
return encryptUtil.decryptList(list, AddUpSituationDTO.class);
|
||||
encryptUtil.decryptList(list, AddUpSituationDTO.class);
|
||||
return SalaryI18nUtil.i18nList(list);
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
|
|
@ -46,15 +48,15 @@ public class AddUpSituationBiz extends BaseBean {
|
|||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
AddUpSituationMapper mapper = sqlSession.getMapper(AddUpSituationMapper.class);
|
||||
if(CollectionUtils.isNotEmpty(param.getEmployeeIds())){
|
||||
if (CollectionUtils.isNotEmpty(param.getEmployeeIds())) {
|
||||
List<AddUpSituation> addUpSituations = new ArrayList<>();
|
||||
List<List<Long>> partition = Lists.partition((List<Long>) param.getEmployeeIds(), 500);
|
||||
partition.forEach(l->{
|
||||
partition.forEach(l -> {
|
||||
param.setEmployeeIds(l);
|
||||
addUpSituations.addAll(mapper.listSome(param));
|
||||
});
|
||||
return encryptUtil.decryptList(addUpSituations, AddUpSituation.class);
|
||||
}else {
|
||||
return encryptUtil.decryptList(addUpSituations, AddUpSituation.class);
|
||||
} else {
|
||||
List<AddUpSituation> addUpSituations = mapper.listSome(param);
|
||||
return encryptUtil.decryptList(addUpSituations, AddUpSituation.class);
|
||||
}
|
||||
|
|
@ -143,9 +145,6 @@ public class AddUpSituationBiz extends BaseBean {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public void handleImportData(List<AddUpSituation> pos) {
|
||||
if (CollectionUtils.isEmpty(pos)) {
|
||||
return;
|
||||
|
|
@ -188,10 +187,9 @@ public class AddUpSituationBiz extends BaseBean {
|
|||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @description 批量删除数据
|
||||
* @return void
|
||||
* @description 批量删除数据
|
||||
* @author Harryxzy
|
||||
* @date 2022/10/27 22:39
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -51,7 +51,8 @@ public class SpecialAddDeductionBiz extends BaseBean {
|
|||
|
||||
public List<SpecialAddDeductionListDTO> listByParam(SpecialAddDeductionQueryParam param) {
|
||||
List<SpecialAddDeductionListDTO> specialAddDeductionListDTOS = mapper().listByParam(param);
|
||||
return encryptUtil.decryptList(specialAddDeductionListDTOS, SpecialAddDeductionListDTO.class);
|
||||
encryptUtil.decryptList(specialAddDeductionListDTOS, SpecialAddDeductionListDTO.class);
|
||||
return SalaryI18nUtil.i18nList(specialAddDeductionListDTOS);
|
||||
}
|
||||
|
||||
public List<SpecialAddDeductionPO> listByTaxAgentIds(List<Long> taxAgentIds) {
|
||||
|
|
|
|||
|
|
@ -1,10 +1,7 @@
|
|||
package com.engine.salary.entity.datacollection.dto;
|
||||
|
||||
import com.cloudstore.eccom.pc.table.WeaTableType;
|
||||
import com.engine.salary.annotation.Encrypt;
|
||||
import com.engine.salary.annotation.SalaryTable;
|
||||
import com.engine.salary.annotation.SalaryTableColumn;
|
||||
import com.engine.salary.annotation.TableTitle;
|
||||
import com.engine.salary.annotation.*;
|
||||
import com.engine.salary.util.excel.ExcelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
|
@ -31,6 +28,7 @@ public class AddUpDeductionRecordDTO {
|
|||
private Long employeeId;
|
||||
|
||||
@ExcelProperty(index = 0)
|
||||
@I18n
|
||||
private String username;
|
||||
|
||||
//申报月份
|
||||
|
|
@ -56,6 +54,7 @@ public class AddUpDeductionRecordDTO {
|
|||
@SalaryTableColumn(text = "部门", width = "10%", column = "departmentName")
|
||||
@TableTitle(title = "部门", dataIndex = "departmentName", key = "departmentName")
|
||||
@ExcelProperty(index = 3)
|
||||
@I18n
|
||||
private String departmentName;
|
||||
|
||||
//手机号
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ public class AddUpSituationDTO {
|
|||
@SalaryTableColumn(text = "姓名", width = "10%", column = "username")
|
||||
@TableTitle(title = "姓名", dataIndex = "username", key = "username")
|
||||
@ExcelProperty(index = 0)
|
||||
@I18n
|
||||
private String username;
|
||||
//
|
||||
// @SalaryTableColumn(text = "申报月份", width = "10%", column = "username")
|
||||
|
|
@ -59,6 +60,7 @@ public class AddUpSituationDTO {
|
|||
@SalaryTableColumn(text = "部门", width = "10%", column = "departmentName")
|
||||
@TableTitle(title = "部门", dataIndex = "departmentName", key = "departmentName")
|
||||
@ExcelProperty(index = 2)
|
||||
@I18n
|
||||
private String departmentName;
|
||||
|
||||
//手机号
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ public class OtherDeductionListDTO {
|
|||
@SalaryTableColumn(text = "姓名", width = "10%", column = "username")
|
||||
@TableTitle(title = "姓名", dataIndex = "username", key = "username")
|
||||
@ExcelProperty(index = 0)
|
||||
@I18n
|
||||
private String username;
|
||||
|
||||
//个税扣缴义务人
|
||||
|
|
@ -54,6 +55,7 @@ public class OtherDeductionListDTO {
|
|||
@SalaryTableColumn(text = "部门", width = "10%", column = "departmentName")
|
||||
@TableTitle(title = "部门", dataIndex = "departmentName", key = "departmentName")
|
||||
@ExcelProperty(index = 2)
|
||||
@I18n
|
||||
private String departmentName;
|
||||
|
||||
//手机号
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ public class SpecialAddDeductionListDTO {
|
|||
@SalaryTableColumn(text = "姓名", width = "10%", column = "username")
|
||||
@TableTitle(title = "姓名", dataIndex = "username", key = "username")
|
||||
@ExcelProperty(index = 0)
|
||||
@I18n
|
||||
private String username;
|
||||
|
||||
//个税扣缴义务人
|
||||
|
|
@ -54,6 +55,7 @@ public class SpecialAddDeductionListDTO {
|
|||
@SalaryTableColumn(text = "部门", width = "10%", column = "departmentName")
|
||||
@TableTitle(title = "部门", dataIndex = "departmentName", key = "departmentName")
|
||||
@ExcelProperty(index = 2)
|
||||
@I18n
|
||||
private String departmentName;
|
||||
|
||||
//手机号
|
||||
|
|
|
|||
|
|
@ -67,4 +67,7 @@ public class AddUpDeductionQueryParam extends BaseQueryParam {
|
|||
|
||||
//累计专项附加扣除id(获取明细)
|
||||
private Long accumulatedSpecialAdditionalDeductionId;
|
||||
|
||||
//下载模板时是否带出现有数据
|
||||
private boolean hasData;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,4 +62,7 @@ public class AddUpSituationQueryParam extends BaseQueryParam {
|
|||
|
||||
//累计情况id(获取明细)
|
||||
private Long accumulatedSituationId;
|
||||
|
||||
//下载模板时是否带出现有数据
|
||||
private boolean hasData;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,4 +58,8 @@ public class OtherDeductionQueryParam extends BaseQueryParam {
|
|||
|
||||
//其他免税扣除id(获取明细)
|
||||
private Long otherTaxExemptDeductionId;
|
||||
|
||||
|
||||
//下载模板是否带数据
|
||||
private boolean hasData;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,4 +54,7 @@ public class SpecialAddDeductionQueryParam extends BaseQueryParam {
|
|||
|
||||
//其他免税扣除id(获取明细)
|
||||
private Long specialAddDeductionId;
|
||||
|
||||
//下载模板是否带数据
|
||||
private boolean hasData;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,10 +78,9 @@ public interface AddUpDeductionService {
|
|||
/**
|
||||
* 导出
|
||||
*
|
||||
* @param isChief
|
||||
* @param queryParam
|
||||
*/
|
||||
XSSFWorkbook export(boolean isChief, AddUpDeductionQueryParam queryParam);
|
||||
XSSFWorkbook export( AddUpDeductionQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 导出详情
|
||||
|
|
|
|||
|
|
@ -234,7 +234,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
String workcode = dto.getJobNum();
|
||||
|
||||
//筛选导入人员信息可以在人力资源池中匹配到的人员信息
|
||||
List<DataCollectionEmployee> employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(confValue,employees, userName, deparmentName, mobile, workcode, null);
|
||||
List<DataCollectionEmployee> employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(confValue, employees, userName, deparmentName, mobile, workcode, null);
|
||||
|
||||
if (StringUtils.isBlank(userName) && "0".equals(confValue)) {
|
||||
//姓名 不能为空
|
||||
|
|
@ -422,7 +422,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
String formatYearMonth = SalaryDateUtil.getFormatYearMonth(po.getDeclareMonth());
|
||||
LoggerContext loggerContext = new LoggerContext();
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel( 0, "累计专项附加扣除 ") + formatYearMonth);
|
||||
loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "累计专项附加扣除 ") + formatYearMonth);
|
||||
loggerContext.setOperateType(OperateTypeEnum.ADD.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "导入"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "导入累计专项附加扣除 ") + formatYearMonth);
|
||||
|
|
@ -445,7 +445,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
throw new SalaryRunTimeException("该数据不存在!");
|
||||
}
|
||||
Long taxAgentId = byId.getTaxAgentId();
|
||||
boolean canEdit = taxAgentList.stream().anyMatch(t -> Objects.equals(t.getTaxAgentId() , taxAgentId));
|
||||
boolean canEdit = taxAgentList.stream().anyMatch(t -> Objects.equals(t.getTaxAgentId(), taxAgentId));
|
||||
if (!canEdit) {
|
||||
//没有编辑权限
|
||||
throw new SalaryRunTimeException("该个税扣缴义务人无权限编辑此数据!");
|
||||
|
|
@ -490,7 +490,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
|
||||
//税款所属期
|
||||
String declareMonthStr = addUpDeductionRecordParam.getDeclareMonth();
|
||||
if (declareMonthStr .equals("")) {
|
||||
if (declareMonthStr.equals("")) {
|
||||
throw new SalaryRunTimeException("税款所属期不能为空!");
|
||||
}
|
||||
// 获取所有个税扣缴义务人
|
||||
|
|
@ -518,7 +518,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
.updateTime(now)
|
||||
.creator((long) user.getUID())
|
||||
.declareMonth(declareMonth).build();
|
||||
boolean employeeSameId = employees.stream().anyMatch(e -> Objects.equals(e.getEmployeeId() , addUpDeductionRecordParam.getEmployeeId()));
|
||||
boolean employeeSameId = employees.stream().anyMatch(e -> Objects.equals(e.getEmployeeId(), addUpDeductionRecordParam.getEmployeeId()));
|
||||
if (!employeeSameId) {
|
||||
throw new SalaryRunTimeException("员工信息不存在");
|
||||
}
|
||||
|
|
@ -617,7 +617,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
throw new SalaryRunTimeException("数据不存在或已被删除!");
|
||||
}
|
||||
// 判断是否在个税扣缴义务人范围内
|
||||
Optional<TaxAgentManageRangeEmployeeDTO> first = taxAgentList.stream().filter(m -> Objects.equals(m.getTaxAgentId() , byId.getTaxAgentId())).findFirst();
|
||||
Optional<TaxAgentManageRangeEmployeeDTO> first = taxAgentList.stream().filter(m -> Objects.equals(m.getTaxAgentId(), byId.getTaxAgentId())).findFirst();
|
||||
if (!first.isPresent()) {
|
||||
throw new SalaryRunTimeException("个税扣缴义务人不存在或不在权限范围内");
|
||||
}
|
||||
|
|
@ -635,7 +635,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
|
||||
//记录日志
|
||||
if (CollectionUtils.isNotEmpty(oldAddUpDeductions)) {
|
||||
oldAddUpDeductions.stream().forEach( e -> {
|
||||
oldAddUpDeductions.stream().forEach(e -> {
|
||||
LoggerContext<AddUpDeduction> loggerContext = new LoggerContext<>();
|
||||
loggerContext.setTargetId(e.getId().toString());
|
||||
loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "累计专项附加扣除") + "-" + e.getId());
|
||||
|
|
@ -669,7 +669,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
if (deleteParam.getTaxAgentId() != null && (!deleteParam.getTaxAgentId().equals(""))) {
|
||||
// 设置了个税扣缴义务人
|
||||
Long taxAgentId = SalaryEntityUtil.string2Long(deleteParam.getTaxAgentId());
|
||||
boolean canDelete = taxAgentIds.stream().anyMatch(t -> Objects.equals(t , taxAgentId));
|
||||
boolean canDelete = taxAgentIds.stream().anyMatch(t -> Objects.equals(t, taxAgentId));
|
||||
if (!canDelete) {
|
||||
throw new SalaryRunTimeException("个税扣缴义务人不存在或不在权限范围内!");
|
||||
}
|
||||
|
|
@ -732,12 +732,12 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
@Override
|
||||
public String autoAddAll(Date yearMonth, Boolean isAdmin) {
|
||||
String cacheKey = "addUpDeduction_autoAddAll_processing";
|
||||
Object objVal = Util_DataCache.getObjVal( cacheKey);
|
||||
if(objVal != null){
|
||||
Object objVal = Util_DataCache.getObjVal(cacheKey);
|
||||
if (objVal != null) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(135788, "一键累计过于频繁,请稍后再试"));
|
||||
}
|
||||
try {
|
||||
Util_DataCache.setObjVal(cacheKey,true );
|
||||
Util_DataCache.setObjVal(cacheKey, true);
|
||||
//如果是定时任务直接查询所有,isAdmin传true
|
||||
boolean isChief = Boolean.TRUE.equals(isAdmin)
|
||||
|| getTaxAgentService(user).isChief((long) user.getUID());
|
||||
|
|
@ -844,10 +844,10 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
String yearMonthStr = SalaryDateUtil.getFormatYearMonth(yearMonth);
|
||||
LoggerContext loggerContext = new LoggerContext();
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "一键累计 "+yearMonthStr));
|
||||
loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "一键累计 " + yearMonthStr));
|
||||
loggerContext.setOperateType(OperateTypeEnum.ADD.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "一键累计专项附加扣除"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "一键累计 "+ yearMonthStr +" 专项附加扣除"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "一键累计 " + yearMonthStr + " 专项附加扣除"));
|
||||
loggerContext.setNewValueList(updateList);
|
||||
SalaryElogConfig.addUpDeductionLoggerTemplate.write(loggerContext);
|
||||
}
|
||||
|
|
@ -1138,24 +1138,16 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
SalaryI18nUtil.getI18nLabel(105142, "累计婴幼儿照护")
|
||||
};
|
||||
|
||||
List<String> dataIndexList = Lists.newArrayList("username", "taxAgentName", "departmentName", "mobile", "workcode", "idNo", "hiredate", "billMonth", "supplementaryMonth");
|
||||
List<Object> headerList = Arrays.asList(header);
|
||||
|
||||
//查询当前申报月份和个税扣缴义务人的累计专项附加扣除表数据
|
||||
List<Map<String, Object>> resultMapList = getAddUpDeductionDate(queryParam);
|
||||
// excel导出的数据
|
||||
List<List<Object>> rows = Lists.newArrayListWithExpectedSize(resultMapList.size());
|
||||
|
||||
List<List<Object>> rows = new ArrayList<>();
|
||||
rows.add(headerList);
|
||||
for (Map<String, Object> map : resultMapList) {
|
||||
List<Object> row = Lists.newArrayListWithExpectedSize(headerList.size());
|
||||
for (String dataIndex : dataIndexList) {
|
||||
row.add(map.getOrDefault(dataIndex, StringUtils.EMPTY));
|
||||
}
|
||||
rows.add(row);
|
||||
if (queryParam.isHasData()) {
|
||||
List<List<Object>> datas = getLists(queryParam);
|
||||
rows.addAll(datas);
|
||||
}
|
||||
|
||||
|
||||
// 4.注释
|
||||
List<ExcelComment> excelComments = Lists.newArrayList();
|
||||
excelComments.add(new ExcelComment(0, 0, 3, 2, SalaryI18nUtil.getI18nLabel(100344, "必填")));
|
||||
|
|
@ -1173,46 +1165,18 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
return book;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当前申报月份和个税扣缴义务人的累计专项附加扣除表数据
|
||||
*/
|
||||
private List<Map<String, Object>> getAddUpDeductionDate(AddUpDeductionQueryParam queryParam) {
|
||||
|
||||
List<Map<String, Object>> resultList = new ArrayList<>();
|
||||
|
||||
//申报月份
|
||||
List<String> declareMonth = queryParam.getDeclareMonth();
|
||||
if (CollectionUtils.isNotEmpty(declareMonth)) {
|
||||
queryParam.setDeclareMonth(declareMonth.stream().map(e -> e + "-01 00:00:00").collect(Collectors.toList()));
|
||||
queryParam.setDeclareMonthDate(declareMonth.stream().map(e -> e + "-01 00:00:00").map(SalaryDateUtil::dateStrToLocalTime).collect(Collectors.toList()));
|
||||
}
|
||||
List<AddUpDeductionDTO> list = new AddUpDeductionBiz().list(queryParam);
|
||||
|
||||
for (AddUpDeductionDTO dto : list) {
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
resultMap.put("username", Util.null2String(dto.getUsername()));
|
||||
resultMap.put("departmentName", Util.null2String(dto.getDepartmentName()));
|
||||
resultMap.put("mobile", Util.null2String(dto.getMobile()));
|
||||
resultMap.put("workcode", Util.null2String(dto.getJobNum()));
|
||||
resultMap.put("taxAgentName", Util.null2String(dto.getTaxAgentName()));
|
||||
if (dto.getIdNo() != null) {
|
||||
resultMap.put("idNo", Util.null2String(dto.getIdNo()));
|
||||
}
|
||||
if (dto.getHiredate() != null) {
|
||||
resultMap.put("hiredate", Util.null2String(dto.getHiredate()));
|
||||
}
|
||||
|
||||
resultList.add(resultMap);
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public XSSFWorkbook export(boolean isChief, AddUpDeductionQueryParam queryParam) {
|
||||
public XSSFWorkbook export(AddUpDeductionQueryParam queryParam) {
|
||||
//excel标题
|
||||
List<Object> title = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "入职日期", "累计子女教育", "累计继续教育", "累计住房贷款利息", "累计住房租金", "累计赡养老人", "累计大病医疗", "累计婴幼儿照护");
|
||||
|
||||
//获取操作按钮资源
|
||||
List<List<String>> rowList = getExcelRowList(isChief, queryParam);
|
||||
List<List<Object>> dataRowList = getLists(queryParam);
|
||||
|
||||
List<List<Object>> rowList = new ArrayList<>();
|
||||
rowList.add(title);
|
||||
|
||||
rowList.addAll(dataRowList);
|
||||
|
||||
// 记录日志
|
||||
String name = SalaryI18nUtil.getI18nLabel(0, "导出");
|
||||
|
|
@ -1225,22 +1189,12 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
SalaryElogConfig.addUpDeductionLoggerTemplate.write(loggerContext);
|
||||
|
||||
//获取excel
|
||||
return ExcelUtil.genWorkbook(rowList, "累计专项附加扣除");
|
||||
return ExcelUtil.genWorkbookV2(rowList, "累计专项附加扣除");
|
||||
}
|
||||
|
||||
private List<List<Object>> getLists(AddUpDeductionQueryParam param) {
|
||||
|
||||
/**
|
||||
* 获取excel数据行
|
||||
*
|
||||
* @return 导出数据行集合
|
||||
*/
|
||||
private List<List<String>> getExcelRowList(boolean isChief, AddUpDeductionQueryParam param) {
|
||||
Long employeeId = (long) user.getUID();
|
||||
|
||||
//excel标题
|
||||
List<String> title = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "入职日期", "累计子女教育", "累计继续教育", "累计住房贷款利息", "累计住房租金", "累计赡养老人", "累计大病医疗", "累计婴幼儿照护");
|
||||
|
||||
|
||||
long uid = user.getUID();
|
||||
//排序配置
|
||||
OrderRuleVO orderRule = getSalarySysConfService(user).orderRule();
|
||||
param.setOrderRule(orderRule);
|
||||
|
|
@ -1248,9 +1202,9 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
List<AddUpDeductionDTO> list = new AddUpDeductionBiz().list(param);
|
||||
|
||||
// 开启分权并且不是薪酬模块总管理员
|
||||
if (getTaxAgentService(user).isOpenDevolution() && !isChief) {
|
||||
List<TaxAgentEmployeeDTO> taxAgentEmployees = getTaxAgentService(user).listTaxAgentAndEmployee(employeeId);
|
||||
List<Long> taxAgentIdsAsAdmin = getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId).stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
||||
if (getTaxAgentService(user).isNeedAuth(uid)) {
|
||||
List<TaxAgentEmployeeDTO> taxAgentEmployees = getTaxAgentService(user).listTaxAgentAndEmployee(uid);
|
||||
List<Long> taxAgentIdsAsAdmin = getTaxAgentService(user).listAllTaxAgentsAsAdmin(uid).stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
||||
list = list.stream().filter(f ->
|
||||
// 作为管理员
|
||||
taxAgentIdsAsAdmin.contains(f.getTaxAgentId())
|
||||
|
|
@ -1259,11 +1213,10 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
final List<List<String>> dataRowList = Optional.ofNullable(list)
|
||||
List<List<Object>> dataRowList = Optional.ofNullable(list)
|
||||
.map(List::stream)
|
||||
.map(operatorStream -> operatorStream.map(dto -> {
|
||||
List<String> cellList = new ArrayList<>();
|
||||
List<Object> cellList = new ArrayList<>();
|
||||
cellList.add(Util.null2String(dto.getUsername()));
|
||||
cellList.add(Util.null2String(dto.getTaxAgentName()));
|
||||
cellList.add(Util.null2String(dto.getDepartmentName()));
|
||||
|
|
@ -1281,11 +1234,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
return cellList;
|
||||
}).collect(Collectors.toList()))
|
||||
.orElse(Collections.emptyList());
|
||||
|
||||
List<List<String>> rowList = new ArrayList<>();
|
||||
rowList.add(title);
|
||||
rowList.addAll(dataRowList);
|
||||
return rowList;
|
||||
return dataRowList;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -260,7 +260,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
|||
@Override
|
||||
public XSSFWorkbook export(AddUpSituationQueryParam queryParam) {
|
||||
// 获取操作按钮资源
|
||||
List<List<String>> rowList = getExcelRowList(queryParam);
|
||||
List<List<Object>> rowList = getExcelRowList(queryParam, true);
|
||||
|
||||
// 记录日志
|
||||
String name = SalaryI18nUtil.getI18nLabel(0, "导出");
|
||||
|
|
@ -273,7 +273,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
|||
SalaryElogConfig.addUpSituationLoggerTemplate.write(loggerContext);
|
||||
|
||||
// 获取excel
|
||||
return ExcelUtil.genWorkbook(rowList, "累计情况");
|
||||
return ExcelUtil.genWorkbookV2(rowList, "累计情况");
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -282,62 +282,65 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
|||
*
|
||||
* @return 导出数据行集合
|
||||
*/
|
||||
private List<List<String>> getExcelRowList(AddUpSituationQueryParam param) {
|
||||
private List<List<Object>> getExcelRowList(AddUpSituationQueryParam param, boolean hasData) {
|
||||
long employeeId = user.getUID();
|
||||
// excel标题
|
||||
final List<String> title = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "入职日期", "累计收入额", "累计减除费用",
|
||||
final List<Object> title = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "入职日期", "累计收入额", "累计减除费用",
|
||||
"累计社保个人合计", "累计公积金个人合计", "累计子女教育", "累计继续教育", "累计住房贷款利息", "累计住房租金", "累计赡养老人",
|
||||
"累计大病医疗", "累计企业(职业)年金及其他福利", "累计其他扣除", "累计免税收入", "累计准予扣除的捐赠额", "累计减免税额", "累计已预扣预缴税额", "累计婴幼儿照护", "累计个人养老金");
|
||||
|
||||
//排序配置
|
||||
OrderRuleVO orderRule = getSalarySysConfService(user).orderRule();
|
||||
param.setOrderRule(orderRule);
|
||||
List<AddUpSituationDTO> list = biz.list(param);
|
||||
// 开启分权并且不是薪酬模块总管理员
|
||||
if (getTaxAgentService(user).isOpenDevolution() && !getTaxAgentService(user).isChief(employeeId)) {
|
||||
List<Long> taxAgentIdsAsAdmin = getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId).stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
||||
list = list.stream().filter(f ->
|
||||
taxAgentIdsAsAdmin.contains(f.getTaxAgentId())
|
||||
).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
final List<List<String>> dataRowList = Optional.ofNullable(list)
|
||||
.map(List::stream)
|
||||
.map(operatorStream -> operatorStream.map(dto -> {
|
||||
List<String> cellList = new ArrayList<>();
|
||||
cellList.add(Util.null2String(dto.getUsername()));
|
||||
cellList.add(Util.null2String(dto.getTaxAgentName()));
|
||||
cellList.add(Util.null2String(dto.getDepartmentName()));
|
||||
cellList.add(Util.null2String(dto.getMobile()));
|
||||
cellList.add(Util.null2String(dto.getJobNum()));
|
||||
cellList.add(Util.null2String(dto.getIdNo()));
|
||||
cellList.add(Util.null2String(dto.getHiredate()));
|
||||
cellList.add(Util.null2String(dto.getAddUpIncome()));
|
||||
cellList.add(Util.null2String(dto.getAddUpSubtraction()));
|
||||
cellList.add(Util.null2String(dto.getAddUpSocialSecurityTotal()));
|
||||
cellList.add(Util.null2String(dto.getAddUpAccumulationFundTotal()));
|
||||
cellList.add(Util.null2String(dto.getAddUpChildEducation()));
|
||||
cellList.add(Util.null2String(dto.getAddUpContinuingEducation()));
|
||||
cellList.add(Util.null2String(dto.getAddUpHousingLoanInterest()));
|
||||
cellList.add(Util.null2String(dto.getAddUpHousingRent()));
|
||||
cellList.add(Util.null2String(dto.getAddUpSupportElderly()));
|
||||
cellList.add(Util.null2String(dto.getAddUpIllnessMedical()));
|
||||
cellList.add(Util.null2String(dto.getAddUpEnterpriseAndOther()));
|
||||
cellList.add(Util.null2String(dto.getAddUpOtherDeduction()));
|
||||
cellList.add(Util.null2String(dto.getAddUpTaxExemptIncome()));
|
||||
cellList.add(Util.null2String(dto.getAddUpAllowedDonation()));
|
||||
cellList.add(Util.null2String(dto.getAddUpTaxSavings()));
|
||||
cellList.add(Util.null2String(dto.getAddUpAdvanceTax()));
|
||||
cellList.add(Util.null2String(dto.getAddUpInfantCare()));
|
||||
cellList.add(Util.null2String(dto.getAddUpPrivatePension()));
|
||||
return cellList;
|
||||
}).collect(Collectors.toList()))
|
||||
.orElse(Collections.emptyList());
|
||||
|
||||
List<List<String>> rowList = new ArrayList<>();
|
||||
List<List<Object>> rowList = new ArrayList<>();
|
||||
rowList.add(title);
|
||||
rowList.addAll(dataRowList);
|
||||
|
||||
if (hasData) {
|
||||
//排序配置
|
||||
OrderRuleVO orderRule = getSalarySysConfService(user).orderRule();
|
||||
param.setOrderRule(orderRule);
|
||||
List<AddUpSituationDTO> list = biz.list(param);
|
||||
// 开启分权并且不是薪酬模块总管理员
|
||||
if (getTaxAgentService(user).isOpenDevolution() && !getTaxAgentService(user).isChief(employeeId)) {
|
||||
List<Long> taxAgentIdsAsAdmin = getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId).stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
||||
list = list.stream().filter(f ->
|
||||
taxAgentIdsAsAdmin.contains(f.getTaxAgentId())
|
||||
).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
final List<List<Object>> dataRowList = Optional.ofNullable(list)
|
||||
.map(List::stream)
|
||||
.map(operatorStream -> operatorStream.map(dto -> {
|
||||
List<Object> cellList = new ArrayList<>();
|
||||
cellList.add(Util.null2String(dto.getUsername()));
|
||||
cellList.add(Util.null2String(dto.getTaxAgentName()));
|
||||
cellList.add(Util.null2String(dto.getDepartmentName()));
|
||||
cellList.add(Util.null2String(dto.getMobile()));
|
||||
cellList.add(Util.null2String(dto.getJobNum()));
|
||||
cellList.add(Util.null2String(dto.getIdNo()));
|
||||
cellList.add(Util.null2String(dto.getHiredate()));
|
||||
cellList.add(Util.null2String(dto.getAddUpIncome()));
|
||||
cellList.add(Util.null2String(dto.getAddUpSubtraction()));
|
||||
cellList.add(Util.null2String(dto.getAddUpSocialSecurityTotal()));
|
||||
cellList.add(Util.null2String(dto.getAddUpAccumulationFundTotal()));
|
||||
cellList.add(Util.null2String(dto.getAddUpChildEducation()));
|
||||
cellList.add(Util.null2String(dto.getAddUpContinuingEducation()));
|
||||
cellList.add(Util.null2String(dto.getAddUpHousingLoanInterest()));
|
||||
cellList.add(Util.null2String(dto.getAddUpHousingRent()));
|
||||
cellList.add(Util.null2String(dto.getAddUpSupportElderly()));
|
||||
cellList.add(Util.null2String(dto.getAddUpIllnessMedical()));
|
||||
cellList.add(Util.null2String(dto.getAddUpEnterpriseAndOther()));
|
||||
cellList.add(Util.null2String(dto.getAddUpOtherDeduction()));
|
||||
cellList.add(Util.null2String(dto.getAddUpTaxExemptIncome()));
|
||||
cellList.add(Util.null2String(dto.getAddUpAllowedDonation()));
|
||||
cellList.add(Util.null2String(dto.getAddUpTaxSavings()));
|
||||
cellList.add(Util.null2String(dto.getAddUpAdvanceTax()));
|
||||
cellList.add(Util.null2String(dto.getAddUpInfantCare()));
|
||||
cellList.add(Util.null2String(dto.getAddUpPrivatePension()));
|
||||
return cellList;
|
||||
}).collect(Collectors.toList()))
|
||||
.orElse(Collections.emptyList());
|
||||
|
||||
rowList.addAll(dataRowList);
|
||||
}
|
||||
return rowList;
|
||||
}
|
||||
|
||||
|
|
@ -446,88 +449,8 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
|||
@Override
|
||||
public XSSFWorkbook downloadTemplate(AddUpSituationQueryParam queryParam) {
|
||||
String sheetName = SalaryI18nUtil.getI18nLabel(101605, "往期累计情况导入模板");
|
||||
String[] header = {
|
||||
SalaryI18nUtil.getI18nLabel(85429, "姓名"),
|
||||
SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人"),
|
||||
SalaryI18nUtil.getI18nLabel(86185, "部门"),
|
||||
SalaryI18nUtil.getI18nLabel(86186, "手机号"),
|
||||
SalaryI18nUtil.getI18nLabel(86317, "工号"),
|
||||
SalaryI18nUtil.getI18nLabel(86318, "证件号码"),
|
||||
SalaryI18nUtil.getI18nLabel(86319, "入职日期"),
|
||||
SalaryI18nUtil.getI18nLabel(86712, "累计收入额"),
|
||||
SalaryI18nUtil.getI18nLabel(86711, "累计减除费用"),
|
||||
SalaryI18nUtil.getI18nLabel(86710, "累计社保个人合计"),
|
||||
SalaryI18nUtil.getI18nLabel(86709, "累计公积金个人合计"),
|
||||
SalaryI18nUtil.getI18nLabel(86321, "累计子女教育"),
|
||||
SalaryI18nUtil.getI18nLabel(86323, "累计继续教育"),
|
||||
SalaryI18nUtil.getI18nLabel(86324, "累计住房贷款利息"),
|
||||
SalaryI18nUtil.getI18nLabel(86325, "累计住房租金"),
|
||||
SalaryI18nUtil.getI18nLabel(86326, "累计赡养老人"),
|
||||
SalaryI18nUtil.getI18nLabel(105142, "累计大病医疗"),
|
||||
SalaryI18nUtil.getI18nLabel(90567, "累计企业(职业)年金及其他福利"),
|
||||
SalaryI18nUtil.getI18nLabel(93902, "累计其他免税扣除"),
|
||||
SalaryI18nUtil.getI18nLabel(86704, "累计免税收入"),
|
||||
SalaryI18nUtil.getI18nLabel(86703, "累计准予扣除的捐赠额"),
|
||||
SalaryI18nUtil.getI18nLabel(105478, "累计减免税额"),
|
||||
SalaryI18nUtil.getI18nLabel(86702, "累计已预扣预缴税额"),
|
||||
SalaryI18nUtil.getI18nLabel(86702, "累计婴幼儿照护"),
|
||||
SalaryI18nUtil.getI18nLabel(86702, "累计个人养老金")
|
||||
};
|
||||
// 2.表头
|
||||
List<Object> headerList = Arrays.asList(header);
|
||||
List<List<Object>> rows = new ArrayList<>();
|
||||
rows.add(headerList);
|
||||
|
||||
// // 获取累计情况
|
||||
// List<String> taxYearMonth = queryParam.getTaxYearMonth();
|
||||
// if (CollectionUtils.isNotEmpty(taxYearMonth)) {
|
||||
// queryParam.setTaxYearMonth(taxYearMonth.stream().map(e -> e + "-01 00:00:00").collect(Collectors.toList()));
|
||||
// queryParam.setTaxYearMonthDate(taxYearMonth.stream().map(e -> e + "-01 00:00:00").map(SalaryDateUtil::dateStrToLocalTime).collect(Collectors.toList()));
|
||||
// }
|
||||
|
||||
// 开启分权并且不是薪酬模块总管理员
|
||||
List<AddUpSituationDTO> list = getAddUpSituationMapper().list(queryParam);
|
||||
long employeeId = user.getUID();
|
||||
if (getTaxAgentService(user).isOpenDevolution() && !getTaxAgentService(user).isChief(employeeId)) {
|
||||
List<Long> taxAgentIdsAsAdmin = getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId).stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
||||
list = list.stream().filter(f ->
|
||||
taxAgentIdsAsAdmin.contains(f.getTaxAgentId())
|
||||
).collect(Collectors.toList());
|
||||
}
|
||||
// // 人员信息赋值
|
||||
// list.forEach(m -> {
|
||||
// // todo 身份证号
|
||||
// m.setIdNo("");
|
||||
// });
|
||||
//
|
||||
for (AddUpSituationDTO dto : list) {
|
||||
List<Object> row = new ArrayList<>();
|
||||
row.add(Util.null2String(dto.getUsername()));
|
||||
row.add(Util.null2String(dto.getTaxAgentName()));
|
||||
row.add(Util.null2String(dto.getDepartmentName()));
|
||||
row.add(Util.null2String(dto.getMobile()));
|
||||
row.add(Util.null2String(dto.getJobNum()));
|
||||
row.add(Util.null2String(dto.getIdNo()));
|
||||
row.add(Util.null2String(dto.getHiredate()));
|
||||
// row.add(Util.null2String(dto.getAddUpIncome()));
|
||||
// row.add(Util.null2String(dto.getAddUpSubtraction()));
|
||||
// row.add(Util.null2String(dto.getAddUpSocialSecurityTotal()));
|
||||
// row.add(Util.null2String(dto.getAddUpAccumulationFundTotal()));
|
||||
// row.add(Util.null2String(dto.getAddUpChildEducation()));
|
||||
// row.add(Util.null2String(dto.getAddUpContinuingEducation()));
|
||||
// row.add(Util.null2String(dto.getAddUpHousingLoanInterest()));
|
||||
// row.add(Util.null2String(dto.getAddUpHousingRent()));
|
||||
// row.add(Util.null2String(dto.getAddUpSupportElderly()));
|
||||
// row.add(Util.null2String(dto.getAddUpIllnessMedical()));
|
||||
// row.add(Util.null2String(dto.getAddUpEnterpriseAndOther()));
|
||||
// row.add(Util.null2String(dto.getAddUpOtherDeduction()));
|
||||
// row.add(Util.null2String(dto.getAddUpTaxExemptIncome()));
|
||||
// row.add(Util.null2String(dto.getAddUpAllowedDonation()));
|
||||
// row.add(Util.null2String(dto.getAddUpTaxSavings()));
|
||||
// row.add(Util.null2String(dto.getAddUpAdvanceTax()));
|
||||
// row.add(Util.null2String(dto.getAddUpInfantCare()));
|
||||
rows.add(row);
|
||||
}
|
||||
// 获取操作按钮资源
|
||||
List<List<Object>> rowList = getExcelRowList(queryParam, queryParam.isHasData());
|
||||
// 4.注释
|
||||
List<ExcelComment> excelComments = Lists.newArrayList();
|
||||
excelComments.add(new ExcelComment(0, 0, 3, 2, SalaryI18nUtil.getI18nLabel(100344, "必填")));
|
||||
|
|
@ -551,7 +474,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
|||
excelComments.add(new ExcelComment(23, 0, 28, 2, SalaryI18nUtil.getI18nLabel(100344, "输入数字")));
|
||||
excelComments.add(new ExcelComment(24, 0, 29, 2, SalaryI18nUtil.getI18nLabel(100344, "输入数字")));
|
||||
|
||||
return ExcelUtil.genWorkbookV2(rows, sheetName, excelComments);
|
||||
return ExcelUtil.genWorkbookV2(rowList, sheetName, excelComments);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -681,7 +604,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
|||
String workcode = dto.getJobNum();
|
||||
|
||||
//筛选导入人员信息可以在人力资源池中匹配到的人员信息
|
||||
List<DataCollectionEmployee> employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(confValue,employees, userName, deparmentName, mobile, workcode, null);
|
||||
List<DataCollectionEmployee> employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(confValue, employees, userName, deparmentName, mobile, workcode, null);
|
||||
|
||||
//当人员信息导入筛选的全局配置为"0"时,姓名才是必填项
|
||||
if (StringUtils.isBlank(userName) && "0".equals(confValue)) {
|
||||
|
|
|
|||
|
|
@ -250,7 +250,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
|
|||
List<Long> employeeSameIds = new ArrayList<>();
|
||||
|
||||
//筛选导入人员信息可以在人力资源池中匹配到的人员信息
|
||||
List<DataCollectionEmployee> emps = getSalaryEmployeeService(user).matchImportEmployee(confValue,employees, userName, deparmentName, mobile, workcode, null);
|
||||
List<DataCollectionEmployee> emps = getSalaryEmployeeService(user).matchImportEmployee(confValue, employees, userName, deparmentName, mobile, workcode, null);
|
||||
//含在职和离职,选在职数据
|
||||
if (CollectionUtils.isNotEmpty(emps) && emps.size() > 1) {
|
||||
employeeSameIds = emps.stream()
|
||||
|
|
@ -434,13 +434,13 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
|
|||
if (CollectionUtils.isNotEmpty(updateList)) {
|
||||
LoggerContext loggerContext = new LoggerContext<>();
|
||||
loggerContext.setUser(user);
|
||||
if (updateList.size() ==1) {
|
||||
if (updateList.size() == 1) {
|
||||
loggerContext.setTargetId(updateList.get(0).getId().toString());
|
||||
}
|
||||
loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel( 0, "其他免税扣除"));
|
||||
loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "其他免税扣除"));
|
||||
loggerContext.setOperateType(OperateTypeEnum.ADD.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel( 0, "新增"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel( 0, "新增其他免税扣除"));
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "新增"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "新增其他免税扣除"));
|
||||
loggerContext.setNewValueList(updateList);
|
||||
SalaryElogConfig.otherDeductionLoggerTemplate.write(loggerContext);
|
||||
}
|
||||
|
|
@ -472,7 +472,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
|
|||
public XSSFWorkbook export(OtherDeductionQueryParam param) {
|
||||
|
||||
//获取操作按钮资源
|
||||
List<List<String>> rowList = getExcelRowList(param);
|
||||
List<List<Object>> rowList = getExcelRowList(param,true);
|
||||
|
||||
// 记录日志
|
||||
String name = SalaryI18nUtil.getI18nLabel(0, "导出");
|
||||
|
|
@ -485,7 +485,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
|
|||
SalaryElogConfig.otherDeductionLoggerTemplate.write(loggerContext);
|
||||
|
||||
//获取excel
|
||||
return ExcelUtil.genWorkbook(rowList, "其他免税扣除");
|
||||
return ExcelUtil.genWorkbookV2(rowList, "其他免税扣除");
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -494,56 +494,53 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
|
|||
*
|
||||
* @return 导出数据行集合
|
||||
*/
|
||||
private List<List<String>> getExcelRowList(OtherDeductionQueryParam param) {
|
||||
private List<List<Object>> getExcelRowList(OtherDeductionQueryParam param, boolean hasData) {
|
||||
long employeeId = user.getUID();
|
||||
//excel标题
|
||||
List<String> title = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "入职日期", "商业健康保险", "税延养老保险", "其他", "准予扣除的捐赠额", "个人养老金");
|
||||
//排序配置
|
||||
OrderRuleVO orderRule = getSalarySysConfService(user).orderRule();
|
||||
param.setOrderRule(orderRule);
|
||||
|
||||
//申报月份
|
||||
List<String> declareMonth = param.getDeclareMonth();
|
||||
if (CollectionUtils.isNotEmpty(declareMonth)) {
|
||||
param.setDeclareMonth(declareMonth.stream().map(e -> e + "-01 00:00:00").collect(Collectors.toList()));
|
||||
param.setDeclareMonthDate(declareMonth.stream().map(e -> e + "-01 00:00:00").map(SalaryDateUtil::dateStrToLocalTime).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
List<OtherDeductionListDTO> list = getOtherDeductionMapper().list(param);
|
||||
encryptUtil.decryptList(list, OtherDeductionListDTO.class);
|
||||
// 开启分权并且不是薪酬模块总管理员
|
||||
if (getTaxAgentService(user).isOpenDevolution() && !getTaxAgentService(user).isChief(employeeId)) {
|
||||
List<Long> taxAgentIdsAsAdmin = getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId).stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
||||
list = list.stream().filter(f ->
|
||||
// 作为管理员
|
||||
taxAgentIdsAsAdmin.contains(f.getTaxAgentId())
|
||||
).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
final List<List<String>> dataRowList = Optional.ofNullable(list)
|
||||
.map(List::stream)
|
||||
.map(operatorStream -> operatorStream.map(dto -> {
|
||||
List<String> cellList = new ArrayList<>();
|
||||
cellList.add(Util.null2String(dto.getUsername()));
|
||||
cellList.add(Util.null2String(dto.getTaxAgentName()));
|
||||
cellList.add(Util.null2String(dto.getDepartmentName()));
|
||||
cellList.add(Util.null2String(dto.getMobile()));
|
||||
cellList.add(Util.null2String(dto.getJobNum()));
|
||||
cellList.add(Util.null2String(dto.getIdNo()));
|
||||
cellList.add(Util.null2String(dto.getHiredate()));
|
||||
cellList.add(Util.null2String(dto.getBusinessHealthyInsurance()));
|
||||
cellList.add(Util.null2String(dto.getTaxDelayEndowmentInsurance()));
|
||||
cellList.add(Util.null2String(dto.getOtherDeduction()));
|
||||
cellList.add(Util.null2String(dto.getDeductionAllowedDonation()));
|
||||
cellList.add(Util.null2String(dto.getPrivatePension()));
|
||||
return cellList;
|
||||
}).collect(Collectors.toList()))
|
||||
.orElse(Collections.emptyList());
|
||||
|
||||
List<List<String>> rowList = new ArrayList<>();
|
||||
List<Object> title = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "入职日期", "商业健康保险", "税延养老保险", "其他", "准予扣除的捐赠额", "个人养老金");
|
||||
List<List<Object>> rowList = new ArrayList<>();
|
||||
rowList.add(title);
|
||||
rowList.addAll(dataRowList);
|
||||
|
||||
if (hasData) {
|
||||
//排序配置
|
||||
OrderRuleVO orderRule = getSalarySysConfService(user).orderRule();
|
||||
param.setOrderRule(orderRule);
|
||||
|
||||
List<OtherDeductionListDTO> list = getOtherDeductionMapper().list(param);
|
||||
encryptUtil.decryptList(list, OtherDeductionListDTO.class);
|
||||
SalaryI18nUtil.i18nList(list);
|
||||
// 开启分权并且不是薪酬模块总管理员
|
||||
if (getTaxAgentService(user).isOpenDevolution() && !getTaxAgentService(user).isChief(employeeId)) {
|
||||
List<Long> taxAgentIdsAsAdmin = getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId).stream().map(TaxAgentPO::getId).collect(Collectors.toList());
|
||||
list = list.stream().filter(f ->
|
||||
// 作为管理员
|
||||
taxAgentIdsAsAdmin.contains(f.getTaxAgentId())
|
||||
).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
final List<List<Object>> dataRowList = Optional.ofNullable(list)
|
||||
.map(List::stream)
|
||||
.map(operatorStream -> operatorStream.map(dto -> {
|
||||
List<Object> cellList = new ArrayList<>();
|
||||
cellList.add(Util.null2String(dto.getUsername()));
|
||||
cellList.add(Util.null2String(dto.getTaxAgentName()));
|
||||
cellList.add(Util.null2String(dto.getDepartmentName()));
|
||||
cellList.add(Util.null2String(dto.getMobile()));
|
||||
cellList.add(Util.null2String(dto.getJobNum()));
|
||||
cellList.add(Util.null2String(dto.getIdNo()));
|
||||
cellList.add(Util.null2String(dto.getHiredate()));
|
||||
cellList.add(Util.null2String(dto.getBusinessHealthyInsurance()));
|
||||
cellList.add(Util.null2String(dto.getTaxDelayEndowmentInsurance()));
|
||||
cellList.add(Util.null2String(dto.getOtherDeduction()));
|
||||
cellList.add(Util.null2String(dto.getDeductionAllowedDonation()));
|
||||
cellList.add(Util.null2String(dto.getPrivatePension()));
|
||||
return cellList;
|
||||
}).collect(Collectors.toList()))
|
||||
.orElse(Collections.emptyList());
|
||||
|
||||
rowList.addAll(dataRowList);
|
||||
}
|
||||
|
||||
return rowList;
|
||||
}
|
||||
|
||||
|
|
@ -988,13 +985,13 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
|
|||
});
|
||||
|
||||
if (CollectionUtils.isNotEmpty(updatetInfo)) {
|
||||
String yearMonthStr = SalaryDateUtil.getFormatYearMonth(lastMonth.toLocalDate()) ;
|
||||
String yearMonthStr = SalaryDateUtil.getFormatYearMonth(lastMonth.toLocalDate());
|
||||
LoggerContext loggerContext = new LoggerContext();
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "沿用上月 "+yearMonthStr));
|
||||
loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "沿用上月 " + yearMonthStr));
|
||||
loggerContext.setOperateType(OperateTypeEnum.ADD.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "沿用上月其他免税扣除"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "沿用上月 "+ yearMonthStr +" 其他免税扣除"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "沿用上月 " + yearMonthStr + " 其他免税扣除"));
|
||||
loggerContext.setNewValueList(updatetInfo);
|
||||
SalaryElogConfig.otherDeductionLoggerTemplate.write(loggerContext);
|
||||
}
|
||||
|
|
@ -1006,23 +1003,8 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
|
|||
public XSSFWorkbook downloadTemplate(OtherDeductionQueryParam param) {
|
||||
// 1.工作簿名称
|
||||
String sheetName = SalaryI18nUtil.getI18nLabel(101604, "其他免税扣除导入模板");
|
||||
String[] header = {
|
||||
SalaryI18nUtil.getI18nLabel(85429, "姓名"),
|
||||
SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人"),
|
||||
SalaryI18nUtil.getI18nLabel(86185, "部门"),
|
||||
SalaryI18nUtil.getI18nLabel(86186, "手机号"),
|
||||
SalaryI18nUtil.getI18nLabel(86317, "工号"),
|
||||
SalaryI18nUtil.getI18nLabel(86318, "证件号码"),
|
||||
SalaryI18nUtil.getI18nLabel(86319, "入职日期"),
|
||||
SalaryI18nUtil.getI18nLabel(91238, "商业健康保险"),
|
||||
SalaryI18nUtil.getI18nLabel(91239, "税延养老保险"),
|
||||
SalaryI18nUtil.getI18nLabel(84500, "其他"),
|
||||
SalaryI18nUtil.getI18nLabel(91240, "准予扣除的捐赠额")
|
||||
};
|
||||
// 2.表头
|
||||
List<List<Object>> rows = new ArrayList<>();
|
||||
List<Object> headerList = Arrays.asList(header);
|
||||
rows.add(headerList);
|
||||
//获取操作按钮资源
|
||||
List<List<Object>> rowList = getExcelRowList(param,param.isHasData());
|
||||
|
||||
// 4.注释
|
||||
List<ExcelComment> excelComments = Lists.newArrayList();
|
||||
|
|
@ -1032,8 +1014,9 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
|
|||
excelComments.add(new ExcelComment(8, 0, 11, 2, SalaryI18nUtil.getI18nLabel(100344, "输入数字")));
|
||||
excelComments.add(new ExcelComment(9, 0, 12, 2, SalaryI18nUtil.getI18nLabel(100344, "输入数字")));
|
||||
excelComments.add(new ExcelComment(10, 0, 13, 2, SalaryI18nUtil.getI18nLabel(100344, "输入数字")));
|
||||
excelComments.add(new ExcelComment(11, 0, 14, 2, SalaryI18nUtil.getI18nLabel(100344, "输入数字")));
|
||||
|
||||
XSSFWorkbook book = ExcelUtil.genWorkbookV2(rows, sheetName, excelComments);
|
||||
XSSFWorkbook book = ExcelUtil.genWorkbookV2(rowList, sheetName, excelComments);
|
||||
return book;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -243,7 +243,7 @@ public class SpecialAddDeductionServiceImpl extends Service implements SpecialAd
|
|||
|
||||
//筛选导入人员信息可以在人力资源池中匹配到的人员信息
|
||||
List<DataCollectionEmployee> emps = getSalaryEmployeeService(user)
|
||||
.matchImportEmployee(confValue,employees, userName, deparmentName, mobile, workcode, null);
|
||||
.matchImportEmployee(confValue, employees, userName, deparmentName, mobile, workcode, null);
|
||||
//含在职和离职,选在职数据
|
||||
if (CollectionUtils.isNotEmpty(emps) && emps.size() > 1) {
|
||||
employeeSameIds = emps.stream()
|
||||
|
|
@ -396,7 +396,7 @@ public class SpecialAddDeductionServiceImpl extends Service implements SpecialAd
|
|||
|
||||
List<List<String>> rowList = new ArrayList<>();
|
||||
rowList.add(title);
|
||||
if (!isTemplate) {
|
||||
if (!isTemplate || param.isHasData()) {
|
||||
// 非下载导入模版,查询数据填充
|
||||
List<List<String>> dataRowList = queryInfoForExcel(param, rowList);
|
||||
rowList.addAll(dataRowList);
|
||||
|
|
@ -626,10 +626,10 @@ public class SpecialAddDeductionServiceImpl extends Service implements SpecialAd
|
|||
oldSpecialAddDeductionList.add(byId);
|
||||
}
|
||||
SpecialAddDeductionBiz.batchDeleteByIds(deleteList);
|
||||
|
||||
|
||||
// 记录操作日志
|
||||
if (CollectionUtils.isNotEmpty(oldSpecialAddDeductionList)) {
|
||||
oldSpecialAddDeductionList.stream().forEach( e -> {
|
||||
oldSpecialAddDeductionList.stream().forEach(e -> {
|
||||
LoggerContext<AddUpDeduction> loggerContext = new LoggerContext<>();
|
||||
loggerContext.setTargetId(e.getId().toString());
|
||||
loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "专项附加扣除") + "-" + e.getId());
|
||||
|
|
@ -671,7 +671,7 @@ public class SpecialAddDeductionServiceImpl extends Service implements SpecialAd
|
|||
specialAddDeductionBiz.batchDeleteByIds(deleteIds);
|
||||
|
||||
// 记录操作日志
|
||||
Collection<Long> finalTaxAgentIds =taxAgentIds;
|
||||
Collection<Long> finalTaxAgentIds = taxAgentIds;
|
||||
List<String> taxAgentNames = taxAgentList.stream().filter(t -> finalTaxAgentIds.contains(t.getTaxAgentId()))
|
||||
.map(TaxAgentManageRangeEmployeeDTO::getTaxAgentName).collect(Collectors.toList());
|
||||
String name = StringUtils.join(taxAgentNames, ",");
|
||||
|
|
@ -692,9 +692,7 @@ public class SpecialAddDeductionServiceImpl extends Service implements SpecialAd
|
|||
|
||||
@Override
|
||||
public SpecialAddDeductionRecordDTO getRecordById(Long id) {
|
||||
return getSpecialAddDeductionBiz()
|
||||
.listDTOByParam(SpecialAddDeductionQueryParam.builder().specialAddDeductionId(id).build())
|
||||
.stream().findFirst().orElse(null);
|
||||
return getSpecialAddDeductionBiz().listDTOByParam(SpecialAddDeductionQueryParam.builder().specialAddDeductionId(id).build()).stream().findFirst().orElse(null);
|
||||
}
|
||||
|
||||
private List<List<String>> queryInfoForExcel(SpecialAddDeductionQueryParam param, List<List<String>> rowList) {
|
||||
|
|
|
|||
|
|
@ -251,6 +251,10 @@ public class AddUpDeductionController {
|
|||
if (StringUtils.isNotBlank(accumulatedSpecialAdditionalDeductionId)) {
|
||||
param.setAccumulatedSpecialAdditionalDeductionId(Long.valueOf(accumulatedSpecialAdditionalDeductionId));
|
||||
}
|
||||
String hasData = request.getParameter("hasData");
|
||||
if (StringUtils.isNotBlank(hasData)) {
|
||||
param.setHasData("true".equals(hasData));
|
||||
}
|
||||
return param;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -261,6 +261,10 @@ public class AddUpSituationController {
|
|||
if (StringUtils.isNotBlank(accumulatedSituationId)) {
|
||||
param.setAccumulatedSituationId(Long.valueOf(accumulatedSituationId));
|
||||
}
|
||||
String hasData = request.getParameter("hasData");
|
||||
if (StringUtils.isNotBlank(hasData)) {
|
||||
param.setHasData("true".equals(hasData));
|
||||
}
|
||||
return param;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -254,6 +254,11 @@ public class OtherDeductionController {
|
|||
if (StringUtils.isNotBlank(otherTaxExemptDeductionId)) {
|
||||
param.setOtherTaxExemptDeductionId(Long.valueOf(otherTaxExemptDeductionId));
|
||||
}
|
||||
|
||||
String hasData = request.getParameter("hasData");
|
||||
if (StringUtils.isNotBlank(hasData)) {
|
||||
param.setHasData("true".equals(hasData));
|
||||
}
|
||||
return param;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,8 +3,10 @@ package com.engine.salary.web;
|
|||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.salary.entity.datacollection.dto.SpecialAddDeductionListDTO;
|
||||
import com.engine.salary.entity.datacollection.dto.SpecialAddDeductionRecordDTO;
|
||||
import com.engine.salary.entity.datacollection.param.*;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.entity.datacollection.param.SpecialAddDeductionImportParam;
|
||||
import com.engine.salary.entity.datacollection.param.SpecialAddDeductionParam;
|
||||
import com.engine.salary.entity.datacollection.param.SpecialAddDeductionQueryParam;
|
||||
import com.engine.salary.entity.datacollection.param.SpecialAddDeductionRecordDeleteParam;
|
||||
import com.engine.salary.util.ResponseResult;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.wrapper.SpecialAddDeductionWrapper;
|
||||
|
|
@ -16,7 +18,6 @@ import org.jetbrains.annotations.Nullable;
|
|||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import javax.security.sasl.SaslException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.GET;
|
||||
|
|
@ -258,6 +259,10 @@ public class SpecialAddDeductionController {
|
|||
if (StringUtils.isNotBlank(otherTaxExemptDeductionId)) {
|
||||
param.setSpecialAddDeductionId(Long.valueOf(otherTaxExemptDeductionId));
|
||||
}
|
||||
String hasData = request.getParameter("hasData");
|
||||
if (StringUtils.isNotBlank(hasData)) {
|
||||
param.setHasData("true".equals(hasData));
|
||||
}
|
||||
return param;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -103,8 +103,7 @@ public class AddUpDeductionWrapper extends Service {
|
|||
* @return
|
||||
*/
|
||||
public XSSFWorkbook export(AddUpDeductionQueryParam queryParam) {
|
||||
boolean isChief = getTaxAgentService(user).isChief((long) user.getUID());
|
||||
return getAddUpDeductionService(user).export(isChief, queryParam);
|
||||
return getAddUpDeductionService(user).export( queryParam);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ public class OtherDeductionWrapper extends Service {
|
|||
* @return
|
||||
*/
|
||||
public XSSFWorkbook downloadTemplate(OtherDeductionQueryParam queryParam) {
|
||||
return getOtherDeductionService(user).export(queryParam);
|
||||
return getOtherDeductionService(user).downloadTemplate(queryParam);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue