liupeng 4 yıl önce
ebeveyn
işleme
ae85fcfcfa

+ 12 - 0
code/sapparent/sapservice/src/main/java/org/fouram/entity/SapUser.java

@@ -63,6 +63,18 @@ public class SapUser implements Serializable {
 
 	private List<List<SapOrg>> departList;
 
+	public Long getWxDepartId() {
+		if (fourthOrgWxDepartId != null) {
+			return fourthOrgWxDepartId;
+		} else if (thirdOrgWxDepartId != null) {
+			return thirdOrgWxDepartId;
+		} else if (secondOrgWxDepartId != null) {
+			return secondOrgWxDepartId;
+		} else {
+			return firstOrgWxDepartId;
+		}
+	}
+
 	@Override
 	public String toString() {
 		StringBuilder sBuilder = new StringBuilder();

+ 9 - 6
code/sapparent/sapservice/src/main/java/org/fouram/service/SapUserService.java

@@ -16,6 +16,7 @@ import org.fouram.core.util.JsonNodeUtil;
 import org.fouram.core.util.Tools;
 import org.fouram.entity.SapOrg;
 import org.fouram.entity.SapUser;
+import org.fouram.entity.WxUser;
 import org.fouram.enums.DelFlagEnum;
 import org.fouram.enums.SapUserResultEnum;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -25,17 +26,15 @@ import org.springframework.stereotype.Service;
 import com.fasterxml.jackson.databind.JsonNode;
 import com.google.common.collect.Lists;
 
-import me.chanjar.weixin.cp.bean.WxCpUser;
-
 @Service
 public class SapUserService extends BaseService {
 
 	@Autowired
 	private SapOrgService sapOrgService;
 	@Autowired
-	private RequestService requestService;
+	private WxUserService wxUserService;
 	@Autowired
-	private WxDepartService wxDepartService;
+	private RequestService requestService;
 	@Autowired
 	private SapEmpJobService sapEmpJobService;
 	@Autowired
@@ -123,8 +122,12 @@ public class SapUserService extends BaseService {
 		}
 	}
 
-	
-	private boolean checkSensitiveDataIsChange(SapUser sapUser) {
+	private boolean checkSensitiveDataIsChange(SapUser sapUser) throws Exception {
+		WxUser wxUser = wxUserService.selectById(sapUser.getPersonId());
+		if (!wxUser.getPosition().equals(sapUser.getPosition())
+				|| !wxUser.getDepartIds().contains("," + sapUser.getWxDepartId() + ",")) {
+			return true;
+		}
 		return false;
 	}