Browse Source

店铺审核搜索添加审核人搜索

Hu Jie 7 years ago
parent
commit
819bde0581

+ 15 - 0
src/main/java/com/uas/platform/b2c/prod/store/controller/StoreApplyController.java

@@ -165,6 +165,21 @@ public class StoreApplyController {
 		return storeApplyService.pageStoreApplications(pageInfo, status, type, keyword);
 	}
 
+	/**
+	 * 分页获取店铺审核信息
+	 *
+	 * @param params		分页参数
+	 * @param status		店铺审核状态
+	 * @param type			店铺类型
+	 * @param keyword		搜索关键字,审核人
+	 */
+	@RequestMapping(value = "/applications", method = RequestMethod.GET, params = "operate=authorPage")
+	public Page<StoreApply> pageStoreApplicationsByAuth(PageParams params, @RequestParam(value = "status", required = false) StoreApply.ApplyStatus status, @RequestParam(value = "type", required = false) StoreType type, @RequestParam(value = "keyword", required = false) String keyword) {
+		logger.info("Page store information");
+		PageInfo pageInfo = new PageInfo(params);
+		return storeApplyService.pageStoreApplicationsByAuthor(pageInfo, status, type, keyword);
+	}
+
 	/**
 	 * 获取当前店铺的待处理和已通过申请信息,应当有且只有一条记录
 	 */

+ 9 - 0
src/main/java/com/uas/platform/b2c/prod/store/service/StoreApplyService.java

@@ -67,6 +67,15 @@ public interface StoreApplyService {
 	 */
 	Page<StoreApply> pageStoreApplications(PageInfo pageInfo, StoreApply.ApplyStatus status, StoreType type, String keyword);
 
+	/**
+	 * 分页获取待审核店铺信息
+	 *  @param pageInfo    	分页信息
+	 * @param status    	查询的店铺申请状态
+	 * @param type			店铺类型
+	 * @param keyword		搜索关键字
+	 */
+	Page<StoreApply> pageStoreApplicationsByAuthor(PageInfo pageInfo, StoreApply.ApplyStatus status, StoreType type, String keyword);
+
 	/**
 	 * 获取当前店铺的待处理和已通过申请信息,应当有且只有一条记录
 	 */

+ 23 - 0
src/main/java/com/uas/platform/b2c/prod/store/service/impl/StoreApplyServiceImpl.java

@@ -28,6 +28,7 @@ import javax.persistence.criteria.CriteriaBuilder;
 import javax.persistence.criteria.CriteriaQuery;
 import javax.persistence.criteria.Predicate;
 import javax.persistence.criteria.Root;
+import javax.servlet.http.HttpServletRequest;
 import java.util.Date;
 import java.util.Iterator;
 import java.util.List;
@@ -239,6 +240,28 @@ public class StoreApplyServiceImpl implements StoreApplyService {
 		}, pageInfo);
 	}
 
+	public Page<StoreApply> pageStoreApplicationsByAuthor(final PageInfo pageInfo, StoreApply.ApplyStatus status, StoreType type, String keyword) {
+		if (status != null) {
+			SimpleExpression expression = new SimpleExpression("status", status, CriterionExpression.Operator.EQ);
+			pageInfo.expression(expression);
+		}
+		if (type != null) {
+			SimpleExpression expression = new SimpleExpression("type", type, CriterionExpression.Operator.EQ);
+			pageInfo.expression(expression);
+		}
+		if (StringUtils.hasText(keyword)) {
+			SimpleExpression expression = new SimpleExpression("authPerson", keyword, CriterionExpression.Operator.LIKE);
+			pageInfo.expression(expression);
+		}
+		return storeApplyDao.findAll(new Specification<StoreApply>() {
+			@Override
+			public Predicate toPredicate(Root<StoreApply> root, CriteriaQuery<?> query, CriteriaBuilder builder) {
+				query.where(pageInfo.getPredicates(root, query, builder));
+				return null;
+			}
+		}, pageInfo);
+	}
+
 	@Override
 	public ResultMap findShopOwnerApplyByNormalStatus() {
 		User user = SystemSession.getUser();