Commit 41f1c465 authored by huyuchen's avatar huyuchen

huych-入职确认信息编辑提交

parent 6917e07a
......@@ -1398,7 +1398,11 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
updateFileId(registration);
}
//企业微信消息提醒
sendMessageToWx(registration, registration.getFeedbackType());
if (registration.getFeedbackType().equals(CommonConstants.ONE_STRING)) {
sendMessageToWxSingle(registration);
} else {
sendMessageToWx(registration, registration.getFeedbackType());
}
//操作记录
logService.saveLog(registration.getId(), CommonConstants.ZERO_STRING, RegistConstants.MESSAGE_REGIST, LocalDateTime.now(),
registration.getRegistorUsername(), null);
......@@ -1839,6 +1843,54 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
}
}
//发送企业微信待办
private void sendMessageToWxSingle(EmployeeRegistration registration) {
//获取前端客服
SysUser user;
if (Common.isEmpty(registration.getCustomerUserLoginname())) {
return;
}
R<SysUser> res = upmsDaprUtils.getSimpleUserByLoginName(registration.getCustomerUserLoginname());
if (Common.isNotNull(res) && Common.isNotNull(res.getData())) {
user = res.getData();
} else {
return;
}
StringBuilder sendUser = null;
if (Common.isNotKong(user.getWxMessage())) {
sendUser = new StringBuilder(user.getWxMessage());
}
if (sendUser != null) {
RestTemplate restTemplate = new RestTemplate();
Map<String, Object> requestMap = new HashMap<>();
Map<String, Object> textcard = new HashMap<>();
String authUrl = String.format(SecurityConstants.WX_GET_MESSAGE_AUTH_URL, wxConfig.getCorpid(), wxConfig.getDomainName() + "/auth/oauth/wxLogin", "64" + registration.getId());
StringBuilder description = new StringBuilder();
String title = "作业自动化--人员入职通知";
description.append(registration.getEmployeeName())
.append("_")
.append(registration.getEmpIdcard())
.append("_")
.append(registration.getEmpPhone())
.append("<br>");
description.append("请及时处理").append("<br>");
textcard.put("title", title);
textcard.put("url", authUrl);
textcard.put("description", description.toString());
requestMap.put("touser", sendUser);
requestMap.put("agentid", wxConfig.getAgentid());
requestMap.put("msgtype", "textcard");
requestMap.put("textcard", textcard);
// 必须加上header说明
if (!wxConfig.sendTextCard(restTemplate, requestMap)) {
wxConfig.sendTextCard(restTemplate, requestMap);
}
//企业微信发送记录
logService.saveLog(user.getUserId(), CommonConstants.ZERO_STRING, "企业微信消息提醒", LocalDateTime.now(),
registration.getRegistorUsername(), "提醒人:" + user.getNickname());
}
}
/**
* @param searchCspVo 身份证与类型
* @Description: 获取已接收的入离职申请,同步所属部门到项目档案里
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment