|
|
@@ -1,30 +1,37 @@
|
|
|
package com.uas.platform.b2b.controller;
|
|
|
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
+import org.springframework.data.domain.Sort.Direction;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
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.servlet.ModelAndView;
|
|
|
|
|
|
import com.uas.platform.b2b.model.UsageLog;
|
|
|
import com.uas.platform.b2b.service.UsageLogService;
|
|
|
+import com.uas.platform.b2b.support.JxlsExcelView;
|
|
|
import com.uas.platform.b2b.support.SystemSession;
|
|
|
import com.uas.platform.core.model.PageInfo;
|
|
|
import com.uas.platform.core.model.PageParams;
|
|
|
|
|
|
/**
|
|
|
* 平台使用日志
|
|
|
+ *
|
|
|
* @author yingp
|
|
|
*
|
|
|
*/
|
|
|
@Controller
|
|
|
@RequestMapping(value = "/log/usage")
|
|
|
public class UsageLogController {
|
|
|
-
|
|
|
+
|
|
|
@Autowired
|
|
|
private UsageLogService usageLogSerice;
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 分页查找平台使用日志
|
|
|
*
|
|
|
@@ -33,10 +40,26 @@ public class UsageLogController {
|
|
|
*/
|
|
|
@RequestMapping(method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
- public Page<UsageLog> getReceivedPurchaseInquiries(PageParams params) {
|
|
|
+ public Page<UsageLog> getUsgaeLogs(PageParams params) {
|
|
|
PageInfo info = new PageInfo(params);
|
|
|
info.filter("enUU", SystemSession.getUser().getEnterprise().getUu());
|
|
|
return usageLogSerice.findAllByPageInfo(info);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 分页查找平台使用日志
|
|
|
+ *
|
|
|
+ * @param params
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/xls", method = RequestMethod.GET)
|
|
|
+ public ModelAndView exportUsageLogs() {
|
|
|
+ Map<String, Object> map = new HashMap<String, Object>();
|
|
|
+ PageInfo pageInfo = new PageInfo(1, JxlsExcelView.MAX_SIZE, 0);
|
|
|
+ pageInfo.sorting("time", Direction.DESC);
|
|
|
+ pageInfo.filter("enUU", SystemSession.getUser().getEnterprise().getUu());
|
|
|
+ map.put("data", usageLogSerice.findAllByPageInfo(pageInfo).getContent());
|
|
|
+ return new ModelAndView(new JxlsExcelView("classpath:jxls-tpl/UsageLog", "平台使用日志"), map);
|
|
|
+ }
|
|
|
+
|
|
|
}
|