Forráskód Böngészése

需求:供应商退款列表增加CRM关联的退款导出xls2

chao 3 éve
szülő
commit
328a637a27

+ 32 - 5
src/main/java/com/caimei/modules/order/service/CmRefundShopService.java

@@ -90,11 +90,38 @@ public class CmRefundShopService extends CrudService<CmRefundShopDao, CmRefundSh
         return page;
     }
 
-//    public List<CmRefundShop> exports(Page<CmRefundShop> cmRefundShopPage, CmRefundShop cmRefundShop){
-//        Page<CmRefundShop> result = super.findPage(cmRefundShopPage, cmRefundShop);
-//        List<CmRefundShop> list = result.getList();
-//        return list;
-//    }
+    public List<CmRefundShop> exports(Page<CmRefundShop> page, CmRefundShop cmRefundShop){
+        cmRefundShop.setPage(page);
+        List<CmRefundShop> result = cmRefundShopDao.findList(cmRefundShop);
+        for (CmRefundShop crs : result) {
+            List<String> idInfo = cmRefundShopRecordDao.findByRefundShopID(crs.getId());
+            String str = "";
+            String ono = "";
+            for (String i : idInfo) {
+                if (StringUtils.isNotEmpty(i)) {
+                    String no = i.split("_")[0];
+                    String od = i.split("_")[1];
+                    String id = i.split("_")[2];
+                    if ("".equals(str)) {
+                        str += no;
+                    } else {
+                        str += "," + no;
+                    }
+                    if ("".equals(ono)) {
+                        ono += od;
+                    } else {
+                        ono += "," + od;
+                    }
+                }
+            }
+            crs.setShopOrderIDs(str);
+            crs.setOrderNo(ono);
+            if ("4".equals(crs.getRefundWay())){
+                crs.setOperatorName(crs.getCrmOperatorName()+"(CRM)");
+            }
+        }
+        return result;
+    }
 
     @Transactional(readOnly = false)
     public void save(CmRefundShop cmRefundShop) {

+ 2 - 2
src/main/java/com/caimei/modules/order/web/CmRefundShopController.java

@@ -1,6 +1,7 @@
 package com.caimei.modules.order.web;
 
 import com.caimei.modules.common.utils.ExcelUtil;
+import com.caimei.modules.order.entity.CmPayShop;
 import com.caimei.modules.order.entity.CmRefundShop;
 import com.caimei.modules.order.service.CmRefundShopService;
 import com.caimei.modules.user.entity.CmUserOrganize;
@@ -84,8 +85,7 @@ public class CmRefundShopController extends BaseController {
 		String templateFileName = template + "/refundShopList.xls";
 		try {
 			Map data = new HashMap<String, Object>();
-			Page<CmRefundShop> page = cmRefundShopService.findPage(new Page<CmRefundShop>(request, response), cmRefundShop);
-			List<CmRefundShop> list = page.getList();
+			List<CmRefundShop> list = cmRefundShopService.exports(new Page<CmRefundShop>(request, response), cmRefundShop);
 			data.put("list", list);
 			new ExcelUtil().createExcel(templateFileName, data, fileName, response);
 		} catch (Exception e) {

BIN
src/main/resources/export/refundShopList.xls