【7.6.0】format类增加职务id的转化

pull/55/head
fengshuonan 2023-05-04 21:24:34 +08:00
parent c66e0d9c9f
commit fe55faf0a1
1 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,34 @@
package cn.stylefeng.roses.kernel.system.api.format;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.extra.spring.SpringUtil;
import cn.stylefeng.roses.kernel.rule.format.BaseSimpleFieldFormatProcess;
import cn.stylefeng.roses.kernel.system.api.PositionServiceApi;
import cn.stylefeng.roses.kernel.system.api.pojo.organization.HrPositionDTO;
/**
* JSONid
*
* @author fengshuonan
* @since 2023/5/4 21:20
*/
public class PositionFormatProcess extends BaseSimpleFieldFormatProcess {
@Override
public Class<?> getItemClass() {
return Long.class;
}
@Override
public Object simpleItemFormat(Object businessId) {
Long positionId = Convert.toLong(businessId);
PositionServiceApi bean = SpringUtil.getBean(PositionServiceApi.class);
HrPositionDTO positionDetail = bean.getPositionDetail(positionId);
if (ObjectUtil.isEmpty(positionDetail)) {
return null;
}
return positionDetail.getPositionName();
}
}