package cn.stylefeng.guns.sys.modular.system.service.impl;
import cn.stylefeng.guns.base.pojo.page.LayuiPageFactory;
import cn.stylefeng.guns.base.pojo.page.LayuiPageInfo;
import cn.stylefeng.guns.sys.modular.system.entity.Position;
import cn.stylefeng.guns.sys.modular.system.entity.UserPos;
import cn.stylefeng.guns.sys.modular.system.mapper.PositionMapper;
import cn.stylefeng.guns.sys.modular.system.model.params.PositionParam;
import cn.stylefeng.guns.sys.modular.system.model.result.PositionResult;
import cn.stylefeng.guns.sys.modular.system.service.PositionService;
import cn.stylefeng.guns.sys.modular.system.service.UserPosService;
import cn.stylefeng.roses.core.util.ToolUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
/**
*
* 职位表 服务实现类
*
*
* @author stylefeng
* @since 2019-06-27
*/
@Service
public class PositionServiceImpl extends ServiceImpl implements PositionService {
@Autowired
private UserPosService userPosService;
@Override
public void add(PositionParam param) {
param.setStatus("ENABLE");
Position entity = getEntity(param);
this.save(entity);
}
@Override
public void delete(PositionParam param) {
this.removeById(getKey(param));
}
@Override
public void update(PositionParam param) {
Position oldEntity = getOldEntity(param);
Position newEntity = getEntity(param);
ToolUtil.copyProperties(newEntity, oldEntity);
this.updateById(newEntity);
}
@Override
public PositionResult findBySpec(PositionParam param) {
return null;
}
@Override
public List findListBySpec(PositionParam param) {
return null;
}
@Override
public LayuiPageInfo findPageBySpec(PositionParam param) {
Page pageContext = getPageContext();
IPage page = this.baseMapper.customPageList(pageContext, param);
return LayuiPageFactory.createPageInfo(page);
}
@Override
public LayuiPageInfo listPositions(Long userId) {
//找出所有职位
List