|
@@ -10,6 +10,7 @@ import org.fouram.constants.WebConstants;
|
|
|
import org.fouram.core.base.model.PageData;
|
|
|
import org.fouram.core.base.service.BaseService;
|
|
|
import org.fouram.core.base.service.RequestService;
|
|
|
+import org.fouram.core.plugin.weixin.cp.util.WXCpMessageUtil;
|
|
|
import org.fouram.core.plugin.weixin.cp.util.WXCpUserUtil;
|
|
|
import org.fouram.core.util.Base64Util;
|
|
|
import org.fouram.core.util.ConfConfig;
|
|
@@ -99,7 +100,7 @@ public class SapUserService extends BaseService {
|
|
|
// 获取用户对应职务
|
|
|
sapEmpJobService.setPosition(sapUsers);
|
|
|
LoggerUtil.info("saveWxDeparts->setPosition:" + DateUtil.getTime());
|
|
|
- // EmpEmployment->startDate
|
|
|
+ // EmpEmployment->startDate
|
|
|
sapEmpEmploymentService.setStartDate(sapUsers);
|
|
|
LoggerUtil.info("saveWxDeparts->setStartDate:" + DateUtil.getTime());
|
|
|
// EmpEmploymentTermination->endDate
|
|
@@ -116,7 +117,7 @@ public class SapUserService extends BaseService {
|
|
|
this.saveSapUser(sapUser);
|
|
|
} else {
|
|
|
// 如果是忽略INGORE,保留INGORE状态
|
|
|
- if(SapUserResultEnum.INGORE.getCode().equals(sapUserDb.getResult())) {
|
|
|
+ if (SapUserResultEnum.INGORE.getCode().equals(sapUserDb.getResult())) {
|
|
|
sapUser.setResult(SapUserResultEnum.INGORE.getCode());
|
|
|
} else {
|
|
|
sapUser.setResult(SapUserResultEnum.NORMAL.getCode());
|
|
@@ -204,7 +205,7 @@ public class SapUserService extends BaseService {
|
|
|
sb.append(user.getFullOrgName()).append(";");
|
|
|
}
|
|
|
}
|
|
|
- if(sb.length() > 0) {
|
|
|
+ if (sb.length() > 0) {
|
|
|
return sb.substring(0, sb.length() - 1);
|
|
|
}
|
|
|
return "";
|
|
@@ -224,7 +225,7 @@ public class SapUserService extends BaseService {
|
|
|
sb.append(user.getFormatPosition()).append("、");
|
|
|
}
|
|
|
}
|
|
|
- if(sb.length() > 0) {
|
|
|
+ if (sb.length() > 0) {
|
|
|
return sb.substring(0, sb.length() - 1);
|
|
|
}
|
|
|
return "";
|
|
@@ -245,7 +246,7 @@ public class SapUserService extends BaseService {
|
|
|
@Transactional
|
|
|
public void updateSync(List<String> userIds) throws Exception {
|
|
|
SapUser sapUser = null;
|
|
|
- for(String userId : userIds) {
|
|
|
+ for (String userId : userIds) {
|
|
|
sapUser = this.selectByUserId(userId);
|
|
|
if (SapUserResultEnum.LEAVE.getCode().equals(sapUser.getResult())) {
|
|
|
this.deleteQuitUserByUserId(userId, null);
|
|
@@ -254,7 +255,7 @@ public class SapUserService extends BaseService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public void updateSyncWxResult(String personId) throws Exception {
|
|
|
String result = createOrUpdateWXUser(personId);
|
|
|
updateResultByUserId(result, personId);
|
|
@@ -408,7 +409,7 @@ public class SapUserService extends BaseService {
|
|
|
|
|
|
public void updateResultByUserId(String result, String userId) throws Exception {
|
|
|
SapUser sapUser = SapUser.builder().userId(userId).result(result).build();
|
|
|
- if(SapUserResultEnum.INGORE.getCode().equals(result)) {
|
|
|
+ if (SapUserResultEnum.INGORE.getCode().equals(result)) {
|
|
|
sapUser.setIngoreDate(new Date());
|
|
|
}
|
|
|
update("SapUserMapper.updateResultByUserId", sapUser);
|
|
@@ -441,15 +442,15 @@ public class SapUserService extends BaseService {
|
|
|
|
|
|
@Transactional
|
|
|
public void updateIngore(List<String> personIds) throws Exception {
|
|
|
- for(String personId : personIds) {
|
|
|
+ for (String personId : personIds) {
|
|
|
updateResultByUserId(SapUserResultEnum.INGORE.getCode(), personId);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public void updateCancelIngore(String personId) throws Exception {
|
|
|
SapUser sapUser = selectByUserId(personId);
|
|
|
String result = getCheckResultByWx(sapUser);
|
|
|
- if(StringUtils.isBlank(result)) {
|
|
|
+ if (StringUtils.isBlank(result)) {
|
|
|
result = SapUserResultEnum.NORMAL.getCode();
|
|
|
}
|
|
|
updateResultByUserId(result, personId);
|
|
@@ -480,4 +481,20 @@ public class SapUserService extends BaseService {
|
|
|
Long total = (Long) findObject("SapUserMapper.selectIngorePrimaryTotal", pd);
|
|
|
return GetIngoreListOutput.builder().data(toInfoDetails(data)).total(total).build();
|
|
|
}
|
|
|
+
|
|
|
+ @SuppressWarnings("unchecked")
|
|
|
+ public List<SapUser> selectNotSendEntryMessageList() throws Exception {
|
|
|
+ return (List<SapUser>) findList("SapUserMapper.selectNotSendEntryMessageList", null);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Transactional
|
|
|
+ public void sendEntryMessage(String messageContent, SapUser sapUser) throws Exception {
|
|
|
+ WXCpMessageUtil.send(messageContent, "1000001");
|
|
|
+ updateSendEntryMessageFlag(sapUser.getUserId(), true);
|
|
|
+ }
|
|
|
+
|
|
|
+ private void updateSendEntryMessageFlag(String userId, boolean sendEntryMessageFlag) throws Exception {
|
|
|
+ SapUser sapUser = SapUser.builder().userId(userId).sendEntryMessageFlag(sendEntryMessageFlag).build();
|
|
|
+ update("SapUserMapper.updateSendEntryMessageFlag", sapUser);
|
|
|
+ }
|
|
|
}
|