diff --git a/src/com/engine/salary/web/SalaryArchiveController.java b/src/com/engine/salary/web/SalaryArchiveController.java index dbfa40c35..0e6f6b6f7 100644 --- a/src/com/engine/salary/web/SalaryArchiveController.java +++ b/src/com/engine/salary/web/SalaryArchiveController.java @@ -77,20 +77,19 @@ public class SalaryArchiveController { } + /** + * 待定薪列表 + * + * @return + */ + @POST + @Path("/pendingList") + @Produces(MediaType.APPLICATION_JSON) + public String pendingList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryArchiveQueryParam queryParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getSalaryArchiveWrapper(user)::pendingList, queryParam); + } - -// /** -// * 待定薪列表 -// * -// * @param queryParam -// * @return -// */ -// @PostMapping("/pendingList") -// @ApiOperation("待定薪列表") -// @WeaPermission -// public WeaResult> pendingList(@RequestBody SalaryArchiveQueryParam queryParam) { -// return WeaResult.success(salaryArchiveWrapper.pendingList(queryParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey())); -// } // // /** // * 设为定薪员工 @@ -130,33 +129,36 @@ public class SalaryArchiveController { // public WeaResult deletePendingTodo(@RequestBody Collection ids) { // return WeaResult.success(salaryArchiveWrapper.deletePendingTodo(ids, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey())); // } -// -// /** -// * 定薪列表 -// * -// * @param queryParam -// * @return -// */ -// @PostMapping("/fixedList") -// @ApiOperation("定薪列表") -// @WeaPermission -// public WeaResult> fixedList(@RequestBody SalaryArchiveQueryParam queryParam) { -// return WeaResult.success(salaryArchiveWrapper.fixedList(queryParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey())); -// } -// -// /** -// * 待停薪列表 -// * -// * @param queryParam -// * @return -// */ -// @PostMapping("/suspendList") -// @ApiOperation("待停薪列表") -// @WeaPermission -// public WeaResult> suspendList(@RequestBody SalaryArchiveQueryParam queryParam) { -// return WeaResult.success(salaryArchiveWrapper.suspendList(queryParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey())); -// } -// + + /** + * 定薪列表 + * + * @param queryParam + * @return + */ + @POST + @Path("/fixedList") + @Produces(MediaType.APPLICATION_JSON) + public String fixedList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryArchiveQueryParam queryParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getSalaryArchiveWrapper(user)::fixedList, queryParam); + } + + + /** + * 待停薪列表 + * + * @param queryParam + * @return + */ + @POST + @Path("/suspendList") + @Produces(MediaType.APPLICATION_JSON) + public String suspendList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryArchiveQueryParam queryParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getSalaryArchiveWrapper(user)::suspendList, queryParam); + } + // /** // * 停薪 // * @@ -195,20 +197,22 @@ public class SalaryArchiveController { // public WeaResult deleteSuspendTodo(@RequestBody Collection ids) { // return WeaResult.success(salaryArchiveWrapper.deleteSuspendTodo(ids, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey())); // } -// -// /** -// * 停薪列表 -// * -// * @param queryParam -// * @return -// */ -// @PostMapping("/stopList") -// @ApiOperation("停薪列表") -// @WeaPermission -// public WeaResult> stopList(@RequestBody SalaryArchiveQueryParam queryParam) { -// return WeaResult.success(salaryArchiveWrapper.stopList(queryParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey())); -// } -// + + /** + * 停薪列表 + * + * @param queryParam + * @return + */ + @POST + @Path("/stopList") + @Produces(MediaType.APPLICATION_JSON) + public String stopList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryArchiveQueryParam queryParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getSalaryArchiveWrapper(user)::stopList, queryParam); + } + + // /** // * 取消停薪 // * diff --git a/src/com/engine/salary/wrapper/SalaryArchiveWrapper.java b/src/com/engine/salary/wrapper/SalaryArchiveWrapper.java index 8e45ce335..73371ab7d 100644 --- a/src/com/engine/salary/wrapper/SalaryArchiveWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryArchiveWrapper.java @@ -110,6 +110,51 @@ public class SalaryArchiveWrapper extends Service { } + /** + * 薪资档案列表(分页) + * + * @param queryParam + * @return + */ + public Map list(SalaryArchiveQueryParam queryParam, SalaryArchiveListTypeEnum listTypeEnum) { + //薪资档案列表 + PageInfo pageInfo = getSalaryArchiveService(user).listPage(queryParam); + Collection salaryArchives = pageInfo.getList(); + + //所有个税扣缴义务人 + Collection taxAgentLists = getTaxAgentService(user).listAll(); + + // 获取所有可被引用的薪资项目 + List salaryItems = getSalaryArchiveItemService(user).getCanAdjustSalaryItems(); + + //整合所有的显示列(固定列+薪资项目动态列) + List> listMaps = getSalaryArchiveService(user).buildSalaryArchiveData(salaryArchives, taxAgentLists, salaryItems, Boolean.TRUE); + + PageInfo> pageInfos = new PageInfo>(listMaps); + pageInfos.setTotal(pageInfo.getTotal()); + pageInfos.setPageNum(pageInfo.getPageNum()); + pageInfos.setPageSize(pageInfo.getPageSize()); + + + //动态列组装 + List columns = SalaryArchiveBO.buildSalaryArchiveTable(salaryItems); + + SalaryWeaTable table = new SalaryWeaTable(user, SalaryArchiveListDTO.class); + table.setColumns(columns); + + + WeaResultMsg result = new WeaResultMsg(false); + result.putAll(table.makeDataResult()); + result.success(); + + + Map datas = new HashMap<>(); + datas.put("pageInfo", pageInfos); + datas.put("dataKey", result.getResultMap()); + datas.put("salaryArchives", salaryArchives); + return datas; + } + /** * 获取各tab总人数 @@ -133,6 +178,136 @@ public class SalaryArchiveWrapper extends Service { return list; } + + /** + * 待定薪列表 + * + * @param queryParam + * @return + */ + public Map pendingList(SalaryArchiveQueryParam queryParam) { + queryParam.setRunStatusList(Arrays.asList(SalaryArchiveStatusEnum.PENDING.getValue())); + return list(queryParam, SalaryArchiveListTypeEnum.PENDING); + } + + /** + * 定薪列表 + * + * @param queryParam + * @return + */ + public Map fixedList(SalaryArchiveQueryParam queryParam) { + queryParam.setRunStatusList(Arrays.asList(SalaryArchiveStatusEnum.FIXED.getValue(), SalaryArchiveStatusEnum.SUSPEND.getValue())); + return list(queryParam, SalaryArchiveListTypeEnum.FIXED); + } + + /** + * 待停薪列表 + * + * @param queryParam + * @return + */ + public Map suspendList(SalaryArchiveQueryParam queryParam) { + queryParam.setRunStatusList(Arrays.asList(SalaryArchiveStatusEnum.SUSPEND.getValue())); + return list(queryParam, SalaryArchiveListTypeEnum.SUSPEND); + } + + /** + * 停薪列表 + * + * @param queryParam + * @return + */ + public Map stopList(SalaryArchiveQueryParam queryParam) { + queryParam.setRunStatusList(Arrays.asList(SalaryArchiveStatusEnum.STOP_FROM_PENDING.getValue(), SalaryArchiveStatusEnum.STOP_FROM_SUSPEND.getValue())); + return list(queryParam, SalaryArchiveListTypeEnum.STOP); + } + +// /** +// * 设为定薪员工 +// * +// * @param ids +// * @param currentEmployeeId +// * @param currentTenantKey +// * @return +// */ +// public Map gotoFixed(Collection ids, Long currentEmployeeId, String currentTenantKey) { +// return getSalaryArchiveService(user).gotoFixed(ids, currentEmployeeId, currentTenantKey); +// } +// +// /** +// * 一键全部定薪 +// * +// * @param queryParam +// * @param currentEmployeeId +// * @param currentTenantKey +// * @return +// */ +// public Map allGotoFixed(SalaryArchiveQueryParam queryParam, Long currentEmployeeId, String currentTenantKey) { +// return getSalaryArchiveService(user).allGotoFixed(queryParam, currentEmployeeId, currentTenantKey); +// } +// +// /** +// * 删除待定薪待办 +// * +// * @param ids +// * @param currentEmployeeId +// * @param currentTenantKey +// * @return +// */ +// public String deletePendingTodo(Collection ids, Long currentEmployeeId, String currentTenantKey) { +// return getSalaryArchiveService(user).deletePendingTodo(ids, currentEmployeeId, currentTenantKey); +// } +// +// /** +// * 停薪 +// * +// * @param ids +// * @param currentEmployeeId +// * @param currentTenantKey +// * @return +// */ +// public Map gotoStop(Collection ids, Long currentEmployeeId, String currentTenantKey) { +// return getSalaryArchiveService(user).gotoStop(ids, currentEmployeeId, currentTenantKey); +// } +// +// /** +// * 一键全部停薪 +// * +// * @param queryParam +// * @param currentEmployeeId +// * @param currentTenantKey +// * @return +// */ +// public Map allGotoStop(SalaryArchiveQueryParam queryParam, Long currentEmployeeId, String currentTenantKey) { +// return getSalaryArchiveService(user).allGotoStop(queryParam, currentEmployeeId, currentTenantKey); +// } +// +// /** +// * 删除待停薪待办 +// * +// * @param ids +// * @param currentEmployeeId +// * @param currentTenantKey +// * @return +// */ +// public String deleteSuspendTodo(Collection ids, Long currentEmployeeId, String currentTenantKey) { +// return getSalaryArchiveService(user).deleteSuspendTodo(ids, currentEmployeeId, currentTenantKey); +// } +// +// /** +// * 取消停薪 +// * +// * @param ids +// * @param currentEmployeeId +// * @param currentTenantKey +// * @return +// */ +// public String cancelStop(Collection ids, Long currentEmployeeId, String currentTenantKey) { +// return getSalaryArchiveService(user).cancelStop(ids, currentEmployeeId, currentTenantKey); +// } + + /** * 获取薪资档案详情表单 * @@ -379,5 +554,4 @@ public class SalaryArchiveWrapper extends Service { } - }