Browse Source

Merge branch 'master' of http://git.iamberry.com/hexiugang/iamberry-common-parent

# Conflicts接入京东电子面单打印
liujiankang 5 years ago
parent
commit
7b78cf281b

+ 27 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/cm/Postage.java

@@ -84,6 +84,9 @@ public class Postage implements Serializable {
 
     private Integer postageIsPrint;//是否已打印1:未打印2:已打印
     private String postagePayImg;//支付截图
+    private String salesDealCode;//订单交易号
+    private String startTime;
+    private String endTime;
 
     public Integer getPostageId() {
         return postageId;
@@ -412,4 +415,28 @@ public class Postage implements Serializable {
     public void setPostagePayImg(String postagePayImg) {
         this.postagePayImg = postagePayImg;
     }
+
+    public String getSalesDealCode() {
+        return salesDealCode;
+    }
+
+    public void setSalesDealCode(String salesDealCode) {
+        this.salesDealCode = salesDealCode;
+    }
+
+    public String getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(String startTime) {
+        this.startTime = startTime;
+    }
+
+    public String getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(String endTime) {
+        this.endTime = endTime;
+    }
 }

+ 7 - 2
watero-rst-core/src/main/java/com.iamberry.rst.core/tools/KuaiDi100.java

@@ -658,11 +658,12 @@ public class KuaiDi100 {
     /**
      * 快递鸟查询顺风物流信息
      * 根据物流单号查询快递信息
+     * CustomerName  京东查询使用
      * @param
      * @return
      */
     public String selectCourierSF(String expCode, String expNo) throws Exception{
-        String requestData= "{'OrderCode':'','ShipperCode':'" + expCode + "','LogisticCode':'" + expNo + "'}";
+        String requestData= "{'OrderCode':'','ShipperCode':'" + expCode + "','LogisticCode':'" + expNo + "','CustomerName': '020K726726'}";
 
         Map<String, String> params = new HashMap<String, String>();
         params.put("RequestData", urlEncoder(requestData, "UTF-8"));
@@ -683,7 +684,11 @@ public class KuaiDi100 {
         KuaiDi100 kuaidi = new KuaiDi100();
         /*System.out.println(kuaidi.selectCourierCompany2("yuantong","yt9053971537384"));*/
         /*System.out.println(kuaidi.selectCourierSignTime("yuantong","yt9053971537384"));*/
-        /*System.out.println(kuaidi.selectCourierSF("106494280800","SF","291003792023"));*/
+        try {
+            System.out.println(kuaidi.selectCourierSF("JD","JDVC03353249595"));
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
         /*System.out.println(kuaidi.getExpressInfo("shentong","221510432233"));*/
 
 

+ 9 - 1
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/postageMapper.xml

@@ -42,13 +42,15 @@
     pi.postage_pay_type postagePayType,
     pi.postage_pay_where postagePayWhere,
     pt.proc_type_name procTypeName,
-    pm.proc_method_name procMethodName
+    pm.proc_method_name procMethodName,
+    soi.sales_deal_code AS salesDealCode
     from tb_rst_postage p
     LEFT JOIN tb_rst_sys_admin sa ON p.admin_id = sa.admin_id
     LEFT JOIN tb_rst_store_info si ON p.postage_order_source = si.store_id
     LEFT JOIN tb_rst_postage_info pi on pi.postage_id = p.customer_postage_id
     LEFT JOIN tb_rst_cm_proc_method pm ON pm.proc_method_id = p.postage_treatment_method
     LEFT JOIN tb_rst_cm_proc_type pt ON pt.proc_type_id = pm.proc_type_id
+    LEFT JOIN tb_rst_sales_order_info soi ON p.sales_orderId = soi.sales_id
     <where>
       <if test="adminId != null and adminId != ''">
         p.admin_id = #{adminId}
@@ -107,6 +109,12 @@
             #{item}
           </foreach >
       </if>
+      <if test="startTime != null and startTime != ''">
+        AND p.postage_create_time &gt; #{startTime}
+      </if>
+      <if test="endTime != null and endTime != ''">
+        AND p.postage_create_time &lt; #{endTime}
+      </if>
     </where>
     ORDER BY postage_id DESC
   </select>

+ 122 - 65
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminCustomerController.java

@@ -1819,23 +1819,25 @@ public class AdminCustomerController {
      *
      * @param request
      * @param res
-     * @param
+     * @param type  1查询客诉订单 2查询寄回订单
      * @throws Exception
      */
     @ResponseBody
     @RequestMapping("/download_customer_excel")
-    public ResponseJson downloadEfastOrderExcel(HttpServletRequest request, HttpServletResponse res, CustomerInfo customerInfo) throws Exception {
+    public ResponseJson downloadEfastOrderExcel(HttpServletRequest request, HttpServletResponse res, CustomerInfo customerInfo,Integer type) throws Exception {
         String path = request.getSession().getServletContext().getRealPath("/");
-        new Thread(new Mythread(path,customerInfo)).start();
+        new Thread(new Mythread(path,customerInfo,type)).start();
         return new ResponseJson(200, "查询成功", 200);
     }
 
     class Mythread extends Thread{
         private String path;
         private CustomerInfo customerInfo;
-        public Mythread(String path,CustomerInfo customerInfo) {
+        private Integer type;
+        public Mythread(String path,CustomerInfo customerInfo,Integer type) {
             this.path=path;
             this.customerInfo=customerInfo;
+            this.type=type;
         }
         @Override
         public void run(){
@@ -1873,71 +1875,114 @@ public class AdminCustomerController {
                 List<CustomerCommon> listCustomerCommon = customerService.listCustomerCommons(customerCommon);
                 if(listCustomerCommon.size() > 0) {
                     for (CustomerCommon common : listCustomerCommon) {
-                        if (common.getSalesOrderList().size() > 0) {
-                            for (SalesOrder salesOrder : common.getSalesOrderList()) {
-                                if (salesOrder.getSalesOrderItemList().size() > 0) {
-                                    for (SalesOrderItem salesOrderItem : salesOrder.getSalesOrderItemList()) {
-                                        if(common.getSignclosedInfos().size() > 0){
-                                            for(ComplaintSignclosedInfo signclosedInfo : common.getSignclosedInfos()){
-                                                for (SignclosedProductInfo signclosedProductInfo : signclosedInfo.getSignclosedProductInfoList()) {
-                                                    //将数据copy到新容器
-                                                    CustomerStatisticalInfo customers = new CustomerStatisticalInfo();
-                                                    BeanUtils.copyProperties(customer, customers);
-                                                    customers.setRelationBackLogisticsCompany(signclosedInfo.getSignclosedLogistics());
-                                                    customers.setRelationBackLogisticsNo(signclosedInfo.getSignclosedLogisticsNumber());
-                                                    customers.setRelationBackStatus(String.valueOf(signclosedInfo.getSignclosedIsReceiving()));
-                                                    if(signclosedInfo.getSignclosedDate() == null){
-                                                        customers.setRelationBackReceiptDate(null);
-                                                    }else{
-                                                        customers.setRelationBackReceiptDate(sdf4.format(signclosedInfo.getSignclosedDate()));
-                                                    }
-                                                    customers.setSignclosedProductInfo(signclosedProductInfo.getProductName()+"("+signclosedProductInfo.getColorName()+")"+"*"+signclosedProductInfo.getProductNum());
-                                                    customers.setItemProductColor(signclosedProductInfo.getColorName());
-                                                    customers.setRelationSendLogisticsCompany(salesOrder.getSalesPostNum());
-                                                    customers.setRelationSendLogisticsNo(salesOrder.getSalesPostFirm());
+                        if(type == 1){
+                            if (common.getSalesOrderList().size() > 0) {
+                                for (SalesOrder salesOrder : common.getSalesOrderList()) {
+                                    if (salesOrder.getSalesOrderItemList().size() > 0) {
+                                        for (SalesOrderItem salesOrderItem : salesOrder.getSalesOrderItemList()) {
+                                            if(common.getSignclosedInfos().size() > 0){
+                                                        //将数据copy到新容器
+                                                        CustomerStatisticalInfo customers = new CustomerStatisticalInfo();
+                                                        BeanUtils.copyProperties(customer, customers);
+                                                  /*      customers.setRelationBackLogisticsCompany(signclosedInfo.getSignclosedLogistics());
+                                                        customers.setRelationBackLogisticsNo(signclosedInfo.getSignclosedLogisticsNumber());
+                                                        customers.setRelationBackStatus(String.valueOf(signclosedInfo.getSignclosedIsReceiving()));
+                                                        if(signclosedInfo.getSignclosedDate() == null){
+                                                            customers.setRelationBackReceiptDate(null);
+                                                        }else{
+                                                            customers.setRelationBackReceiptDate(sdf4.format(signclosedInfo.getSignclosedDate()));
+                                                        }
+                                                        customers.setSignclosedProductInfo(signclosedProductInfo.getProductName()+"("+signclosedProductInfo.getColorName()+")"+"*"+signclosedProductInfo.getProductNum());
+                                                        customers.setItemProductColor(signclosedProductInfo.getColorName());*/
+                                                        customers.setRelationSendLogisticsCompany(salesOrder.getSalesPostFirm());
+                                                        customers.setRelationSendLogisticsNo(salesOrder.getSalesPostNum());
 
-                                                    customers.setSalesPayTime(salesOrder.getSalesPayTime());
-                                                    customers.setItemProductName(salesOrderItem.getItemProductName());
+                                                        customers.setSalesPayTime(salesOrder.getSalesPayTime());
+                                                        customers.setItemProductName(salesOrderItem.getItemProductName());
 
-                                                    customers.setItemNum(String.valueOf(salesOrderItem.getItemNum()));
-                                                    if(salesOrderItem.getTypeName() != null || !salesOrderItem.getTypeName().equals("")){
-                                                        customers.setTypeName(String.valueOf(salesOrderItem.getTypeName()));
-                                                    }
-                                                    customers.setRelationFactoryCosts(customerInfo.getRelationFactoryCosts());
-                                                    customers.setRelationCustomerCosts(customerInfo.getRelationCustomerCosts());
-                                                    customers.setSignclosedProductInfos(common.getSignclosedProductInfos());
-                                                    String postageString = "";
-                                                    //查询邮费信息
-                                                    List<PostageInfo> listPostageInfo = customerService.listPostageInfo(customers.getRelationId());
-                                                    if(listPostageInfo.size() > 0){
-                                                        for(PostageInfo postageInfo : listPostageInfo){
-                                                            String state = "";
-                                                            if(postageInfo.getPostageStatus() == 1){
-                                                                state = "未申请";
-                                                            }
-                                                            if(postageInfo.getPostageStatus() == 2){
-                                                                state = "已申请(待转账)";
-                                                            }
-                                                            if(postageInfo.getPostageStatus() == 3){
-                                                                state = "已转账";
+                                                        customers.setItemNum(String.valueOf(salesOrderItem.getItemNum()));
+                                                        if(salesOrderItem.getTypeName() != null || !salesOrderItem.getTypeName().equals("")){
+                                                            customers.setTypeName(String.valueOf(salesOrderItem.getTypeName()));
+                                                        }
+                                                        customers.setRelationFactoryCosts(customerInfo.getRelationFactoryCosts());
+                                                        customers.setRelationCustomerCosts(customerInfo.getRelationCustomerCosts());
+                                                        customers.setSignclosedProductInfos(common.getSignclosedProductInfos());
+                                                        String postageString = "";
+                                                        //查询邮费信息
+                                                        List<PostageInfo> listPostageInfo = customerService.listPostageInfo(customers.getRelationId());
+                                                        if(listPostageInfo.size() > 0){
+                                                            for(PostageInfo postageInfo : listPostageInfo){
+                                                                String state = "";
+                                                                if(postageInfo.getPostageStatus() == 1){
+                                                                    state = "未申请";
+                                                                }
+                                                                if(postageInfo.getPostageStatus() == 2){
+                                                                    state = "已申请(待转账)";
+                                                                }
+                                                                if(postageInfo.getPostageStatus() == 3){
+                                                                    state = "已转账";
+                                                                }
+                                                                postageString = postageString+"状态:"+state+" ,金额:"+postageInfo.getPostageAmount()/100+" ,支付宝账号:"+postageInfo.getPostageAlipay()+";";
                                                             }
-                                                            postageString = postageString+"状态:"+state+" ,金额:"+postageInfo.getPostageAmount()/100+" ,支付宝账号:"+postageInfo.getPostageAlipay()+";";
                                                         }
-                                                    }
-                                                    customers.setPostageString(postageString);
-                                                    customerStatisticalInfoList.add(customers);
-                                                }
+                                                        customers.setPostageString(postageString);
+                                                        customerStatisticalInfoList.add(customers);
                                             }
                                         }
+                                    } else {
+                                        customerStatisticalInfoList.add(customer);
                                     }
-                                } else {
-                                    customerStatisticalInfoList.add(customer);
                                 }
+                            } else {
+                                customerStatisticalInfoList.add(customer);
                             }
-                        } else {
-                            customerStatisticalInfoList.add(customer);
-                        }
-
+                        }else if (type == 2){
+                            if(common.getSignclosedInfos().size() > 0){
+                                for(ComplaintSignclosedInfo signclosedInfo : common.getSignclosedInfos()){
+                                    for (SignclosedProductInfo signclosedProductInfo : signclosedInfo.getSignclosedProductInfoList()) {
+                                        //将数据copy到新容器
+                                        CustomerStatisticalInfo customers = new CustomerStatisticalInfo();
+                                        BeanUtils.copyProperties(customer, customers);
+                                        customers.setRelationBackLogisticsCompany(signclosedInfo.getSignclosedLogistics());
+                                        customers.setRelationBackLogisticsNo(signclosedInfo.getSignclosedLogisticsNumber());
+                                        customers.setRelationBackStatus(String.valueOf(signclosedInfo.getSignclosedIsReceiving()));
+                                        if(signclosedInfo.getSignclosedDate() == null){
+                                            customers.setRelationBackReceiptDate(null);
+                                            }else{
+                                                customers.setRelationBackReceiptDate(sdf4.format(signclosedInfo.getSignclosedDate()));
+                                            }
+                                            customers.setSignclosedProductInfo(signclosedProductInfo.getProductName()+"("+signclosedProductInfo.getColorName()+")"+"*"+signclosedProductInfo.getProductNum());
+                                            customers.setItemProductColor(signclosedProductInfo.getColorName());
+
+                                             customers.setRelationFactoryCosts(customerInfo.getRelationFactoryCosts());
+                                             customers.setRelationCustomerCosts(customerInfo.getRelationCustomerCosts());
+                                             customers.setSignclosedProductInfos(common.getSignclosedProductInfos());
+                                             String postageString = "";
+                                             //查询邮费信息
+                                            List<PostageInfo> listPostageInfo = customerService.listPostageInfo(customers.getRelationId());
+                                            if(listPostageInfo.size() > 0){
+                                                for(PostageInfo postageInfo : listPostageInfo){
+                                                    String state = "";
+                                                    if(postageInfo.getPostageStatus() == 1){
+                                                        state = "未申请";
+                                                        }
+                                                     if(postageInfo.getPostageStatus() == 2){
+                                                        state = "已申请(待转账)";
+                                                     }
+                                                     if(postageInfo.getPostageStatus() == 3){
+                                                        state = "已转账";
+                                                     }
+                                                        postageString = postageString+"状态:"+state+" ,金额:"+postageInfo.getPostageAmount()/100+" ,支付宝账号:"+postageInfo.getPostageAlipay()+";";
+                                                      }
+                                                     }
+                                                     customers.setPostageString(postageString);
+                                             customerStatisticalInfoList.add(customers);
+                                                    }
+                                                }
+                                            }else {
+                                                customerStatisticalInfoList.add(customer);
+                                            }
+                                        }
                     }
                 }else{
                     customerStatisticalInfoList.add(customer);
@@ -1963,7 +2008,7 @@ public class AdminCustomerController {
             }
                 //导出订单Excel并下载
             try {
-                customerExcel(cells,customerStatisticalInfoList,downloadProgressInfo,path);
+                customerExcel(cells,customerStatisticalInfoList,downloadProgressInfo,path,type);
             } catch (Exception e) {
                 e.printStackTrace();
             }
@@ -1978,7 +2023,7 @@ public class AdminCustomerController {
      * @throws Exception
      */
     public void customerExcel(String[] cells,List<CustomerStatisticalInfo> customerList,
-                              DownloadProgressInfo downloadProgressInfo,String path) throws Exception {
+                              DownloadProgressInfo downloadProgressInfo,String path,Integer type) throws Exception {
 
         //创建一个workbook,对应一个Excel文件
         HSSFWorkbook wb = new HSSFWorkbook();
@@ -2019,7 +2064,13 @@ public class AdminCustomerController {
             }
             String backLogisticsCompany = "";
             if(customerStatisticalInfo.getRelationBackLogisticsCompany() != null){
-                backLogisticsCompany = KuaiDi100.replace(customerStatisticalInfo.getRelationBackLogisticsCompany());
+
+                LogisticsInfo logisticsInfo =  logisticsInfoService.getLogisticsNameByRSTCode(customerStatisticalInfo.getRelationBackLogisticsCompany());
+                if(logisticsInfo != null){
+                    backLogisticsCompany = logisticsInfo.getLogisticsName();
+                }else{
+                    backLogisticsCompany = customerStatisticalInfo.getRelationBackLogisticsCompany();
+                }
             }
             String backStatus = "未知";
             if(customerStatisticalInfo.getRelationBackStatus() != null){
@@ -2035,7 +2086,12 @@ public class AdminCustomerController {
             }
             String sendLogisticsCompany = "";
             if(customerStatisticalInfo.getRelationSendLogisticsCompany() != null){
-                sendLogisticsCompany = KuaiDi100.replace(customerStatisticalInfo.getRelationSendLogisticsCompany());
+                LogisticsInfo logisticsInfo =  logisticsInfoService.getLogisticsNameByRSTCode(customerStatisticalInfo.getRelationSendLogisticsCompany());
+                if(logisticsInfo != null){
+                    sendLogisticsCompany = logisticsInfo.getLogisticsName();
+                }else{
+                    sendLogisticsCompany = customerStatisticalInfo.getRelationSendLogisticsCompany();
+                }
             }
 
             // 创建单元格,设置值
@@ -2091,8 +2147,9 @@ public class AdminCustomerController {
             row.createCell(29).setCellValue(customerStatisticalInfo.getPostageString());
 
         }
+
         //下载导出订单Excel
-       downloadCustomerExcel(wb,downloadProgressInfo,path,"客诉报表");
+       downloadCustomerExcel(wb,downloadProgressInfo,path,"客诉报表"+ (type== 1 ? "(客诉订单)" : "(寄回订单)"));
     }
 
     /**

+ 198 - 0
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminPostageController.java

@@ -11,6 +11,7 @@ import com.iamberry.rst.faces.sys.SysService;
 import com.iamberry.rst.utils.AdminUtils;
 import com.iamberry.rst.utils.StitchAttrUtil;
 import com.iamberry.wechat.tools.ResponseJson;
+import org.apache.poi.hssf.usermodel.*;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -21,8 +22,12 @@ import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.servlet.ModelAndView;
 
+import javax.servlet.ServletOutputStream;
 import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.*;
 import java.lang.reflect.Array;
+import java.text.SimpleDateFormat;
 import java.util.*;
 
 /**
@@ -407,5 +412,198 @@ public class AdminPostageController {
         mv.addObject("postageId",postageId);
         return mv;
     }
+
+
+    /**
+     * 查询邮费转账信息
+     * @param request
+     * @param res
+     * @param postage
+     * @throws Exception
+     */
+    @ResponseBody
+    @RequestMapping("/to_download_Postage")
+    public ResponseJson to_download_Postage(HttpServletRequest request,HttpServletResponse res,
+                                Postage postage) throws Exception{
+        //根据id查询订单数据
+        List<Postage> postageList = postageService.listPostage(postage);
+        if (postageList == null || postageList.size() == 0) {
+            return new ResponseJson(500, "未获取到记录", 500);
+        }
+        return new ResponseJson(200, "查询到记录", 200);
+    }
+
+    /**
+     * 导出邮费转账
+     * @param request
+     * @param res
+     * @param postage
+     * @throws Exception
+     */
+    @RequestMapping("/download_Postage")
+        public void salesOrderExcel(HttpServletRequest request,HttpServletResponse res,
+                Postage postage) throws Exception{
+            List<Postage> postageList = postageService.listPostage(postage);
+        if (postageList == null || postageList.size() == 0) {
+            return;
+        }
+        String[] cells = {
+                "创建时间","客诉ID","申请人","邮费ID",
+                "申请状态","客服经理审核","财务审核","订单交易号","客户姓名",
+                "联系电话","详细地址","退款运费","支付宝账户","支付宝姓名",
+                "转账状态","审批编码","店铺名称","支付方式",
+                "开户行","售后处理方式","售后处理子方式"
+        };
+        //导出订单Excel并下载
+        exportExcel(request,res,cells,postageList);
+    }
+
+    /**
+     * 导出Excel并下载
+     * @param request
+     * @param res
+     * @param cells
+     * @param postageList
+     * @throws Exception
+     */
+    public void exportExcel(HttpServletRequest request,HttpServletResponse res,
+                            String[] cells,List<Postage> postageList) throws Exception {
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        //创建一个workbook,对应一个Excel文件
+        HSSFWorkbook wb = new HSSFWorkbook();
+        //在workbook中添加一个sheet,对应Excel中的一个sheet
+        HSSFSheet sheet = wb.createSheet("导出订单");
+        //在sheet中添加表头第0行,老版本poi对excel行数列数有限制short
+        HSSFRow row = sheet.createRow((int) 0);
+        //创建单元格,设置值表头,设置表头居中
+        HSSFCellStyle style = wb.createCellStyle();
+        //居中格式
+        style.setAlignment(HSSFCellStyle.ALIGN_CENTER);
+        //设置表头
+
+        if (cells == null || cells.length == 0) {
+            return;
+        }
+        //循环设置表头
+        HSSFCell cell = null;
+        for (int i = 0;i < cells.length;i++) {
+            String name = cells[i];
+            cell = row.createCell(i);
+            cell.setCellValue(name);
+            cell.setCellStyle(style);
+        }
+        for (int i = 0; i < postageList.size(); i++) {
+            row = sheet.createRow((int) i + 1);
+            Postage postage = postageList.get(i);
+
+
+            /*"创建时间","客诉ID","申请人","邮费ID",
+                "申请状态","客服经理审核","财务审核","订单交易号","客户姓名",
+                "联系电话","详细地址","退款运费","支付宝账户","支付宝姓名",
+                "转账状态","审批编码","店铺名称","支付方式",
+                "开户行","售后处理方式","售后处理子方式"*/
+
+            String postageCustomerStatus = "";
+            switch (postage.getPostageCustomerStatus()) {
+                case 1:postageCustomerStatus = "待申请";break;
+                case 2:postageCustomerStatus = "申请中";break;
+                case 3:postageCustomerStatus = "已申请";break;
+            }
+            String postageManagerStatus = "";
+            switch (postage.getPostageManagerStatus()) {
+                case 1:postageManagerStatus = "审核中";break;
+                case 2:postageManagerStatus = "通过";break;
+                case 3:postageManagerStatus = "驳回";break;
+            }
+            String postageFinanceStatus = "";
+            if(postage.getPostageFinanceStatus() != null){
+                switch (postage.getPostageFinanceStatus()) {
+                    case 1:postageFinanceStatus = "审核中";break;
+                    case 2:postageFinanceStatus = "通过(已申请待转账)";break;
+                    case 3:postageFinanceStatus = "驳回";break;
+                    case 4:postageFinanceStatus = "已转账";break;
+                }
+            }
+
+            String postageTransferStatus = "";
+            switch (postage.getPostageTransferStatus()) {
+                case 1:postageTransferStatus = "待转";break;
+                case 2:postageTransferStatus = "已转";break;
+            }
+            String postagePayType = "";
+            switch (postage.getPostagePayType()) {
+                case 1:postagePayType = "支付宝";break;
+                case 2:postagePayType = "微信";break;
+                case 3:postagePayType = "银行卡";break;
+            }
+
+            // 创建单元格,设置值
+          row.createCell(0).setCellValue(postage.getPostageCreateTime());
+            row.createCell(1).setCellValue(postage.getCustomerId());
+            row.createCell(2).setCellValue(postage.getAdminName());
+            row.createCell(3).setCellValue(postage.getPostageId());
+            row.createCell(4).setCellValue(postageCustomerStatus);
+            row.createCell(5).setCellValue(postageManagerStatus);
+            row.createCell(6).setCellValue(postageFinanceStatus);
+            row.createCell(7).setCellValue(postage.getSalesDealCode());
+            row.createCell(8).setCellValue(postage.getPostageClientName());
+            row.createCell(9).setCellValue(postage.getPostageClientTel());
+            row.createCell(10).setCellValue(postage.getPostageClientAddress());
+            row.createCell(11).setCellValue(postage.getPostageAmount());
+            row.createCell(12).setCellValue(postage.getPostageAlipay());
+            row.createCell(13).setCellValue(postage.getPostageAlipayName());
+            row.createCell(14).setCellValue(postageTransferStatus);
+            row.createCell(15).setCellValue(postage.getPostageCoding());
+            row.createCell(16).setCellValue(postage.getStoreName());
+            row.createCell(17).setCellValue(postagePayType);
+            row.createCell(18).setCellValue(postage.getPostagePayWhere());
+            row.createCell(19).setCellValue(postage.getProcTypeName());
+            row.createCell(20).setCellValue(postage.getProcMethodName());
+        }
+        //下载导出订单Excel
+        downloadOrderExcel(res,wb);
+    }
+
+    /**
+     * 下载导出订单Excel
+     * @param res
+     * @param wb
+     * @throws Exception
+     */
+    public void downloadOrderExcel(HttpServletResponse res, HSSFWorkbook wb) throws Exception{
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
+        String fileName = format.format(new Date()) + "邮费转账报表";
+        ByteArrayOutputStream os = new ByteArrayOutputStream();
+        wb.write(os);
+        byte[] content = os.toByteArray();
+        InputStream is = new ByteArrayInputStream(content);
+        // 设置response参数,可以打开下载页面
+        res.reset();
+        res.setContentType("application/vnd.ms-excel;charset=utf-8");
+        res.setHeader("Content-Disposition", "attachment;filename="
+                + new String((fileName + ".xls").getBytes(), "iso-8859-1"));
+        ServletOutputStream out = res.getOutputStream();
+        BufferedInputStream bis = null;
+        BufferedOutputStream bos = null;
+        try {
+            bis = new BufferedInputStream(is);
+            bos = new BufferedOutputStream(out);
+            byte[] buff = new byte[2048];
+            int bytesRead;
+            // Simple read/write loop.
+            while (-1 != (bytesRead = bis.read(buff, 0, buff.length))) {
+                bos.write(buff, 0, bytesRead);
+            }
+        } catch (Exception e) {
+            // TODO: handle exception
+            e.printStackTrace();
+        } finally {
+            if (bis != null)
+                bis.close();
+            if (bos != null)
+                bos.close();
+        }
+    }
+
 }
 

+ 7 - 3
watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/download_customer.ftl

@@ -80,7 +80,10 @@
             <div class="row cl"  style="margin-bottom: 20px;">
                 <label class="form-label col-1 col-sm-1"></label>
                 <div class="col-2 col-sm-2">
-                    <button type="button" class="btn" style="background: #50a2ea;border: 1px solid #50a2ea;color: #fff;height: 35px;margin-top: -8px;margin-bottom: 3px;" onclick="download();">开始下载</button>
+                    <button type="button" class="btn" style="background: #50a2ea;border: 1px solid #50a2ea;color: #fff;height: 35px;margin-top: -8px;margin-bottom: 3px;" onclick="download(1);">开始下载(客诉订单)</button>
+                </div>
+                <div class="col-2 col-sm-2">
+                    <button type="button" class="btn" style="background: #50a2ea;border: 1px solid #50a2ea;color: #fff;height: 35px;margin-top: -8px;margin-bottom: 3px;" onclick="download(2);">开始下载(寄回订单)</button>
                 </div>
                 <div class="col-2 col-sm-2">
                     <button type="button" class="btn" style="background: #50a2ea;border: 1px solid #50a2ea;color: #fff;height: 35px;margin-top: -8px;margin-bottom: 3px;" onclick="download2();">下载统计</button>
@@ -142,7 +145,7 @@
     function toDetect(customerId) {
         layer_show("品检信息","${path}/admin/detect/select_detect_list?customerId="+customerId,"1000","500");
     }
-    function download(){
+    function download(type){
         $.ajax({
             cache: true,
             type: "POST",
@@ -150,7 +153,8 @@
                    "companyId" : $("#companyId").val(),
                    "storeId" : $("#storeId").val(),
                    "startTime" : $("#startTime").val(),
-                   "endTime" : $("#endTime").val()
+                   "endTime" : $("#endTime").val(),
+                   "type" : type
             },
             url: "${path}/admin/customer/download_customer_excel",
             async: false,

File diff suppressed because it is too large
+ 53 - 3
watero-rst-web/src/main/webapp/WEB-INF/views/cm/postage/postage_list.ftl