| 
					
				 | 
			
			
				@@ -1,18 +1,21 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 package com.kmall.admin.service.impl; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.kmall.admin.dao.MallPaymentOrderDataDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.kmall.admin.dto.AliPaymentOrderDto; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.kmall.admin.dto.WxPaymentOrderDto; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.kmall.admin.entity.MallPaymentOrderDataEntity; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import com.kmall.admin.entity.compared.PayOrderInfoEntity; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.kmall.admin.fromcomm.entity.SysUserEntity; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.kmall.admin.service.MallPaymentOrderDataService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import com.kmall.admin.service.SaleRecordService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.kmall.admin.utils.ShiroUtils; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.kmall.common.constant.Dict; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.kmall.common.constant.JxlsXmlTemplateName; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.kmall.common.utils.RRException; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.kmall.common.utils.excel.ExcelExport; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.kmall.common.utils.excel.ExcelUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.springframework.beans.BeanUtils; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.springframework.beans.factory.annotation.Autowired; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.springframework.stereotype.Service; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import org.springframework.web.multipart.MultipartFile; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import javax.servlet.http.HttpServletResponse; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import java.util.*; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -30,6 +33,9 @@ public class MallPaymentOrderDataServiceImpl implements MallPaymentOrderDataServ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private MallPaymentOrderDataDao mall2PaymentOrderDataDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private ExcelUtil excelUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public MallPaymentOrderDataEntity queryObject(Integer payOrderId) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return mall2PaymentOrderDataDao.queryObject(payOrderId); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -72,7 +78,6 @@ public class MallPaymentOrderDataServiceImpl implements MallPaymentOrderDataServ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (list!=null && list.size()>0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             for (MallPaymentOrderDataEntity  paymentOrderDataEntity : list) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 //判断wx要进行截取 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if (Dict.payFlag.item_weixin.getItem().equals(payFlag)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     try { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -118,46 +123,169 @@ public class MallPaymentOrderDataServiceImpl implements MallPaymentOrderDataServ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public void exportDataFormatList(Map<String, Object> map, HttpServletResponse response) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        List<MallPaymentOrderDataEntity> mallList = mall2PaymentOrderDataDao.queryListData(map); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        String payFlag = map.get("payFlag").toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        String itemName = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        String[] header = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        LinkedHashMap<String, Object> headerMap = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if (Dict.payFlag.item_weixin.getItem().equals(payFlag)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            //初始化 第一行数据信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            itemName = Dict.payFlag.item_weixin.getItemName(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            header = new String[]{"Time Str","Transaction Order", "OutTrade No", "Pay Type", "Transaction Status", "Payment Type","Currency Type","Amount Order","Cash Coupon","Refund Id", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    "MerRefund Number", "Refund Money", "Refund RechargpCoupon", "Refund Type", "Refund Status", "Merchant Name","Attach", "Fee Charge", "Rate", "Pay Money", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    "ApplyRefund Amount","Rate Remark"}; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            //初始化 第二行数据信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            headerMap = initHeaderWxMap(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        }else if (Dict.payFlag.item_alipay.getItem().equals(payFlag)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            //初始化 第一行数据信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            itemName = Dict.payFlag.item_alipay.getItemName(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            header = new String[]{"Time Str","Transaction Order", "Serial Number", "OutTrade No", "Pay Type", "Pay Money","Refund Money","payment Type","Opposite Account","Other Name", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    "Bank Order ", "Merchant Name", "Remark", "BusinessBasic Order", "Business Order", "BusinessBilling Source","Business Description", "Payment Notes"}; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            //初始化 第二行数据信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            headerMap = initHeaderAliMap(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public void saveUploadExcel(MultipartFile file, String payFlag) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<WxPaymentOrderDto> wxPaymentOrderDtoList = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<AliPaymentOrderDto> aliPaymentOrderDtoList = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (file.isEmpty()) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                throw new RRException("上传文件不能为空"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (Dict.payFlag.item_weixin.getItem().equals(payFlag)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                WxPaymentOrderDto wxPaymentOrderDto = new WxPaymentOrderDto(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                Map<String, Object> beans = new HashMap<String, Object>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                beans.put("WxPaymentOrderDto", wxPaymentOrderDto); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                beans.put("WxPaymentOrderDtoList", wxPaymentOrderDtoList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                excelUtil.readExcel(JxlsXmlTemplateName.WX_PAYMENT_ORDER_DTO_List, beans, file.getInputStream()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            }else if (Dict.payFlag.item_alipay.getItem().equals(payFlag)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                AliPaymentOrderDto aliPaymentOrderDto = new AliPaymentOrderDto(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                Map<String, Object> beans = new HashMap<String, Object>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                beans.put("AliPaymentOrderDto", aliPaymentOrderDto); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                beans.put("AliPaymentOrderDtoList", aliPaymentOrderDtoList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                excelUtil.readExcel(JxlsXmlTemplateName.ALI_PAYMENT_ORDER_DTO_List, beans, file.getInputStream()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }catch (Exception e) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            e.printStackTrace(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            throw new RRException("导入失败!"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        // excel 表单名字 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        ExcelExport ee = new ExcelExport(itemName+"账单"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        List<Map<String, Object>> list = new LinkedList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        list.add(headerMap); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        for (MallPaymentOrderDataEntity orderDataEntity : mallList) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            LinkedHashMap<String, Object> mapLinked = new LinkedHashMap<>(24); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (Dict.payFlag.item_weixin.getItem().equals(payFlag)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                //渲染表单数据 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                mapLinked = initHeaderWxMap(orderDataEntity); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                saveWxData(wxPaymentOrderDtoList,payFlag); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             }else if (Dict.payFlag.item_alipay.getItem().equals(payFlag)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                //渲染表单数据 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                mapLinked = initHeaderAliMap(orderDataEntity); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                saveAliData(aliPaymentOrderDtoList,payFlag); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } catch (Exception e) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            e.printStackTrace(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            throw new RRException(e.getMessage()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private void saveWxData(List<WxPaymentOrderDto> list,String payFlag){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<MallPaymentOrderDataEntity> insertList = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        SysUserEntity sysUserEntity = ShiroUtils.getUserEntity(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (list!=null && list.size()>0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            for (WxPaymentOrderDto wxPaymentOrderDto : list) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    wxPaymentOrderDto.setTimeStr(wxPaymentOrderDto.getTimeStr().split("`")[1].toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    wxPaymentOrderDto.setTransactionOrder(wxPaymentOrderDto.getTransactionOrder().split("`")[1].toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    wxPaymentOrderDto.setOutTradeNo(wxPaymentOrderDto.getOutTradeNo().split("`")[1].toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    wxPaymentOrderDto.setAmountOrder(wxPaymentOrderDto.getAmountOrder().split("`")[1].toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    wxPaymentOrderDto.setMerchantName(wxPaymentOrderDto.getMerchantName().split("`")[1].toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    wxPaymentOrderDto.setPayMoney(wxPaymentOrderDto.getPayMoney().split("`")[1].toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    wxPaymentOrderDto.setRefundMoney(wxPaymentOrderDto.getRefundMoney().split("`")[1].toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    wxPaymentOrderDto.setRefundId(wxPaymentOrderDto.getRefundId().split("`")[1].toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    wxPaymentOrderDto.setCashCoupon(wxPaymentOrderDto.getCashCoupon().split("`")[1].toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    wxPaymentOrderDto.setMerRefundNumber(wxPaymentOrderDto.getMerRefundNumber().split("`")[1].toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    wxPaymentOrderDto.setRefundRechargpCoupon(wxPaymentOrderDto.getRefundRechargpCoupon().split("`")[1].toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    wxPaymentOrderDto.setFeeCharge(wxPaymentOrderDto.getFeeCharge().split("`")[1].toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    wxPaymentOrderDto.setRate(wxPaymentOrderDto.getRate().split("`")[1].toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    wxPaymentOrderDto.setApplyRefundAmount(wxPaymentOrderDto.getApplyRefundAmount().split("`")[1].toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } catch (Exception e) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    throw new RRException("导入的数据不是微信账单!"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                String outTradeNo = wxPaymentOrderDto.getOutTradeNo(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                String timeStr = wxPaymentOrderDto.getTimeStr(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                Map<String, Object> map = new HashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                map.put("timeStr",timeStr); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                map.put("outTradeNo",outTradeNo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                //根据时间和商户订单号来判断当前数据是否有重复录入 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                List<MallPaymentOrderDataEntity> timeAndTnoData = mall2PaymentOrderDataDao.queryListTimeAndTnoData(map); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (timeAndTnoData.size()>0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    throw new RRException("数据有重复,请检查导入数据的正确性!"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                MallPaymentOrderDataEntity mallPaymentOrderDataEntity = new MallPaymentOrderDataEntity(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                BeanUtils.copyProperties(wxPaymentOrderDto,mallPaymentOrderDataEntity); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                mallPaymentOrderDataEntity.setCreaterSn(sysUserEntity.getUsername()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                mallPaymentOrderDataEntity.setCreateTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                mallPaymentOrderDataEntity.setPayFlag(payFlag); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                insertList.add(mallPaymentOrderDataEntity); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            mall2PaymentOrderDataDao.saveBatch(insertList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            throw new RRException("导入数据信息为空,请看模版再重新导入!"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private void saveAliData(List<AliPaymentOrderDto> list,String payFlag){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<MallPaymentOrderDataEntity> insertList = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        SysUserEntity sysUserEntity = ShiroUtils.getUserEntity(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (list!=null && list.size()>0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            for (AliPaymentOrderDto aliPaymentOrderDto : list) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                String outTradeNo = aliPaymentOrderDto.getOutTradeNo(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                String timeStr = aliPaymentOrderDto.getTimeStr(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                Map<String, Object> map = new HashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                map.put("timeStr",timeStr); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                map.put("outTradeNo",outTradeNo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                //根据时间和商户订单号来判断当前数据是否有重复录入 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                List<MallPaymentOrderDataEntity> timeAndTnoData = mall2PaymentOrderDataDao.queryListTimeAndTnoData(map); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (timeAndTnoData.size()>0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    throw new RRException("数据有重复,请检查导入数据的正确性!"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                MallPaymentOrderDataEntity mallPaymentOrderDataEntity = new MallPaymentOrderDataEntity(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                BeanUtils.copyProperties(aliPaymentOrderDto,mallPaymentOrderDataEntity); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                mallPaymentOrderDataEntity.setCreaterSn(sysUserEntity.getUsername()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                mallPaymentOrderDataEntity.setCreateTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                mallPaymentOrderDataEntity.setPayFlag(payFlag); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                insertList.add(mallPaymentOrderDataEntity); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            mall2PaymentOrderDataDao.saveBatch(insertList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            throw new RRException("导入数据信息为空,请看模版再重新导入!"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public void exportDataFormatList(Map<String, Object> map, HttpServletResponse response) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            List<MallPaymentOrderDataEntity> mallList = mall2PaymentOrderDataDao.queryListData(map); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            String payFlag = map.get("payFlag").toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            String itemName = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            String[] header = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            LinkedHashMap<String, Object> headerMap = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (Dict.payFlag.item_weixin.getItem().equals(payFlag)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                //初始化 第一行数据信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                itemName = Dict.payFlag.item_weixin.getItemName(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                header = new String[]{"Time Str","Transaction Order", "OutTrade No", "Pay Type", "Transaction Status", "Payment Type","Currency Type","Amount Order","Cash Coupon","Refund Id", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        "MerRefund Number", "Refund Money", "Refund RechargpCoupon", "Refund Type", "Refund Status", "Merchant Name","Attach", "Fee Charge", "Rate", "Pay Money", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        "ApplyRefund Amount","Rate Remark"}; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                //初始化 第二行数据信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                headerMap = initHeaderWxMap(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            }else if (Dict.payFlag.item_alipay.getItem().equals(payFlag)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                //初始化 第一行数据信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                itemName = Dict.payFlag.item_alipay.getItemName(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                header = new String[]{"Time Str","Transaction Order", "Serial Number", "OutTrade No", "Pay Type", "Pay Money","Refund Money","payment Type","Opposite Account","Other Name", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        "Bank Order ", "Merchant Name", "Remark", "BusinessBasic Order", "Business Order", "BusinessBilling Source","Business Description", "Payment Notes"}; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                //初始化 第二行数据信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                headerMap = initHeaderAliMap(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            // excel 表单名字 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            ExcelExport ee = new ExcelExport(itemName+"账单"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            List<Map<String, Object>> list = new LinkedList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            list.add(headerMap); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            for (MallPaymentOrderDataEntity orderDataEntity : mallList) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                LinkedHashMap<String, Object> mapLinked = new LinkedHashMap<>(24); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (Dict.payFlag.item_weixin.getItem().equals(payFlag)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    //渲染表单数据 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    mapLinked = initHeaderWxMap(orderDataEntity); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                }else if (Dict.payFlag.item_alipay.getItem().equals(payFlag)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    //渲染表单数据 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    mapLinked = initHeaderAliMap(orderDataEntity); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                list.add(mapLinked); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            list.add(mapLinked); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            //渲染excel表单 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            ee.addSheetByMap(itemName+"账单", list, header); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            ee.export(response); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } catch (Exception e) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            e.printStackTrace(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            throw new RRException(e.getMessage()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        //渲染excel表单 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        ee.addSheetByMap(itemName+"账单", list, header); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        ee.export(response); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private LinkedHashMap<String, Object> initHeaderAliMap() { 
			 |