在线对比相关功能
This commit is contained in:
parent
bcfcd1de9a
commit
15b6c80cdc
|
|
@ -95,17 +95,6 @@ public interface TaxDeclarationValueService {
|
|||
*/
|
||||
Map<String, Object> contrast(ContrastQueryParam param);
|
||||
|
||||
/**
|
||||
* 在线对比表头列表
|
||||
* @param param
|
||||
*/
|
||||
// Map<String, Object> contrastHeaderList(ContrastQueryParam param);
|
||||
|
||||
/**
|
||||
* 缓存在线对比表头列表
|
||||
* @param columnIndex
|
||||
*/
|
||||
void cacheContrastHeader(List<String> columnIndex);
|
||||
|
||||
/**
|
||||
* 导出在线对比
|
||||
|
|
|
|||
|
|
@ -1,13 +1,11 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
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;
|
||||
|
|
@ -329,22 +327,6 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar
|
|||
// 查询个税申报表表头
|
||||
IncomeCategoryEnum incomeCategoryEnum = SalaryEnumUtil.enumMatchByValue(taxDeclaration.getIncomeCategory(), IncomeCategoryEnum.class);
|
||||
List<TaxReportColumnPO> taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(incomeCategoryEnum);
|
||||
// 筛选表头
|
||||
// 获取缓存中保存的设置
|
||||
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.isNotEmpty(selectedItems)) {
|
||||
Map<String, TaxReportColumnPO> columnMap = SalaryEntityUtil.convert2Map(taxReportColumns, TaxReportColumnPO::getReportColumnDataIndex);
|
||||
List<TaxReportColumnPO> finalColumn = new ArrayList<>();
|
||||
selectedItems.stream().forEach(index -> {
|
||||
TaxReportColumnPO c = columnMap.get(index);
|
||||
if (c!=null) {
|
||||
finalColumn.add(c);
|
||||
}
|
||||
});
|
||||
taxReportColumns = finalColumn;
|
||||
}
|
||||
List<String> columns = SalaryEntityUtil.properties(taxReportColumns, TaxReportColumnPO::getReportColumnName, Collectors.toList());
|
||||
// 人员id
|
||||
Set<Long> employeeIds = SalaryEntityUtil.properties(taxDeclarationValues, TaxDeclarationValuePO::getEmployeeId);
|
||||
|
|
@ -389,7 +371,7 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar
|
|||
onlineNoMap.put(no, map);
|
||||
}
|
||||
|
||||
Set<String> onlyShowColumns = new HashSet<>();
|
||||
List<String> onlyShowColumns = new ArrayList<>();
|
||||
List<Map<String, Object>> oneResultList = new ArrayList<>();
|
||||
for (Map<String, Object> local : localList) {
|
||||
AtomicBoolean hasDiff = new AtomicBoolean(false);
|
||||
|
|
@ -433,12 +415,14 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar
|
|||
oneResultList.add(result);
|
||||
}
|
||||
}
|
||||
|
||||
List<String> finalOnlyShowColumns = onlyShowColumns.stream().distinct().collect(Collectors.toList());
|
||||
List<String> headerList = new ArrayList<>();
|
||||
headerList.add("工号");
|
||||
headerList.add("姓名");
|
||||
headerList.add("证件类型");
|
||||
headerList.add("证件号码");
|
||||
headerList.addAll((param.isOnlyShowDiffItem() ? onlyShowColumns : columns).stream().collect(Collectors.toList()));
|
||||
headerList.addAll((param.isOnlyShowDiffItem() ? finalOnlyShowColumns : columns).stream().collect(Collectors.toList()));
|
||||
resultList.put("columns", headerList);
|
||||
resultList.put("pageInfo", SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), oneResultList));
|
||||
|
||||
|
|
@ -463,79 +447,6 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar
|
|||
|
||||
}
|
||||
|
||||
// @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) {
|
||||
String cacheKey = user.getUID() + SalaryItemConstant.TAX_DECLARE_CONTRAST_FIELD_SIGN;
|
||||
Util_DataCache.setObjVal(cacheKey, JsonUtil.toJsonString(columnIndex));
|
||||
}
|
||||
|
||||
@Override
|
||||
public XSSFWorkbook exportContrast(ContrastQueryParam param) {
|
||||
param.setPageSize(1000000000);
|
||||
|
|
@ -555,7 +466,8 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar
|
|||
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());
|
||||
List<String> finalHeader = header;
|
||||
header = param.getColumns().stream().filter(col -> finalHeader.contains(col)).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
return ExcelUtilPlus.genWorkbook4TaxDeclareContrast(empInfoColumns, header, list, "在线对比结果");
|
||||
|
|
|
|||
|
|
@ -296,39 +296,6 @@ public class TaxDeclarationController {
|
|||
return new ResponseResult<ContrastQueryParam, Map<String, Object>>(user).run(getTaxDeclareRecordWrapper(user)::contrast, param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 在线对比表头列表
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
// @POST
|
||||
// @Path("/contrastHeaderList")
|
||||
// @Produces(MediaType.APPLICATION_JSON)
|
||||
// public String contrastHeaderList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody ContrastQueryParam param) {
|
||||
// User user = HrmUserVarify.getUser(request, response);
|
||||
// return new ResponseResult<ContrastQueryParam, Map<String, Object>>(user).run(getTaxDeclareRecordWrapper(user)::contrastHeaderList, param);
|
||||
// }
|
||||
|
||||
|
||||
/**
|
||||
* 缓存在线对比表头列表
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/cacheContrastHeader")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String cacheContrastHeader(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody ContrastQueryParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<List<String>, Void>(user).run(getTaxDeclareRecordWrapper(user)::cacheContrastHeader, param.getColumns());
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出在线对比
|
||||
*
|
||||
|
|
|
|||
|
|
@ -647,23 +647,6 @@ public class TaxDeclareRecordWrapper extends Service {
|
|||
return getTaxDeclarationValueService(user).contrast(param);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 在线对比表头列表
|
||||
* @param param
|
||||
*/
|
||||
// public Map<String, Object> contrastHeaderList(ContrastQueryParam param) {
|
||||
// return getTaxDeclarationValueService(user).contrastHeaderList(param);
|
||||
// }
|
||||
|
||||
/**
|
||||
* 在线对比表头列表
|
||||
* @param columnIndex
|
||||
*/
|
||||
public void cacheContrastHeader(List<String> columnIndex) {
|
||||
getTaxDeclarationValueService(user).cacheContrastHeader(columnIndex);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出在线对比
|
||||
* @param param
|
||||
|
|
|
|||
Loading…
Reference in New Issue