|
@@ -39,6 +39,7 @@ import com.cloudcross.ssp.common.consts.Status;
|
|
|
import com.cloudcross.ssp.common.utils.Common;
|
|
|
import com.cloudcross.ssp.common.utils.LangUtil;
|
|
|
import com.cloudcross.ssp.common.utils.Pager;
|
|
|
+import com.cloudcross.ssp.common.utils.Pager1;
|
|
|
|
|
|
|
|
|
|
|
@@ -378,112 +379,142 @@ public class AdvertiserController extends SimpleController {
|
|
|
return OK;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
//导出advertiser列表页Excel用
|
|
|
-
|
|
|
- @RequestMapping("/exportDataReportExcel")
|
|
|
- public void exportDataReportExcel(Model model,HttpServletRequest request,
|
|
|
- HttpServletResponse response,
|
|
|
- @RequestParam(defaultValue="2") int status,
|
|
|
- @RequestParam Map<String, Object> paramMap) {
|
|
|
- //model.addAttribute("advertiserId", advertiserId);
|
|
|
- //按状态搜索用
|
|
|
- if (status != 2){
|
|
|
- paramMap.put("status", new Integer(status));
|
|
|
- }else {
|
|
|
- paramMap.put("status", null);
|
|
|
- }
|
|
|
- /**
|
|
|
- * 参数和list里要一样
|
|
|
- */
|
|
|
- List<Advertiser> reportList = advertiserService.findDeliverEffectAnalysis(paramMap);
|
|
|
- System.out.println("aaa"+reportList.toString());
|
|
|
- paramMap.put("dataList", reportList);
|
|
|
- response.reset();
|
|
|
- // Content-Type:application/vnd.ms-excel;charset=utf8或者text/xml;charset=utf8
|
|
|
- response.setContentType("application/vnd.ms-excel;charset=utf8");
|
|
|
- // 设置excel文件名称
|
|
|
- SimpleDateFormat df2 = new SimpleDateFormat("yyyyMMddHHmmss");
|
|
|
- String fileName = "Report" + df2.format(new Date());
|
|
|
- response.setHeader("Content-Disposition", "attachment;filename="
|
|
|
- + fileName + ".xls");
|
|
|
- // 需要对excel的列和行的总数进行指定
|
|
|
- int column = 9;
|
|
|
- paramMap.put("dataSize", (reportList.size() + 100));
|
|
|
- paramMap.put("column", column);
|
|
|
- paramMap.put("advertiserName", "广告主列表");
|
|
|
- paramMap.put("startDate", "2015-04-01");
|
|
|
- paramMap.put("endDate", "2015-06-01");
|
|
|
- String excelOrder = templateProcessor.processTemplate("excel/advertiserDataReport.ftl", paramMap);
|
|
|
- try {
|
|
|
- PrintWriter out = response.getWriter();
|
|
|
- out.write(excelOrder);
|
|
|
- out.flush();
|
|
|
- out.close();
|
|
|
- } catch (IOException e) {
|
|
|
- // TODO Auto-generated catch block
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
+ @RequestMapping("/exportDataReportExcel")
|
|
|
+ public void exportDataReportExcel(Model model,HttpServletRequest request,
|
|
|
+ HttpServletResponse response,
|
|
|
+ @RequestParam(defaultValue="2") int status,
|
|
|
+ @RequestParam Map<String, Object> paramMap) {
|
|
|
+ //按状态搜索用
|
|
|
+ if (status != 2){
|
|
|
+ paramMap.put("status", new Integer(status));
|
|
|
+ }else {
|
|
|
+ paramMap.put("status", null);
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 参数和list里要一样
|
|
|
+ */
|
|
|
+ List<Advertiser> reportList = advertiserService.findDeliverEffectAnalysis(paramMap);
|
|
|
+ System.out.println("aaa"+reportList.toString());
|
|
|
+ paramMap.put("dataList", reportList);
|
|
|
+ response.reset();
|
|
|
+ // Content-Type:application/vnd.ms-excel;charset=utf8或者text/xml;charset=utf8
|
|
|
+ response.setContentType("application/vnd.ms-excel;charset=utf8");
|
|
|
+ // 设置excel文件名称
|
|
|
+ SimpleDateFormat df2 = new SimpleDateFormat("yyyyMMddHHmmss");
|
|
|
+ String fileName = "Report" + df2.format(new Date());
|
|
|
+ response.setHeader("Content-Disposition", "attachment;filename="
|
|
|
+ + fileName + ".xls");
|
|
|
+ // 需要对excel的列和行的总数进行指定
|
|
|
+ int column = 9;
|
|
|
+ paramMap.put("dataSize", (reportList.size() + 100));
|
|
|
+ paramMap.put("column", column);
|
|
|
+ paramMap.put("advertiserName", "广告主列表");
|
|
|
+ paramMap.put("startDate", "2015-04-01");
|
|
|
+ paramMap.put("endDate", "2015-06-01");
|
|
|
+ String excelOrder = templateProcessor.processTemplate("excel/advertiserDataReport.ftl", paramMap);
|
|
|
+ try {
|
|
|
+ PrintWriter out = response.getWriter();
|
|
|
+ out.write(excelOrder);
|
|
|
+ out.flush();
|
|
|
+ out.close();
|
|
|
+ } catch (IOException e) {
|
|
|
+ // TODO Auto-generated catch block
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- //导出日志Excel用
|
|
|
-
|
|
|
- @RequestMapping("/exportLogExcel")
|
|
|
- public void exportLogExcel(Model model,HttpServletRequest request,
|
|
|
- HttpServletResponse response,
|
|
|
- @RequestParam Map<String, Object> paramMap
|
|
|
- ,@RequestParam Long advertiserId) {
|
|
|
- model.addAttribute("advertiserId", advertiserId);
|
|
|
- paramMap.put("tableName", "t_advertiser");
|
|
|
- paramMap.put("recordId", advertiserId);
|
|
|
- /*
|
|
|
- * 参数和list里要一样
|
|
|
- */
|
|
|
- System.out.println("aaa1"+paramMap.toString());
|
|
|
- List<Log> reportList = logService.findDeliverEffectAnalysis(paramMap);
|
|
|
- System.out.println("aaa"+reportList.toString());
|
|
|
- paramMap.put("dataList", reportList);
|
|
|
- response.reset();
|
|
|
- // Content-Type:application/vnd.ms-excel;charset=utf8或者text/xml;charset=utf8
|
|
|
- response.setContentType("application/vnd.ms-excel;charset=utf8");
|
|
|
- // 设置excel文件名称
|
|
|
- SimpleDateFormat df2 = new SimpleDateFormat("yyyyMMddHHmmss");
|
|
|
- String fileName = "advertiserModify" + df2.format(new Date());
|
|
|
- response.setHeader("Content-Disposition", "attachment;filename="
|
|
|
- + fileName + ".xls");
|
|
|
- // 需要对excel的列和行的总数进行指定
|
|
|
- int column = 9;
|
|
|
- paramMap.put("dataSize", (reportList.size() + 100));
|
|
|
- paramMap.put("column", column);
|
|
|
- paramMap.put("advertiserName", "广告主修改记录");
|
|
|
- paramMap.put("startDate", "2015-04-01");
|
|
|
- paramMap.put("endDate", "2015-06-01");
|
|
|
- String excelOrder = templateProcessor.processTemplate(
|
|
|
- "excel/logReport.ftl", paramMap);
|
|
|
- try {
|
|
|
- PrintWriter out = response.getWriter();
|
|
|
- out.write(excelOrder);
|
|
|
- out.flush();
|
|
|
- out.close();
|
|
|
- } catch (IOException e) {
|
|
|
- // TODO Auto-generated catch block
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * 上传
|
|
|
- * 创建人:周俊
|
|
|
- * 创建时间:2015-10-16 11:48
|
|
|
- * @return
|
|
|
- */
|
|
|
- @RequestMapping("/fileUpload")
|
|
|
- @ResponseBody
|
|
|
- public AjaxResult fileUpload(HttpServletRequest request,HttpServletResponse response) {
|
|
|
- return this.advertiserService.fileUpload(request, response);
|
|
|
-
|
|
|
- }
|
|
|
+ //导出日志Excel用
|
|
|
+ @RequestMapping("/exportLogExcel")
|
|
|
+ public void exportLogExcel(Model model,HttpServletRequest request,
|
|
|
+ HttpServletResponse response,
|
|
|
+ @RequestParam Map<String, Object> paramMap
|
|
|
+ ,@RequestParam Long advertiserId) {
|
|
|
+ model.addAttribute("advertiserId", advertiserId);
|
|
|
+ paramMap.put("tableName", "t_advertiser");
|
|
|
+ paramMap.put("recordId", advertiserId);
|
|
|
+ /*
|
|
|
+ * 参数和list里要一样
|
|
|
+ */
|
|
|
+ List<Log> reportList = logService.findDeliverEffectAnalysis(paramMap);
|
|
|
+ paramMap.put("dataList", reportList);
|
|
|
+ response.reset();
|
|
|
+ // Content-Type:application/vnd.ms-excel;charset=utf8或者text/xml;charset=utf8
|
|
|
+ response.setContentType("application/vnd.ms-excel;charset=utf8");
|
|
|
+ // 设置excel文件名称
|
|
|
+ SimpleDateFormat df2 = new SimpleDateFormat("yyyyMMddHHmmss");
|
|
|
+ String fileName = "advertiserModify" + df2.format(new Date());
|
|
|
+ response.setHeader("Content-Disposition", "attachment;filename="
|
|
|
+ + fileName + ".xls");
|
|
|
+ // 需要对excel的列和行的总数进行指定
|
|
|
+ int column = 9;
|
|
|
+ paramMap.put("dataSize", (reportList.size() + 100));
|
|
|
+ paramMap.put("column", column);
|
|
|
+ paramMap.put("advertiserName", "广告主修改记录");
|
|
|
+ paramMap.put("startDate", "2015-04-01");
|
|
|
+ paramMap.put("endDate", "2015-06-01");
|
|
|
+ String excelOrder = templateProcessor.processTemplate("excel/logReport.ftl", paramMap);
|
|
|
+ try {
|
|
|
+ PrintWriter out = response.getWriter();
|
|
|
+ out.write(excelOrder);
|
|
|
+ out.flush();
|
|
|
+ out.close();
|
|
|
+ } catch (IOException e) {
|
|
|
+ // TODO Auto-generated catch block
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 上传
|
|
|
+ * 创建人:周俊
|
|
|
+ * 创建时间:2015-10-16 11:48
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping("/fileUpload")
|
|
|
+ @ResponseBody
|
|
|
+ public AjaxResult fileUpload(HttpServletRequest request,HttpServletResponse response) {
|
|
|
+ return this.advertiserService.fileUpload(request, response);
|
|
|
+ }
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取父层的行业
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping("/getAllFatherIndustry")
|
|
|
+ public String getAllFatherIndustry(Model model, @RequestParam(defaultValue = "1") int page,
|
|
|
+ @RequestParam Map<String, Object> paramMap) {
|
|
|
+ Integer count = this.industryService.conutAllFatherIndustry(paramMap);
|
|
|
+ Pager1 pager = new Pager1();
|
|
|
+ pager.setPage(page);
|
|
|
+ pager.setTotalRow(count);
|
|
|
+ paramMap.put("pager", pager);
|
|
|
+ List<Industry> industryList = this.industryService.findAllFatherIndustry(paramMap);
|
|
|
+ model.addAttribute("pager", pager);
|
|
|
+ model.addAttribute("fatherId", paramMap.get("industry"));
|
|
|
+ model.addAttribute("industryId", "");
|
|
|
+ model.addAttribute("industryList", industryList);
|
|
|
+ return page("industry");
|
|
|
+ }
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取父层下的子行业
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping("/getIndustry")
|
|
|
+ public String getIndustry(Model model, @RequestParam(defaultValue = "1") int page,
|
|
|
+ @RequestParam Map<String, Object> paramMap) {
|
|
|
+ Integer count = this.industryService.countIndustryByFatherId(paramMap);
|
|
|
+ Pager1 pager = new Pager1();
|
|
|
+ pager.setPage(page);
|
|
|
+ pager.setTotalRow(count);
|
|
|
+ paramMap.put("pager", pager);
|
|
|
+ List<Industry> industryList = this.industryService.findIndustryByFatherId(paramMap);
|
|
|
+ model.addAttribute("pager", pager);
|
|
|
+ model.addAttribute("fatherId", "");
|
|
|
+ model.addAttribute("industryId", paramMap.get("industry"));
|
|
|
+ model.addAttribute("industryList", industryList);
|
|
|
+ return page("industry");
|
|
|
+ }
|
|
|
+
|
|
|
}
|