|
|
|
|
@ -5,16 +5,17 @@ import com.cloudstore.dev.api.util.Util_DataCache;
|
|
|
|
|
import com.cloudstore.eccom.pc.table.WeaTableColumn;
|
|
|
|
|
import com.engine.common.util.ServiceUtil;
|
|
|
|
|
import com.engine.core.impl.Service;
|
|
|
|
|
import com.engine.salary.component.SalaryWeaTable;
|
|
|
|
|
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
|
|
|
|
import com.engine.salary.constant.SalaryItemConstant;
|
|
|
|
|
import com.engine.salary.encrypt.EncryptUtil;
|
|
|
|
|
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
|
|
|
|
import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO;
|
|
|
|
|
import com.engine.salary.entity.extemp.po.ExtEmpPO;
|
|
|
|
|
import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveListDTO;
|
|
|
|
|
import com.engine.salary.entity.taxdeclaration.bo.TaxDeclarationValueList;
|
|
|
|
|
import com.engine.salary.entity.taxdeclaration.dto.ContrastListDTO;
|
|
|
|
|
import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationValueListDTO;
|
|
|
|
|
import com.engine.salary.entity.taxdeclaration.dto.TaxReportColumnDTO;
|
|
|
|
|
import com.engine.salary.entity.taxdeclaration.param.ContrastQueryParam;
|
|
|
|
|
import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationValueListQueryParam;
|
|
|
|
|
import com.engine.salary.entity.taxdeclaration.param.TaxDeclareRecordDetailSaveParam;
|
|
|
|
|
@ -36,6 +37,7 @@ import com.engine.salary.service.*;
|
|
|
|
|
import com.engine.salary.util.JsonUtil;
|
|
|
|
|
import com.engine.salary.util.SalaryEntityUtil;
|
|
|
|
|
import com.engine.salary.util.SalaryEnumUtil;
|
|
|
|
|
import com.engine.salary.util.SalaryI18nUtil;
|
|
|
|
|
import com.engine.salary.util.db.IdGenerator;
|
|
|
|
|
import com.engine.salary.util.db.MapperProxyFactory;
|
|
|
|
|
import com.engine.salary.util.excel.ExcelUtilPlus;
|
|
|
|
|
@ -43,6 +45,7 @@ import com.engine.salary.util.page.PageInfo;
|
|
|
|
|
import com.engine.salary.util.page.SalaryPageUtil;
|
|
|
|
|
import com.google.common.collect.Lists;
|
|
|
|
|
import com.google.common.collect.Maps;
|
|
|
|
|
import com.wbi.core.entity.WeaResultMsg;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
@ -391,7 +394,7 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar
|
|
|
|
|
for (Map<String, Object> local : localList) {
|
|
|
|
|
AtomicBoolean hasDiff = new AtomicBoolean(false);
|
|
|
|
|
Map<String, Object> result = new HashMap<>();
|
|
|
|
|
result.put("工号", local.get("jobNum"));
|
|
|
|
|
result.put("工号", local.get("工号"));
|
|
|
|
|
result.put("姓名", local.get("姓名"));
|
|
|
|
|
result.put("证件类型", local.get("证件类型"));
|
|
|
|
|
result.put("证件号码", local.get("证件号码"));
|
|
|
|
|
@ -430,50 +433,102 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar
|
|
|
|
|
oneResultList.add(result);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
resultList.put("columns", param.isOnlyShowDiffItem() ? onlyShowColumns : columns);
|
|
|
|
|
List<String> headerList = new ArrayList<>();
|
|
|
|
|
headerList.add("工号");
|
|
|
|
|
headerList.add("姓名");
|
|
|
|
|
headerList.add("证件类型");
|
|
|
|
|
headerList.add("证件号码");
|
|
|
|
|
headerList.addAll((param.isOnlyShowDiffItem() ? onlyShowColumns : columns).stream().collect(Collectors.toList()));
|
|
|
|
|
resultList.put("columns", headerList);
|
|
|
|
|
resultList.put("pageInfo", SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), oneResultList));
|
|
|
|
|
|
|
|
|
|
// 显示定制列
|
|
|
|
|
List<WeaTableColumn> weaColumns = new ArrayList<>();
|
|
|
|
|
weaColumns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "工号"), "工号"));
|
|
|
|
|
weaColumns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "姓名"), "姓名"));
|
|
|
|
|
weaColumns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "证件类型"), "证件类型"));
|
|
|
|
|
weaColumns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "证件号码"), "证件号码"));
|
|
|
|
|
for (TaxReportColumnPO columnPO : taxReportColumns) {
|
|
|
|
|
weaColumns.add(new WeaTableColumn("100px", columnPO.getReportColumnName(), columnPO.getReportColumnName()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SalaryWeaTable<SalaryArchiveListDTO> table = new SalaryWeaTable<SalaryArchiveListDTO>(user, TaxDeclarationValueListDTO.class);
|
|
|
|
|
table.setColumns(weaColumns);
|
|
|
|
|
WeaResultMsg result = new WeaResultMsg(false);
|
|
|
|
|
result.putAll(table.makeDataResult());
|
|
|
|
|
result.success();
|
|
|
|
|
|
|
|
|
|
resultList.put("dataKey", result.getResultMap());
|
|
|
|
|
return resultList;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, List<TaxReportColumnDTO>> contrastHeaderList(ContrastQueryParam param) {
|
|
|
|
|
Map<String, List<TaxReportColumnDTO>> resultMap = new HashMap<>();
|
|
|
|
|
TaxDeclarationPO taxDeclaration = getTaxDeclarationService(user).getById(param.getTaxDeclarationId());
|
|
|
|
|
if (taxDeclaration == null) {
|
|
|
|
|
throw new SalaryRunTimeException("无申报表");
|
|
|
|
|
}
|
|
|
|
|
// 查询个税申报表表头
|
|
|
|
|
IncomeCategoryEnum incomeCategoryEnum = SalaryEnumUtil.enumMatchByValue(taxDeclaration.getIncomeCategory(), IncomeCategoryEnum.class);
|
|
|
|
|
List<TaxReportColumnPO> taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(incomeCategoryEnum);
|
|
|
|
|
List<TaxReportColumnDTO> defaultDtoList = new ArrayList<>();
|
|
|
|
|
taxReportColumns.stream().forEach(po -> {defaultDtoList.add(TaxReportColumnDTO.builder().id(po.getId()).reportColumnName(po.getReportColumnName()).reportColumnDataIndex(po.getReportColumnDataIndex()).build());});
|
|
|
|
|
resultMap.put("defaultList",defaultDtoList);
|
|
|
|
|
// 获取缓存中保存的设置
|
|
|
|
|
String cacheKey = user.getUID() + SalaryItemConstant.TAX_DECLARE_CONTRAST_FIELD_SIGN;
|
|
|
|
|
String cacheValue = (String) Util_DataCache.getObjVal(cacheKey);
|
|
|
|
|
List<String> selectedItems = JsonUtil.parseList(cacheValue, String.class) == null ? new ArrayList<>() : JsonUtil.parseList(cacheValue, String.class);
|
|
|
|
|
if (CollectionUtils.isEmpty(selectedItems)) {
|
|
|
|
|
// 默认全选
|
|
|
|
|
resultMap.put("selectedList", defaultDtoList);
|
|
|
|
|
resultMap.put("unSelectedList", Collections.emptyList());
|
|
|
|
|
} else {
|
|
|
|
|
Map<String, TaxReportColumnDTO> columnMap = SalaryEntityUtil.convert2Map(defaultDtoList, TaxReportColumnDTO::getReportColumnDataIndex);
|
|
|
|
|
List<TaxReportColumnDTO> selectedColumn = new ArrayList<>();
|
|
|
|
|
selectedItems.stream().forEach(index -> {
|
|
|
|
|
TaxReportColumnDTO taxReportColumnDTO = columnMap.get(index);
|
|
|
|
|
if (taxReportColumnDTO != null) {
|
|
|
|
|
// 已选择的项目
|
|
|
|
|
selectedColumn.add(taxReportColumnDTO);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
// 过滤出未选择的项目
|
|
|
|
|
List<TaxReportColumnDTO> unSelectedList = defaultDtoList.stream().filter(po -> !selectedItems.contains(po.getReportColumnDataIndex())).collect(Collectors.toList());
|
|
|
|
|
resultMap.put("selectedList", selectedColumn);
|
|
|
|
|
resultMap.put("unSelectedList", unSelectedList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return resultMap;
|
|
|
|
|
}
|
|
|
|
|
// @Override
|
|
|
|
|
// public Map<String, Object> contrastHeaderList(ContrastQueryParam param) {
|
|
|
|
|
// TaxDeclarationPO taxDeclaration = getTaxDeclarationService(user).getById(param.getTaxDeclarationId());
|
|
|
|
|
// if (taxDeclaration == null) {
|
|
|
|
|
// throw new SalaryRunTimeException("无申报表");
|
|
|
|
|
// }
|
|
|
|
|
// // 查询个税申报表表头
|
|
|
|
|
// IncomeCategoryEnum incomeCategoryEnum = SalaryEnumUtil.enumMatchByValue(taxDeclaration.getIncomeCategory(), IncomeCategoryEnum.class);
|
|
|
|
|
// List<TaxReportColumnPO> taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(incomeCategoryEnum);
|
|
|
|
|
//
|
|
|
|
|
// SalaryWeaTable<SalaryArchiveListDTO> table = new SalaryWeaTable<SalaryArchiveListDTO>(user, TaxDeclarationValueListDTO.class);
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// List<WeaTableColumn> columns = new ArrayList<>();
|
|
|
|
|
// columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "工号"), "工号"));
|
|
|
|
|
// columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "姓名"), "姓名"));
|
|
|
|
|
// columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "证件类型"), "证件类型"));
|
|
|
|
|
// columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "证件号码"), "证件号码"));
|
|
|
|
|
// for (TaxReportColumnPO columnPO : taxReportColumns) {
|
|
|
|
|
// columns.add(new WeaTableColumn("100px", columnPO.getReportColumnName(), columnPO.getReportColumnName()));
|
|
|
|
|
// }
|
|
|
|
|
// table.setColumns(columns);
|
|
|
|
|
// WeaResultMsg result = new WeaResultMsg(false);
|
|
|
|
|
// result.putAll(table.makeDataResult());
|
|
|
|
|
// result.success();
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// Map<String, Object> datas = new HashMap<>();
|
|
|
|
|
// datas.put("dataKey", result.getResultMap());
|
|
|
|
|
// return datas;
|
|
|
|
|
// //
|
|
|
|
|
// //
|
|
|
|
|
// //
|
|
|
|
|
// //
|
|
|
|
|
// //
|
|
|
|
|
// //
|
|
|
|
|
// //
|
|
|
|
|
// // List<TaxReportColumnDTO> defaultDtoList = new ArrayList<>();
|
|
|
|
|
// // taxReportColumns.stream().forEach(po -> {defaultDtoList.add(TaxReportColumnDTO.builder().id(po.getId()).reportColumnName(po.getReportColumnName()).reportColumnDataIndex(po.getReportColumnDataIndex()).build());});
|
|
|
|
|
// // resultMap.put("defaultList",defaultDtoList);
|
|
|
|
|
// // // 获取缓存中保存的设置
|
|
|
|
|
// // String cacheKey = user.getUID() + SalaryItemConstant.TAX_DECLARE_CONTRAST_FIELD_SIGN;
|
|
|
|
|
// // String cacheValue = (String) Util_DataCache.getObjVal(cacheKey);
|
|
|
|
|
// // List<String> selectedItems = JsonUtil.parseList(cacheValue, String.class) == null ? new ArrayList<>() : JsonUtil.parseList(cacheValue, String.class);
|
|
|
|
|
// // if (CollectionUtils.isEmpty(selectedItems)) {
|
|
|
|
|
// // // 默认全选
|
|
|
|
|
// // resultMap.put("selectedList", defaultDtoList);
|
|
|
|
|
// // resultMap.put("unSelectedList", Collections.emptyList());
|
|
|
|
|
// // } else {
|
|
|
|
|
// // Map<String, TaxReportColumnDTO> columnMap = SalaryEntityUtil.convert2Map(defaultDtoList, TaxReportColumnDTO::getReportColumnDataIndex);
|
|
|
|
|
// // List<TaxReportColumnDTO> selectedColumn = new ArrayList<>();
|
|
|
|
|
// // selectedItems.stream().forEach(index -> {
|
|
|
|
|
// // TaxReportColumnDTO taxReportColumnDTO = columnMap.get(index);
|
|
|
|
|
// // if (taxReportColumnDTO != null) {
|
|
|
|
|
// // // 已选择的项目
|
|
|
|
|
// // selectedColumn.add(taxReportColumnDTO);
|
|
|
|
|
// // }
|
|
|
|
|
// // });
|
|
|
|
|
// // // 过滤出未选择的项目
|
|
|
|
|
// // List<TaxReportColumnDTO> unSelectedList = defaultDtoList.stream().filter(po -> !selectedItems.contains(po.getReportColumnDataIndex())).collect(Collectors.toList());
|
|
|
|
|
// // resultMap.put("selectedList", selectedColumn);
|
|
|
|
|
// // resultMap.put("unSelectedList", unSelectedList);
|
|
|
|
|
// // }
|
|
|
|
|
//
|
|
|
|
|
// return resultMap;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void cacheContrastHeader(List<String> columnIndex) {
|
|
|
|
|
@ -487,7 +542,7 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar
|
|
|
|
|
param.setCurrent(1);
|
|
|
|
|
// 获取线下对比结果
|
|
|
|
|
Map<String, Object> contrastMap = contrast(param);
|
|
|
|
|
List<String> header = (List<String>)contrastMap.get("columns");
|
|
|
|
|
List<String> header = ((List<String>) contrastMap.get("columns"));
|
|
|
|
|
PageInfo<Map<String, Object>> pageInfo = (PageInfo<Map<String, Object>>)contrastMap.get("pageInfo");
|
|
|
|
|
List<Map<String, Object>> list = pageInfo.getList();
|
|
|
|
|
|
|
|
|
|
@ -497,6 +552,12 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar
|
|
|
|
|
empInfoColumns.add(new WeaTableColumn("100px", "证件类型", "cardType"));
|
|
|
|
|
empInfoColumns.add(new WeaTableColumn("100px", "证件号码", "cardNum"));
|
|
|
|
|
|
|
|
|
|
List<String> empInfoList = empInfoColumns.stream().map(WeaTableColumn::getText).collect(Collectors.toList());
|
|
|
|
|
header = header.stream().filter(h -> !empInfoList.contains(h)).collect(Collectors.toList());
|
|
|
|
|
if (CollectionUtils.isNotEmpty(param.getColumns())) {
|
|
|
|
|
header = header.stream().filter(h -> param.getColumns().contains(h)).collect(Collectors.toList());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return ExcelUtilPlus.genWorkbook4TaxDeclareContrast(empInfoColumns, header, list, "在线对比结果");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|