2023-04-10 09:47:33 +08:00
|
|
|
package com.engine.salary.report.web;
|
|
|
|
|
|
2023-04-11 09:22:09 +08:00
|
|
|
import com.engine.common.util.ServiceUtil;
|
|
|
|
|
import com.engine.salary.report.entity.param.SalaryStatisticsReportDataQueryParam;
|
|
|
|
|
import com.engine.salary.report.entity.param.SalaryStatisticsReportQueryParam;
|
|
|
|
|
import com.engine.salary.report.entity.param.SalaryStatisticsReportSaveParam;
|
2023-04-10 12:43:48 +08:00
|
|
|
import com.engine.salary.report.wrapper.SalaryStatisticsReportWrapper;
|
2023-04-11 09:22:09 +08:00
|
|
|
import com.engine.salary.util.ResponseResult;
|
|
|
|
|
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
|
|
|
|
import weaver.hrm.HrmUserVarify;
|
|
|
|
|
import weaver.hrm.User;
|
2023-04-10 09:47:33 +08:00
|
|
|
|
2023-04-11 09:22:09 +08:00
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
import javax.ws.rs.*;
|
|
|
|
|
import javax.ws.rs.core.Context;
|
|
|
|
|
import javax.ws.rs.core.MediaType;
|
2023-04-10 09:47:33 +08:00
|
|
|
import java.util.Collection;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Description: 薪酬统计报表
|
|
|
|
|
* @Author: wangxiangzhong
|
|
|
|
|
* @Date: 2022/12/15 11:40
|
|
|
|
|
*/
|
|
|
|
|
public class SalaryStatisticsReportController {
|
|
|
|
|
|
2023-04-11 09:22:09 +08:00
|
|
|
private SalaryStatisticsReportWrapper getSalaryStatisticsReportWrapper(User user) {
|
|
|
|
|
return ServiceUtil.getService(SalaryStatisticsReportWrapper.class, user);
|
|
|
|
|
}
|
|
|
|
|
|
2023-04-10 09:47:33 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 薪酬统计报表列表
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
2023-04-11 09:22:09 +08:00
|
|
|
@POST
|
|
|
|
|
@Path("/list")
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
public String list(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryStatisticsReportQueryParam queryParam) {
|
|
|
|
|
User user = HrmUserVarify.getUser(request, response);
|
|
|
|
|
return new ResponseResult<SalaryStatisticsReportQueryParam, List<Map<String, Object>>>(user).run(getSalaryStatisticsReportWrapper(user)::list, queryParam);
|
2023-04-10 09:47:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取薪酬统计报表表单
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
2023-04-11 09:22:09 +08:00
|
|
|
@GET
|
|
|
|
|
@Path("/getForm")
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
public String getForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) {
|
|
|
|
|
User user = HrmUserVarify.getUser(request, response);
|
2023-04-18 18:55:38 +08:00
|
|
|
return new ResponseResult<Long, Map<String,Object>>(user).run(getSalaryStatisticsReportWrapper(user)::getFrom, id);
|
2023-04-10 09:47:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 保存薪酬统计报表
|
|
|
|
|
*
|
2023-04-11 09:22:09 +08:00
|
|
|
* @param param
|
2023-04-10 09:47:33 +08:00
|
|
|
* @return
|
|
|
|
|
*/
|
2023-04-11 09:22:09 +08:00
|
|
|
@POST
|
|
|
|
|
@Path("/save")
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
public String save(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryStatisticsReportSaveParam param) {
|
|
|
|
|
User user = HrmUserVarify.getUser(request, response);
|
|
|
|
|
return new ResponseResult<SalaryStatisticsReportSaveParam, String>(user).run(getSalaryStatisticsReportWrapper(user)::save, param);
|
2023-04-10 09:47:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 删除薪酬统计报表
|
|
|
|
|
*
|
|
|
|
|
* @param ids
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
2023-04-11 09:22:09 +08:00
|
|
|
@POST
|
|
|
|
|
@Path("/delete")
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
public String delete(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody Collection<Long> ids) {
|
|
|
|
|
User user = HrmUserVarify.getUser(request, response);
|
|
|
|
|
return new ResponseResult<Collection<Long>, Map<String, Object>>(user).run(getSalaryStatisticsReportWrapper(user)::delete, ids);
|
2023-04-10 09:47:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2023-04-11 09:22:09 +08:00
|
|
|
// @GetMapping("/getSearchCondition")
|
|
|
|
|
// @ApiOperation("获取薪酬统计报表查询条件")
|
|
|
|
|
// @WeaPermission(publicPermission = true)
|
|
|
|
|
// public WeaResult<WeaSearchCondition> getSearchCondition(@RequestParam Long id) {
|
|
|
|
|
// return WeaResult.success(salaryStatisticsReportWrapper.getSearchCondition(id, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()));
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// /**
|
|
|
|
|
// * 保存薪酬统计报表查询条件
|
|
|
|
|
// *
|
|
|
|
|
// * @param param
|
|
|
|
|
// * @return
|
|
|
|
|
// */
|
|
|
|
|
// @PostMapping("/saveSearchCondition")
|
|
|
|
|
// @ApiOperation("保存薪酬统计报表查询条件")
|
|
|
|
|
// @WeaPermission(publicPermission = true)
|
|
|
|
|
// public WeaResult<String> saveSearchCondition(@RequestBody SalaryStatisticsSearchConditionSaveParam param) {
|
|
|
|
|
// return WeaResult.success(salaryStatisticsReportWrapper.saveSearchCondition(param, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()));
|
|
|
|
|
// }
|
2023-04-10 09:47:33 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取薪酬统计报表数据
|
|
|
|
|
*
|
|
|
|
|
* @param param
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
2023-04-11 09:22:09 +08:00
|
|
|
@POST
|
|
|
|
|
@Path("/getData")
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
2023-04-18 18:55:38 +08:00
|
|
|
public String getData(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryStatisticsReportDataQueryParam param) {
|
2023-04-11 09:22:09 +08:00
|
|
|
User user = HrmUserVarify.getUser(request, response);
|
|
|
|
|
return new ResponseResult<SalaryStatisticsReportDataQueryParam, Map<String, Object>>(user).run(getSalaryStatisticsReportWrapper(user)::getData, param);
|
2023-04-10 09:47:33 +08:00
|
|
|
}
|
|
|
|
|
|
2023-04-11 09:22:09 +08:00
|
|
|
// /**
|
|
|
|
|
// * 导出报表数据
|
|
|
|
|
// *
|
|
|
|
|
// * @param param
|
|
|
|
|
// * @return
|
|
|
|
|
// */
|
|
|
|
|
// @PostMapping("/exportData")
|
|
|
|
|
// @ApiOperation("导出报表数据")
|
|
|
|
|
// @WeaPermission(publicPermission = true)
|
|
|
|
|
// public WeaResult<Map<String, String>> exportData(@RequestBody SalaryStatisticsReportDataQueryParam param) {
|
|
|
|
|
// return WeaResult.success(salaryStatisticsReportWrapper.exportData(param, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()));
|
2023-04-10 09:47:33 +08:00
|
|
|
}
|