Browse Source

修改飞亚达订餐支持多项目模式

longmeizhen@avic-s.com 2 years ago
parent
commit
abef75d52c

+ 21 - 20
src/main/java/com/palmnest/service/dinner/service/impl/OrderDinnerServiceImpl.java

@@ -1416,7 +1416,7 @@ public class OrderDinnerServiceImpl implements OrderDinnerService {
 			//		String path=SERVER_ADDRESS+"/upload/OrderExcel.xlsx";
 			//		String path=this.getClass().getClassLoader().getResource("./upload/OrderExcel.xlsx").getPath();
 			//设置导出的excel路径
-			String path = setPath("upload/OrderExcel.xls");
+			String path = setPath("upload/OrderExcel"+orgId+".xls");
 			File   file = new File(new ExcelUtils().getPath(path));
 			System.out.println("path:" + path);
 			String sheetName = "";
@@ -1744,26 +1744,27 @@ public class OrderDinnerServiceImpl implements OrderDinnerService {
 			log.info("getOrderInfoTask/orgIds:" + orgIds);
 			if (StringUtils.isNotEmpty(orgIds)) {
 				String[] orgArr = orgIds.split(",");
-				for (int i = 0; i < orgArr.length; i++) {
-					TbOrganization org = organizationManager.getOrganizationById(Integer.parseInt(orgArr[i]));
-					if (null == org) {
-						continue;
-					}
-					log.info("getOrderInfoTask/orgName:" + org.getName());
-					if ("飞亚达大厦".equals(org.getName())) {
-						log.info("getOrderInfoTask/orgArr[i]:" + orgArr[i]);
-						orgId = orgArr[i];
-					}
-				}
-				log.info("getOrderInfoTask/orgId:" + orgId);
-				if (StringUtils.isNotEmpty(orgId)) {
-					String res = getOrderTime(orgId, "importTime");
-					log.info("getOrderInfoTask/res:" + res);
-					if (StringUtils.isEmpty(res)) {
-					} else {
-						redisExport(orgId);
+				for (String org : orgArr) {
+//					TbOrganization org = organizationManager.getOrganizationById(Integer.parseInt(orgArr[i]));
+//					if (null == org) {
+//						continue;
+//					}
+//					log.info("getOrderInfoTask/orgName:" + org.getName());
+//					if ("飞亚达大厦".equals(org.getName())) {
+//						log.info("getOrderInfoTask/orgArr[i]:" + orgArr[i]);
+//						orgId = orgArr[i];
+//					}
+					log.info("getOrderInfoTask/orgId:" + org);
+					if (StringUtils.isNotEmpty(org)) {
+						String res = getOrderTime(org, "importTime");
+						log.info("getOrderInfoTask/res:" + res);
+						if (StringUtils.isEmpty(res)) {
+						} else {
+							redisExport(org);
+						}
 					}
 				}
+
 			}
 		}
 	}
@@ -1771,7 +1772,7 @@ public class OrderDinnerServiceImpl implements OrderDinnerService {
 	private void redisExport(String orgId) {
 		String time = DateHelper.formatDate(new Date(), DateHelper.DATE);
 		log.info("-------------redisExport---time:" + time + "--------------------------");
-		String key = "getOrder_" + time;
+		String key = "getOrder_" + orgId +"_"+ time;
 		log.info("-------------redisExport---key:" + key + "--------------------------");
 		String mealJson = baseRedisService.get(key);
 		log.info("-------------redisExport---mealJson:" + mealJson + "--------------------------");

+ 1 - 1
src/main/webapp/scripts/admin/orderDinner/orderManage.js

@@ -535,7 +535,7 @@ $(function() {
                 },
                 success: function(data) {
                     if (data.code == ERROK) {
-                        location.href = $("#contextPath").val() + "/upload/OrderExcel.xls";
+                        location.href = $("#contextPath").val() + "/upload/OrderExcel"+orgId+".xls";
                         callback && callback();
                     } else {
                         layer.msg(data.msg)