PortalSearchController.java 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. package com.goafanti.portal.controller;
  2. import java.math.BigDecimal;
  3. import java.util.List;
  4. import javax.annotation.Resource;
  5. import javax.servlet.http.HttpServletRequest;
  6. import org.apache.commons.lang3.StringUtils;
  7. import org.springframework.web.bind.annotation.RequestMapping;
  8. import org.springframework.web.bind.annotation.RequestMethod;
  9. import org.springframework.web.bind.annotation.RestController;
  10. import com.alibaba.druid.sql.visitor.functions.If;
  11. import com.goafanti.achievement.service.AchievementService;
  12. import com.goafanti.common.bo.Result;
  13. import com.goafanti.common.constant.ErrorConstants;
  14. import com.goafanti.common.controller.BaseController;
  15. import com.goafanti.common.enums.AchievementMaturity;
  16. import com.goafanti.common.enums.DemandPortalSearchSignType;
  17. import com.goafanti.common.enums.UserLevel;
  18. import com.goafanti.common.enums.UserType;
  19. import com.goafanti.core.mybatis.page.Pagination;
  20. import com.goafanti.demand.service.DemandService;
  21. import com.goafanti.portal.bo.AchievementSearchListBo;
  22. import com.goafanti.portal.bo.BoutiqueListBo;
  23. import com.goafanti.user.service.OrganizationIdentityService;
  24. import com.goafanti.user.service.UserIdentityService;
  25. @RestController
  26. @RequestMapping(value = "/portal/search")
  27. public class PortalSearchController extends BaseController {
  28. @Resource
  29. private AchievementService achievementService;
  30. @Resource
  31. private DemandService demandService;
  32. @Resource
  33. private UserIdentityService userIdentityService;
  34. @Resource
  35. private OrganizationIdentityService organizationIdentityService;
  36. /**
  37. * 用户搜索
  38. */
  39. @RequestMapping(value = "/subscriberList", method = RequestMethod.GET)
  40. public Result subscriberSearchList(HttpServletRequest req,String name, Integer level, Integer type, String field, Integer province,
  41. Integer city, Integer area,Integer international, String pageNo, String pageSize, Integer auditStatus) {
  42. Result res = new Result();
  43. String url=req.getServerName();
  44. url=url.substring(url.indexOf(".")+1, url.length());
  45. Integer pNo = 1;
  46. Integer pSize = 12;
  47. if (StringUtils.isNumeric(pageSize)) {
  48. pSize = Integer.parseInt(pageSize);
  49. }
  50. if (StringUtils.isNumeric(pageNo)) {
  51. pNo = Integer.parseInt(pageNo);
  52. }
  53. if(field!=null && field.length()<=0) {
  54. field=null;
  55. }
  56. if(province ==null || province.intValue()<=0)province=null;
  57. res.setData(userIdentityService.listSubscriber(url,name, level, field, province, city, area, international, pNo, pSize,auditStatus));
  58. return res;
  59. }
  60. }