mirror of https://gitee.com/stylefeng/roses
【8.0】【sys】更新快速获取职务名称的format类
parent
4b626f09b0
commit
64e34f7635
|
@ -0,0 +1,19 @@
|
|||
package cn.stylefeng.roses.kernel.sys.api;
|
||||
|
||||
/**
|
||||
* 职位相关的业务api
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @since 2023/7/15 21:59
|
||||
*/
|
||||
public interface PositionServiceApi {
|
||||
|
||||
/**
|
||||
* 获取职务的名称
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @since 2023/6/12 16:38
|
||||
*/
|
||||
String getPositionName(Long positionId);
|
||||
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package cn.stylefeng.roses.kernel.sys.api.format;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import cn.stylefeng.roses.kernel.rule.format.BaseSimpleFieldFormatProcess;
|
||||
import cn.stylefeng.roses.kernel.sys.api.PositionServiceApi;
|
||||
|
||||
/**
|
||||
* 职位名称的格式化
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @since 2023/7/15 21:58
|
||||
*/
|
||||
public class PositionNameFormatProcess extends BaseSimpleFieldFormatProcess {
|
||||
|
||||
@Override
|
||||
public Class<?> getItemClass() {
|
||||
return Long.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object simpleItemFormat(Object businessId) {
|
||||
|
||||
if (businessId == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Long positionId = Convert.toLong(businessId);
|
||||
|
||||
PositionServiceApi positionServiceApi = SpringUtil.getBean(PositionServiceApi.class);
|
||||
|
||||
return positionServiceApi.getPositionName(positionId);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
package cn.stylefeng.roses.kernel.sys.modular.position.service;
|
||||
|
||||
import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
|
||||
import cn.stylefeng.roses.kernel.sys.api.PositionServiceApi;
|
||||
import cn.stylefeng.roses.kernel.sys.modular.position.entity.HrPosition;
|
||||
import cn.stylefeng.roses.kernel.sys.modular.position.pojo.request.HrPositionRequest;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
@ -13,7 +14,7 @@ import java.util.List;
|
|||
* @author fengshuonan
|
||||
* @date 2023/06/10 21:25
|
||||
*/
|
||||
public interface HrPositionService extends IService<HrPosition> {
|
||||
public interface HrPositionService extends IService<HrPosition>, PositionServiceApi {
|
||||
|
||||
/**
|
||||
* 新增
|
||||
|
@ -79,12 +80,4 @@ public interface HrPositionService extends IService<HrPosition> {
|
|||
*/
|
||||
PageResult<HrPosition> findPage(HrPositionRequest hrPositionRequest);
|
||||
|
||||
/**
|
||||
* 获取职务的名称
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @since 2023/6/12 16:38
|
||||
*/
|
||||
String getPositionName(Long positionId);
|
||||
|
||||
}
|
Loading…
Reference in New Issue