2023-09-26 15:21:22 +08:00
|
|
|
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;
|
2023-09-26 18:50:30 +08:00
|
|
|
import org.apache.commons.lang3.StringUtils;
|
2023-09-26 15:21:22 +08:00
|
|
|
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;
|
|
|
|
|
}
|
2023-09-26 18:50:30 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 转换空字符串为null
|
|
|
|
|
*
|
|
|
|
|
* @param str 字符串
|
|
|
|
|
* @return 转换后的字符串
|
|
|
|
|
*/
|
|
|
|
|
public static Object parseBlankToNull(String str) {
|
|
|
|
|
return StringUtils.isBlank(str) ? null : str;
|
|
|
|
|
}
|
|
|
|
|
|
2023-09-26 15:21:22 +08:00
|
|
|
}
|