Просмотр исходного кода

更新公共询价列表导出功能

hejq 8 лет назад
Родитель
Сommit
d4283626e1

+ 8 - 4
src/main/java/com/uas/platform/b2b/controller/PubInquiryListController.java

@@ -15,6 +15,7 @@ import com.uas.platform.b2b.support.UsageBufferedLogger;
 import com.uas.platform.core.logging.BufferedLoggerManager;
 import com.uas.platform.core.model.PageInfo;
 import com.uas.platform.core.model.PageParams;
+import com.uas.ps.core.util.CollectionUtils;
 import com.uas.ps.core.util.StringUtils;
 import com.uas.search.b2b.model.SPage;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -62,7 +63,7 @@ public class PubInquiryListController {
         logger.log("公共询价单", "查看公共询价单列表");
         PageInfo pageInfo = new PageInfo(params);
         SearchFilter filter = JSONObject.parseObject(searchFilter, SearchFilter.class);
-        return enquiryService.fingByPageInfo(pageInfo, filter);
+        return enquiryService.fingByPageInfo(pageInfo, filter, null);
     }
 
     /**
@@ -165,13 +166,16 @@ public class PubInquiryListController {
         modelAndView.addObject("dateFormat", dateFormat);
         if (StringUtils.isEmpty(state) || state.equals("all")) {
             modelAndView.addObject("state", "全部");
-            modelAndView.addObject("data", enquiryService.fingByPageInfo(pageInfo, filter).getContent());
+            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")) {// 导出客户询价列表
             modelAndView.addObject("state", "我的客户询价");
-            filter.setDistribute(customerService.getCustomerDistribute());
-            modelAndView.addObject("data", enquiryService.fingByPageInfo(pageInfo, filter).getContent());
+            List<Long> uuList = customerService.getCustomerDistribute();
+            if (CollectionUtils.isEmpty(uuList)) {
+                uuList.add(1l);
+            }
+            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")){

+ 4 - 1
src/main/java/com/uas/platform/b2b/ps/InquiryUtils.java

@@ -106,11 +106,14 @@ public class InquiryUtils {
      * @return
      * @throws Exception
      */
-    public static Page<PurcInquiryItemInfo> getInfo(PageInfo pageInfo, SearchFilter searchFilter) throws Exception {
+    public static Page<PurcInquiryItemInfo> getInfo(PageInfo pageInfo, SearchFilter searchFilter, List<Long> distribute) throws Exception {
         JSONObject formData = JSON.parseObject(JSON.toJSONString(pageInfo));
         if (searchFilter != null) {
             formData.putAll(JSON.parseObject(JSON.toJSONString(searchFilter)));
         }
+        if (null != distribute) {
+            formData.put("distributes", JSON.toJSONString(distribute));
+        }
         HttpUtil.Response res = HttpUtil.sendGetRequest(url + "/inquiry/public", formData);
         return (Page)JSONObject.parseObject(res.getResponseText(), new TypeReference<Page<PurcInquiryItemInfo>>() {
         }, new Feature[0]);

+ 4 - 1
src/main/java/com/uas/platform/b2b/service/EnquiryService.java

@@ -8,6 +8,8 @@ import com.uas.platform.core.model.PageInfo;
 import com.uas.search.b2b.model.SPage;
 import org.springframework.ui.ModelMap;
 
+import java.util.List;
+
 /**
  * 公共询价操作接口
  *
@@ -20,9 +22,10 @@ public interface EnquiryService {
      *
      * @param pageInfo 分页信息
      * @param searchFilter 过滤条件
+     * @param distribute 客户分配
      * @return
      */
-    SPage<PurcInquiryItemInfo> fingByPageInfo(PageInfo pageInfo, SearchFilter searchFilter) throws Exception;
+    SPage<PurcInquiryItemInfo> fingByPageInfo(PageInfo pageInfo, SearchFilter searchFilter, List<Long> distribute) throws Exception;
 
     /**
      * 通过id查询询价详情

+ 1 - 1
src/main/webapp/resources/js/index/app.js

@@ -5600,7 +5600,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                                 dataType: 'json',
                                 url: $scope.url + '/inquiry/public',
                                 params: {pageNumber: pageParams.page, pageSize: pageParams.count, enUU: $scope.currentEn.uu, keyword: $scope.keyword,
-                                    fromDate: getDateTime($scope.condition.dateFrom), endDate: getDateTime($scope.condition.dateTo), distribute: $scope.distribute,  remind: $scope.remind}
+                                    fromDate: getDateTime($scope.condition.dateFrom), endDate: getDateTime($scope.condition.dateTo), distribute: $scope.distribute, remind: $scope.remind}
                             }).success(function (response) {
                                 $scope.loading = false;
                                 if (response) {

+ 1 - 1
src/main/webapp/resources/tpl/index/baseInfo/inquiry_list.html

@@ -328,7 +328,7 @@
                         <!--(<em> 10 </em>)-->
                     </span>
                     <a href="#/index">返回</a>
-                    <a href="pubInquiry/xls?keyword={{keyword}}&fromDate={{filterXls.fromDate}}&endDate={{filterXls.endDate}}&state={{active}}">导出</a>
+                    <a href="pubInquiry/xls?keyword={{keyword}}&fromDate={{searchFilterXls.fromDate}}&endDate={{searchFilterXls.endDate}}&state={{active}}">导出</a>
                 </div>
                 <div class="tender-list-content">
                     <div class="container">