叫料查询修改

master
zpl 3 years ago
parent 102a1e17bb
commit 40c3245f76

@ -155,12 +155,13 @@ public class CallItemServiceImpl extends ServiceImpl<CallItemMapper, CallItem> i
String site = CommonMethods.getSite();
String user = CommonMethods.getUser();
String language = LocaleContextHolder.getLocale().getLanguage();
List<String> list = new ArrayList<>();
list.add("CJZR");
list.add("ADMINISTRATORS");
callItem.setCallType(Constants.CALL_TYPE_MATERIAL);
List<NwaUser> nwaUsers = nwaUserService.checkUserGroup(site, "CJZR,ADMINISTRATORS");
for (NwaUser nwaUser:nwaUsers) {
if (user.equals(nwaUser.getUserName())){
return callItemMapper.findCallItemListPda(site,language,null,callItem);
}
Integer cnt = userGroupMapper.findUserGroupByUser(site, user, list);
if (cnt > 0){
return callItemMapper.findCallItemListPda(site,language,null,callItem);
}
return callItemMapper.findCallItemListPda(site,language,user,callItem);
}

@ -27,4 +27,7 @@ public interface UserGroupMapper extends BaseMapper<UserGroup> {
@Param("userGroup")String userGroup);
Integer getUserGroupByUser(@Param("userBO")String userBO,@Param("userGroupBO")String userGroupBO);
Integer findUserGroupByUser(@Param("site")String site,@Param("user")String user,@Param("list")List<String> list);
}

@ -363,4 +363,17 @@
SELECT COUNT(HANDLE) FROM USER_GROUP_MEMBER ugm
WHERE ugm.USER_OR_GROUP_GBO=#{userBO} AND USER_GROUP_BO=#{userGroupBO}
</select>
<!--自定义sql查询用户是否在指定用户组-->
<select id="findUserGroupByUser" resultType="Integer">
SELECT COUNT(*) FROM WIP.Z_NWA_USER ZNU
INNER JOIN WIP.USER_GROUP_MEMBER UGM ON UGM.USER_OR_GROUP_GBO = ZNU.HANDLE
INNER JOIN WIP.USER_GROUP UG ON UG.HANDLE = UGM.USER_GROUP_BO
WHERE ZNU.SITE = #{site} AND ZNU.USER_NAME = #{user}
AND UG.USER_GROUP IN
<foreach item="item" index="index" collection="list" open="(" close=")" separator=",">UPPER(#{item})
</foreach>
</select>
</mapper>

Loading…
Cancel
Save