|
|
@@ -3,6 +3,7 @@ package com.uas.platform.b2b.controller;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.uas.platform.b2b.core.util.ContextUtils;
|
|
|
+import com.uas.platform.b2b.core.util.DateFormatUtils;
|
|
|
import com.uas.platform.b2b.model.*;
|
|
|
import com.uas.platform.b2b.ps.InquiryUtils;
|
|
|
import com.uas.platform.b2b.service.CustomerService;
|
|
|
@@ -26,14 +27,14 @@ import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
-import java.text.SimpleDateFormat;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* 首页公共询价列表数据
|
|
|
*
|
|
|
- * Created by hejq on 2018-01-17.
|
|
|
+ * @author hejq
|
|
|
+ * @date 2018-01-17
|
|
|
*/
|
|
|
@RequestMapping("/pubInquiry")
|
|
|
@RestController
|
|
|
@@ -162,15 +163,23 @@ public class PubInquiryListController {
|
|
|
filter.setEndDate(endDate);
|
|
|
filter.setKeyword(keyword);
|
|
|
filter.setUserUU(SystemSession.getUser().getUserUU());
|
|
|
- SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日");
|
|
|
ModelAndView modelAndView = new ModelAndView();
|
|
|
- modelAndView.addObject("dateFormat", dateFormat);
|
|
|
- if (StringUtils.isEmpty(state) || state.equals("all")) {
|
|
|
+ modelAndView.addObject("dateFormat", DateFormatUtils.EXPORT_FORMAT);
|
|
|
+ // 全部
|
|
|
+ String allState = "all";
|
|
|
+ // 客户
|
|
|
+ String customerState = "customer";
|
|
|
+ // 个人商机
|
|
|
+ String remindState = "remind";
|
|
|
+ // 企业商机
|
|
|
+ String enterpirseState = "enterprise";
|
|
|
+ if (StringUtils.isEmpty(state) || allState.equals(state)) {
|
|
|
modelAndView.addObject("state", "全部");
|
|
|
modelAndView.addObject("data", enquiryService.fingByPageInfo(pageInfo, filter, null).getContent());
|
|
|
modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/public/publicInquiry", "公共询价单列表"));
|
|
|
logger.log("公共询价单", "导出Excel列表", "导出公共询价列表(全部)");
|
|
|
- } else if (state.equals("customer")) {// 导出客户询价列表
|
|
|
+ } else if (customerState.equals(state)) {
|
|
|
+ // 导出客户询价列表
|
|
|
modelAndView.addObject("state", "我的客户询价");
|
|
|
List<Long> uuList = customerService.getCustomerDistribute();
|
|
|
if (CollectionUtils.isEmpty(uuList)) {
|
|
|
@@ -179,14 +188,15 @@ public class PubInquiryListController {
|
|
|
modelAndView.addObject("data", enquiryService.fingByPageInfo(pageInfo, filter, uuList).getContent());
|
|
|
modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/public/publicInquiry", "客户公共询价列表"));
|
|
|
logger.log("公共询价单", "导出Excel列表", "导出我的客户询价列表");
|
|
|
- } else if (state.equals("remind")) {
|
|
|
+ } else if (remindState.equals(state)) {
|
|
|
modelAndView.addObject("state", "个人商机询价列表");
|
|
|
List<InquiryRemind> reminds = InquiryUtils.getRemind(pageInfo, filter, SystemSession.getUser().getUserUU(), SystemSession.getUser().getEnterprise().getUu()).getContent();
|
|
|
modelAndView.addObject("data", !CollectionUtils.isEmpty(reminds) ? reminds : new ArrayList<InquiryRemind>());
|
|
|
modelAndView.addObject("title", "个人商机询价列表");
|
|
|
modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/public/inquiryRemind", "个人商机询价列表"));
|
|
|
logger.log("公共询价单", "导出Excel列表", "导出个人商机询价列表");
|
|
|
- } else if (state.equals("enterprise")) { // 导出企业商机
|
|
|
+ } else if (enterpirseState.equals(state)) {
|
|
|
+ // 导出企业商机
|
|
|
modelAndView.addObject("state", "企业商机询价列表");
|
|
|
List<InquiryRemind> reminds = InquiryUtils.getEngerpriseRemind(pageInfo, filter, SystemSession.getUser().getUserUU(), SystemSession.getUser().getEnterprise().getUu()).getContent();
|
|
|
modelAndView.addObject("data", !CollectionUtils.isEmpty(reminds) ? reminds : new ArrayList<InquiryRemind>());
|