|
|
@@ -1,5 +1,8 @@
|
|
|
package com.uas.platform.b2b.controller;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.ui.ModelMap;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
@@ -8,7 +11,14 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.uas.platform.b2b.model.InvitationRecord;
|
|
|
+import com.uas.platform.b2b.search.SearchService;
|
|
|
import com.uas.platform.b2b.service.InvitationRecordService;
|
|
|
+import com.uas.platform.b2b.support.SystemSession;
|
|
|
+import com.uas.platform.core.model.PageParams;
|
|
|
+import com.uas.search.b2b.model.SPage;
|
|
|
+import com.uas.search.b2b.model.Sort;
|
|
|
+import com.uas.search.b2b.model.Sort.Type;
|
|
|
+import com.uas.search.b2b.util.SearchConstants;
|
|
|
|
|
|
@RestController
|
|
|
@RequestMapping("/invitationrecord")
|
|
|
@@ -17,6 +27,9 @@ public class InvitationRecordController {
|
|
|
@Autowired
|
|
|
private InvitationRecordService invitationRecordService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private SearchService searchService;
|
|
|
+
|
|
|
/**
|
|
|
* 邀请开通平台
|
|
|
*
|
|
|
@@ -28,4 +41,19 @@ public class InvitationRecordController {
|
|
|
InvitationRecord record = JSONObject.parseObject(formStore, InvitationRecord.class);
|
|
|
return invitationRecordService.invite(record);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询邀请记录
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/records", method = RequestMethod.GET)
|
|
|
+ private SPage<InvitationRecord> getRecords(PageParams params, String keyword) {
|
|
|
+ com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, null);
|
|
|
+ pageParams.getFilters().put("in_useruu", SystemSession.getUser().getUserUU());
|
|
|
+ List<Sort> sortList = new ArrayList<>();
|
|
|
+ sortList.add(new Sort("in_id", false, Type.LONG, new Long(1)));
|
|
|
+ pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
|
|
|
+ return searchService.getInvitationByKeyword(keyword, pageParams);
|
|
|
+ }
|
|
|
}
|