浮动薪酬优化
This commit is contained in:
parent
c255d74912
commit
2ee605df44
|
|
@ -37,6 +37,7 @@ public class VariableArchiveBO {
|
|||
WeaTableColumn employeeIdColumn = new WeaTableColumn("100px", "人员信息表的主键id", "employeeId");
|
||||
employeeIdColumn.setDisplay(WeaBoolAttr.FALSE);
|
||||
columns.add(employeeIdColumn);
|
||||
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "薪资所属月"), "salaryMonth"));
|
||||
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(85429, "个税扣缴义务人"), "taxAgentName"));
|
||||
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(85429, "姓名"), "username"));
|
||||
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(86185, "部门"), "departmentName"));
|
||||
|
|
|
|||
|
|
@ -47,4 +47,6 @@ public class VariableArchiveQueryParam extends BaseQueryParam {
|
|||
private boolean hasData;
|
||||
|
||||
private List<Long> employeeIds;
|
||||
|
||||
private List<String> columns;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -524,40 +524,45 @@ public class VariableArchiveServiceImpl extends Service implements VariableArchi
|
|||
|
||||
// 获取所有可被引用的薪资项目
|
||||
List<VariableItemPO> variableItems = getVariableItemService(user).listAll();
|
||||
List<Object> header = Lists.newArrayList();
|
||||
header.add(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人"));
|
||||
header.add(SalaryI18nUtil.getI18nLabel(85429, "姓名"));
|
||||
header.add(SalaryI18nUtil.getI18nLabel(86185, "部门"));
|
||||
header.add(SalaryI18nUtil.getI18nLabel(86186, "手机号"));
|
||||
header.add(SalaryI18nUtil.getI18nLabel(1933, "工号"));
|
||||
header.add(SalaryI18nUtil.getI18nLabel(86186, "证件号码"));
|
||||
header.add(SalaryI18nUtil.getI18nLabel(86187, "入职日期"));
|
||||
for (VariableItemPO variableItem : variableItems) {
|
||||
header.add(variableItem.getName());
|
||||
}
|
||||
List<WeaTableColumn> header = VariableArchiveBO.buildVariableArchiveTable(variableItems);
|
||||
Map<String, WeaTableColumn> columnMap = SalaryEntityUtil.convert2Map(header, WeaTableColumn::getColumn);
|
||||
|
||||
List<WeaTableColumn> finalColumns = new ArrayList<>();
|
||||
param.getColumns().forEach(col -> {
|
||||
WeaTableColumn column = columnMap.get(col);
|
||||
if (column != null) {
|
||||
finalColumns.add(column);
|
||||
}
|
||||
});
|
||||
header = finalColumns;
|
||||
|
||||
// 2.表头
|
||||
List<List<Object>> rows = new ArrayList<>();
|
||||
rows.add(header);
|
||||
rows.add(header.stream().map(WeaTableColumn::getText).collect(Collectors.toList()));
|
||||
// 获取档案信息
|
||||
List<VariableArchiveListDTO> variableArchiveList = list(param);
|
||||
List<Map<String, Object>> listMaps = buildVariableArchiveData(variableArchiveList);
|
||||
// 组装数据
|
||||
List<WeaTableColumn> finalHeader = header;
|
||||
listMaps.forEach(e -> {
|
||||
List<Object> row = new ArrayList<>();
|
||||
row.add(e.get("taxAgentName").toString());
|
||||
row.add(e.get("username").toString());
|
||||
row.add(Optional.ofNullable(e.get("departmentName")).orElse("").toString());
|
||||
row.add(e.get("mobile") == null ? "" : e.get("mobile").toString());
|
||||
row.add(Optional.ofNullable(e.get("workcode")).orElse("").toString());
|
||||
row.add(Util.null2String(e.get("idNo")));
|
||||
row.add(Util.null2String(e.get("companystartdate")));
|
||||
|
||||
// 薪资项目数据
|
||||
for (VariableItemPO variableItem : variableItems) {
|
||||
row.add(e.containsKey(variableItem.getId() + SalaryItemConstant.VARIABLE_ITEM_DYNAMIC_SUFFIX) ? (e.get(variableItem.getId() + SalaryItemConstant.VARIABLE_ITEM_DYNAMIC_SUFFIX) == null ? ""
|
||||
: e.get(variableItem.getId() + SalaryItemConstant.VARIABLE_ITEM_DYNAMIC_SUFFIX).toString()) : "");
|
||||
for (WeaTableColumn column : finalHeader) {
|
||||
row.add(Util.null2String(e.get(column.getColumn())));
|
||||
}
|
||||
// row.add(e.get("salaryMonth").toString());
|
||||
// row.add(e.get("taxAgentName").toString());
|
||||
// row.add(e.get("username").toString());
|
||||
// row.add(Optional.ofNullable(e.get("departmentName")).orElse("").toString());
|
||||
// row.add(e.get("mobile") == null ? "" : e.get("mobile").toString());
|
||||
// row.add(Optional.ofNullable(e.get("workcode")).orElse("").toString());
|
||||
// row.add(Util.null2String(e.get("idNo")));
|
||||
// row.add(Util.null2String(e.get("companystartdate")));
|
||||
//
|
||||
// // 薪资项目数据
|
||||
// for (VariableItemPO variableItem : variableItems) {
|
||||
// row.add(e.containsKey(variableItem.getId() + SalaryItemConstant.VARIABLE_ITEM_DYNAMIC_SUFFIX) ? (e.get(variableItem.getId() + SalaryItemConstant.VARIABLE_ITEM_DYNAMIC_SUFFIX) == null ? ""
|
||||
// : e.get(variableItem.getId() + SalaryItemConstant.VARIABLE_ITEM_DYNAMIC_SUFFIX).toString()) : "");
|
||||
// }
|
||||
rows.add(row);
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -150,13 +150,17 @@ public class VariableArchiveController {
|
|||
* @param
|
||||
* @return
|
||||
*/
|
||||
@GET
|
||||
@POST
|
||||
@Path("/export")
|
||||
@Produces(MediaType.APPLICATION_OCTET_STREAM)
|
||||
public Response export(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
public Response export(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody VariableArchiveQueryParam param) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
VariableArchiveQueryParam param = buildParam(request);
|
||||
// VariableArchiveQueryParam param = buildParam(request);
|
||||
// String columns = request.getParameter("columns");
|
||||
// if (StringUtils.isNotBlank(columns)) {
|
||||
// param.setColumns(Arrays.stream(columns.split(",")).collect(Collectors.toList()));
|
||||
// }
|
||||
|
||||
XSSFWorkbook workbook = getVariableArchiveWrapper(user).export(param);
|
||||
|
||||
|
|
@ -211,6 +215,7 @@ public class VariableArchiveController {
|
|||
if (StringUtils.isNotBlank(hasData)) {
|
||||
param.setHasData(hasData.equals("true"));
|
||||
}
|
||||
|
||||
return param;
|
||||
}
|
||||
|
||||
|
|
@ -245,32 +250,4 @@ public class VariableArchiveController {
|
|||
return new ResponseResult<Collection<Long>, String>(user).run(getVariableArchiveWrapper(user)::deleteSelectVariableArchive, variableArchiveQueryParam.getIds());
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @description 获取其他免税扣除数据
|
||||
// * @return String
|
||||
// * @author Harryxzy
|
||||
// * @date 2022/10/31 13:42
|
||||
// */
|
||||
// @POST
|
||||
// @Path("/getData")
|
||||
// @Produces(MediaType.APPLICATION_JSON)
|
||||
// public String getOtherDeduction(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody OtherDeductionParam otherDeductionParam) {
|
||||
// User user = HrmUserVarify.getUser(request, response);
|
||||
// return new ResponseResult<OtherDeductionParam, OtherDeductionRecordDTO>(user).run(getOtherDeductionWrapper(user)::getOtherDeduction, otherDeductionParam);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * @description 删除所选其他免税扣除
|
||||
// * @return String
|
||||
// * @author Harryxzy
|
||||
// * @date 2022/10/27 14:41
|
||||
// */
|
||||
// @POST
|
||||
// @Path("/deleteSelectData")
|
||||
// @Produces(MediaType.APPLICATION_JSON)
|
||||
// public String deleteSelectOtherDeduction(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody AddUpDeductionRecordDeleteParam otherDeductionDeleteParam) {
|
||||
// User user = HrmUserVarify.getUser(request, response);
|
||||
// return new ResponseResult<AddUpDeductionRecordDeleteParam, Map<String, Object>>(user).run(getOtherDeductionWrapper(user)::deleteSelectData, otherDeductionDeleteParam);
|
||||
// }
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -122,69 +122,4 @@ public class VariableArchiveWrapper extends Service {
|
|||
public void deleteSelectVariableArchive(Collection<Long> deleteIds) {
|
||||
getVariableArchiveService(user).deleteSelectVariableArchive(deleteIds);
|
||||
}
|
||||
|
||||
|
||||
// /**
|
||||
// * 导出-其他免税扣除列表
|
||||
// *
|
||||
// * @param queryParam
|
||||
// * @return
|
||||
// */
|
||||
// public XSSFWorkbook export(OtherDeductionQueryParam queryParam) {
|
||||
// return getOtherDeductionService(user).export(queryParam);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 下载导入模板
|
||||
// *
|
||||
// * @param queryParam
|
||||
// * @return
|
||||
// */
|
||||
// public XSSFWorkbook downloadTemplate(OtherDeductionQueryParam queryParam) {
|
||||
// return getOtherDeductionService(user).downloadTemplate(queryParam);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 预览
|
||||
// */
|
||||
// public Map<String, Object> preview(OtherDeductionImportParam importParam) {
|
||||
// return getOtherDeductionService(user).preview(importParam);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 导入数据
|
||||
// */
|
||||
// public Map<String, Object> importData(OtherDeductionImportParam importParam) {
|
||||
// return getOtherDeductionService(user).importData(importParam);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 编辑数据
|
||||
// */
|
||||
// public void editData(OtherDeductionParam otherDeductionParam) {
|
||||
// getOtherDeductionService(user).editData(otherDeductionParam);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 新增数据
|
||||
// */
|
||||
// public void createData(OtherDeductionParam otherDeductionParam) {
|
||||
// getOtherDeductionService(user).createData(otherDeductionParam);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 删除所选数据
|
||||
// */
|
||||
// public void deleteSelectData(AddUpDeductionRecordDeleteParam deleteParam) {
|
||||
// getOtherDeductionService(user).deleteSelectData(deleteParam);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 获取数据
|
||||
// */
|
||||
// public OtherDeductionRecordDTO getOtherDeduction(OtherDeductionParam otherDeductionParam) {
|
||||
// return getOtherDeductionService(user).getOtherDeduction(otherDeductionParam);
|
||||
// }
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue