2022-03-16 14:29:02 +08:00
|
|
|
package com.engine.salary.web;
|
|
|
|
|
|
2022-03-21 09:33:21 +08:00
|
|
|
import com.engine.common.util.ServiceUtil;
|
|
|
|
|
import com.engine.salary.component.WeaFormOption;
|
|
|
|
|
import com.engine.salary.entity.salaryitem.param.SalaryItemSearchParam;
|
|
|
|
|
import com.engine.salary.util.ResponseResult;
|
|
|
|
|
import com.engine.salary.wrapper.SalaryItemWrapper;
|
|
|
|
|
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
|
|
|
|
import weaver.hrm.HrmUserVarify;
|
|
|
|
|
import weaver.hrm.User;
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
import javax.ws.rs.GET;
|
|
|
|
|
import javax.ws.rs.POST;
|
|
|
|
|
import javax.ws.rs.Path;
|
|
|
|
|
import javax.ws.rs.Produces;
|
|
|
|
|
import javax.ws.rs.core.Context;
|
|
|
|
|
import javax.ws.rs.core.MediaType;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
2022-03-16 14:29:02 +08:00
|
|
|
/**
|
|
|
|
|
* 薪资项目
|
|
|
|
|
* <p>Copyright: Copyright (c) 2022</p>
|
|
|
|
|
* <p>Company: 泛微软件</p>
|
|
|
|
|
*
|
|
|
|
|
* @author qiantao
|
|
|
|
|
* @version 1.0
|
|
|
|
|
**/
|
|
|
|
|
public class SalaryItemController {
|
|
|
|
|
|
2022-03-21 09:33:21 +08:00
|
|
|
private SalaryItemWrapper getSalaryItemWrapper(User user) {
|
|
|
|
|
return ServiceUtil.getService(SalaryItemWrapper.class, user);
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-16 14:29:02 +08:00
|
|
|
// @Autowired
|
|
|
|
|
// private SysSalaryItemWrapper sysSalaryItemWrapper;
|
|
|
|
|
//
|
|
|
|
|
// /**********************************自定义薪资项目 start*********************************/
|
2022-03-21 09:33:21 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 薪资项目列表
|
|
|
|
|
*/
|
|
|
|
|
@POST
|
|
|
|
|
@Path("/list")
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
public String listSalaryItem(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryItemSearchParam searchParam) {
|
|
|
|
|
User user = HrmUserVarify.getUser(request, response);
|
|
|
|
|
return new ResponseResult<SalaryItemSearchParam, Map<String, Object>>().run(getSalaryItemWrapper(user)::listPage, searchParam);
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-16 14:29:02 +08:00
|
|
|
// @PostMapping("/listCanDelete")
|
|
|
|
|
// @ApiOperation("可删除的薪资项目列表")
|
|
|
|
|
// @WeaPermission
|
|
|
|
|
// public WeaResult<WeaTable<SalaryItemListDTO>> listCanDeleteSalaryItem(@RequestBody SalaryItemSearchParam searchParam) {
|
|
|
|
|
// return WeaResult.success(salaryItemWrapper.listPage4CanDelete(searchParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()));
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// @PostMapping("/listSalaryItemDetail")
|
|
|
|
|
// @ApiOperation("获取多个薪资项目的详情")
|
|
|
|
|
// @WeaPermission
|
|
|
|
|
// public WeaResult<List<SalaryItemListDTO>> listSalaryItemDetail(@RequestBody Collection<Long> ids) {
|
|
|
|
|
// if (CollectionUtils.isEmpty(ids)) {
|
|
|
|
|
// return WeaResult.success(Collections.emptyList());
|
|
|
|
|
// }
|
|
|
|
|
// List<SalaryItemListDTO> salaryItemListDTOS = salaryItemWrapper.listByIds(ids, TenantContext.getCurrentTenantKey());
|
|
|
|
|
// return WeaResult.success(salaryItemListDTOS);
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// @GetMapping("/getSearchCondition")
|
|
|
|
|
// @ApiOperation("薪资项目列表的高级搜索")
|
|
|
|
|
// @WeaPermission
|
|
|
|
|
// public WeaResult<WeaSearchCondition> getSearchCondition() {
|
|
|
|
|
// return WeaResult.success(salaryItemWrapper.getSearchCondition());
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// @PostMapping("/getSalaryForm")
|
|
|
|
|
// @ApiOperation("薪资项目的详情")
|
|
|
|
|
// @WeaPermission
|
|
|
|
|
// public WeaResult<WeaForm> getSalaryItemForm(@RequestParam(value = "id", required = false) Long id) {
|
|
|
|
|
// return WeaResult.success(salaryItemWrapper.getForm(id, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()));
|
|
|
|
|
// }
|
|
|
|
|
//
|
2022-03-21 09:33:21 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* "获取薪资项目可选的类型(与属性有联动)"
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@GET
|
|
|
|
|
@Path("/listSalaryItemTypeOption")
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
public String listSalaryItemTypeOption(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
|
|
|
|
User user = HrmUserVarify.getUser(request, response);
|
|
|
|
|
return new ResponseResult<String, Map<String, List<WeaFormOption>>>().run(getSalaryItemWrapper(user)::listSalaryItemTypeOption);
|
|
|
|
|
}
|
2022-03-16 14:29:02 +08:00
|
|
|
//
|
|
|
|
|
// @PostMapping("/delete")
|
|
|
|
|
// @ApiOperation("批量删除薪资项目")
|
|
|
|
|
// @WeaPermission
|
|
|
|
|
// public WeaResult<Object> deleteSalaryItem(@RequestBody Collection<Long> ids) {
|
|
|
|
|
// Long employeeId = UserContext.getCurrentEmployeeId();
|
|
|
|
|
// String tenantKey = TenantContext.getCurrentTenantKey();
|
|
|
|
|
// if (CollectionUtils.isEmpty(ids)) {
|
|
|
|
|
// return WeaResult.fail(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 84026, "参数错误"));
|
|
|
|
|
// }
|
|
|
|
|
// salaryItemWrapper.delete(ids, tenantKey);
|
|
|
|
|
// return WeaResult.success(null);
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// @PostMapping("/save")
|
|
|
|
|
// @ApiOperation("保存薪资项目")
|
|
|
|
|
// @WeaPermission
|
|
|
|
|
// public WeaResult<Object> saveSalaryItem(@RequestBody @Validated SalaryItemSaveParam saveParam) {
|
|
|
|
|
// if (saveParam.getId() == null || saveParam.getId() <= 0) {
|
|
|
|
|
// salaryItemWrapper.save(saveParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey());
|
|
|
|
|
// } else {
|
|
|
|
|
// salaryItemWrapper.update(saveParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey());
|
|
|
|
|
// }
|
|
|
|
|
// return WeaResult.success(null);
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// @PostMapping("/update")
|
|
|
|
|
// @ApiOperation("更新薪资项目")
|
|
|
|
|
// @WeaPermission
|
|
|
|
|
// public WeaResult<Object> updateSalaryItem(@RequestBody @Validated SalaryItemSaveParam saveParam) {
|
|
|
|
|
// salaryItemWrapper.update(saveParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey());
|
|
|
|
|
// return WeaResult.success(null);
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// /**********************************自定义薪资项目 end*********************************/
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// /**********************************系统薪资项目 start*********************************/
|
|
|
|
|
//
|
|
|
|
|
// @PostMapping("/sysList")
|
|
|
|
|
// @ApiOperation("系统薪资项目列表")
|
|
|
|
|
// @WeaPermission
|
|
|
|
|
// public WeaResult<WeaTable<SysSalaryItemListDTO>> listSysSalaryItem(@RequestBody SysSalaryItemSearchParam searchParam) {
|
|
|
|
|
// return WeaResult.success(sysSalaryItemWrapper.listPage(searchParam, TenantContext.getCurrentTenantKey()));
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// @GetMapping("/getSysSearchCondition")
|
|
|
|
|
// @ApiOperation("系统薪资项目的高级搜索")
|
|
|
|
|
// @WeaPermission
|
|
|
|
|
// public WeaResult<WeaSearchCondition> getSysSearchCondition() {
|
|
|
|
|
// return WeaResult.success(sysSalaryItemWrapper.getSearchCondition());
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// @PostMapping("/saveSys")
|
|
|
|
|
// @ApiOperation("添加系统薪资项目")
|
|
|
|
|
// @WeaPermission
|
|
|
|
|
// public WeaResult<Object> saveSysSalaryItem(@RequestBody Collection<Long> sysSalaryItemIds) {
|
|
|
|
|
// Long employeeId = UserContext.getCurrentEmployeeId();
|
|
|
|
|
// String tenantKey = TenantContext.getCurrentTenantKey();
|
|
|
|
|
// if (CollectionUtils.isEmpty(sysSalaryItemIds)) {
|
|
|
|
|
// return WeaResult.fail(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 84026, "参数错误"));
|
|
|
|
|
// }
|
|
|
|
|
// sysSalaryItemWrapper.add2SalaryItem(sysSalaryItemIds, employeeId, tenantKey);
|
|
|
|
|
// return WeaResult.success(null);
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// /**********************************系统薪资项目 end*********************************/
|
|
|
|
|
}
|