package com.thhy.staff.modules.biz.position.controller;
|
|
import com.github.pagehelper.PageInfo;
|
import com.thhy.general.common.BasicResult;
|
import com.thhy.general.utils.PagingUtils;
|
import com.thhy.staff.modules.biz.group.entity.Group;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import com.thhy.staff.modules.biz.position.entity.Position;
|
import com.thhy.staff.modules.biz.position.service.PositionService;
|
import java.io.Serializable;
|
import java.util.HashMap;
|
import java.util.List;
|
import javax.servlet.http.HttpServletRequest;
|
import org.springframework.web.bind.annotation.RestController;
|
|
/**
|
* @author zhang_xiao_bo
|
* @since 2023-03-31 10:41:42
|
*/
|
@RestController
|
@RequestMapping("position")
|
public class PositionController {
|
|
@Autowired
|
private PositionService positionService;
|
|
@RequestMapping("findList")
|
public BasicResult findList(@RequestBody(required = false) Position position,HttpServletRequest req){
|
PagingUtils.setPageParam(req);
|
List<Position> positionList = positionService.findList(position);
|
PageInfo<Position> pageInfo = new PageInfo<>(positionList);
|
return BasicResult.success(pageInfo);
|
}
|
|
@RequestMapping("pulldown")
|
public BasicResult pulldown(@RequestBody(required = false) Position position, HttpServletRequest req){
|
|
List<HashMap<String,Object>> mapList = positionService.pulldown(position);
|
return BasicResult.success(mapList);
|
}
|
|
/**
|
* 根据分公司
|
* @param position
|
* @return
|
*/
|
@RequestMapping("findall")
|
public BasicResult findall(@RequestBody Position position){
|
List<HashMap<String,Object>> mapList = positionService.pulldown(position);
|
return BasicResult.success(mapList);
|
}
|
|
@RequestMapping("addPosition")
|
public BasicResult addPosition(@RequestBody Position position){
|
positionService.addPosition(position);
|
return BasicResult.success();
|
}
|
|
/**
|
@RequestMapping("update")
|
public BasicResult update(@RequestBody Position position){
|
positionService.update(position);
|
return BasicResult.success();
|
}**/
|
|
@RequestMapping("delete")
|
public BasicResult delete(@RequestBody Position position){
|
positionService.delete(position.getPosId());
|
return BasicResult.success();
|
}
|
}
|