2023-03-01 09:05:03 +08:00
|
|
|
package com.engine.salary.web;
|
|
|
|
|
|
2023-03-03 14:40:17 +08:00
|
|
|
import com.engine.common.util.ServiceUtil;
|
|
|
|
|
import com.engine.salary.entity.extemp.param.ExtEmpQueryParam;
|
|
|
|
|
import com.engine.salary.entity.extemp.param.ExtEmpSaveParam;
|
|
|
|
|
import com.engine.salary.entity.extemp.po.ExtEmpPO;
|
|
|
|
|
import com.engine.salary.util.ResponseResult;
|
|
|
|
|
import com.engine.salary.wrapper.ExtEmpWrapper;
|
|
|
|
|
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.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.Collection;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
2023-03-01 09:05:03 +08:00
|
|
|
/**
|
2023-03-03 14:40:17 +08:00
|
|
|
* 外部人员
|
2023-03-01 09:05:03 +08:00
|
|
|
* <p>Copyright: Copyright (c) 2022</p>
|
|
|
|
|
* <p>Company: 泛微软件</p>
|
|
|
|
|
*
|
|
|
|
|
* @author qiantao
|
|
|
|
|
* @version 1.0
|
|
|
|
|
**/
|
|
|
|
|
public class ExtEmpController {
|
|
|
|
|
|
2023-03-03 14:40:17 +08:00
|
|
|
private ExtEmpWrapper getExtEmpWrapper(User user) {
|
|
|
|
|
return ServiceUtil.getService(ExtEmpWrapper.class, user);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@POST
|
|
|
|
|
@Path("/list")
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
public String list(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody ExtEmpQueryParam param) {
|
|
|
|
|
User user = HrmUserVarify.getUser(request, response);
|
|
|
|
|
return new ResponseResult<ExtEmpQueryParam, List<ExtEmpPO>>(user).run(getExtEmpWrapper(user)::list, param);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@POST
|
|
|
|
|
@Path("/save")
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
public String save(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody ExtEmpSaveParam param) {
|
|
|
|
|
User user = HrmUserVarify.getUser(request, response);
|
|
|
|
|
return new ResponseResult<ExtEmpSaveParam, String>(user).run(getExtEmpWrapper(user)::save, param);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@POST
|
|
|
|
|
@Path("/update")
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
public String update(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody ExtEmpSaveParam param) {
|
|
|
|
|
User user = HrmUserVarify.getUser(request, response);
|
|
|
|
|
return new ResponseResult<ExtEmpSaveParam, String>(user).run(getExtEmpWrapper(user)::update, param);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@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>, String>(user).run(getExtEmpWrapper(user)::delete, ids);
|
|
|
|
|
}
|
2023-03-01 09:05:03 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|