【8.0】【sys】更新快速获取职务名称的format类

pull/57/head
fengshuonan 2023-07-15 22:19:35 +08:00
parent 4b626f09b0
commit 64e34f7635
3 changed files with 56 additions and 9 deletions

View File

@ -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);
}

View File

@ -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);
}
}

View File

@ -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);
}