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-03-10 15:09:44 +08:00
|
|
|
|
import com.engine.salary.entity.sicategory.dto.ICategoryFormDTO;
|
|
|
|
|
|
import com.engine.salary.entity.sicategory.param.UpdateStatusParam;
|
2022-03-11 14:28:39 +08:00
|
|
|
|
import com.engine.salary.entity.sischeme.dto.InsuranceSchemeDTO;
|
|
|
|
|
|
import com.engine.salary.enums.sicategory.WelfareTypeEnum;
|
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;
|
2022-03-10 15:09:44 +08:00
|
|
|
|
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
2022-03-11 14:28:39 +08:00
|
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
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;
|
2022-03-10 15:09:44 +08:00
|
|
|
|
import java.util.Collection;
|
2022-03-09 16:12:47 +08:00
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* @Author weaver_cl
|
|
|
|
|
|
* @Description: TODO 社保自定义福利控制器
|
|
|
|
|
|
* @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);
|
|
|
|
|
|
return ResponseResult.run(getService(user)::getForm, map);
|
|
|
|
|
|
}
|
2022-03-10 15:09:44 +08:00
|
|
|
|
|
2022-03-11 14:28:39 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 查询自定义福利列表
|
|
|
|
|
|
*/
|
|
|
|
|
|
@GET
|
|
|
|
|
|
@Path("/customCategoryList")
|
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
|
public String listPage(@Context HttpServletRequest request, @Context HttpServletResponse response,
|
|
|
|
|
|
@RequestParam(value = "welfareTypeEnum") WelfareTypeEnum welfareTypeEnum) {
|
|
|
|
|
|
User user = HrmUserVarify.getUser(request, response);
|
|
|
|
|
|
InsuranceSchemeDTO insuranceSchemeDTO = InsuranceSchemeDTO.builder().welfareType(welfareTypeEnum).build();
|
|
|
|
|
|
Integer welfareType = insuranceSchemeDTO.getWelfareType().getValue();
|
|
|
|
|
|
Map<String, Object> map = ParamUtil.request2Map(request);
|
|
|
|
|
|
map.put("welfareType",welfareType);
|
|
|
|
|
|
return ResponseResult.run(getService(user)::listPage, map);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
return ResponseResult.run(getService(user)::insert, map);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 编辑
|
|
|
|
|
|
* @param request
|
|
|
|
|
|
* @param response
|
|
|
|
|
|
* @param iCategoryFormDTO
|
|
|
|
|
|
* @return
|
|
|
|
|
|
*/
|
|
|
|
|
|
@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 ResponseResult.run(getService(user)::update, map);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 该接口暂时没用,删除福利类型对档案和台账核算都有很大的影响,暂时还没考虑好怎么做
|
|
|
|
|
|
* 删除福利类型
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param request
|
|
|
|
|
|
* @param response
|
|
|
|
|
|
* @return
|
|
|
|
|
|
*/
|
|
|
|
|
|
@POST
|
|
|
|
|
|
@Path("/deleteCustomCategory")
|
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
|
public String deleteSoftById(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
|
|
|
|
|
User user = HrmUserVarify.getUser(request, response);
|
|
|
|
|
|
return null;
|
|
|
|
|
|
//return ResponseResult.run(getService(user)::delete, map);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
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());
|
|
|
|
|
|
return ResponseResult.run(getService(user)::updateStatusById, map);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-03-09 16:12:47 +08:00
|
|
|
|
}
|