weaver-hrm-recruit/src/weaver/formmode/recruit/modeexpand/util/RecruitModeUtil.java

71 lines
2.0 KiB
Java
Raw Normal View History

package weaver.formmode.recruit.modeexpand.util;
import com.cloudstore.dev.api.bean.MessageBean;
import com.cloudstore.dev.api.bean.MessageType;
import com.cloudstore.dev.api.util.Util_Message;
import weaver.general.BaseBean;
import weaver.hrm.resource.ResourceComInfo;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.Set;
/**
* @author:dxfeng
* @createTime: 2023/09/26
* @version: 1.0
*/
public class RecruitModeUtil {
/**
* 消息推送
*
* @param messageType 消息来源
* @param title 消息标题
* @param context 消息内容
* @param userIdList 接收人ID集合
* @param creater 消息创建者
*/
public static void messagePush(String messageType, String title, String context, Set<String> userIdList, Integer creater) {
MessageType message = MessageType.newInstance(Integer.parseInt(messageType));
try {
MessageBean messageBean = Util_Message.createMessage(message, userIdList, title, context, "", "");
messageBean.setCreater(creater);
Util_Message.store(messageBean);
} catch (IOException e) {
new BaseBean().writeLog(e);
e.printStackTrace();
}
}
/**
* 获取人员姓名
*
* @param ids 人员ID
* @return 人员姓名
*/
public static String getResourceNames(String ids) {
try {
return new ResourceComInfo().getLastnames(ids);
} catch (Exception e) {
new BaseBean().writeLog(e);
throw new RuntimeException(e);
}
}
/**
* 获取聚才林招聘相关配置文件
*
* @param key
* @return
*/
public static String getRecruitPropValue(String key) {
String value = new BaseBean().getPropValue("jclRecruit", key);
try {
value = new String(value.getBytes("ISO-8859-1"), "utf-8");
} catch (UnsupportedEncodingException e) {
new BaseBean().writeLog(e);
}
return value;
}
}