liupeng před 5 roky
rodič
revize
a512cfebee

+ 4 - 4
code/sapparent/sapservice/src/main/java/org/fouram/mapper/SapUserMapper.xml

@@ -85,16 +85,16 @@
 		select * from sap_user 
 		where result = 'SUCCESS' and isPrimary = 1 and delFlag = 0 
 		<if test="level == 1">
-			and firstOrgId = #{id} and secondOrgId is null
+			and firstOrgId = #{departId} and secondOrgId is null
 		</if>
 		<if test="level == 2">
-			and secondOrgId = #{id} and thirdOrgId is null
+			and secondOrgId = #{departId} and thirdOrgId is null
 		</if>
 		<if test="level == 3">
-			and thirdOrgId = #{id} and fourthOrgId is null
+			and thirdOrgId = #{departId} and fourthOrgId is null
 		</if>
 		<if test="level == 4">
-			and fourthOrgId = #{id}
+			and fourthOrgId = #{departId}
 		</if>
 		order by sortNumber ASC
 	</select>

+ 5 - 1
code/sapparent/sapservice/src/main/java/org/fouram/service/SapUserService.java

@@ -6,6 +6,7 @@ import java.util.List;
 
 import org.apache.commons.lang3.StringUtils;
 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.WXCpUserUtil;
@@ -198,7 +199,10 @@ public class SapUserService extends BaseService {
 	@SuppressWarnings("unchecked")
 	public List<SapUser> selectListByDepartIdAndLevel(String departId) throws Exception {
 		SapOrg sapOrg = sapOrgService.selectById(departId);
-		return (List<SapUser>) findList("SapUserMapper.selectListByDepartIdAndLevel", sapOrg);
+		PageData pd = new PageData();
+		pd.put("departId", departId);
+		pd.put("level", sapOrg.getLevel());
+		return (List<SapUser>) findList("SapUserMapper.selectListByDepartIdAndLevel", pd);
 	}
 
 	public SapUser toInfoDetail(SapUser sapUser) throws Exception {