|
@@ -14,13 +14,14 @@ import org.fouram.core.plugin.weixin.cp.util.WXCpMessageUtil;
|
|
import org.fouram.core.plugin.weixin.cp.util.WXCpUserUtil;
|
|
import org.fouram.core.plugin.weixin.cp.util.WXCpUserUtil;
|
|
import org.fouram.core.util.Base64Util;
|
|
import org.fouram.core.util.Base64Util;
|
|
import org.fouram.core.util.ConfConfig;
|
|
import org.fouram.core.util.ConfConfig;
|
|
-import org.fouram.core.util.DateUtil;
|
|
|
|
|
|
+import org.fouram.core.util.HttpClientUtil;
|
|
import org.fouram.core.util.JSONUtil;
|
|
import org.fouram.core.util.JSONUtil;
|
|
import org.fouram.core.util.JsonNodeUtil;
|
|
import org.fouram.core.util.JsonNodeUtil;
|
|
import org.fouram.core.util.LoggerUtil;
|
|
import org.fouram.core.util.LoggerUtil;
|
|
import org.fouram.core.util.Tools;
|
|
import org.fouram.core.util.Tools;
|
|
import org.fouram.dto.input.GetIngoreListDTO;
|
|
import org.fouram.dto.input.GetIngoreListDTO;
|
|
import org.fouram.dto.input.GetToBeConfirmedListDTO;
|
|
import org.fouram.dto.input.GetToBeConfirmedListDTO;
|
|
|
|
+import org.fouram.dto.input.UploadModifyEmpDTO;
|
|
import org.fouram.dto.output.GetIngoreListOutput;
|
|
import org.fouram.dto.output.GetIngoreListOutput;
|
|
import org.fouram.dto.output.GetToBeConfirmedListOutput;
|
|
import org.fouram.dto.output.GetToBeConfirmedListOutput;
|
|
import org.fouram.entity.SapMessageUser;
|
|
import org.fouram.entity.SapMessageUser;
|
|
@@ -34,6 +35,7 @@ import org.springframework.http.HttpHeaders;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
import com.fasterxml.jackson.databind.JsonNode;
|
|
import com.fasterxml.jackson.databind.JsonNode;
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Lists;
|
|
|
|
|
|
@@ -59,6 +61,8 @@ public class SapUserService extends BaseService {
|
|
@Autowired
|
|
@Autowired
|
|
private SapBlacklistService sapBlacklistService;
|
|
private SapBlacklistService sapBlacklistService;
|
|
@Autowired
|
|
@Autowired
|
|
|
|
+ private SapPerNationalIdService sapPerNationalIdService;
|
|
|
|
+ @Autowired
|
|
private SapEmpEmploymentService sapEmpEmploymentService;
|
|
private SapEmpEmploymentService sapEmpEmploymentService;
|
|
@Autowired
|
|
@Autowired
|
|
private SapEmpEmploymentTerminationService sapEmpEmploymentTerminationService;
|
|
private SapEmpEmploymentTerminationService sapEmpEmploymentTerminationService;
|
|
@@ -94,19 +98,16 @@ public class SapUserService extends BaseService {
|
|
}
|
|
}
|
|
// 获取用户对应机构
|
|
// 获取用户对应机构
|
|
sapOrgService.setOrg(sapUsers);
|
|
sapOrgService.setOrg(sapUsers);
|
|
- LoggerUtil.info("saveWxDeparts->setOrg:" + DateUtil.getTime());
|
|
|
|
// 获取用户对应性别
|
|
// 获取用户对应性别
|
|
sapPersonalService.setGender(sapUsers);
|
|
sapPersonalService.setGender(sapUsers);
|
|
- LoggerUtil.info("saveWxDeparts->setGender:" + DateUtil.getTime());
|
|
|
|
// 获取用户对应职务
|
|
// 获取用户对应职务
|
|
sapEmpJobService.setPosition(sapUsers);
|
|
sapEmpJobService.setPosition(sapUsers);
|
|
- LoggerUtil.info("saveWxDeparts->setPosition:" + DateUtil.getTime());
|
|
|
|
- // EmpEmployment->startDate
|
|
|
|
- sapEmpEmploymentService.setStartDate(sapUsers);
|
|
|
|
- LoggerUtil.info("saveWxDeparts->setStartDate:" + DateUtil.getTime());
|
|
|
|
|
|
+ // EmpEmployment->startDate/jobNumber
|
|
|
|
+ sapEmpEmploymentService.setEmpInfo(sapUsers);
|
|
|
|
+ // PerNationalId->userId/cardType
|
|
|
|
+ sapPerNationalIdService.setCardInfo(sapUsers);
|
|
// EmpEmploymentTermination->endDate
|
|
// EmpEmploymentTermination->endDate
|
|
sapEmpEmploymentTerminationService.setEndDate(sapUsers);
|
|
sapEmpEmploymentTerminationService.setEndDate(sapUsers);
|
|
- LoggerUtil.info("saveWxDeparts->setEndDate:" + DateUtil.getTime());
|
|
|
|
// 更新用户
|
|
// 更新用户
|
|
SapUser sapUserDb = null;
|
|
SapUser sapUserDb = null;
|
|
SapUser sapUser = null;
|
|
SapUser sapUser = null;
|
|
@@ -501,12 +502,12 @@ public class SapUserService extends BaseService {
|
|
SapUser sapUser = SapUser.builder().userId(userId).sendEntryMessageFlag(sendEntryMessageFlag).build();
|
|
SapUser sapUser = SapUser.builder().userId(userId).sendEntryMessageFlag(sendEntryMessageFlag).build();
|
|
update("SapUserMapper.updateSendEntryMessageFlag", sapUser);
|
|
update("SapUserMapper.updateSendEntryMessageFlag", sapUser);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
@SuppressWarnings("unchecked")
|
|
@SuppressWarnings("unchecked")
|
|
public List<SapUser> selectNotSendLeaveMessageList() throws Exception {
|
|
public List<SapUser> selectNotSendLeaveMessageList() throws Exception {
|
|
return (List<SapUser>) findList("SapUserMapper.selectNotSendLeaveMessageList", null);
|
|
return (List<SapUser>) findList("SapUserMapper.selectNotSendLeaveMessageList", null);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
@Transactional
|
|
@Transactional
|
|
public void sendLeaveMessage(String messageContent, SapUser sapUser, List<SapMessageUser> sapMessageUsers)
|
|
public void sendLeaveMessage(String messageContent, SapUser sapUser, List<SapMessageUser> sapMessageUsers)
|
|
throws Exception {
|
|
throws Exception {
|
|
@@ -515,9 +516,19 @@ public class SapUserService extends BaseService {
|
|
}
|
|
}
|
|
updateSendLeaveMessageFlag(sapUser.getUserId(), true);
|
|
updateSendLeaveMessageFlag(sapUser.getUserId(), true);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
private void updateSendLeaveMessageFlag(String userId, boolean sendEntryMessageFlag) throws Exception {
|
|
private void updateSendLeaveMessageFlag(String userId, boolean sendEntryMessageFlag) throws Exception {
|
|
SapUser sapUser = SapUser.builder().userId(userId).sendEntryMessageFlag(sendEntryMessageFlag).build();
|
|
SapUser sapUser = SapUser.builder().userId(userId).sendEntryMessageFlag(sendEntryMessageFlag).build();
|
|
update("SapUserMapper.updateSendLeaveMessageFlag", sapUser);
|
|
update("SapUserMapper.updateSendLeaveMessageFlag", sapUser);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public void uploadHrEmpUserInfo(SapUser user, Integer type) throws Exception {
|
|
|
|
+ UploadModifyEmpDTO reqdata = UploadModifyEmpDTO.builder().username(user.getUsername())
|
|
|
|
+ .entryDate(user.getStartDate()).resignDate(user.getEndDate()).type(type).phone(user.getFormatMobile())
|
|
|
|
+ .cardId(user.getCardId()).cardType(user.getCardType()).jobNumber(user.getJobNumber()).build();
|
|
|
|
+ String url = "http://cmcadmin.info666.com/hr/emp/modifyEmpInfo";
|
|
|
|
+ JSONObject parameters = new JSONObject();
|
|
|
|
+ parameters.put("reqdata", reqdata);
|
|
|
|
+ HttpClientUtil.postJson(url, parameters.toJSONString());
|
|
|
|
+ }
|
|
}
|
|
}
|