Skip to content

Commit

Permalink
修改分馆检索
Browse files Browse the repository at this point in the history
  • Loading branch information
renyh committed Jan 12, 2024
1 parent 55931e7 commit 3da1743
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
9 changes: 9 additions & 0 deletions dp2weixin.service/AreaLib.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ public int init(string libcfgFile, out string error)
// 2022/10/13 目标数据库
string biblioDbName = DomUtil.GetAttr(libNode, "biblioDbName");

// 2024/1/12
string searchAllBiblio = DomUtil.GetAttr(libNode, "searchAllBiblio");

LibModel lib = new LibModel();
lib.libId = id;
lib.name = name;
Expand All @@ -81,6 +84,7 @@ public int init(string libcfgFile, out string error)
lib.patronMaskValue = patronMaskValue; //2021/8/3增加
lib.fieldsMap = fieldsMap;//2022/10/13加
lib.biblioDbName = biblioDbName;//2022/10/13 加
lib.searchAllBiblio = searchAllBiblio;


area.libs.Add(lib);
Expand Down Expand Up @@ -150,6 +154,7 @@ public void SaveLib(LibEntity entity)
lib.patronMaskValue = oldLib.patronMaskValue; //2021/8/3 增加屏蔽通知中的读者信息
lib.fieldsMap=oldLib.fieldsMap;//2022/10/13加
lib.biblioDbName = oldLib.biblioDbName;//2022/10/13加
lib.searchAllBiblio=oldLib.searchAllBiblio;//2024/1/12

//lib.capoUser = oldLib.capoUser; // 20220720-ryh 发现这个字段没有使用到
//lib.visible = oldLib.visible; // 20220720-ryh 发现这个字段没有使用到
Expand Down Expand Up @@ -188,6 +193,7 @@ public void Save2Xml()
+ " patronMaskValue='" + lib.patronMaskValue + "'" // 2021/8/3 增加通知中屏幕读者信息
+ " fieldsMap='" + lib.fieldsMap + "'" // 2022/10/13 增加编目配置的字段规则
+ " biblioDbName='" + lib.biblioDbName + "'" //2022/10/13 加
+ " searchAllBiblio='"+lib.searchAllBiblio + "'" //2024/1/12


+ " />";
Expand Down Expand Up @@ -405,6 +411,9 @@ public class LibModel
// 2022/10/13 增加目标数据库,用于新增书目
public string biblioDbName = "";

// 2024/1/12 是否检索全部书目
public string searchAllBiblio = "0";

// 2022/07/20 在整理接口过程中发现capoUser这个字段没有使用到,所以注释掉
// 对应的capo帐户
//public string capoUser = "";
Expand Down
23 changes: 21 additions & 2 deletions dp2weixin.service/dp2WeiXinService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7272,18 +7272,37 @@ public long SearchBiblioInternal(string weixinId,
WxUserItem activeUser = WxUserDatabase.Current.GetActive(weixinId);
string libraryCode = "";
if (activeUser != null)
libraryCode = activeUser.bindLibraryCode; // todo,这里用实际还是绑定,现成用的绑定帐户
libraryCode = activeUser.bindLibraryCode; // todo,这里用实际还是绑定,现在用的绑定帐户


// 过滤条件,如果有分馆代码的过滤条件为分馆代码,如果图书馆设置的过滤条件

// todo 2022/10/20 感觉这里应该是把两个条件组合起来,现在这种写法是排斥效果。
// 2024/1/11 将分馆过滤与单独配置的过滤,改为组合的用法。
string filter = "";
if (string.IsNullOrEmpty(libraryCode) == false)
{
filter = libraryCode;

// 2024/1/12 如果明确配置了检索全部书目,则不过滤分馆
LibModel libCfg = this._areaMgr.GetLibCfg(lib.id, libraryCode);
if (libCfg != null && string.IsNullOrEmpty(libCfg.searchAllBiblio) == false)
{
if (libCfg.searchAllBiblio.ToLower() == "true")
{
filter = "";
}
}
}
else if (string.IsNullOrEmpty(biblioFilter) == false)



// 过滤一些特殊状态的图书
if (string.IsNullOrEmpty(biblioFilter) == false)
{
if (filter != "")
filter += ",";

filter = biblioFilter;
}

Expand Down

0 comments on commit 3da1743

Please sign in to comment.