|
|
@@ -26,6 +26,7 @@ import com.uas.platform.b2b.search.SearchService;
|
|
|
import com.uas.platform.b2b.service.UserService;
|
|
|
import com.uas.platform.b2b.service.VendorService;
|
|
|
import com.uas.platform.b2b.support.CollectionUtil;
|
|
|
+import com.uas.platform.b2b.support.SPageUtils;
|
|
|
import com.uas.platform.b2b.support.SystemSession;
|
|
|
import com.uas.platform.core.model.Constant;
|
|
|
import com.uas.platform.core.model.PageInfo;
|
|
|
@@ -37,6 +38,7 @@ import com.uas.search.b2b.model.Sort;
|
|
|
import com.uas.search.b2b.util.SearchConstants;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
+import org.springframework.data.domain.PageImpl;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.ui.ModelMap;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
@@ -678,4 +680,28 @@ public class VendorsServiceImpl implements VendorService {
|
|
|
});
|
|
|
return users;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 通过分页信息和关键词查询用户信息
|
|
|
+ *
|
|
|
+ * @param params 分页参数
|
|
|
+ * @param keyword 关键词
|
|
|
+ * @return 符合条件的数据
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public SPage<UserBaseInfo> findUserInfoByPage(PageParams params, String keyword) {
|
|
|
+ Long enUU = SystemSession.getUser().getEnterprise().getUu();
|
|
|
+ PageInfo pageInfo = new PageInfo(params);
|
|
|
+ List<UserBaseInfo> userList;
|
|
|
+ Integer total;
|
|
|
+ Integer startIndex = (pageInfo.getPageNumber() - 1) * pageInfo.getPageSize();
|
|
|
+ if (StringUtils.isEmpty(keyword)) {
|
|
|
+ userList = userBaseInfoDao.findByEnUU(enUU, startIndex, pageInfo.getPageSize());
|
|
|
+ total = userBaseInfoDao.countByEnUU(enUU);
|
|
|
+ } else {
|
|
|
+ userList = userBaseInfoDao.findByEnUUAndKeyword(enUU, keyword, startIndex, pageInfo.getPageSize());
|
|
|
+ total = userBaseInfoDao.countByEnUUAndKeyword(enUU, keyword);
|
|
|
+ }
|
|
|
+ return SPageUtils.covertSPage(new PageImpl<>(userList, pageInfo, total));
|
|
|
+ }
|
|
|
}
|