|
|
@@ -13,11 +13,11 @@ import com.uas.platform.core.util.AgentUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
import org.springframework.data.domain.Sort;
|
|
|
-import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
@@ -30,7 +30,7 @@ import java.util.Date;
|
|
|
* @author hejq
|
|
|
* @date 2018-07-10 16:17
|
|
|
*/
|
|
|
-@Controller
|
|
|
+@RestController
|
|
|
@RequestMapping(value = "/invite")
|
|
|
public class InviteController extends BaseController {
|
|
|
|
|
|
@@ -49,10 +49,9 @@ public class InviteController extends BaseController {
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
|
|
- @ResponseBody
|
|
|
public Page<Invite> findByPageInfo(PageParams params, String keyword, HttpServletRequest request) {
|
|
|
PageInfo info = new PageInfo(params);
|
|
|
- Sort sort = new Sort(Sort.Direction.DESC, "inviteEnName");
|
|
|
+ Sort sort = new Sort(Sort.Direction.DESC, "inviteEnName", "inviteUserName");
|
|
|
info.setSort(sort);
|
|
|
if (!StringUtils.isEmpty(keyword)) {
|
|
|
keyword = keyword.trim();
|
|
|
@@ -64,24 +63,25 @@ public class InviteController extends BaseController {
|
|
|
/**
|
|
|
* 导出邀请注册记录信息
|
|
|
*
|
|
|
- * @param params 分页参数
|
|
|
* @param keyword 关键字
|
|
|
* @param request request
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/xls", method = RequestMethod.GET )
|
|
|
- public ModelAndView exportInvites(PageParams params, String keyword, HttpServletRequest request) {
|
|
|
+ public ModelAndView exportInvites(String keyword, HttpServletRequest request) {
|
|
|
+ PageParams params = new PageParams();
|
|
|
params.setPage(1);
|
|
|
- params.setCount(1);
|
|
|
- SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日");
|
|
|
+ params.setCount(JxlsExcelView.MAX_SIZE);
|
|
|
+ SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日 HH时mm分");
|
|
|
ModelAndView modelAndView = new ModelAndView();
|
|
|
Page<Invite> invites = findByPageInfo(params, keyword, request);
|
|
|
modelAndView.addObject("time", dateFormat.format(new Date(System.currentTimeMillis())));
|
|
|
modelAndView.addObject("user", SystemSession.getUser().getFullName());
|
|
|
- modelAndView.addObject("count", invites.getTotalElements());
|
|
|
+ modelAndView.addObject("count",
|
|
|
+ invites.getTotalElements() > JxlsExcelView.MAX_SIZE ? JxlsExcelView.MAX_SIZE : invites.getTotalElements());
|
|
|
modelAndView.addObject("data", invites.getContent());
|
|
|
modelAndView.addObject("dateFormat", dateFormat);
|
|
|
- modelAndView.setView(new JxlsExcelView("classpath*:jxls-tpl/Invite", "邀请注册记录"));
|
|
|
+ modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/Invite", "邀请注册记录"));
|
|
|
useLogService.appendLog(UseType.EXPROT_INVITE_DATA.code(), keyword, AgentUtils.getIp(request));
|
|
|
return modelAndView;
|
|
|
}
|