Procházet zdrojové kódy

[bug-1417]首页用户导航增加地点过滤

szjbdgzl před 1 rokem
rodič
revize
6678b3a25b

+ 1 - 1
ibps-common-root/modules/org-biz/src/main/java/com/lc/ibps/org/party/repository/PartyUserNavigateRepository.java

@@ -17,6 +17,6 @@ public interface PartyUserNavigateRepository extends IRepository<String, PartyUs
      * @param userId
      * @return
      */
-    List<PartyUserNavigatePo> findByUserId(String userId);
+    List<PartyUserNavigatePo> findByUserId(String userId,String diDian);
 
 }

+ 3 - 3
ibps-common-root/modules/org-biz/src/main/java/com/lc/ibps/org/party/repository/impl/PartyUserNavigateRepositoryImpl.java

@@ -38,9 +38,9 @@ public class PartyUserNavigateRepositoryImpl extends AbstractRepository<String,
     }
 
     @Override
-    public List<PartyUserNavigatePo> findByUserId(String userId) {
-        return findByKey("findByUserId", "findIdsByUserId",
-                b().a("userId", userId).p());
+    public List<PartyUserNavigatePo> findByUserId(String userId,String diDian) {
+        return findByKey("findByUserId", "",
+                b().a("userId", userId).a("diDian",diDian).p());
     }
 
 

+ 1 - 6
ibps-model-root/modules/org-model/src/main/resources/com/lc/ibps/org/party/persistence/mapping/PartyUserNavigate.map.xml

@@ -36,17 +36,12 @@
 
     <select id="findByUserId"  parameterType="java.util.Map" resultMap="PartyUserNavigate">
         SELECT <include refid="columns"/> FROM IBPS_PARTY_USER_NAVIGATE
-        WHERE (USER_ID_ ='' OR USER_ID_ is null )
+        WHERE (USER_ID_ ='' OR USER_ID_ is null) and di_dian_=#{diDian}
         UNION ALL
         (SELECT <include refid="columns"/> FROM IBPS_PARTY_USER_NAVIGATE
         WHERE USER_ID_ = #{userId} ORDER BY SN_,CREATE_TIME_ DESC)
     </select>
 
-    <select id="findIdsByUserId"  parameterType="java.util.Map" resultMap="PartyUserNavigate">
-        SELECT ID_ FROM FROM IBPS_PARTY_USER_NAVIGATE
-        WHERE USER_ID_ = #{userId} ORDER BY SN_,CREATE_TIME_ DESC
-    </select>
-
     <update id="update" parameterType="com.lc.ibps.org.party.persistence.entity.PartyEmployeePo">
         UPDATE IBPS_PARTY_USER_NAVIGATE SET
             <if test="updateBy !='' and updateBy !=null ">

+ 12 - 1
ibps-provider-root/modules/provider-platform-default/src/main/java/com/lc/ibps/common/provider/DesktopFacadeProvider.java

@@ -149,7 +149,18 @@ public class DesktopFacadeProvider extends GenericProvider implements IDesktopFa
 	public APIResult<List<PartyUserNavigatePo>> findNavigateByCurrUserId() {
 		APIResult<List<PartyUserNavigatePo>> result = new APIResult<>();
 		try {
-			List<PartyUserNavigatePo> navigatePoList = userNavigateRepository.findByUserId(ContextUtil.getCurrentUserId());
+			String userId = ContextUtil.getCurrentUserId();
+			PartyEmployeePo employeePo = partyEmployeeRepository.get(userId);
+			String position = employeePo.getPositions().split(",")[0];
+			PartyEntityPo entityPo = partyEntityRepository.get(position);
+			// 根据用户id查询用户所属医院(地点)  查询 ibps_party_entity 表 path_ 字段第二级,没有则查询第一级
+			String diDian = "";
+			try{
+				diDian = entityPo.getPath().split(StringPool.BACK_SLASH+StringPool.DOT)[1];
+			}catch (Exception e){
+				diDian = entityPo.getPath().split(StringPool.BACK_SLASH+StringPool.DOT)[0];
+			}
+			List<PartyUserNavigatePo> navigatePoList = userNavigateRepository.findByUserId(userId,diDian);
 			result.setData(navigatePoList);
 		} catch (Exception e) {
 			setExceptionResult(result, StateEnum.ERROR_SYSTEM_DESKTOP.getCode(), "用户导航信息查询异常!", e);