2022-03-09 16:12:47 +08:00
|
|
|
|
package com.engine.salary.web;
|
|
|
|
|
|
|
|
|
|
|
|
import com.engine.common.util.ParamUtil;
|
|
|
|
|
|
import com.engine.common.util.ServiceUtil;
|
2022-10-14 15:17:56 +08:00
|
|
|
|
import com.engine.salary.entity.sicategory.dto.ICategoryDTO;
|
2022-03-10 15:09:44 +08:00
|
|
|
|
import com.engine.salary.entity.sicategory.dto.ICategoryFormDTO;
|
2023-03-02 10:46:53 +08:00
|
|
|
|
import com.engine.salary.entity.sicategory.dto.ICategoryListDTO;
|
2022-03-10 15:09:44 +08:00
|
|
|
|
import com.engine.salary.entity.sicategory.param.UpdateStatusParam;
|
2023-03-02 10:46:53 +08:00
|
|
|
|
import com.engine.salary.entity.sischeme.param.InsuranceSchemeParam;
|
2022-03-09 16:12:47 +08:00
|
|
|
|
import com.engine.salary.service.SICategoryService;
|
|
|
|
|
|
import com.engine.salary.service.impl.SICategoryServiceImpl;
|
|
|
|
|
|
import com.engine.salary.util.ResponseResult;
|
2023-03-02 10:46:53 +08:00
|
|
|
|
import com.engine.salary.util.page.PageInfo;
|
2022-03-10 15:09:44 +08:00
|
|
|
|
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
2022-03-09 16:12:47 +08:00
|
|
|
|
import weaver.hrm.HrmUserVarify;
|
|
|
|
|
|
import weaver.hrm.User;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
2022-03-10 15:09:44 +08:00
|
|
|
|
import javax.ws.rs.*;
|
2022-03-09 16:12:47 +08:00
|
|
|
|
import javax.ws.rs.core.Context;
|
|
|
|
|
|
import javax.ws.rs.core.MediaType;
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* @Author weaver_cl
|
2022-07-13 11:45:16 +08:00
|
|
|
|
* @Description: 社保自定义福利控制器
|
2022-03-09 16:12:47 +08:00
|
|
|
|
* @Date 2022/3/9
|
|
|
|
|
|
* @Version V1.0
|
|
|
|
|
|
**/
|
|
|
|
|
|
public class SICategoryController {
|
|
|
|
|
|
|
|
|
|
|
|
private SICategoryService getService (User user) {
|
|
|
|
|
|
return ServiceUtil.getService(SICategoryServiceImpl.class,user);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 福利表单
|
|
|
|
|
|
* @param request
|
|
|
|
|
|
* @param response
|
|
|
|
|
|
* @return
|
|
|
|
|
|
*/
|
|
|
|
|
|
@GET
|
2022-03-10 15:09:44 +08:00
|
|
|
|
@Path("/customCategoryForm")
|
2022-03-09 16:12:47 +08:00
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
|
public String getForm(@Context HttpServletRequest request, @Context HttpServletResponse response,
|
|
|
|
|
|
@QueryParam(value = "id") Long id) {
|
|
|
|
|
|
User user = HrmUserVarify.getUser(request, response);
|
|
|
|
|
|
Map<String, Object> map = ParamUtil.request2Map(request);
|
|
|
|
|
|
map.put("id",id);
|
2022-05-05 10:35:58 +08:00
|
|
|
|
return new ResponseResult< Map<String, Object>, Map<String, Object>>(user).run(getService(user)::getForm, map);
|
2022-03-09 16:12:47 +08:00
|
|
|
|
}
|
2022-03-10 15:09:44 +08:00
|
|
|
|
|
2022-03-11 14:28:39 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 查询自定义福利列表
|
|
|
|
|
|
*/
|
2023-03-02 10:46:53 +08:00
|
|
|
|
@POST
|
2022-03-11 14:28:39 +08:00
|
|
|
|
@Path("/customCategoryList")
|
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
|
public String listPage(@Context HttpServletRequest request, @Context HttpServletResponse response,
|
2023-03-02 10:46:53 +08:00
|
|
|
|
@RequestBody InsuranceSchemeParam queryParam) {
|
2022-03-11 14:28:39 +08:00
|
|
|
|
User user = HrmUserVarify.getUser(request, response);
|
2023-03-02 10:46:53 +08:00
|
|
|
|
return new ResponseResult< InsuranceSchemeParam, PageInfo<ICategoryListDTO>>(user).run(getService(user)::listPage, queryParam);
|
2022-03-11 14:28:39 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-03-10 15:09:44 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 新增
|
|
|
|
|
|
* @param request
|
|
|
|
|
|
* @param response
|
|
|
|
|
|
* @return
|
|
|
|
|
|
*/
|
|
|
|
|
|
@POST
|
|
|
|
|
|
@Path("/createSICategory")
|
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
|
public String insert(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody ICategoryFormDTO iCategoryFormDTO) {
|
|
|
|
|
|
User user = HrmUserVarify.getUser(request, response);
|
|
|
|
|
|
Map<String, Object> map = ParamUtil.request2Map(request);
|
|
|
|
|
|
map.put("iCategoryFormDTO",iCategoryFormDTO);
|
2022-05-05 10:35:58 +08:00
|
|
|
|
return new ResponseResult< Map<String, Object>, Map<String, Object>>(user).run(getService(user)::insert, map);
|
2022-03-10 15:09:44 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-10-14 15:17:56 +08:00
|
|
|
|
|
|
|
|
|
|
|
2022-03-10 15:09:44 +08:00
|
|
|
|
/**
|
2022-10-14 15:17:56 +08:00
|
|
|
|
* @description 获取指定自定义福利信息
|
|
|
|
|
|
* @return String
|
|
|
|
|
|
* @author Harryxzy
|
|
|
|
|
|
* @date 2022/10/14 11:34
|
2022-03-10 15:09:44 +08:00
|
|
|
|
*/
|
|
|
|
|
|
@POST
|
2022-10-14 15:17:56 +08:00
|
|
|
|
@Path("/getCustomCategoryByID")
|
2022-03-10 15:09:44 +08:00
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
2022-10-14 15:17:56 +08:00
|
|
|
|
public String getCustomCategoryByID(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody ICategoryFormDTO iCategoryFormDTO) {
|
|
|
|
|
|
User user = HrmUserVarify.getUser(request, response);
|
|
|
|
|
|
return new ResponseResult< Long, ICategoryDTO>(user).run(getService(user)::getByID, iCategoryFormDTO.getId());
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* @description 编辑自定义福利名称
|
|
|
|
|
|
* @return String
|
|
|
|
|
|
* @author Harryxzy
|
|
|
|
|
|
* @date 2022/10/14 11:37
|
|
|
|
|
|
*/
|
|
|
|
|
|
@POST
|
|
|
|
|
|
@Path("/updateCustomCategoryName")
|
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
|
public String updateCustomCategoryName(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody ICategoryFormDTO iCategoryFormDTO) {
|
2022-03-10 15:09:44 +08:00
|
|
|
|
User user = HrmUserVarify.getUser(request, response);
|
|
|
|
|
|
Map<String, Object> map = ParamUtil.request2Map(request);
|
2023-07-25 14:28:35 +08:00
|
|
|
|
// return new ResponseResult< ICategoryFormDTO, Map<String, Object>>(user).run(getService(user)::updateCategoryName, iCategoryFormDTO);
|
|
|
|
|
|
return new ResponseResult< ICategoryFormDTO, Map<String, Object>>(user).run(getService(user)::updateCategoryNameAndPayScope, iCategoryFormDTO);
|
2022-03-10 15:09:44 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-10-14 15:17:56 +08:00
|
|
|
|
|
|
|
|
|
|
// @POST
|
|
|
|
|
|
// @Path("/updateCustomCategory")
|
|
|
|
|
|
// @Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
|
// public String update(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody ICategoryFormDTO iCategoryFormDTO) {
|
|
|
|
|
|
// User user = HrmUserVarify.getUser(request, response);
|
|
|
|
|
|
// Map<String, Object> map = ParamUtil.request2Map(request);
|
|
|
|
|
|
// map.put("iCategoryFormDTO",iCategoryFormDTO);
|
|
|
|
|
|
// return new ResponseResult< Map<String, Object>, Map<String, Object>>(user).run(getService(user)::update, map);
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-10 15:09:44 +08:00
|
|
|
|
/**
|
2023-07-25 16:17:24 +08:00
|
|
|
|
* 删除自定义福利项
|
2023-07-26 14:04:42 +08:00
|
|
|
|
* 必要条件:
|
|
|
|
|
|
* 1-福利项未启用,
|
|
|
|
|
|
* 2-福利核算数据中不能存在该福利项的核算数据
|
2022-03-10 15:09:44 +08:00
|
|
|
|
*/
|
2023-07-26 14:04:42 +08:00
|
|
|
|
|
2022-03-10 15:09:44 +08:00
|
|
|
|
@POST
|
|
|
|
|
|
@Path("/deleteCustomCategory")
|
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
2023-07-25 16:17:24 +08:00
|
|
|
|
public String deleteCustomCategory(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody ICategoryFormDTO iCategoryFormDTO) {
|
2022-03-10 15:09:44 +08:00
|
|
|
|
User user = HrmUserVarify.getUser(request, response);
|
2023-07-25 16:17:24 +08:00
|
|
|
|
return new ResponseResult< ICategoryFormDTO, Map<String, Object>>(user).run(getService(user)::deleteCustomCategory, iCategoryFormDTO);
|
2022-03-10 15:09:44 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-10 15:26:09 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 更新自定义福利的启用停用状态
|
|
|
|
|
|
* @param request
|
|
|
|
|
|
* @param response
|
|
|
|
|
|
* @param updateStatusParam
|
|
|
|
|
|
* @return
|
|
|
|
|
|
*/
|
2022-03-10 15:09:44 +08:00
|
|
|
|
@POST
|
|
|
|
|
|
@Path("/updateCustomCategoryStatus")
|
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
|
public String updateStatusById(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody UpdateStatusParam updateStatusParam) {
|
|
|
|
|
|
User user = HrmUserVarify.getUser(request, response);
|
|
|
|
|
|
Map<String, Object> map = ParamUtil.request2Map(request);
|
|
|
|
|
|
map.put("id",updateStatusParam.getId());
|
|
|
|
|
|
map.put("isUse",updateStatusParam.getIsUse());
|
2022-05-05 10:35:58 +08:00
|
|
|
|
return new ResponseResult< Map<String, Object>, Map<String, Object>>(user).run(getService(user)::updateStatusById, map);
|
2022-03-10 15:09:44 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-03-09 16:12:47 +08:00
|
|
|
|
}
|