Selaa lähdekoodia

Merge branch 'master' of https://gogs.superdesk.cn/super_service/superdesk_superservice

qingzhangyin 2 vuotta sitten
vanhempi
commit
22c0bcd94c
35 muutettua tiedostoa jossa 989 lisäystä ja 264 poistoa
  1. 2 2
      sql/huanjingpeizhi/formal environment/tomcat_super_service/WEB-INF/classes/quartz_job2.xml
  2. 3 7
      src/main/java/com/palmnest/application/core/util/DateUtils.java
  3. 5 0
      src/main/java/com/palmnest/dao/dinner/MealDao.java
  4. 6 8
      src/main/java/com/palmnest/dao/dinner/OrderDinnerDao.java
  5. 4 4
      src/main/java/com/palmnest/dao/dinner/OrderDinnerInfoDao.java
  6. 38 0
      src/main/java/com/palmnest/dao/dinner/impl/MealDaoImpl.java
  7. 25 35
      src/main/java/com/palmnest/dao/dinner/impl/OrderDinnerDaoImpl.java
  8. 8 8
      src/main/java/com/palmnest/dao/dinner/impl/OrderDinnerInfoDaoImpl.java
  9. 2 0
      src/main/java/com/palmnest/service/dinner/manager/ConsumerManager.java
  10. 5 0
      src/main/java/com/palmnest/service/dinner/manager/MealManager.java
  11. 4 4
      src/main/java/com/palmnest/service/dinner/manager/OrderDinnerInfoManager.java
  12. 1 1
      src/main/java/com/palmnest/service/dinner/manager/OrderDinnerManager.java
  13. 164 1
      src/main/java/com/palmnest/service/dinner/manager/impl/ConsumerManagerImpl.java
  14. 28 0
      src/main/java/com/palmnest/service/dinner/manager/impl/MealManagerImpl.java
  15. 8 8
      src/main/java/com/palmnest/service/dinner/manager/impl/OrderDinnerInfoManagerImpl.java
  16. 17 18
      src/main/java/com/palmnest/service/dinner/manager/impl/OrderDinnerManagerImpl.java
  17. 3 0
      src/main/java/com/palmnest/service/dinner/service/ConsumerUserService.java
  18. 2 0
      src/main/java/com/palmnest/service/dinner/service/OrderDinnerService.java
  19. 30 0
      src/main/java/com/palmnest/service/dinner/service/impl/ConsumerUserServiceImpl.java
  20. 154 25
      src/main/java/com/palmnest/service/dinner/service/impl/OrderDinnerServiceImpl.java
  21. 105 11
      src/main/java/com/palmnest/service/dinner/service/impl/PlaceAnOrderServiceImpl.java
  22. 34 0
      src/main/java/com/palmnest/webapp/controller/dinner/ConsumerUserController.java
  23. 38 0
      src/main/java/com/palmnest/webapp/controller/dinner/wechat/WechatConsumerController.java
  24. 9 1
      src/main/java/com/palmnest/webapp/controller/dinner/wechat/WechatPlaceAnOrderController.java
  25. 1 1
      src/main/java/com/palmnest/webapp/quartz/OrderDinnerGetOrderInfoTask.java
  26. 10 2
      src/main/resources/quartz_job2.xml
  27. 66 65
      src/main/webapp/WEB-INF/pages/admin/notice/noticeAppPublish.jsp
  28. 1 1
      src/main/webapp/WEB-INF/pages/admin/notice/noticeAppVerify.jsp
  29. 12 12
      src/main/webapp/WEB-INF/pages/admin/orderDinner/dataStatistics.jsp
  30. 150 0
      src/main/webapp/WEB-INF/securityNewFilter.xml
  31. 37 37
      src/main/webapp/scripts/admin/notice/noticeAppPublish.js
  32. 5 1
      src/main/webapp/scripts/admin/notice/noticeAppVerify.js
  33. 6 6
      src/main/webapp/scripts/admin/orderDinner/dataStatistics.js
  34. 1 1
      src/main/webapp/scripts/admin/orderDinner/orderManage.js
  35. 5 5
      src/main/webapp/scripts/lib/plugins/noticePhotoClip/myCrop.js

+ 2 - 2
sql/huanjingpeizhi/formal environment/tomcat_super_service/WEB-INF/classes/quartz_job2.xml

@@ -343,8 +343,8 @@
     <bean id="orderDinnerGetOrderInfoTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
         <property name="jobDetail" ref="orderDinnerGetOrderInfoTimer"/>
         <property name="cronExpression">
-            <value>0 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30 10 * * ?</value>
-            <!-- 从10点开始执行,每1分钟执行一次,只执行到10点30 -->
+            <value>0 40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59 16 * * ?</value>
+            <!-- 从16点40开始执行,每1分钟执行一次,只执行到16点59 -->
         </property>
     </bean>
 

+ 3 - 7
src/main/java/com/palmnest/application/core/util/DateUtils.java

@@ -162,13 +162,9 @@ public class DateUtils {
     }
 
 	public static void main(String[] args) {
-		
-		try {
-			getTimeMin(30);
-		} catch (Exception e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}
+
+		List<WeekDate> list=getWeek();
+		System.out.println(JsonUtils.toJson(list));
 	}
 
 	/**

+ 5 - 0
src/main/java/com/palmnest/dao/dinner/MealDao.java

@@ -1,6 +1,7 @@
 package com.palmnest.dao.dinner;
 
 import java.util.List;
+import java.util.Map;
 
 import com.palmnest.application.bean.Page;
 import com.palmnest.application.dto.input.MealSearchDto;
@@ -58,4 +59,8 @@ public interface MealDao extends GenericDao<Meal, Long> {
 	 * @return
 	 */
 	List<Meal> getMealList(String orgId, String time);
+
+	List<Map<String,Object>> getMealDate(Integer orgId);
+
+	String getNextMealDate(Integer orgId,String date , int type);
 }

+ 6 - 8
src/main/java/com/palmnest/dao/dinner/OrderDinnerDao.java

@@ -118,7 +118,6 @@ public interface OrderDinnerDao extends GenericDao<OrderDinner, Long> {
 	 * @param year
 	 * @param time
 	 * @param type
-	 * @param dept
 	 * @return
 	 */
 	int getTempFoodCountByDept(String orgId, int dateType, String year, String time, int type, String deptOrComp, int isDept);
@@ -175,7 +174,6 @@ public interface OrderDinnerDao extends GenericDao<OrderDinner, Long> {
 	/**
 	 * 这些项目下所有有效的订单
 	 *
-	 * @param orgId
 	 * @return
 	 */
 	int updateOrderDinnerByTime(String orgIds, String time);
@@ -218,7 +216,7 @@ public interface OrderDinnerDao extends GenericDao<OrderDinner, Long> {
 	 */
 	int getCountByUserAndMeal(String userId, String itemId, String itemOrgId);
 
-	int getCountByUserAndMealFood(String userId, String foodId, String foodOrgId);
+	int getCountByUserAndMealFood(String userId, String foodId, String foodOrgId,String date);
 
 	/**
 	 * 根据地址获取相应地址下的部门
@@ -227,7 +225,7 @@ public interface OrderDinnerDao extends GenericDao<OrderDinner, Long> {
 	 * @param addressId
 	 * @return
 	 */
-	List<Map<String, Object>> getDeptByOrgAddress(String orgId, String addressId, String addressOrgId);
+	List<Map<String, Object>> getDeptByOrgAddress(String orgId, String addressId, String addressOrgId,String date);
 
 	/**
 	 * 根据部门及餐品id获取餐品相关的下单数量
@@ -237,9 +235,9 @@ public interface OrderDinnerDao extends GenericDao<OrderDinner, Long> {
 	 * @param itemOrgId 现餐品名
 	 * @return
 	 */
-	int getCountByDeptAndMeal(String deptId, String itemId, String itemOrgId);
+	int getCountByDeptAndMeal(String deptId, String itemId, String itemOrgId,String date);
 
-	int getCountByDeptAndMealFood(String addressId, String addressOrgId, String deptId, String foodId, String foodOrgId);
+	int getCountByDeptAndMealFood(String addressId, String addressOrgId, String deptId, String foodId, String foodOrgId,String date);
 
 	/**
 	 * 获取该部门或者用户的订餐情况
@@ -249,9 +247,9 @@ public interface OrderDinnerDao extends GenericDao<OrderDinner, Long> {
 	 * @param deptId
 	 * @return
 	 */
-	List<Map<String, Object>> getCountByUserOrDept(String orgId, String userId, String addressId, String addressOrgId, String deptId);
+	List<Map<String, Object>> getCountByUserOrDept(String orgId, String userId, String addressId, String addressOrgId, String deptId,String date);
 
-	List<Map<String, Object>> getCountByAddress(String orgId, String addressId, String addressOrgId);
+	List<Map<String, Object>> getCountByAddress(String orgId, String addressId, String addressOrgId,String date);
 
 	/**
 	 * 获取订餐统计总数、会议餐、普通餐、临时工作餐

+ 4 - 4
src/main/java/com/palmnest/dao/dinner/OrderDinnerInfoDao.java

@@ -37,7 +37,7 @@ public interface OrderDinnerInfoDao extends GenericDao<OrderDinnerInfo, Long> {
 	 * @param orgId
 	 * @return
 	 */
-	List<Map<String, Object>> getOrderExcelListByMeal(String orgId);
+	List<Map<String, Object>> getOrderExcelListByMeal(String orgId,String date);
 
 	/**
 	 * 根据部门汇总
@@ -45,7 +45,7 @@ public interface OrderDinnerInfoDao extends GenericDao<OrderDinnerInfo, Long> {
 	 * @param orgId
 	 * @return
 	 */
-	List<Map<String, Object>> getOrderExcelListByDept(String orgId);
+	List<Map<String, Object>> getOrderExcelListByDept(String orgId,String date);
 
 	/**
 	 * 根据用户名汇总
@@ -53,7 +53,7 @@ public interface OrderDinnerInfoDao extends GenericDao<OrderDinnerInfo, Long> {
 	 * @param orgId
 	 * @return
 	 */
-	List<Map<String, Object>> getOrderExcelListByUserName(String orgId);
+	List<Map<String, Object>> getOrderExcelListByUserName(String orgId,String date);
 
 	/**
 	 * 根据地址汇总
@@ -61,7 +61,7 @@ public interface OrderDinnerInfoDao extends GenericDao<OrderDinnerInfo, Long> {
 	 * @param orgId
 	 * @return
 	 */
-	List<Map<String, Object>> getOrderExcelListByAddress(String orgId);
+	List<Map<String, Object>> getOrderExcelListByAddress(String orgId,String date);
 
 	/**
 	 * 根据下单人以及送餐时间获取该用户下的订餐数据

+ 38 - 0
src/main/java/com/palmnest/dao/dinner/impl/MealDaoImpl.java

@@ -1,7 +1,10 @@
 package com.palmnest.dao.dinner.impl;
 
 import java.util.List;
+import java.util.Map;
 
+import com.palmnest.application.core.util.DateHelper;
+import lombok.extern.slf4j.Slf4j;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Repository;
@@ -14,12 +17,14 @@ import com.palmnest.application.dto.input.MealSearchDto;
 import com.palmnest.dao.dinner.MealDao;
 import com.palmnest.dao.hibernate.GenericDaoHibernate;
 import com.palmnest.model.dinner.Meal;
+import org.springframework.util.CollectionUtils;
 
 /**
  * 餐品DAO实现类
  *
  * @author longmeizhen
  */
+@Slf4j
 @Repository("mealDao")
 public class MealDaoImpl extends GenericDaoHibernate<Meal, Long> implements MealDao {
 	private static Logger LOG = LoggerFactory.getLogger(MealDaoImpl.class);
@@ -118,4 +123,37 @@ public class MealDaoImpl extends GenericDaoHibernate<Meal, Long> implements Meal
 		sql.append(" and (mealCodeId=?  or mealCodeId=? )");
 		return getSession().createQuery(sql.toString()).setString(0, orgId).setString(1, mealCodeId).setString(2, mealCodeOrgId).list();
 	}
+
+
+	@Override
+	public List<Map<String,Object>> getMealDate(Integer orgId) {
+		StringBuilder sql = new StringBuilder(" SELECT DISTINCT supplyTime ");
+		sql.append(" ,( CASE WHEN DAYOFWEEK( supplyTime) = 1 THEN 7 WHEN DAYOFWEEK( supplyTime ) > 1 THEN DAYOFWEEK( supplyTime )- 1 END ) weekNo ");
+		sql.append(" , ( CASE WHEN DAYOFWEEK( supplyTime ) = 1 THEN '星期日' WHEN DAYOFWEEK( supplyTime ) = 2 THEN '星期一' WHEN DAYOFWEEK( supplyTime ) = 3 THEN '星期二' WHEN DAYOFWEEK( supplyTime ) = 4 THEN '星期三' WHEN DAYOFWEEK( supplyTime ) = 5 THEN '星期四' WHEN DAYOFWEEK( supplyTime ) = 6 THEN '星期五' WHEN DAYOFWEEK( supplyTime ) = 7 THEN '星期六' END ) weekName ");
+		sql.append(" , ( CASE WHEN supplyTime = DATE_FORMAT( SYSDATE(), '%Y-%m-%d' ) THEN 1 ELSE 0 END ) isToday ");
+		sql.append(" FROM tb_meal  ");
+		sql.append(" WHERE supplyTime >= DATE_FORMAT( SYSDATE(), '%Y-%m-%d' ) AND orgId = "+orgId+" AND isEnabled = 1 AND `status` = 1 ORDER BY supplyTime ");
+		return getJdbcTemplate().queryForList(sql.toString());
+	}
+
+	@Override
+	public String getNextMealDate(Integer orgId, String date, int type) {
+		StringBuilder sql = new StringBuilder(" SELECT DISTINCT supplyTime ");
+		sql.append(" FROM tb_meal  ");
+		if(1 == type){
+			sql.append(" WHERE supplyTime > DATE_FORMAT( '"+date+"', '%Y-%m-%d' ) AND orgId = "+orgId+" AND isEnabled = 1 AND `status` = 1 ORDER BY supplyTime LIMIT 1");
+		}else if(2 == type){
+			sql.append(" WHERE supplyTime >= DATE_FORMAT( '"+date+"', '%Y-%m-%d' ) AND orgId = "+orgId+" AND isEnabled = 1 AND `status` = 1 ORDER BY supplyTime LIMIT 1");
+		}
+		log.info("getNextMealDate-sql:{}",sql);
+		List<Map<String,Object>> list = getJdbcTemplate().queryForList(sql.toString());
+		if(CollectionUtils.isEmpty(list)){
+			return "";
+		}
+		Map<String, Object> map = list.get(0);
+		if (map == null || !map.containsKey("supplyTime") || null == map.get("supplyTime") || StringUtils.isEmpty(map.get("supplyTime").toString())) {
+			return "";
+		}
+		return map.get("supplyTime").toString();
+	}
 }

+ 25 - 35
src/main/java/com/palmnest/dao/dinner/impl/OrderDinnerDaoImpl.java

@@ -3,6 +3,8 @@ package com.palmnest.dao.dinner.impl;
 import java.util.List;
 import java.util.Map;
 
+import com.palmnest.application.Constants;
+import lombok.extern.slf4j.Slf4j;
 import org.openxmlformats.schemas.drawingml.x2006.chart.STScatterStyle;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -17,6 +19,7 @@ import com.palmnest.dao.dinner.OrderDinnerDao;
 import com.palmnest.dao.hibernate.GenericDaoHibernate;
 import com.palmnest.model.dinner.OrderDinner;
 
+@Slf4j
 @Repository("orderDinnerDao")
 public class OrderDinnerDaoImpl extends GenericDaoHibernate<OrderDinner, Long> implements OrderDinnerDao {
 	private static Logger LOG = LoggerFactory.getLogger(OrderDinnerDaoImpl.class);
@@ -196,7 +199,7 @@ public class OrderDinnerDaoImpl extends GenericDaoHibernate<OrderDinner, Long> i
 		if (StringUtils.isEmpty(orgId)) {
 			return null;
 		}
-		sql.append(" select vir.name companyName,sum(od.foodCount) sumCount,c.id,c.userName,dl.name dept,c.userMobile mobile ");
+		sql.append(" select vir.name companyName,sum(od.foodCount) sumCount,c.id,c.user_Name userName,dl.name dept,c.user_Mobile mobile ");
 		if (dateType == 1) {//年度
 			sql.append(" ,(select ifnull(sum(odi.foodCount),0) from tb_order_dinner tod  ");
 			sql.append(" 	left join tb_order_dinner_info odi on tod.id=odi.orderId  ");
@@ -232,11 +235,11 @@ public class OrderDinnerDaoImpl extends GenericDaoHibernate<OrderDinner, Long> i
 			sql.append(" 	and year(od.createTime)=" + year + "  and month(od.createTime)=" + time + "     and tod.isTempOrder=1) tempWorkFood ");
 		}
 		sql.append(" from tb_order_dinner_info od ");
-		sql.append(" inner join tb_user c on od.consId=c.id ");
-		sql.append(" left join tb_department dl on dl.id=c.departmentId ");
+		sql.append(" inner join " + Constants.DATABASE + "tb_user c on od.consId=c.id ");
+		sql.append(" left join " + Constants.DATABASE + "tb_department dl on dl.id=c.department_Id ");
 		sql.append(" left join tb_order_dinner o on o.id=od.orderId ");
-		sql.append(" left join tb_virtualarchitecture vir on vir.id=c.virtualArchId ");
-		sql.append(" where c.organizationId in (" + orgId + ") and o.isEnabled='1' and od.isEnabled='1' and (o.status='2' or o.status='3') ");
+		sql.append(" left join tb_virtualarchitecture vir on vir.id=c.virt_id ");
+		sql.append(" where c.org_id in (" + orgId + ") and o.isEnabled='1' and od.isEnabled='1' and (o.status='2' or o.status='3') ");
 		if (dateType == 1) {//年度
 			sql.append("  and year(od.createTime)=" + year + "   ");
 		} else if (dateType == 2) {//季度
@@ -463,9 +466,9 @@ public class OrderDinnerDaoImpl extends GenericDaoHibernate<OrderDinner, Long> i
 		sql.append("  select vir.name companyName,dl.name dept,sum(od.foodCount) sumCount,od.stapleFood,od.stapleFoodStr  ");
 		sql.append("  from tb_order_dinner_info od  ");
 		sql.append("  LEFT join tb_order_dinner o on o.id=od.orderId  ");
-		sql.append("  left join tb_user c on c.id=od.consId  ");
-		sql.append(" left join tb_department dl on dl.id=c.departmentId ");
-		sql.append(" left join tb_virtualarchitecture vir on vir.id=c.virtualArchId ");
+		sql.append("  left join " + Constants.DATABASE + "tb_user c on c.id=od.consId  ");
+		sql.append(" left join " + Constants.DATABASE + "tb_department dl on dl.id=c.department_Id ");
+		sql.append(" left join tb_virtualarchitecture vir on vir.id=c.virt_id ");
 //			sql.append("  left join tb_consumer c on c.id=od.creator  ");
 		sql.append("  where 1=1  ");
 		if (StringUtils.isNotEmpty(orgId)) {
@@ -479,7 +482,7 @@ public class OrderDinnerDaoImpl extends GenericDaoHibernate<OrderDinner, Long> i
 		} else if (dateType == 3) {//月
 			sql.append("  and year(od.createTime)=" + year + "  and month(od.createTime)=" + time + "   ");
 		}
-		sql.append("  group by c.virtualArchId,dl.id,od.stapleFood  ");
+		sql.append("  group by c.virt_id,dl.id,od.stapleFood  ");
 		return getJdbcTemplate().queryForList(sql.toString());
 	}
 
@@ -724,13 +727,13 @@ public class OrderDinnerDaoImpl extends GenericDaoHibernate<OrderDinner, Long> i
 	}
 
 	@Override
-	public int getCountByUserAndMealFood(String userId, String foodId, String foodOrgId) {
+	public int getCountByUserAndMealFood(String userId, String foodId, String foodOrgId,String date) {
 		StringBuilder sql = new StringBuilder(" select SUM(od.foodCount) sumCount  from tb_order_dinner d  ");
 		sql.append("  left join tb_order_dinner_info od on d.id=od.orderId   ");
 		sql.append("  left join tb_meal m on m.id=od.mealId   ");
 		sql.append("  where  d.status=1 and d.consId=" + userId + "  ");
 		sql.append("  and (od.stapleFood='" + foodId + "' or (od.stapleFood='" + foodOrgId + "' and m.spec>1  )  )   ");
-		sql.append("  and date_format(d.dinnerTime,'%Y-%m-%d')=date_format(SYSDATE(),'%Y-%m-%d')   ");
+		sql.append("  and date_format(d.dinnerTime,'%Y-%m-%d')=date_format('"+date+"','%Y-%m-%d')   ");
 		sql.append("  GROUP BY d.consId   ");
 		List<Map<String, Object>> list = getJdbcTemplate().queryForList(sql.toString());
 		int count = 0;
@@ -745,27 +748,13 @@ public class OrderDinnerDaoImpl extends GenericDaoHibernate<OrderDinner, Long> i
 
 	@Override
 	public List<Map<String, Object>> getDeptByOrgAddress(String orgId,
-														 String addressId, String addressOrgId) {
-//		StringBuilder sql = new StringBuilder("  select distinct ifnull(ador.itemname,adr.itemname) address,d.id,IF(IFNULL(d.shortName,'')='',d.name,d.shortName) deptname  ");
-//		sql.append(" from tb_department d   ");
-//		sql.append(" left join tb_user u on d.id=u.departmentId   ");
-//		sql.append(" left join tb_dictionary_item adr on adr.id=u.address  ");
-//		sql.append(" left join tb_dictionary_org_item ador on ador.id=u.address  ");
-//		sql.append("  where d.isEnabled=1 and u.organizationId=" + orgId + " and (adr.id= '" + addressId + "' or ador.id= '" + addressOrgId + "' )   ");
-//		sql.append("  and d.id in (select us.departmentId from tb_order_dinner o     ");
-//		sql.append("  left join tb_order_dinner_info od on o.id=od.orderId    ");
-//		sql.append("  left join tb_user us on us.id=od.consId   ");
-//		sql.append("  where o.`status`='1' and od.orgId=u.organizationId and od.isEnabled='1' and (us.address=adr.id or us.address=ador.id )     ");
-//		sql.append("  and date_format(od.dinnerTime,'%Y-%m-%d')=date_format(SYSDATE(),'%Y-%m-%d')        ");
-//		sql.append("  GROUP BY us.departmentId)       ");
-//		sql.append("  ORDER BY d.orderNum      ");
+														 String addressId, String addressOrgId,String date) {
 		StringBuilder sql = new StringBuilder(" SELECT DISTINCT ifnull(doi.itemname, di.itemname) AS address,d.id,  ");
-		//sql.append("  IF (IFNULL(d.shortName, '') = '',d. NAME,d.shortName) AS deptname,2 type  ");
 		sql.append("  d. NAME AS deptname,2 type  ");
 		sql.append(" FROM tb_department d,   ");
 		sql.append("  ( SELECT DISTINCT us.departmentId FROM tb_order_dinner o   ");
 		sql.append("    LEFT JOIN tb_order_dinner_info od ON o.id = od.orderId AND od.isEnabled = '1'  ");
-		sql.append("    AND date_format(od.dinnerTime, '%Y-%m-%d') = date_format(SYSDATE(), '%Y-%m-%d')  ");
+		sql.append("    AND date_format(od.dinnerTime, '%Y-%m-%d') = date_format('"+date+"', '%Y-%m-%d')  ");
 		sql.append("    LEFT JOIN tb_user us ON us.id = od.consId  ");
 		sql.append("    WHERE o.`status` = '1' AND od.orgId = "+orgId+"  ");
 		sql.append("    AND ( us.address = '"+addressId+"' OR us.address = '"+addressOrgId+"' )  ");
@@ -775,19 +764,20 @@ public class OrderDinnerDaoImpl extends GenericDaoHibernate<OrderDinner, Long> i
 		sql.append(" WHERE b.departmentId = d.id AND u.departmentId = d.id and u.organizationId="+orgId+"   ");
 		sql.append(" AND ( u.address = '"+addressId+"' OR u.address = '"+addressOrgId+"')   ");
 		sql.append(" ORDER BY d.orderNum   ");
+		log.info("getDeptByOrgAddress-sql:{}",sql);
 		List<Map<String, Object>> list = getJdbcTemplate().queryForList(sql.toString());
 		return list;
 	}
 
 	@Override
-	public int getCountByDeptAndMeal(String deptId, String itemId, String itemOrgId) {
+	public int getCountByDeptAndMeal(String deptId, String itemId, String itemOrgId,String date) {
 		StringBuilder sql = new StringBuilder(" select SUM(od.foodCount) sumCount  from tb_order_dinner d  ");
 		sql.append("  left join tb_order_dinner_info od on d.id=od.orderId   ");
 		sql.append("  left join tb_user u on u.id=d.consId  ");
 		sql.append("  left join tb_department dept on dept.id=u.departmentId   ");
 		sql.append("  left join tb_meal m on m.id=od.mealId   ");
 		sql.append("  where d.status=1  and u.departmentId=" + deptId + " and (m.mealCodeId='" + itemId + "' or m.mealCodeId='" + itemOrgId + "'  )  ");
-		sql.append("  and date_format(d.dinnerTime,'%Y-%m-%d')=date_format(SYSDATE(),'%Y-%m-%d')   ");
+		sql.append("  and date_format(d.dinnerTime,'%Y-%m-%d')=date_format('"+date+"','%Y-%m-%d')   ");
 		sql.append("  and u.id not in (select us.id from tb_user us where us.organizationId=u.organizationId and us.isLeader=1)  ");
 		sql.append("  GROUP BY u.departmentId,m.mealCodeId   ");
 		List<Map<String, Object>> list = getJdbcTemplate().queryForList(sql.toString());
@@ -802,7 +792,7 @@ public class OrderDinnerDaoImpl extends GenericDaoHibernate<OrderDinner, Long> i
 	}
 
 	@Override
-	public int getCountByDeptAndMealFood(String addressId, String addressOrgId, String deptId, String foodId, String foodOrgId) {
+	public int getCountByDeptAndMealFood(String addressId, String addressOrgId, String deptId, String foodId, String foodOrgId,String date) {
 		StringBuilder sql = new StringBuilder(" select SUM(od.foodCount) sumCount  from tb_order_dinner d  ");
 		sql.append("  left join tb_order_dinner_info od on d.id=od.orderId   ");
 		sql.append("  left join tb_user u on u.id=d.consId  ");
@@ -813,7 +803,7 @@ public class OrderDinnerDaoImpl extends GenericDaoHibernate<OrderDinner, Long> i
 		sql.append("  where d.status=1  and u.departmentId=" + deptId + "  ");
 		sql.append("  and (dl.id='" + addressId + "' or dol.id='" + addressOrgId + "')  ");
 		sql.append("  and (od.stapleFood='" + foodId + "' or (od.stapleFood='" + foodOrgId + "' and m.spec>1  )  )   ");
-		sql.append("  and date_format(d.dinnerTime,'%Y-%m-%d')=date_format(SYSDATE(),'%Y-%m-%d')   ");
+		sql.append("  and date_format(d.dinnerTime,'%Y-%m-%d')=date_format('"+date+"','%Y-%m-%d')   ");
 		sql.append("  and u.id not in (select us.id from tb_user us where us.organizationId=u.organizationId and us.isLeader=1)  ");
 		sql.append("  GROUP BY u.departmentId   ");
 		List<Map<String, Object>> list = getJdbcTemplate().queryForList(sql.toString());
@@ -829,7 +819,7 @@ public class OrderDinnerDaoImpl extends GenericDaoHibernate<OrderDinner, Long> i
 
 	@Override
 	public List<Map<String, Object>> getCountByUserOrDept(String orgId,
-														  String userId, String addressId, String addressOrgId, String deptId) {
+														  String userId, String addressId, String addressOrgId, String deptId,String date) {
 		StringBuilder sql = new StringBuilder();
 		sql.append("  select m.mealCodeId,ifnull(di.itemname,doi.itemname) mealName,sum(od.foodCount) sumCount from tb_order_dinner_info od  ");
 		sql.append("  left join tb_order_dinner o on o.id=od.orderId  ");
@@ -840,7 +830,7 @@ public class OrderDinnerDaoImpl extends GenericDaoHibernate<OrderDinner, Long> i
 		sql.append("  left join tb_dictionary_item dl on dl.id=u.address ");
 		sql.append("  left join tb_dictionary_org_item dol on dol.id=u.address  ");
 		sql.append("  left join tb_department d on d.id=u.departmentId  ");
-		sql.append("  where o.isEnabled=1 and date_format(o.dinnerTime,'%Y-%m-%d')=date_format(SYSDATE(),'%Y-%m-%d')   ");
+		sql.append("  where o.isEnabled=1 and date_format(o.dinnerTime,'%Y-%m-%d')=date_format('"+date+"','%Y-%m-%d')   ");
 		sql.append("  and o.status=1  and u.organizationId=" + orgId + "  ");
 		if (StringUtil.isNotEmpty(userId)) {
 			sql.append("  and u.id=" + userId + "  ");
@@ -855,7 +845,7 @@ public class OrderDinnerDaoImpl extends GenericDaoHibernate<OrderDinner, Long> i
 
 	@Override
 	public List<Map<String, Object>> getCountByAddress(String orgId,
-													   String addressId, String addressOrgId) {
+													   String addressId, String addressOrgId,String date) {
 		StringBuilder sql = new StringBuilder();
 		sql.append("  select ifnull(doi.itemname,di.itemname) mealName,sum(od.foodCount) sumCount from tb_order_dinner_info od   ");
 		sql.append("  left join tb_order_dinner o on o.id=od.orderId  ");
@@ -863,7 +853,7 @@ public class OrderDinnerDaoImpl extends GenericDaoHibernate<OrderDinner, Long> i
 		sql.append(" left join tb_dictionary_item di on di.id=m.mealCodeId ");
 		sql.append("  left join tb_dictionary_org_item doi on doi.id=m.mealCodeId  ");
 		sql.append("  left join tb_user u on u.id=od.consId  ");
-		sql.append("  where o.isEnabled=1 and date_format(o.dinnerTime,'%Y-%m-%d')=date_format(SYSDATE(),'%Y-%m-%d')  ");
+		sql.append("  where o.isEnabled=1 and date_format(o.dinnerTime,'%Y-%m-%d')=date_format('"+date+"','%Y-%m-%d')  ");
 		sql.append("  and o.status=1  and o.orgId=" + orgId + " and (u.address='" + addressId + "' or u.address='" + addressOrgId + "' )  ");
 		sql.append("  group by ifnull(doi.itemname,di.itemname)  ");
 		return getJdbcTemplate().queryForList(sql.toString());

+ 8 - 8
src/main/java/com/palmnest/dao/dinner/impl/OrderDinnerInfoDaoImpl.java

@@ -71,7 +71,7 @@ public class OrderDinnerInfoDaoImpl extends GenericDaoHibernate<OrderDinnerInfo,
 	 * @return
 	 */
 	@Override
-	public List<Map<String, Object>> getOrderExcelListByMeal(String orgId) {
+	public List<Map<String, Object>> getOrderExcelListByMeal(String orgId,String date) {
 		StringBuilder sql = new StringBuilder("");
 		sql.append(" select sum(od.foodCount) other,ifnull((case when od.stapleFoodStr='' or od.stapleFoodStr is NULL THEN doi.itemname else CONCAT(doi.itemname,':',od.stapleFoodStr) end ) ");
 		sql.append("   , (case when od.stapleFoodStr='' or od.stapleFoodStr is NULL THEN di.itemname else CONCAT(di.itemname,':',od.stapleFoodStr) end )) mName  ");
@@ -80,7 +80,7 @@ public class OrderDinnerInfoDaoImpl extends GenericDaoHibernate<OrderDinnerInfo,
 		sql.append(" left join tb_meal m on m.id=od.mealId ");
 		sql.append(" left join tb_dictionary_item di on di.id=m.mealCodeId ");
 		sql.append(" left join tb_dictionary_org_item doi on doi.id=m.mealCodeId ");
-		sql.append(" where o.orgId in (" + orgId + ")  and o.isEnabled='1' and date_format(o.dinnerTime,'%Y-%m-%d')=date_format(SYSDATE(),'%Y-%m-%d') ");
+		sql.append(" where o.orgId in (" + orgId + ")  and o.isEnabled='1' and date_format(o.dinnerTime,'%Y-%m-%d')=date_format('"+date+"','%Y-%m-%d') ");
 		sql.append(" and o.status='1' ");
 		sql.append(" group by ifnull((case when od.stapleFoodStr='' or od.stapleFoodStr is NULL THEN doi.itemname else CONCAT(doi.itemname,':',od.stapleFoodStr) end ) ,(case when od.stapleFoodStr='' or od.stapleFoodStr is NULL THEN di.itemname else CONCAT(di.itemname,':',od.stapleFoodStr) end )) ");
 		sql.append(" order by  (case when m.spec>1 then 2 else 1 end) desc  ");
@@ -92,7 +92,7 @@ public class OrderDinnerInfoDaoImpl extends GenericDaoHibernate<OrderDinnerInfo,
 	 * 根据部门汇总
 	 */
 	@Override
-	public List<Map<String, Object>> getOrderExcelListByDept(String orgId) {
+	public List<Map<String, Object>> getOrderExcelListByDept(String orgId,String date) {
 		StringBuilder sql = new StringBuilder("");
 		sql.append("  select dl.name other,ifnull((case when od.stapleFoodStr='' or od.stapleFoodStr is NULL THEN  CONCAT(doi.itemname,'*',sum(foodCount)) else CONCAT(CONCAT(doi.itemname,':',od.stapleFoodStr),'*',SUM(foodCount)) end ) ");
 		sql.append(" ,(case when od.stapleFoodStr='' or od.stapleFoodStr is NULL THEN  CONCAT(di.itemname,'*',sum(foodCount)) else CONCAT(CONCAT(di.itemname,':',od.stapleFoodStr),'*',SUM(foodCount)) end )) mName   ");
@@ -103,7 +103,7 @@ public class OrderDinnerInfoDaoImpl extends GenericDaoHibernate<OrderDinnerInfo,
 		sql.append(" left join tb_department dl on dl.id=c.departmentId ");
 		sql.append(" left join tb_dictionary_item di on di.id=m.mealCodeId ");
 		sql.append(" left join tb_dictionary_org_item doi on doi.id=m.mealCodeId ");
-		sql.append(" where o.orgId  in (" + orgId + ")   and o.isEnabled='1' and date_format(o.dinnerTime,'%Y-%m-%d')=date_format(SYSDATE(),'%Y-%m-%d')  ");
+		sql.append(" where o.orgId  in (" + orgId + ")   and o.isEnabled='1' and date_format(o.dinnerTime,'%Y-%m-%d')=date_format('"+date+"','%Y-%m-%d')  ");
 		sql.append(" and o.status='1' ");
 		sql.append(" group by dl.name,ifnull((case when od.stapleFoodStr='' or od.stapleFoodStr is NULL THEN doi.itemname else CONCAT(doi.itemname,':',od.stapleFoodStr) end )  ");
 		sql.append(" ,(case when od.stapleFoodStr='' or od.stapleFoodStr is NULL THEN di.itemname else CONCAT(di.itemname,':',od.stapleFoodStr) end ) ) ");
@@ -120,7 +120,7 @@ public class OrderDinnerInfoDaoImpl extends GenericDaoHibernate<OrderDinnerInfo,
 	 */
 	@Override
 	public List<Map<String, Object>> getOrderExcelListByUserName(
-			String orgId) {
+			String orgId,String date) {
 		StringBuilder sql = new StringBuilder("");
 		sql.append("  select dl.name deptname,c.userName other,ifnull((case when od.stapleFoodStr='' or od.stapleFoodStr is NULL THEN  CONCAT(doi.itemname,'*',sum(foodCount)) else CONCAT(CONCAT(doi.itemname,':',od.stapleFoodStr),'*',SUM(foodCount)) end )   ");
 		sql.append("  ,(case when od.stapleFoodStr='' or od.stapleFoodStr is NULL THEN  CONCAT(di.itemname,'*',sum(foodCount)) else CONCAT(CONCAT(di.itemname,':',od.stapleFoodStr),'*',SUM(foodCount)) end ))  mName  ");
@@ -131,7 +131,7 @@ public class OrderDinnerInfoDaoImpl extends GenericDaoHibernate<OrderDinnerInfo,
 		sql.append(" left join tb_dictionary_item di on di.id=m.mealCodeId ");
 		sql.append(" left join tb_dictionary_org_item doi on doi.id=m.mealCodeId ");
 		sql.append(" left join tb_department dl on dl.id=c.departmentId ");
-		sql.append(" where o.orgId  in (" + orgId + ")   and o.isEnabled='1' and date_format(o.dinnerTime,'%Y-%m-%d')=date_format(SYSDATE(),'%Y-%m-%d')  ");
+		sql.append(" where o.orgId  in (" + orgId + ")   and o.isEnabled='1' and date_format(o.dinnerTime,'%Y-%m-%d')=date_format('"+date+"','%Y-%m-%d')  ");
 		sql.append(" and o.status='1' ");
 		sql.append(" group by c.userName,ifnull((case when od.stapleFoodStr='' or od.stapleFoodStr is NULL THEN doi.itemname else CONCAT(doi.itemname,':',od.stapleFoodStr) end ) ");
 		sql.append(" ,(case when od.stapleFoodStr='' or od.stapleFoodStr is NULL THEN di.itemname else CONCAT(di.itemname,':',od.stapleFoodStr) end )) ");
@@ -148,7 +148,7 @@ public class OrderDinnerInfoDaoImpl extends GenericDaoHibernate<OrderDinnerInfo,
 	 */
 	@Override
 	public List<Map<String, Object>> getOrderExcelListByAddress(
-			String orgId) {
+			String orgId,String date) {
 		StringBuilder sql = new StringBuilder("");
 		sql.append("  select ifnull(dol.itemname,dl.itemname) other,(case when od.stapleFoodStr='' or od.stapleFoodStr is NULL THEN  CONCAT(ifnull(doi.itemname,di.itemname),'*',sum(foodCount)) else CONCAT(CONCAT(ifnull(doi.itemname,di.itemname),':',od.stapleFoodStr),'*',SUM(foodCount)) end ) mName  ");
 		sql.append("  from tb_order_dinner_info od   ");
@@ -159,7 +159,7 @@ public class OrderDinnerInfoDaoImpl extends GenericDaoHibernate<OrderDinnerInfo,
 		sql.append(" left join tb_dictionary_org_item dol on dol.id=c.address ");
 		sql.append(" left join tb_dictionary_item di on di.id=m.mealCodeId ");
 		sql.append(" left join tb_dictionary_org_item doi on doi.id=m.mealCodeId ");
-		sql.append(" where o.orgId  in (" + orgId + ")   and o.isEnabled='1' and date_format(o.dinnerTime,'%Y-%m-%d')=date_format(SYSDATE(),'%Y-%m-%d')  ");
+		sql.append(" where o.orgId  in (" + orgId + ")   and o.isEnabled='1' and date_format(o.dinnerTime,'%Y-%m-%d')=date_format('"+date+"','%Y-%m-%d')  ");
 		sql.append(" and o.status='1' ");
 		sql.append(" group by ifnull(dol.itemname,dl.itemname),(case when od.stapleFoodStr='' or od.stapleFoodStr is NULL THEN ifnull(doi.itemname,di.itemname) else CONCAT(ifnull(doi.itemname,di.itemname),':',od.stapleFoodStr) end ) ");
 		sql.append(" order by ifnull(dol.orderno,dl.orderno)  ");

+ 2 - 0
src/main/java/com/palmnest/service/dinner/manager/ConsumerManager.java

@@ -97,4 +97,6 @@ public interface ConsumerManager extends GenericManager<Consumer, Long> {
 	Map<String, List<ConsumerDto>> getConsByOrgId(String orgId, String time);
 
 	List<Map<String, Object>> findListForReport(Map<String, Object> paramets);
+
+	Map<String, Object> importUserAddress(InputStream ins, String orgId);
 }

+ 5 - 0
src/main/java/com/palmnest/service/dinner/manager/MealManager.java

@@ -1,6 +1,7 @@
 package com.palmnest.service.dinner.manager;
 
 import com.palmnest.application.bean.Page;
+import com.palmnest.application.core.util.WeekDate;
 import com.palmnest.application.dto.input.MealSearchDto;
 import com.palmnest.model.dinner.Meal;
 import com.palmnest.service.GenericManager;
@@ -88,4 +89,8 @@ public interface MealManager extends GenericManager<Meal, Long> {
 	Map<String, Object> importMeal(InputStream ins, String orgId);
 
 	String saveImportMeal(List<Meal> list, String userId) throws RuntimeException;
+
+	List<WeekDate> getMealDate(Integer orgId);
+
+	String getNextMealDate(Integer orgId,String date, int type);
 }

+ 4 - 4
src/main/java/com/palmnest/service/dinner/manager/OrderDinnerInfoManager.java

@@ -39,7 +39,7 @@ public interface OrderDinnerInfoManager extends GenericManager<OrderDinnerInfo,
 	 * @param orgId
 	 * @return
 	 */
-	List<MealExcelDto> getOrderExcelListByMeal(String orgId);
+	List<MealExcelDto> getOrderExcelListByMeal(String orgId,String date);
 
 	/**
 	 * 根据部门汇总
@@ -47,7 +47,7 @@ public interface OrderDinnerInfoManager extends GenericManager<OrderDinnerInfo,
 	 * @param orgId
 	 * @return
 	 */
-	List<MealExcelDto> getOrderExcelListByDept(String orgId);
+	List<MealExcelDto> getOrderExcelListByDept(String orgId,String date);
 
 	/**
 	 * 根据用户名汇总
@@ -55,7 +55,7 @@ public interface OrderDinnerInfoManager extends GenericManager<OrderDinnerInfo,
 	 * @param orgId
 	 * @return
 	 */
-	List<Map<String, Object>> getOrderExcelListByUserName(String orgId);
+	List<Map<String, Object>> getOrderExcelListByUserName(String orgId,String date);
 
 
 	/**
@@ -64,7 +64,7 @@ public interface OrderDinnerInfoManager extends GenericManager<OrderDinnerInfo,
 	 * @param orgId
 	 * @return
 	 */
-	List<MealExcelDto> getOrderExcelListByAddress(String orgId);
+	List<MealExcelDto> getOrderExcelListByAddress(String orgId,String date);
 
 	/**
 	 * 获取所有

+ 1 - 1
src/main/java/com/palmnest/service/dinner/manager/OrderDinnerManager.java

@@ -145,7 +145,7 @@ public interface OrderDinnerManager extends GenericManager<OrderDinner, Long> {
 	 * @param orgId
 	 * @return
 	 */
-	List<Map<String, Object>> exportByAddress(String orgId);
+	List<Map<String, Object>> exportByAddress(String orgId,String date);
 
 	String[] getTitles(List<Map<String, Object>> mapList, String[] arr, int type);
 

+ 164 - 1
src/main/java/com/palmnest/service/dinner/manager/impl/ConsumerManagerImpl.java

@@ -4,6 +4,7 @@ import com.palmnest.application.bean.Page;
 import com.palmnest.application.core.util.RegularPattern;
 import com.palmnest.application.core.util.StringUtil;
 import com.palmnest.application.dto.ConsumerDto;
+import com.palmnest.application.dto.output.ElementDto;
 import com.palmnest.dao.ElementGroupDao;
 import com.palmnest.dao.dinner.*;
 import com.palmnest.dao.estateserve.AppUserDao;
@@ -11,6 +12,7 @@ import com.palmnest.dao.estateserve.VirtualArchDao;
 import com.palmnest.model.dinner.*;
 import com.palmnest.model.estateserve.AppUser;
 import com.palmnest.model.property.VirtualArchitecture;
+import com.palmnest.service.ElementGroupManager;
 import com.palmnest.service.dinner.manager.ConsumerManager;
 import com.palmnest.service.estateserve.AppUserManager;
 import com.palmnest.service.impl.GenericManagerImpl;
@@ -60,7 +62,7 @@ public class ConsumerManagerImpl extends GenericManagerImpl<Consumer, Long> impl
 	@Autowired
 	private AppUserDao            appUserDao;
 	@Autowired
-	private ElementGroupDao       elementGroupDao;
+	private ElementGroupManager elementGroupManager;
 	@Autowired
 	private AppUserManager        appUserManager;
 	@Autowired
@@ -466,4 +468,165 @@ public class ConsumerManagerImpl extends GenericManagerImpl<Consumer, Long> impl
 		return mapList;
 	}
 
+	private List<ElementDto>  getAddress(Integer orgId){
+		List<ElementDto> addressDtoList = elementGroupManager.getOrgElementGroupInfo(orgId, "dinnerAddress");
+		Collections.sort(addressDtoList, new Comparator<ElementDto>() {
+			@Override
+			public int compare(ElementDto o1, ElementDto o2) {
+				String name1 = o1.getId().toString();
+				String name2 = o2.getId().toString();
+				return name1.compareTo(name2);
+			}
+		});
+		return addressDtoList;
+	}
+
+	@Override
+	public Map<String, Object> importUserAddress(InputStream ins, String orgId) {
+		Map<String, Object> retMap    = new HashMap<String, Object>();
+		List<Object>        userList  = new ArrayList<Object>();
+		int                 bugCount  = 0;
+		StringBuffer        bugStr    = new StringBuffer("");
+		StringBuffer        countStr  = new StringBuffer("");
+		List<String>        mobiles   = new ArrayList<String>();
+		Sheet               sheet     = null;
+
+		try {
+			Workbook workbook = WorkbookFactory.create(ins);
+			sheet = workbook.getSheet("ConsumerAddress");
+		} catch (Exception e) {
+			bugCount++;
+			bugStr.append("模板格式有问题,请下载最新的模板");
+		}
+		try {
+			if (sheet == null) {
+				bugCount++;
+				bugStr.append("模板格式有问题,请下载最新的模板");
+			} else {
+				int rows = sheet.getLastRowNum();
+				//如果大于2000行数据
+				if (rows > 20000) {
+					bugCount++;
+					bugStr.append("数据量太大,不能大于2w行");
+				} else if (rows < 1) {
+					bugCount++;
+					bugStr.append("数据为空,请录入账单信息");
+				} else {
+
+					List<ElementDto> addressList = getAddress(Integer.parseInt(orgId));
+
+					for (int i = 1; i <= rows; i++) {
+						if (sheet.getRow(i) == null) {
+							continue;
+						}
+						if (sheet.getRow(i).getCell(0) == null) {
+							bugStr.append("第" + i + "行第1列数据有问题,请检查,问题:姓名必填,请导出系统模板匹配录入<br/>");
+							bugCount++;
+							continue;
+						}
+						sheet.getRow(i).getCell(0).setCellType(Cell.CELL_TYPE_STRING);
+						if (StringUtils.isBlank(sheet.getRow(i).getCell(0).getStringCellValue())) {
+							bugStr.append("第" + i + "行第1列数据有问题,请检查,问题:姓名必填,请导出系统模板匹配录入<br/>");
+							bugCount++;
+							continue;
+						}
+						String userName = sheet.getRow(i).getCell(0).getStringCellValue();
+
+
+						if (sheet.getRow(i).getCell(1) == null) {
+							bugStr.append("第" + i + "行第2列数据有问题,请检查,问题:手机号码必填,请导出系统模板匹配录入<br/>");
+							bugCount++;
+							continue;
+						}
+						sheet.getRow(i).getCell(1).setCellType(Cell.CELL_TYPE_STRING);
+						if (StringUtils.isBlank(sheet.getRow(i).getCell(1).getStringCellValue())) {
+							bugStr.append("第" + i + "行第2列数据有问题,请检查,问题:手机号码必填,请导出系统模板匹配录入<br/>");
+							bugCount++;
+							continue;
+						}
+						String  mobile = sheet.getRow(i).getCell(1).getStringCellValue();
+						boolean bool   = RegularPattern.isMobileNO(mobile);//验证手机格式是否正确
+						if (StringUtils.isNotEmpty(mobile) && !bool) {
+							bugStr.append("第" + i + "行第2列数据有问题,请检查,问题:" + mobile + "手机号码格式有问题,请导出系统模板匹配录入<br/>");
+							bugCount++;
+							continue;
+						}
+						AppUser cons = appUserDao.getAppUsersByPhoneAndOrg(mobile, orgId, "1");
+						if (cons != null && !"-1".equals(cons.getUserType())) {
+							countStr.append("第" + i + "行第2列数据有问题,请检查,问题:" + mobile + "该手机号码已存在账号,请导出系统模板匹配录入<br/>");
+							mobiles.add(mobile);
+						}
+
+						if (sheet.getRow(i).getCell(3) == null) {
+							bugStr.append("第" + i + "行第4列数据有问题,请检查,问题:送餐地址必填,请导出系统模板匹配录入<br/>");
+							bugCount++;
+							continue;
+						}
+						sheet.getRow(i).getCell(3).setCellType(Cell.CELL_TYPE_STRING);
+						if (StringUtils.isBlank(sheet.getRow(i).getCell(3).getStringCellValue())) {
+							bugStr.append("第" + i + "行第4列数据有问题,请检查,问题:送餐地址必填,请导出系统模板匹配录入<br/>");
+							bugCount++;
+							continue;
+						}
+						String address = sheet.getRow(i).getCell(3).getStringCellValue();
+						Long addressId = null;
+						//判断该地址在不在系统内
+						for(ElementDto el : addressList){
+							if(!address.equals(el.getItemname())){
+								continue;
+							}
+							addressId = el.getId();
+							break;
+						}
+						if(null == addressId){
+							bugStr.append("第" + i + "行第4列数据有问题,请检查,问题:送餐地址不在系统中,请导出系统模板匹配录入<br/>");
+							bugCount++;
+							continue;
+						}
+						if (sheet.getRow(i).getCell(4) == null) {
+							bugStr.append("第" + i + "行第5列数据有问题,请检查,问题:账户类型必填,请导出系统模板匹配录入<br/>");
+							bugCount++;
+							continue;
+						}
+						sheet.getRow(i).getCell(4).setCellType(Cell.CELL_TYPE_STRING);
+						if (StringUtils.isBlank(sheet.getRow(i).getCell(4).getStringCellValue())) {
+							bugStr.append("第" + i + "行第5列数据有问题,请检查,问题:账户类型必填,请导出系统模板匹配录入<br/>");
+							bugCount++;
+							continue;
+						}
+						String roleTypeStr = sheet.getRow(i).getCell(4).getStringCellValue();
+						Integer roleType = 2;
+						if("个人账号".equals(roleTypeStr)){
+							roleType=2;
+						}else if("管理员".equals(roleTypeStr)){
+							roleType=1;
+						}else if("可被代订".equals(roleTypeStr)){
+							roleType=3;
+						}
+
+						cons.setAddress(addressId.toString());
+						cons.setRoleType(roleType.toString());
+						userList.add(cons);
+					}
+				}
+			}
+			retMap.put("bugCount", bugCount);
+			retMap.put("countStr", countStr);
+			retMap.put("bugStr", bugStr.toString());
+			retMap.put("userList", userList);
+			retMap.put("okCount", userList.size());
+			return retMap;
+
+		} catch (Exception e) {
+			log.error(e.getMessage());
+			retMap.put("bugCount", bugCount);
+			retMap.put("countStr", countStr);
+			retMap.put("bugStr", bugStr.toString());
+			retMap.put("userList", userList);
+			retMap.put("okCount", userList.size());
+			e.printStackTrace();
+			return retMap;
+		}
+	}
+
 }

+ 28 - 0
src/main/java/com/palmnest/service/dinner/manager/impl/MealManagerImpl.java

@@ -1,6 +1,8 @@
 package com.palmnest.service.dinner.manager.impl;
 
+import cn.superdesk.libs.common.util.BeanUtils;
 import com.palmnest.application.bean.Page;
+import com.palmnest.application.core.util.WeekDate;
 import com.palmnest.application.dto.input.MealSearchDto;
 import com.palmnest.application.dto.output.ElementDto;
 import com.palmnest.dao.dinner.MealDao;
@@ -15,6 +17,7 @@ import org.apache.poi.ss.usermodel.*;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
 
 import java.io.InputStream;
 import java.text.SimpleDateFormat;
@@ -312,4 +315,29 @@ public class MealManagerImpl extends GenericManagerImpl<Meal, Long> implements M
 		return res;
 	}
 
+	@Override
+	public List<WeekDate> getMealDate(Integer orgId) {
+		List<Map<String,Object>> list = mealDao.getMealDate(orgId);
+		List<WeekDate> resList = new ArrayList<>();
+		if(CollectionUtils.isEmpty(list)){
+			return resList;
+		}
+
+		for(int i=0;i<list.size();i++){
+			Map<String,Object> map = list.get(i);
+			WeekDate weekDate=new WeekDate();
+			weekDate.setWeekNo(Integer.parseInt(map.get("weekNo").toString()));
+			weekDate.setWeekName(map.get("weekName").toString());
+			weekDate.setDateTime(map.get("supplyTime").toString());
+			weekDate.setIsToday(Integer.parseInt(map.get("isToday").toString()));
+			resList.add(weekDate);
+		}
+		return resList;
+	}
+
+	@Override
+	public String getNextMealDate(Integer orgId, String date , int type) {
+		return mealDao.getNextMealDate(orgId,date,type);
+	}
+
 }

+ 8 - 8
src/main/java/com/palmnest/service/dinner/manager/impl/OrderDinnerInfoManagerImpl.java

@@ -73,20 +73,20 @@ public class OrderDinnerInfoManagerImpl extends GenericManagerImpl<OrderDinnerIn
 	}
 
 	@Override
-	public List<MealExcelDto> getOrderExcelListByMeal(String orgId) {
-		List<Map<String, Object>> list = orderDinnerInfoDao.getOrderExcelListByMeal(orgId);
+	public List<MealExcelDto> getOrderExcelListByMeal(String orgId,String date) {
+		List<Map<String, Object>> list = orderDinnerInfoDao.getOrderExcelListByMeal(orgId,date);
 		return getExcelList(list);
 	}
 
 	@Override
-	public List<MealExcelDto> getOrderExcelListByDept(String orgId) {
-		List<Map<String, Object>> list = orderDinnerInfoDao.getOrderExcelListByDept(orgId);
+	public List<MealExcelDto> getOrderExcelListByDept(String orgId,String date) {
+		List<Map<String, Object>> list = orderDinnerInfoDao.getOrderExcelListByDept(orgId,date);
 		return getExcelList(list);
 	}
 
 	@Override
-	public List<Map<String, Object>> getOrderExcelListByUserName(String orgId) {
-		List<Map<String, Object>> list = orderDinnerInfoDao.getOrderExcelListByUserName(orgId);
+	public List<Map<String, Object>> getOrderExcelListByUserName(String orgId,String date) {
+		List<Map<String, Object>> list = orderDinnerInfoDao.getOrderExcelListByUserName(orgId,date);
 		return list;
 	}
 
@@ -111,8 +111,8 @@ public class OrderDinnerInfoManagerImpl extends GenericManagerImpl<OrderDinnerIn
 	}
 
 	@Override
-	public List<MealExcelDto> getOrderExcelListByAddress(String orgId) {
-		List<Map<String, Object>> list = orderDinnerInfoDao.getOrderExcelListByAddress(orgId);
+	public List<MealExcelDto> getOrderExcelListByAddress(String orgId,String date) {
+		List<Map<String, Object>> list = orderDinnerInfoDao.getOrderExcelListByAddress(orgId,date);
 		return getExcelList(list);
 	}
 

+ 17 - 18
src/main/java/com/palmnest/service/dinner/manager/impl/OrderDinnerManagerImpl.java

@@ -403,7 +403,7 @@ public class OrderDinnerManagerImpl extends GenericManagerImpl<OrderDinner, Long
 	}
 
 	@Override
-	public List<Map<String, Object>> exportByAddress(String orgId) {
+	public List<Map<String, Object>> exportByAddress(String orgId,String date) {
 		List<Map<String, Object>> infoList = new ArrayList<Map<String, Object>>();
 		List<Map<String, Object>> mealList = getAllItemMeal(orgId);
 		Map<String, Object>       hejiMap  = new HashMap<String, Object>();
@@ -413,7 +413,7 @@ public class OrderDinnerManagerImpl extends GenericManagerImpl<OrderDinner, Long
 		Map<String, Object> rollMap  = getFoodItem(orgId, "stapleFood", "花卷");
 		int                 allCount = 0;
 		if (mealList != null && mealList.size() > 0) {
-			List<Map<String, Object>> mapList = getSysDateData(orgId, mealList);
+			List<Map<String, Object>> mapList = getSysDateData(orgId, mealList,date);
 			mealList.add(bunsMap);
 			mealList.add(rollMap);
 			infoList.addAll(mapList);
@@ -444,7 +444,7 @@ public class OrderDinnerManagerImpl extends GenericManagerImpl<OrderDinner, Long
 		return infoList;
 	}
 
-	private List<Map<String, Object>> getSysDateData(String orgId, List<Map<String, Object>> mealList) {
+	private List<Map<String, Object>> getSysDateData(String orgId, List<Map<String, Object>> mealList,String date) {
 		List<Map<String, Object>> mapList = new ArrayList<Map<String, Object>>();
 		List<ElementDto>          els     = elementGroupManager.getOrgElementGroupInfo(Integer.parseInt(orgId), "dinnerAddress");
 		Collections.sort(els, new Comparator<ElementDto>() {
@@ -465,7 +465,7 @@ public class OrderDinnerManagerImpl extends GenericManagerImpl<OrderDinner, Long
 					if (el != null) {
 						addressId = el.getId().toString();
 					}
-					List<Map<String, Object>> list = getAddressInfoList(orgId, addressId, addressOrgId);//getUserAndDeptByAddress(orgId, addressId,mealList);
+					List<Map<String, Object>> list = getAddressInfoList(orgId, addressId, addressOrgId,date);//getUserAndDeptByAddress(orgId, addressId,mealList);
 					mapList.addAll(list);
 				}
 			}
@@ -499,11 +499,11 @@ public class OrderDinnerManagerImpl extends GenericManagerImpl<OrderDinner, Long
 	 * @param addressId`
 	 * @return
 	 */
-	private List<Map<String, Object>> getAllInfoByAddress(String orgId, String addressId, String addressOrgId) {
+	private List<Map<String, Object>> getAllInfoByAddress(String orgId, String addressId, String addressOrgId,String date) {
 		//汇总领导、部门
 		//List<Map<String, Object>> userList = orderDinnerDao.getUserByOrgAddress(orgId, addressId, addressOrgId);//不取领导,把领导配置为部门 by qzy
 		List<Map<String, Object>> userList = new ArrayList<Map<String,Object>>();
-		List<Map<String, Object>> deptList = orderDinnerDao.getDeptByOrgAddress(orgId, addressId, addressOrgId);
+		List<Map<String, Object>> deptList = orderDinnerDao.getDeptByOrgAddress(orgId, addressId, addressOrgId,date);
 		userList.addAll(deptList);
 		return userList;
 	}
@@ -572,9 +572,9 @@ public class OrderDinnerManagerImpl extends GenericManagerImpl<OrderDinner, Long
 	 * @param addressOrgId
 	 * @return
 	 */
-	private List<Map<String, Object>> getAddressInfoList(String orgId, String addressId, String addressOrgId) {
+	private List<Map<String, Object>> getAddressInfoList(String orgId, String addressId, String addressOrgId,String date) {
 		List<Map<String, Object>> infoList = new ArrayList<Map<String, Object>>();
-		List<Map<String, Object>> mapList  = getAllInfoByAddress(orgId, addressId, addressOrgId);
+		List<Map<String, Object>> mapList  = getAllInfoByAddress(orgId, addressId, addressOrgId,date);
 		int                       rollsSum = 0;
 		int                       bunsSum  = 0;
 		if (mapList != null && mapList.size() > 0) {
@@ -590,10 +590,10 @@ public class OrderDinnerManagerImpl extends GenericManagerImpl<OrderDinner, Long
 						info.put("address", address);
 						info.put("deptname", deptname);
 						if (1 == type) {//是否为用户
-							info = setInfo(orgId, addressId, addressOrgId, id, "", info);
+							info = setInfo(orgId, addressId, addressOrgId, id, "", info,date);
 							infoList.add(info);
 						} else if (2 == type) {//是否为部门
-							info = setInfo(orgId, addressId, addressOrgId, "", id, info);
+							info = setInfo(orgId, addressId, addressOrgId, "", id, info,date);
 							int count = info.get("heji") == null ? 0 : Integer.parseInt(info.get("heji").toString());
 							if (count > 0) {
 								infoList.add(info);
@@ -610,7 +610,7 @@ public class OrderDinnerManagerImpl extends GenericManagerImpl<OrderDinner, Long
 			Map<String, Object> heji = new HashMap<String, Object>();
 			heji.put("address", "");
 			heji.put("deptname", "合计");
-			List<Map<String, Object>> addList = orderDinnerDao.getCountByAddress(orgId, addressId, addressOrgId);
+			List<Map<String, Object>> addList = orderDinnerDao.getCountByAddress(orgId, addressId, addressOrgId,date);
 			if (addList != null && addList.size() > 0) {
 				int sumAddHeji = 0;
 				for (int i = 0; i < addList.size(); i++) {
@@ -640,8 +640,8 @@ public class OrderDinnerManagerImpl extends GenericManagerImpl<OrderDinner, Long
 	 * @param info
 	 * @return
 	 */
-	private Map<String, Object> setInfo(String orgId, String addressId, String addressOrgId, String userId, String deptId, Map<String, Object> info) {
-		List<Map<String, Object>> mapList = orderDinnerDao.getCountByUserOrDept(orgId, userId, addressId, addressOrgId, deptId);
+	private Map<String, Object> setInfo(String orgId, String addressId, String addressOrgId, String userId, String deptId, Map<String, Object> info,String date) {
+		List<Map<String, Object>> mapList = orderDinnerDao.getCountByUserOrDept(orgId, userId, addressId, addressOrgId, deptId,date);
 		int                       sumHe   = 0;
 		if (mapList != null && mapList.size() > 0) {
 			for (int i = 0; i < mapList.size(); i++) {
@@ -669,11 +669,11 @@ public class OrderDinnerManagerImpl extends GenericManagerImpl<OrderDinner, Long
 		Map<String, Object> bunsMap   = getFoodItem(orgId, "stapleFood", "馒头");
 		Map<String, Object> rollMap   = getFoodItem(orgId, "stapleFood", "花卷");
 		if (StringUtil.isNotEmpty(userId)) {//是否为用户
-			rollCount = orderDinnerDao.getCountByUserAndMealFood(userId, rollMap.get("itemId").toString(), rollMap.get("itemOrgId").toString());
-			bunsCount = orderDinnerDao.getCountByUserAndMealFood(userId, bunsMap.get("itemId").toString(), bunsMap.get("itemOrgId").toString());
+			rollCount = orderDinnerDao.getCountByUserAndMealFood(userId, rollMap.get("itemId").toString(), rollMap.get("itemOrgId").toString(),date);
+			bunsCount = orderDinnerDao.getCountByUserAndMealFood(userId, bunsMap.get("itemId").toString(), bunsMap.get("itemOrgId").toString(),date);
 		} else if (StringUtil.isNotEmpty(deptId)) {//是否为部门
-			rollCount = orderDinnerDao.getCountByDeptAndMealFood(addressId, addressOrgId, deptId, rollMap.get("itemId").toString(), rollMap.get("itemOrgId").toString());
-			bunsCount = orderDinnerDao.getCountByDeptAndMealFood(addressId, addressOrgId, deptId, bunsMap.get("itemId").toString(), bunsMap.get("itemOrgId").toString());
+			rollCount = orderDinnerDao.getCountByDeptAndMealFood(addressId, addressOrgId, deptId, rollMap.get("itemId").toString(), rollMap.get("itemOrgId").toString(),date);
+			bunsCount = orderDinnerDao.getCountByDeptAndMealFood(addressId, addressOrgId, deptId, bunsMap.get("itemId").toString(), bunsMap.get("itemOrgId").toString(),date);
 		}
 		info.put(CodeConstants.BUNS, bunsCount);
 		info.put(CodeConstants.ROLLS, rollCount);
@@ -742,7 +742,6 @@ public class OrderDinnerManagerImpl extends GenericManagerImpl<OrderDinner, Long
 	 *
 	 * @param list
 	 * @param formLiveMap
-	 * @param userList
 	 */
 	private void setPlatformData(String orgId, List<Map<String, Object>> list, Map<String, Map<String, Object>> formLiveMap, String dateString, List<MeetintDto> mapList) {
 		//将平台活跃度、时间内新增用户数放到list中

+ 3 - 0
src/main/java/com/palmnest/service/dinner/service/ConsumerUserService.java

@@ -182,4 +182,7 @@ public interface ConsumerUserService {
 
 	String setPath(String fileName);
 
+
+	AppResultDto importUserAddress(String orgId, InputStream ins, String userId);
+
 }

+ 2 - 0
src/main/java/com/palmnest/service/dinner/service/OrderDinnerService.java

@@ -197,4 +197,6 @@ public interface OrderDinnerService {
 	String setPath(String fileName);
 
 	void getOrderInfoTask(String orgId);
+
+	void getOrderInfoTask2(String orgId,String sysDate);
 }

+ 30 - 0
src/main/java/com/palmnest/service/dinner/service/impl/ConsumerUserServiceImpl.java

@@ -1078,5 +1078,35 @@ public class ConsumerUserServiceImpl implements ConsumerUserService {
 		log.info("path:" + path);
 		return path;
 	}
+
+	@Override
+	public AppResultDto importUserAddress(String orgId, InputStream ins, String userId){
+		Map<String, Object> map      = consumerManager.importUserAddress(ins, orgId);
+		int                 bugCount = Integer.parseInt(map.get("bugCount").toString());
+		if (bugCount > 0) {//如果bug数量大于0,说明有异常,直接返回异常即可
+			return AppResultUtil.createErrorDto("100", map.get("bugStr").toString());
+		} else {//否则的话就将用户信息保存到数据库表中
+			if (map.containsKey("userList")) {
+				List<AppUser> list      = (List<AppUser>) map.get("userList");
+				try {
+					if (list != null && list.size() > 0) {
+						for(AppUser user : list){
+							if(null == user.getId()){
+								continue;
+							}
+							appUserManager.saveOrUpdateAppUser(user);
+						}
+					}
+					return AppResultUtil.createErrorDto("100", "导入的模板有误");
+				} catch (Exception e) {
+					log.error(e.getMessage());
+					e.printStackTrace();
+					return AppResultUtil.createErrorDto("100", "导入用户数据失败:DinnerUserServiceImpl/importUserAddress:" + e.getMessage());
+				}
+			} else {
+				return AppResultUtil.createErrorDto("100", "导入用户数据失败:获取不到userList");
+			}
+		}
+	}
 	
 }

+ 154 - 25
src/main/java/com/palmnest/service/dinner/service/impl/OrderDinnerServiceImpl.java

@@ -307,7 +307,6 @@ public class OrderDinnerServiceImpl implements OrderDinnerService {
 	 * 判断餐品是否有效
 	 * 然后根据当前登录用户将购物车中的餐品提交到餐品详情中
 	 *
-	 * @param openId
 	 * @return
 	 */
 	@Transactional
@@ -631,7 +630,6 @@ public class OrderDinnerServiceImpl implements OrderDinnerService {
 	/**
 	 * 保存订单详情
 	 *
-	 * @param consId
 	 * @param orderId
 	 * @return
 	 */
@@ -687,7 +685,8 @@ public class OrderDinnerServiceImpl implements OrderDinnerService {
 		int                 weekDate = cal.get(Calendar.DAY_OF_WEEK) - 1;
 		//首先获取周期,然后获取周期下对应的购物车中的数据,如果周期下没有数据,就不需要展示这个周期
 		List<WeekMealCarDto> weekDtoList = new ArrayList<WeekMealCarDto>();
-		List<WeekDate>       weekList    = DateUtils.getWeek();
+//		List<WeekDate>       weekList    = DateUtils.getWeek();//--------------------------20220526-----------------------------------
+		List<WeekDate>       weekList    = mealManager.getMealDate(Integer.parseInt(orgId));
 		List<MealCar>        mealcarList = mealCarManager.findMealCarListByUserId(userId);
 		int                  sumInt      = 0;//总积分
 		int                  sumCount    = 0;
@@ -702,7 +701,7 @@ public class OrderDinnerServiceImpl implements OrderDinnerService {
 					//没操作下单前只获取当天及之后购物车数据,已超过下单时间只获取今天之后的购物车数据
 					//当下单时间是今天的时候且并没有超过操作时间的数据可以加入到集合中;
 					//下单时间的周几大于当天的周几的时候,周三>周二(该为系统当前时间)也可以加入到集合中
-					if ((isOver == 0 && week.getWeekNo() == weekDate) || (week.getWeekNo() > weekDate)) {
+//					if ((isOver == 0 && week.getWeekNo() == weekDate) || (week.getWeekNo() > weekDate)) {//--------------------------20220526-----------------------------------
 						if (dtoList != null && dtoList.size() > 0) {
 							dto.setMealCarList(dtoList);
 							dto.setWeekDate(week);
@@ -720,7 +719,7 @@ public class OrderDinnerServiceImpl implements OrderDinnerService {
 						if (count > 0) {
 							sumInt = sumInt + reSet.getDayCount();
 						}
-					}
+//					}//--------------------------20220526-----------------------------------
 				}
 			}
 		}
@@ -1402,21 +1401,22 @@ public class OrderDinnerServiceImpl implements OrderDinnerService {
 	@Override
 	public AppResultDto exportExcel(String orgId) {
 		log.info("begin exportExcel:" + orgId);
+		String date = DateHelper.formatDate(new Date(),DateHelper.CURRENT_DATE);
 		HSSFWorkbook wb = new HSSFWorkbook();
 		try {
-			List<MealExcelDto>        mealList    = orderDinnerInfoManager.getOrderExcelListByMeal(orgId);
-			List<MealExcelDto>        deptList    = orderDinnerInfoManager.getOrderExcelListByDept(orgId);
-			List<Map<String, Object>> userList    = orderDinnerInfoManager.getOrderExcelListByUserName(orgId);
-			List<MealExcelDto>        addressList = orderDinnerInfoManager.getOrderExcelListByAddress(orgId);
+			List<MealExcelDto>        mealList    = orderDinnerInfoManager.getOrderExcelListByMeal(orgId,date);
+			List<MealExcelDto>        deptList    = orderDinnerInfoManager.getOrderExcelListByDept(orgId,date);
+			List<Map<String, Object>> userList    = orderDinnerInfoManager.getOrderExcelListByUserName(orgId,date);
+			List<MealExcelDto>        addressList = orderDinnerInfoManager.getOrderExcelListByAddress(orgId,date);
 //			List<Map<String,Object>> sysList=orderDinnerManager.exportExcelByAddress(orgId);
-			List<Map<String, Object>> sysList = orderDinnerManager.exportByAddress(orgId);
+			List<Map<String, Object>> sysList = orderDinnerManager.exportByAddress(orgId,date);
 			if (mealList == null || (mealList != null && mealList.size() == 0)) {
 				return AppResultUtil.createErrorDto("100", "今日没有订单,无法导出");
 			}
 			//		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 = "";
@@ -1470,6 +1470,84 @@ public class OrderDinnerServiceImpl implements OrderDinnerService {
 		}
 	}
 
+
+	public AppResultDto exportExcel2(String orgId,String date) {
+		log.info("begin exportExcel2:" + orgId+";date:"+date);
+		String nextDate = "";
+		if(StringUtils.isEmpty(date)){
+			date =  DateHelper.formatDate(new Date(),DateHelper.CURRENT_DATE);
+		}
+		log.info("begin exportExcel2:" + orgId+";date:"+date);
+		nextDate = mealManager.getNextMealDate(Integer.parseInt(orgId),date,1);
+		log.info("begin exportExcel2:" + orgId+";date:"+date+";nextDate:"+nextDate);
+		if(StringUtils.isEmpty(nextDate)){
+			nextDate = date;
+			log.info("begin exportExcel2:" + orgId+";date:"+date+";nextDate2:"+nextDate);
+		}
+
+		HSSFWorkbook wb = new HSSFWorkbook();
+		try {
+			List<MealExcelDto>        mealList    = orderDinnerInfoManager.getOrderExcelListByMeal(orgId,nextDate);
+			List<MealExcelDto>        deptList    = orderDinnerInfoManager.getOrderExcelListByDept(orgId,nextDate);
+			List<Map<String, Object>> userList    = orderDinnerInfoManager.getOrderExcelListByUserName(orgId,nextDate);
+			List<MealExcelDto>        addressList = orderDinnerInfoManager.getOrderExcelListByAddress(orgId,nextDate);
+			List<Map<String, Object>> sysList = orderDinnerManager.exportByAddress(orgId,nextDate);
+			if (mealList == null || (mealList != null && mealList.size() == 0)) {
+				return AppResultUtil.createErrorDto("100", "今日没有订单,无法导出");
+			}
+			//设置导出的excel路径
+			String path = setPath("upload/OrderExcel"+orgId+".xls");
+			File   file = new File(new ExcelUtils().getPath(path));
+			System.out.println("path:" + path);
+			String sheetName = "";
+			if (sysList != null && sysList.size() > 0) {
+				sheetName = "今日餐品汇总";
+				List<Map<String, Object>> mapList = orderDinnerManager.getAllMealName(orgId);
+				String[] titles     = {"地址", "部门/领导"};
+				String[] fieldNames = {"address", "deptname"};
+				titles = orderDinnerManager.getTitles(mapList, titles, 1);
+				titles = StringUtil.insert(titles, "换花卷");
+				titles = StringUtil.insert(titles, "换馒头");
+				titles = StringUtil.insert(titles, "合计");
+				fieldNames = orderDinnerManager.getTitles(mapList, fieldNames, 2);
+				fieldNames = StringUtil.insert(fieldNames, CodeConstants.ROLLS);
+				fieldNames = StringUtil.insert(fieldNames, CodeConstants.BUNS);
+				fieldNames = StringUtil.insert(fieldNames, "heji");
+				file = ExcelUtils.exportExcel(file, wb, sheetName, sysList, titles, fieldNames);
+			}
+			if (mealList != null && mealList.size() > 0) {
+				sheetName = "餐品和数量汇总";
+				String[] titles     = {"餐品", "数量"};
+				String[] fieldNames = {"mName", "other"};
+				file = ExcelUtils.exportExcel(file, wb, sheetName, mealList, titles, fieldNames);
+			}
+			if (addressList != null && addressList.size() > 0) {
+				sheetName = "餐品数量和送餐地址汇总";
+				String[] titles     = {"送餐地址", "餐品"};
+				String[] fieldNames = {"other", "mName"};
+				file = ExcelUtils.exportExcel(file, wb, sheetName, addressList, titles, fieldNames);
+			}
+			if (deptList != null && deptList.size() > 0) {
+				sheetName = "餐品数量和部门汇总";
+				String[] titles     = {"部门", "餐品"};
+				String[] fieldNames = {"other", "mName"};
+				file = ExcelUtils.exportExcel(file, wb, sheetName, deptList, titles, fieldNames);
+			}
+			if (userList != null && userList.size() > 0) {
+				sheetName = "餐品数量和预订人汇总";
+				String[] titles     = {"部门", "订餐人", "餐品"};
+				String[] fieldNames = {"deptname", "other", "mName"};
+				file = ExcelUtils.exportExcel(file, wb, sheetName, userList, titles, fieldNames);
+			}
+			log.info("导出地址:" + path);
+			return AppResultUtil.createSuccesDto(path);
+		} catch (Exception e) {
+			log.error("导出失败" + e.getMessage());
+			e.printStackTrace();
+			return AppResultUtil.createErrorDto("100", "导出失败:" + e.getMessage());
+		}
+	}
+
 	@Override
 	public OrderDinner getById(Long id) {
 		if (orderDinnerManager.exists(id)) {
@@ -1744,26 +1822,49 @@ 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];
+				for (String org : orgArr) {
+					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);
+						}
 					}
 				}
-				log.info("getOrderInfoTask/orgId:" + orgId);
-				if (StringUtils.isNotEmpty(orgId)) {
-					String res = getOrderTime(orgId, "importTime");
+
+			}
+		}
+	}
+
+	@Override
+	public void getOrderInfoTask2(String orgId,String sysDate) {
+		if (StringUtils.isNotEmpty(orgId)) {
+			String res = getOrderTime(orgId, "importTime");
+			log.info("getOrderInfoTask2-res:{}",res);
+			if (StringUtils.isEmpty(res)) {
+			} else {
+				exportExcel2(orgId,sysDate);
+			}
+		} else {
+			String orgIds = serviceProjectAllocationManager.getServiceProjectByServiceCode("DCFW");
+			log.info("getOrderInfoTask/orgIds:" + orgIds);
+			if (StringUtils.isNotEmpty(orgIds)) {
+				String[] orgArr = orgIds.split(",");
+				for (String org : orgArr) {
+					log.info("getOrderInfoTask/orgId:" + org);
+					if (StringUtils.isEmpty(org)) {
+						continue;
+					}
+					String res = getOrderTime(org, "importTime");
 					log.info("getOrderInfoTask/res:" + res);
 					if (StringUtils.isEmpty(res)) {
 					} else {
-						redisExport(orgId);
+						redisExport2(org,sysDate);
 					}
 				}
+
 			}
 		}
 	}
@@ -1771,7 +1872,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 + "--------------------------");
@@ -1794,4 +1895,32 @@ public class OrderDinnerServiceImpl implements OrderDinnerService {
 			log.info("-----------redisExport-----执行导出结束------------------------");
 		}
 	}
+
+
+	private void redisExport2(String orgId,String date) {
+		String time = DateHelper.formatDate(new Date(), DateHelper.DATE);
+		log.info("-------------redisExport---time:" + time + "--------------------------");
+		String key = "getOrder_" + orgId +"_"+ time;
+		log.info("-------------redisExport---key:" + key + "--------------------------");
+		String mealJson = baseRedisService.get(key);
+		log.info("-------------redisExport---mealJson:" + mealJson + "--------------------------");
+		int count = 0;
+		if (StringUtils.isNotEmpty(mealJson)) {
+			log.info("-------------redisExport---redis获取:" + mealJson + "--------------------------");
+			count = Integer.parseInt(mealJson);
+			count++;
+			baseRedisService.set(key, count + "");
+		} else {
+			count++;
+			log.info("-------------redisExport---设置redis---count:" + count + "-----------------------");
+			baseRedisService.set(key, count + "");
+			log.info("-------------redisExport---设置redis--------------------------");
+		}
+		log.info("-----------redisExport-----count:" + count + "--------------------------");
+		if (count <= 10) {
+			log.info("-----------redisExport-----执行导出开始------------------------");
+			exportExcel2(orgId,date);
+			log.info("-----------redisExport-----执行导出结束------------------------");
+		}
+	}
 }

+ 105 - 11
src/main/java/com/palmnest/service/dinner/service/impl/PlaceAnOrderServiceImpl.java

@@ -217,6 +217,103 @@ public class PlaceAnOrderServiceImpl implements PlaceAnOrderService{
 		}
 		return AppResultUtil.createErrorDto("100", "暂无账号");
 	}
+//	@Override
+//	public AppResultDto getWeek(String orgId, String wxUserId) {
+//		long beginTime=System.currentTimeMillis();
+//		System.out.println("beginTime:"+beginTime);
+//		LOG.info("beginTime:"+beginTime);
+//		List<WeekDate> weekNewList=new ArrayList<WeekDate>();
+//		int isOver=orderDinnerManager.isOver(orgId,"orderTime");
+//		try {
+//			String mealJson = baseRedisService.get(CodeConstants.ORG_MEAL_LIST_KEY+orgId);
+//			if(StringUtils.isNotEmpty(mealJson)) {
+//				List<WeekDate> weekList=JSONArray.parseArray(mealJson, WeekDate.class);
+//				if(weekList!=null&&weekList.size()>0){
+//					for(int i=0;i<weekList.size();i++){
+//						WeekDate week=weekList.get(i);
+//						int count=mealCarManager.findByUserId(wxUserId, week.getDateTime());
+//						if(DateUtils.checkIsOver(week.getDateTime(), isOver)){
+//							week.setIsShow(0);
+//						}else{
+//							week.setIsShow(1);
+//						}
+//						if(count>0&&week.getIsShow()==1){
+//							week.setSumCount(count);
+//						}else{
+//							week.setSumCount(null);
+//						}
+//						String sysDate=DateUtils.formatDate(new Date(), "yyyy-MM-dd");
+//						if(sysDate.equals(week.getDateTime())){
+//							week.setIsToday(1);
+//						}else{
+//							week.setIsToday(0);
+//						}
+//						int blueCount=orderDinnerInfoManager.getOrderCount(wxUserId, week.getDateTime());
+//						if(blueCount>0){
+//							week.setIsBule(1);
+//						}else{
+//							week.setIsBule(0);
+//						}
+//						List<Meal> mealList=week.getMealList();
+//						if(mealList!=null&&mealList.size()>0){
+//							week.setMealList(mealList);
+//							weekNewList.add(week);
+//						}
+//					}
+//				}
+//			}else{
+//				List<WeekDate> weekList=DateUtils.getWeek();
+//				if(weekList!=null&&weekList.size()>0){
+//					for(int i=0;i<weekList.size();i++){
+//						WeekDate week=weekList.get(i);
+//						int count=mealCarManager.findByUserId(wxUserId, week.getDateTime());
+//						if(DateUtils.checkIsOver(week.getDateTime(), isOver)){
+//							week.setIsShow(0);
+//						}else{
+//							week.setIsShow(1);
+//						}
+//						if(count>0&&week.getIsShow()==1){
+//							week.setSumCount(count);
+//						}else{
+//							week.setSumCount(null);
+//						}
+//						int blueCount=orderDinnerInfoManager.getOrderCount(wxUserId, week.getDateTime());
+//						if(blueCount>0){
+//							week.setIsBule(1);
+//						}else{
+//							week.setIsBule(0);
+//						}
+//						List<Meal> mealList=mealManager.findMealList(orgId,week.getDateTime());
+//						List<Meal> mealLists=mealManager.getMealList(orgId,week.getDateTime());
+//						if(mealLists!=null&&mealLists.size()>0){
+//							week.setMealList(mealList);
+//							weekNewList.add(week);
+//						}
+//					}
+//				}
+//				baseRedisService.set(CodeConstants.ORG_MEAL_LIST_KEY+orgId,  JSONObject.toJSONString(weekNewList));
+//			}
+//			Collections.sort(weekNewList,new Comparator<WeekDate>() {
+//				public int compare(WeekDate o1, WeekDate o2) {
+//	                String name1 =String.valueOf(o1.getWeekNo());//name1是从你list里面拿出来的一个
+//	                String name2= String.valueOf(o2.getWeekNo()); //name1是从你list里面拿出来的第二个name
+//	                return name1.compareTo(name2);
+//	        }
+//			});
+//		} catch (Exception e) {
+//			LOG.error(e.getMessage());
+//			return AppResultUtil.createErrorDto("100", "获取餐品列表失败");
+//		}
+//		long endTime=System.currentTimeMillis();
+//		System.out.println("endTime:"+endTime+",间隔:"+(endTime-beginTime));
+//		LOG.info("endTime:"+endTime+",间隔:"+(endTime-beginTime));
+//		if(weekNewList!=null&&weekNewList.size()>0){
+//			return AppResultUtil.createSuccesDto(weekNewList);
+//		}
+//		return AppResultUtil.createErrorDto("100", "尚未维护餐品,请联系管理员");
+//	}
+
+
 	@Override
 	public AppResultDto getWeek(String orgId, String wxUserId) {
 		long beginTime=System.currentTimeMillis();
@@ -224,7 +321,6 @@ public class PlaceAnOrderServiceImpl implements PlaceAnOrderService{
 		LOG.info("beginTime:"+beginTime);
 		List<WeekDate> weekNewList=new ArrayList<WeekDate>();
 		int isOver=orderDinnerManager.isOver(orgId,"orderTime");
-//		baseRedisService.dele(CodeConstants.ORG_MEAL_LIST_KEY+orgId);
 		try {
 			String mealJson = baseRedisService.get(CodeConstants.ORG_MEAL_LIST_KEY+orgId);
 			if(StringUtils.isNotEmpty(mealJson)) {
@@ -263,7 +359,7 @@ public class PlaceAnOrderServiceImpl implements PlaceAnOrderService{
 					}
 				}
 			}else{
-				List<WeekDate> weekList=DateUtils.getWeek();
+				List<WeekDate> weekList=mealManager.getMealDate(Integer.parseInt(orgId));
 				if(weekList!=null&&weekList.size()>0){
 					for(int i=0;i<weekList.size();i++){
 						WeekDate week=weekList.get(i);
@@ -294,13 +390,13 @@ public class PlaceAnOrderServiceImpl implements PlaceAnOrderService{
 				}
 				baseRedisService.set(CodeConstants.ORG_MEAL_LIST_KEY+orgId,  JSONObject.toJSONString(weekNewList));
 			}
-			Collections.sort(weekNewList,new Comparator<WeekDate>() {
-				public int compare(WeekDate o1, WeekDate o2) {  
-	                String name1 =String.valueOf(o1.getWeekNo());//name1是从你list里面拿出来的一个  
-	                String name2= String.valueOf(o2.getWeekNo()); //name1是从你list里面拿出来的第二个name      
-	                return name1.compareTo(name2);    
-	        }  
-			});
+//			Collections.sort(weekNewList,new Comparator<WeekDate>() {
+//				public int compare(WeekDate o1, WeekDate o2) {
+//					String name1 =String.valueOf(o1.getWeekNo());//name1是从你list里面拿出来的一个
+//					String name2= String.valueOf(o2.getWeekNo()); //name1是从你list里面拿出来的第二个name
+//					return name1.compareTo(name2);
+//				}
+//			});
 		} catch (Exception e) {
 			LOG.error(e.getMessage());
 			return AppResultUtil.createErrorDto("100", "获取餐品列表失败");
@@ -313,7 +409,6 @@ public class PlaceAnOrderServiceImpl implements PlaceAnOrderService{
 		}
 		return AppResultUtil.createErrorDto("100", "尚未维护餐品,请联系管理员");
 	}
-	
 	@Override
 	public AppResultDto getWeekDate(String orgId, String wxUserId,
 			String dinnerTime) {
@@ -1240,7 +1335,6 @@ public class PlaceAnOrderServiceImpl implements PlaceAnOrderService{
 	
 	/**
 	 * 封装查询到的通行次数、员工通行次数、访客通行次数、二维码通行次数、实体卡通行次数
-	 * @param orgId
 	 * @param dateType
 	 * @param date
 	 * @param endDate

+ 34 - 0
src/main/java/com/palmnest/webapp/controller/dinner/ConsumerUserController.java

@@ -609,4 +609,38 @@ public class ConsumerUserController extends BaseFormController {
 	}
 
 
+	/**
+	 * 导入用户信息
+	 *
+	 * @param excelFile
+	 * @param request
+	 * @param response
+	 * @return
+	 * @throws Exception
+	 */
+	@RequestMapping(value = "importUserAddress")
+	@ResponseBody
+	public AppResultDto importUserAddress(@RequestParam("excelFile") MultipartFile excelFile, HttpServletRequest request, HttpServletResponse response) throws Exception {
+		User   user   = (User) request.getSession().getAttribute("UserCache");
+		String userId = "";
+		if (user != null) {
+			userId = String.valueOf(user.getId());
+		}
+		String orgId  = request.getParameter("orgId");
+		String orgIds = getUserManageOrgIds(user);
+		if (StringUtils.isEmpty(orgId)) {
+			if (StringUtils.isNotEmpty(orgIds)) {
+				String[] orgs = orgIds.split(";");
+				if (orgs != null && orgs.length > 0) {
+					orgId = orgIds.split(";")[0];
+				}
+			} else {
+				return AppResultUtil.createErrorDto("100", "项目不允许为空");
+			}
+		}
+		AppResultDto dto = consumerUserService.importUserAddress(orgId, excelFile.getInputStream(), userId);
+		return dto;
+	}
+
+
 }

+ 38 - 0
src/main/java/com/palmnest/webapp/controller/dinner/wechat/WechatConsumerController.java

@@ -6,6 +6,7 @@ import com.palmnest.application.core.util.AppResultUtil;
 import com.palmnest.application.dto.input.ConsumerInputDto;
 import com.palmnest.application.dto.output.ElementDto;
 import com.palmnest.model.Element;
+import com.palmnest.model.User;
 import com.palmnest.model.dinner.Consumer;
 import com.palmnest.service.dinner.service.ConsumerUserService;
 import com.palmnest.service.estateserve.ScWxuserManager;
@@ -15,8 +16,12 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.multipart.MultipartFile;
 
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.List;
@@ -216,5 +221,38 @@ public class WechatConsumerController extends BaseFormController {
 		return AppResultUtil.createSuccesDto();
 	}
 
+	/**
+	 * 导入用户信息
+	 *
+	 * @param excelFile
+	 * @param request
+	 * @param response
+	 * @return
+	 * @throws Exception
+	 */
+	@RequestMapping(value = "importUserAddress")
+	@ResponseBody
+	public AppResultDto importUserAddress(@RequestParam("excelFile") MultipartFile excelFile, HttpServletRequest request, HttpServletResponse response) throws Exception {
+		User user   = (User) request.getSession().getAttribute("UserCache");
+		String userId = "";
+		if (user != null) {
+			userId = String.valueOf(user.getId());
+		}
+		String orgId  = request.getParameter("orgId");
+		String orgIds = getUserManageOrgIds(user);
+		if (StringUtils.isEmpty(orgId)) {
+			if (StringUtils.isNotEmpty(orgIds)) {
+				String[] orgs = orgIds.split(";");
+				if (orgs != null && orgs.length > 0) {
+					orgId = orgIds.split(";")[0];
+				}
+			} else {
+				return AppResultUtil.createErrorDto("100", "项目不允许为空");
+			}
+		}
+		AppResultDto dto = consumerUserService.importUserAddress(orgId, excelFile.getInputStream(), userId);
+		return dto;
+	}
+
 
 }

+ 9 - 1
src/main/java/com/palmnest/webapp/controller/dinner/wechat/WechatPlaceAnOrderController.java

@@ -14,6 +14,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.ResponseBody;
 
 import java.text.SimpleDateFormat;
@@ -403,9 +404,16 @@ public class WechatPlaceAnOrderController extends BaseFormController {
 	 * @param orgId
 	 * @return
 	 */
+	@RequestMapping(value = "getOrderInfoTask2")
+	@ResponseBody
+	public AppResultDto getOrderInfoTask2(@RequestParam(value = "orgId",required = false) String orgId,@RequestParam(value = "date",required = false) String date) {
+		orderDinnerService.getOrderInfoTask2(orgId,date);
+		return AppResultUtil.createSuccesDto();
+	}
+
 	@RequestMapping(value = "getOrderInfoTask")
 	@ResponseBody
-	public AppResultDto getOrderInfoTask(String orgId) {
+	public AppResultDto getOrderInfoTask(@RequestParam(value = "orgId",required = false) String orgId) {
 		orderDinnerService.getOrderInfoTask(orgId);
 		return AppResultUtil.createSuccesDto();
 	}

+ 1 - 1
src/main/java/com/palmnest/webapp/quartz/OrderDinnerGetOrderInfoTask.java

@@ -17,7 +17,7 @@ public class OrderDinnerGetOrderInfoTask {
 
 	private void run() {
 		log.info("quartz into orderDinnerGetOrderInfoTask start ..." + new Date());
-		orderDinnerService.getOrderInfoTask("");
+		orderDinnerService.getOrderInfoTask2("","");
 		log.info("quartz into orderDinnerGetOrderInfoTask end ...");
 	}
 

+ 10 - 2
src/main/resources/quartz_job2.xml

@@ -353,11 +353,19 @@
         <property name="targetObject" ref="orderDinnerGetOrderInfoTask"/>
         <property name="targetMethod" value="run"/>
     </bean>
+<!--    <bean id="orderDinnerGetOrderInfoTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">-->
+<!--        <property name="jobDetail" ref="orderDinnerGetOrderInfoTimer"/>-->
+<!--        <property name="cronExpression">-->
+<!--            <value>0 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30 10 * * ?</value>-->
+<!--            &lt;!&ndash; 从10点开始执行,每1分钟执行一次,只执行到10点30 &ndash;&gt;-->
+<!--        </property>-->
+<!--    </bean>-->
+
     <bean id="orderDinnerGetOrderInfoTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
         <property name="jobDetail" ref="orderDinnerGetOrderInfoTimer"/>
         <property name="cronExpression">
-            <value>0 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30 10 * * ?</value>
-            <!-- 从10点开始执行,每1分钟执行一次,只执行到10点30 -->
+            <value>0 40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58 16 * * ?</value>
+            <!-- 从16点40开始执行,每1分钟执行一次,只执行到16点50 -->
         </property>
     </bean>
 

+ 66 - 65
src/main/webapp/WEB-INF/pages/admin/notice/noticeAppPublish.jsp

@@ -149,15 +149,15 @@
 					height: 18px;
 					margin-right: 10px;
 				}
-				
+
 				.tv-choose-content{
 					margin-top:5px;
 					color: #333;
 					font-size: 15px;
 					max-width: 600px;
-					word-break:break-all;       
-					word-wrap:break-word; 
-					line-height: 25px;   
+					word-break:break-all;
+					word-wrap:break-word;
+					line-height: 25px;
 				}
 				.submit-btn{
 					margin-left: 20px;
@@ -274,15 +274,15 @@
 		              					<div class="sortOrg_search_div">
 		              						<input class="default-select sortOrg_search" type="text" autocomplete="off" id='sortOrg_search'/>
 			              					<span class="sortOrg_search_btn">
-			              						
+
 			              					</span>
 		              					</div>
 		              					<div class="orgName_div">
-		              						<span>已选项目:</span>	
-		              					</div>	
+		              						<span>已选项目:</span>
+		              					</div>
 		              					<div class="sortOrg_cheak_all_wrap">
 		              						<span class="item_cheak item_cheak_all"></span>
-		              						<span>所有项目</span>		
+		              						<span>所有项目</span>
 		              					</div>
 		              					<ul class="org_list">
 		              					</ul>
@@ -300,6 +300,7 @@
 									<option value="2">banner</option>
 									<option value="3">生成链接</option>
 									<option value="5">楼闪送banner</option>
+									<option value="6">周边商户banner</option>
 								</select>
 							</div>
 							<div id="part-wp" class="part-wp choose-publish-con">
@@ -320,7 +321,7 @@
 						</form:form>
 					</div>
 					<div>
-						
+
 						<!-- 公告 -->
 						<div id="announcement" class=" app-publish-wrapper clearfloat">
 							<div class="announcement-left main-content-mode-wp">
@@ -410,7 +411,7 @@
 													</span>
 													<label class="checkbox-con" for="wx" >小程序端</label>
 												</div>
-												
+
 												<div class="checkbox-wp" >
 													<span class="checkbox-input">
 														<input type="checkbox" id="public" class="check-item" data-type="3" name="public" />
@@ -426,7 +427,7 @@
 												</span>
 												<label class="checkbox-con" for="pushMsg">模板消息</label>
 											</div>
-											
+
 										</div>
 									</div>
 									<div class="public-item-wp clearfloat public-extra-wp">
@@ -436,29 +437,29 @@
 												<span class="radio-input">
 													<input type="radio" id="pb-all" data-type="1"  class="radio-item" name="public"  checked="checked" >
 													<span class="radio-inner"></span>
-												</span>		
+												</span>
 												<label class="radio-con" for="pb-all">公众号所有粉丝<span style="font-weight:normal">(公众号所有粉丝会受到公众号推送)</span></label>
 											</div>
 											<div class="radio-wp radio-block" >
 												<span class="radio-input">
 													<input type="radio" id="pb-item" data-type="2"  class="radio-item" name="public" >
 													<span class="radio-inner"></span>
-												</span>		
+												</span>
 												<label class="radio-con" for="pb-item">项目所有用户<span style="font-weight:normal">(登录过楼宇之窗的用户才会受到公众号推送)</span></label>
 											</div>
 											<div class="radio-wp radio-block" >
 												<span class="radio-input">
 													<input type="radio" id="pb-some" data-type="3" class="radio-item" name="public" >
 													<span class="radio-inner"></span>
-												</span>		
+												</span>
 												<label class="radio-con" for="pb-some">项目部分用户</label>
-												
+
 											</div>
 											<div class="radio-wp radio-block" >
 												<span class="radio-input">
 													<input type="radio" id="pb-some" data-type="4" class="radio-item" name="public" >
 													<span class="radio-inner"></span>
-												</span>		
+												</span>
 												<label class="radio-con" for="pb-some">部门/分组发送</label>
 												<button class="btn-blue-stp choose-dep-stp" @click="chooseHandler">选择部门/分组</button>
 											</div>
@@ -484,14 +485,14 @@
 													<span class="radio-input">
 														<input type="radio" id="msg-yes" data-type="1" class="radio-item" name="msg" >
 														<span class="radio-inner"></span>
-													</span>		
+													</span>
 													<label class="radio-con" for="msg-yes">是</label>
 												</div>
 												<div class="radio-wp " style="margin-right: 15px;">
 													<span class="radio-input">
 														<input type="radio" id="msg-no" data-type="0" class="radio-item" name="msg" >
 														<span class="radio-inner"></span>
-													</span>		
+													</span>
 													<label class="radio-con" for="msg-no">否</label>
 												</div>
 											</div>
@@ -499,7 +500,7 @@
 										<div class="msg-tips-list">注:加入消息列表后会在公众号消息列表展示,加入列表发送微信推送每日只能发送一次。</div>
 									</div>
 									</div>
-									
+
 									<div class="approve-type-edit">
 									<div class="msg-list-wp clearfloat approvael-result">
 										<span class="tips">审核结果</span>
@@ -509,7 +510,7 @@
 													<span class="radio-input">
 														<input type="radio" id="status-pass" class="radio-item" data-type="1" name="approveStatus" />
 														<span class="radio-inner"></span>
-													</span>		
+													</span>
 													<label class="radio-con" for="status-pass">通过</label>
 
 												</div>
@@ -517,7 +518,7 @@
 													<span class="radio-input">
 														<input type="radio" id="status-fail" class="radio-item status" data-type="2" name="approveStatus" />
 														<span class="radio-inner"></span>
-													</span>		
+													</span>
 													<label class="radio-con" for="status-fail">不通过</label>
 												</div>
 											</div>
@@ -548,8 +549,8 @@
 										<button class="btn-yellow-110 submit-btn">提交发送</button>
 									</div>
 							</div>
-						
-							
+
+
 						</div>
 						<!-- 生成链接 -->
 						<div id="line" class="main-content-mode-wp app-publish-wrapper">
@@ -574,7 +575,7 @@
 												<span class="radio-input">
 													<input type="radio" id="status-pass" class="radio-item" data-type="1" name="approveStatus" />
 													<span class="radio-inner"></span>
-												</span>		
+												</span>
 												<label class="radio-con" for="status-pass">通过</label>
 
 											</div>
@@ -582,7 +583,7 @@
 												<span class="radio-input">
 													<input type="radio" id="status-fail" class="radio-item status" data-type="2" name="approveStatus" />
 													<span class="radio-inner"></span>
-												</span>		
+												</span>
 												<label class="radio-con" for="status-fail">不通过</label>
 											</div>
 										</div>
@@ -667,29 +668,29 @@
 										<span class="radio-input">
 											<input type="radio" id="pb-all" data-type="1"  class="radio-item" name="publicLink"  checked="checked" >
 											<span class="radio-inner"></span>
-										</span>		
+										</span>
 										<label class="radio-con" for="pb-all">公众号所有粉丝<span style="font-weight:normal">(公众号所有粉丝会受到公众号推送)</span></label>
 									</div>
 									<div class="radio-wp radio-block" >
 										<span class="radio-input">
 											<input type="radio" id="pb-item" data-type="2"  class="radio-item" name="publicLink" >
 											<span class="radio-inner"></span>
-										</span>		
+										</span>
 										<label class="radio-con" for="pb-item">项目所有用户<span style="font-weight:normal">(登录过楼宇之窗的用户才会受到公众号推送)</span></label>
 									</div>
 									<div class="radio-wp radio-block" >
 										<span class="radio-input">
 											<input type="radio" id="pb-some" data-type="3" class="radio-item" name="publicLink" >
 											<span class="radio-inner"></span>
-										</span>		
+										</span>
 										<label class="radio-con" for="pb-some">项目部分用户</label>
-										
+
 									</div>
 									<div class="radio-wp radio-block" >
 										<span class="radio-input">
 											<input type="radio" id="pb-some" data-type="4" class="radio-item" name="publicLink" >
 											<span class="radio-inner"></span>
-										</span>		
+										</span>
 										<label class="radio-con" for="pb-some">部门/分组发送</label>
 										<button class="btn-blue-stp choose-dep-stp" @click="chooseHandler">选择部门/分组</button>
 									</div>
@@ -716,7 +717,7 @@
 												<span class="radio-input">
 													<input type="radio" id="status-pass" class="radio-item" data-type="1" name="approveStatus" />
 													<span class="radio-inner"></span>
-												</span>		
+												</span>
 												<label class="radio-con" for="status-pass">通过</label>
 
 											</div>
@@ -724,7 +725,7 @@
 												<span class="radio-input">
 													<input type="radio" id="status-fail" class="radio-item status" data-type="2" name="approveStatus" />
 													<span class="radio-inner"></span>
-												</span>		
+												</span>
 												<label class="radio-con" for="status-fail">不通过</label>
 											</div>
 										</div>
@@ -746,7 +747,7 @@
 										<label class="checkbox-con" for="pushMsg">开启</label>
 									</div>
 								</div>
-								
+
 							</div>
 							<div class="msg-temples-tips">开启后会给公众号所有粉丝发送微信模版消息通知</div> -->
 							<div class="btns-wp">
@@ -792,7 +793,7 @@
 										</span>
 										<label class="checkbox-con" for="app2">APP端</label>
 									</div>
-									<div class="checkbox-wp" 
+									<div class="checkbox-wp"
 									v-if="contextBasePath=='wx.palmnest.com' || contextBasePath=='superdesk.avic-s.com' || contextBasePath=='localhost:8085'">
 										<span class="checkbox-input">
 											<input type="checkbox" id="wx2" class="check-item" data-type="2" name="wx2" />
@@ -815,7 +816,7 @@
 										<label class="checkbox-con" for="pushBannerImage">模板消息</label>
 									</div>
 
-									
+
 								</div>
 							</div>
 							 <div class="public-item-wp clearfloat public-extra-banner-wp">
@@ -825,28 +826,28 @@
 										<span class="radio-input">
 											<input type="radio" id="pb-all1" data-type="1"  class="radio-item" name="publicBanner" >
 											<span class="radio-inner"></span>
-										</span>		
+										</span>
 										<label class="radio-con" for="pb-all1">公众号所有粉丝<span style="font-weight:normal">(公众号所有粉丝会受到公众号推送)</span></label>
 									</div>
 									<div class="radio-wp radio-block" >
 										<span class="radio-input">
 											<input type="radio" id="pb-item1" data-type="2"  class="radio-item" name="publicBanner" >
 											<span class="radio-inner"></span>
-										</span>		
+										</span>
 										<label class="radio-con" for="pb-item1">项目所有用户<span style="font-weight:normal">(登录过楼宇之窗的用户才会受到公众号推送)</span></label>
 									</div>
 									<div class="radio-wp radio-block" >
 										<span class="radio-input">
 											<input type="radio" id="pb-some1" data-type="3" class="radio-item" name="publicBanner" >
 											<span class="radio-inner"></span>
-										</span>		
+										</span>
 										<label class="radio-con" for="pb-some1">项目部分用户</label>
 									</div>
 									<div class="radio-wp radio-block" >
 										<span class="radio-input">
 											<input type="radio" id="pb-some" data-type="4" class="radio-item" name="publicBanner" >
 											<span class="radio-inner"></span>
-										</span>		
+										</span>
 										<label class="radio-con" for="pb-some">部门/分组发送</label>
 										<button class="btn-blue-stp choose-dep-stp" @click="chooseHandler">选择部门/分组</button>
 									</div>
@@ -862,7 +863,7 @@
 									  </el-tag>
 									  </div>
 								</div>
-							</div> 
+							</div>
 						<!--	<div class="msg-list-wp clearfloat public-extra-wp">
 								<span class="tips">加入消息列表</span>
 								<div class="msg-list-con">
@@ -871,14 +872,14 @@
 											<span class="radio-input">
 												<input type="radio" id="msg-yes" data-type="1" class="radio-item" name="msg1" >
 												<span class="radio-inner"></span>
-											</span>		
+											</span>
 											<label class="radio-con" for="msg-yes">是</label>
 										</div>
 										<div class="radio-wp " style="margin-right: 15px;">
 											<span class="radio-input">
 												<input type="radio" id="msg-no" data-type="0" class="radio-item" name="msg1" >
 												<span class="radio-inner"></span>
-											</span>		
+											</span>
 											<label class="radio-con" for="msg-no">否</label>
 										</div>
 									</div>
@@ -895,7 +896,7 @@
 												<span class="radio-input">
 													<input type="radio" id="status-pass" class="radio-item" data-type="1" name="approveStatus" />
 													<span class="radio-inner"></span>
-												</span>		
+												</span>
 												<label class="radio-con" for="status-pass">通过</label>
 
 											</div>
@@ -903,7 +904,7 @@
 												<span class="radio-input">
 													<input type="radio" id="status-fail" class="radio-item status" data-type="2" name="approveStatus" />
 													<span class="radio-inner"></span>
-												</span>		
+												</span>
 												<label class="radio-con" for="status-fail">不通过</label>
 											</div>
 										</div>
@@ -976,7 +977,7 @@
 						  <div style="overflow-y: scroll;height: 440px;">
 							<div v-if=" searchDataList.deptList && searchDataList.deptList.length>0">
 							<div class="search-rs-title">部门</div>
-							<div class="list-box click-cursor" v-for="(item, index) in searchDataList.deptList" :key="item.id" 
+							<div class="list-box click-cursor" v-for="(item, index) in searchDataList.deptList" :key="item.id"
 							  :class="{'line-top': index != 0}">
 							  <div class="cell-box">
 								<div class="tag-size" v-on:click="searchDataHandler(item)">
@@ -989,7 +990,7 @@
 						  </div>
 							<div v-if="searchDataList.groupList&&searchDataList.groupList.length>0">
 							<div class="search-rs-title" >分组</div>
-							<div class="list-box click-cursor" v-for="(item, index) in searchDataList.groupList" :key="item.id" 
+							<div class="list-box click-cursor" v-for="(item, index) in searchDataList.groupList" :key="item.id"
 							  :class="{'line-top': index != 0}">
 							  <div class="cell-box">
 								<div class="tag-size" v-on:click="searchDataHandler(item)">
@@ -1002,7 +1003,7 @@
 						  </div>
 						  </div>
 						</div>
-					   <div class="default-data-wrap" v-show="true"> 
+					   <div class="default-data-wrap" v-show="true">
 					  <div class="tree-group-box box-top10 box-right15">
 						<el-menu :default-active="activeIndex" mode="horizontal" @select="handleSelect">
 						  <el-menu-item index="1" v-if="indexType == 1||indexType == 0">部门</el-menu-item>
@@ -1012,7 +1013,7 @@
 					  <div style="overflow-y: scroll;height: 400px;" v-if="activeIndex == 1">
 						  <el-tree :data="dataTree"  default-expand-all node-key="id" @node-click="handleNodeClick"
 						  :filter-node-method="filterNodeHandler"  :expand-on-click-node="false"
-							  ref="tree" highlight-current  :props="defaultProps"> 
+							  ref="tree" highlight-current  :props="defaultProps">
 						<span class="custom-tree-node" slot-scope="{node, data}">
 						<span @mouseover="showTip(data.id)" @mouseout="hideTip"  class="el-tree-node-name">
 						  <span v-if="data.childList&&data.childList.length>0||data.levels==0"
@@ -1020,12 +1021,12 @@
 						  <span v-else class="span-button ico_docu"></span>
 						  <span>{{node.label}}</span>
 						  </span>
-						  <span v-if="backSelectedDepHandler(data.id)" class="radio-icon el-icon-check icon-check-item"></span> 
+						  <span v-if="backSelectedDepHandler(data.id)" class="radio-icon el-icon-check icon-check-item"></span>
 						</span>
 						</el-tree>
 					  </div>
 					  <div style="overflow-y: scroll;height: 385px;" v-if="activeIndex == 2">
-						<div class="list-box click-cursor" v-for="(item, index) in tagList" :key="item.id" 
+						<div class="list-box click-cursor" v-for="(item, index) in tagList" :key="item.id"
 							  :class="{'line-top': index != 0}">
 						  <div class="cell-box">
 							<div class="tag-size" v-on:click="tagBtnHandler(item)">
@@ -1036,7 +1037,7 @@
 						  </div>
 						</div>
 					  </div>
-					 </div>  
+					 </div>
 					</div>
 					<div style="margin-left:10px;float: left;width: 1px;height: 480px; background: #F3F3F3"></div>
 					<div style="margin-left:10px;float:left;width: 250px;">
@@ -1196,9 +1197,9 @@
 							newArr.push(resultObj)
 							}
 					   this.identityList=[...newArr]
-					
+
 					  console.log("最后选中11111",this.identityList)
-				
+
 					 });
 					},
 
@@ -1313,7 +1314,7 @@
 									} else {
 									return isYN;
 									}
-									} ,  
+									} ,
 									backSelectedHandler(id, isIndex = false) {
 									let isYN = false;
 									let seleIndex = -1;
@@ -1331,7 +1332,7 @@
 									} else {
 									return isYN;
 									}
-								}, 
+								},
 								chooseHandler(){
 									var $dom =$("#announcement");
 									var $domBanner=$("#graphic");
@@ -1353,9 +1354,9 @@
 										}
 										this.identityList=newArr
 										$(".dialog-pop").show();
-										
+
 									}
-									
+
 								},
 								// 分组
 							tagBtnHandler(data) {
@@ -1386,7 +1387,7 @@
 								type: "POST",
 								dataType: "json",
 								data: {
-									orgId:_this.dataForm.orgId,//项目Id 
+									orgId:_this.dataForm.orgId,//项目Id
 									virtId: _this.inputUser,//
 								},
 								success: function (data) {
@@ -1437,7 +1438,7 @@
 										if (data.code == 200) {
 											var result=data.data
 											_this.chooseDepList=result.deptGroupJson
-										} 
+										}
 									}
 								});
 						},
@@ -1469,7 +1470,7 @@
 								},
 								error: function(err){
 
-								} 
+								}
 							});
 							},
 						},
@@ -1481,7 +1482,7 @@
 							 if (id) {
 								this.ajaxDetail(id)
 							}
-						 	
+
 						},
 					})
 				})
@@ -1496,13 +1497,13 @@
 				</script>
 				<script type="text/javascript" src="${ctx }/scripts/admin/cjqt.js"></script>
 				<script type="text/javascript" src="<c:url value='/scripts/lib/plugins/noticePhotoClip/base64Tool.js?v=1.0.4'/>"></script>
-				
+
 				<script type="text/javascript" src="<c:url value='/scripts/lib/plugins/noticePhotoClip/jquery.min.js'/>"></script>
 				<script type="text/javascript" src="<c:url value='/scripts/lib/plugins/noticePhotoClip/exif.js'/>"></script>
 				<script type="text/javascript" src="<c:url value='/scripts/lib/plugins/noticePhotoClip/bootstrap.min.js'/>"></script>
 				<script type="text/javascript" src="<c:url value='/scripts/lib/plugins/noticePhotoClip/cropper.js'/>"></script>
-				<script type="text/javascript" src="<c:url value='/scripts/lib/plugins/noticePhotoClip/myCrop.js?v=1.0.4'/>"></script>
-				<script type="text/javascript" src="<c:url value='/scripts/admin/notice/noticeAppPublish.js?v=2222222'/>"></script>
+				<script type="text/javascript" src="<c:url value='/scripts/lib/plugins/noticePhotoClip/myCrop.js?v=1.0.5'/>"></script>
+				<script type="text/javascript" src="<c:url value='/scripts/admin/notice/noticeAppPublish.js?v=20220525.1'/>"></script>
 			</body>
 
-			</html>
+			</html>

+ 1 - 1
src/main/webapp/WEB-INF/pages/admin/notice/noticeAppVerify.jsp

@@ -145,7 +145,7 @@
       <script type="text/html" id="indexTpl">
         {{d.LAY_TABLE_INDEX+1}}
       </script>
-      <script type="text/javascript" src="<c:url value='/scripts/admin/notice/noticeAppVerify.js?v=2022.03.03.21.2'/>"></script>
+      <script type="text/javascript" src="<c:url value='/scripts/admin/notice/noticeAppVerify.js?v=2022.05.25.1'/>"></script>
     </body>
 
     </html>

+ 12 - 12
src/main/webapp/WEB-INF/pages/admin/orderDinner/dataStatistics.jsp

@@ -15,28 +15,28 @@
 <link href="<c:url value='/scripts/lib/layui/layui.css'/>" rel="stylesheet" type="text/css" />
 <script type="text/javascript" src="<c:url value='/scripts/lib/layui/layui.js'/>"></script>
 <script type="text/javascript" src="<c:url value='/scripts/lib/template-native.js'/>"></script>
-<script type="text/javascript" src="${ctx }/scripts/admin/orderDinner/dataStatistics.js?2018-12-28"></script>
+<script type="text/javascript" src="${ctx }/scripts/admin/orderDinner/dataStatistics.js?2022-05-23"></script>
 <script type="text/javascript" src="${ctx }/scripts/admin/cjqt.js"></script>
 
 </head>
 <body>
-	
+
 	<input type="hidden" value="${ctx}" id="contextPath" />
-	
+
 	<div class="bread-wp">
 		订餐管理  > 数据统计
 	</div>
 	<div class="right-content">
 		<div class="main-content-mode-wp clearfloat email-publish-wp ">
 		<form:form  id="conditionform"  class="clearfloat">
-			 
+
 	            <c:if test="${fn:length(orgs) > 1}">
 		            <div class=" part-wp">
 		              <span class="search-tips">项目</span>
 		              <input class="default-select" name="orgId" id="orgId" org__id="${orgs[0].id}" autocomplete="off" value="${orgs[0].name}"/>
 		              <span class="select_wrap _hide"></span>
 <!-- 		              <select class="default-select" name="orgId" id="orgId" >
-		   
+
 		                <c:forEach items="${orgs }"  var="org">
 		                  <option value="${org.id }" >${org.name }</option>
 		                </c:forEach>
@@ -44,12 +44,12 @@
 	              	</div>
 	            </c:if>
 	            <c:if test="${fn:length(orgs) == 1}">
-	              <input type="hidden" name="orgId" id="orgId" value="${orgs[0].id}" org__id="${orgs[0].id}" class="single-orgid"> 
+	              <input type="hidden" name="orgId" id="orgId" value="${orgs[0].id}" org__id="${orgs[0].id}" class="single-orgid">
 	            </c:if>
-           
+
 			<div class="part-wp">
 				<span class="search-tips">统计类型</span>
-				<select class="default-select type" >		
+				<select class="default-select type" >
 					<option value="1">订餐统计</option>
 					<option value="2">评价统计</option>
 					<option value="3">部门统计</option>
@@ -58,7 +58,7 @@
 			</div>
 			<div class="part-wp">
 				<span class="search-tips">统计周期</span>
-				<select class="default-select dateType" >		
+				<select class="default-select dateType" >
 					<option value="1">年</option>
 					<option value="2">季度</option>
 					<option value="3">月</option>
@@ -66,18 +66,18 @@
 			</div>
 			<div class="part-wp">
 				<span class="search-tips">统计时间</span>
-				<select class="default-select year-and-time" >		
+				<select class="default-select year-and-time" >
 					<option value="2018">选择时间</option>
 				</select>
 			</div>
 			<button class="search-btn btn-red" type="button">统计</button>
 			<button class="set-btn btn-white" type="button">导出Excel</button>
 		</form:form>
-	 	 <table class="layui-hide" id="LAY_table_user" lay-filter="user"></table>  
+	 	 <table class="layui-hide" id="LAY_table_user" lay-filter="user"></table>
 		</div>
 	</div>
 	<script type="text/html" id="indexTpl">
     {{d.LAY_TABLE_INDEX+1}}
 	</script>
 </body>
-</html>
+</html>

+ 150 - 0
src/main/webapp/WEB-INF/securityNewFilter.xml

@@ -0,0 +1,150 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans:beans xmlns="http://www.springframework.org/schema/security"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xmlns:beans="http://www.springframework.org/schema/beans" xmlns:p="http://www.springframework.org/schema/p"
+             xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+              http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd">
+<!-- 增加登录过滤器 -->   
+           
+<!--该路径下的资源不用过滤-->
+    <http pattern="/images/**" security="none"/>
+    <http pattern="/styles/**" security="none"/>
+    <http pattern="/scripts/**" security="none"/>
+    <http pattern="/plugin/**" security="none"/>
+    <http pattern="/upload/**" security="none"/>
+    <http pattern="/app/uploadTemplate/**" security="none"/>
+    <http pattern="/wechat/**" security="none"/>
+    <http pattern="/app/wechat/**" security="none"/>
+    <http pattern="/loginByToken" security="none"/>
+
+    <!--<http use-expressions="true">-->
+    <!--access="isAuthenticated()"-->
+
+    <!--auto-config = true 则使用from-login. 如果不使用该属性 则默认为http-basic(没有session).-->
+    <!-- lowercase-comparisons:表示URL比较前先转为小写。-->
+    <!-- path-type:表示使用Apache Ant的匹配模式。-->
+    <!--access-denied-page:访问拒绝时转向的页面。-->
+    <!-- access-decision-manager-ref:指定了自定义的访问策略管理器。-->
+    <http auto-config="true">
+
+        <http-basic/>
+
+        <!--intercept-url 指定拦截的url
+        通过pattern指定当前intercept-url定义应当作用于哪些url
+        可以通过access属性来指定intercept-url对应URL访问所应当具有的权限
+        -->
+        <intercept-url pattern="/repairBill/**" access="ROLE_ADMIN,ROLE_USER"/>
+
+        <!-- 用于测试权限问题 -->
+        <intercept-url pattern="/api/superdesk-app-auth/**" access="ROLE_ADMIN,ROLE_USER"/>
+
+        <intercept-url pattern="/app/api/**" access="ROLE_ANONYMOUS"/>
+        <intercept-url pattern="/app/kafka/**" access="ROLE_ANONYMOUS"/>
+        <intercept-url pattern="/app/lingling/PcPost/**" access="ROLE_ANONYMOUS"/>
+        <intercept-url pattern="/app/lingling/VisitorPcPost/**" access="ROLE_ANONYMOUS"/>
+        <intercept-url pattern="/app/appuser/**" access="ROLE_ANONYMOUS"/>
+        <intercept-url pattern="/app/appweb/**" access="ROLE_ANONYMOUS"/>
+        <intercept-url pattern="/app/third/**" access="ROLE_ANONYMOUS"/>
+        <!-- <intercept-url pattern="/app/wechat/**" access="ROLE_ANONYMOUS"/> -->
+        <intercept-url pattern="/app/mobile/**" access="ROLE_ANONYMOUS"/>
+        <intercept-url pattern="/app/estate/**" access="ROLE_ADMIN"/>
+        <intercept-url pattern="/app/admin/**" access="ROLE_ADMIN,ROLE_USER"/>
+        <intercept-url pattern="/app/dto/*" access="ROLE_ANONYMOUS"/>
+        <intercept-url pattern="/app/passwordHint*" access="ROLE_ANONYMOUS,ROLE_ADMIN,ROLE_USER"/>
+        <intercept-url pattern="/app/signup*" access="ROLE_ANONYMOUS,ROLE_ADMIN,ROLE_USER"/>
+        <intercept-url pattern="/app/**" access="ROLE_ADMIN,ROLE_USER"/>
+
+
+
+        <!--login-page:指定登录页面。  -->
+        <!-- login-processing-url:指定了客户在登录页面中按下 Sign In 按钮时要访问的 URL。-->
+        <!-- authentication-failure-url:指定了身份验证失败时跳转到的页面。-->
+        <!-- default-target-url:指定了成功进行身份验证和授权后默认呈现给用户的页面。-->
+        <!-- always-use-default-target:指定了是否在身份验证通过后总是跳转到default-target-url属性指定的URL。
+        authentication-success-handler-ref :根据权限跳转不同画面(使用authentication-success-handler-ref流向不同action)
+        -->
+        <form-login login-page="/login"
+                    authentication-failure-url="/login?error=true"
+                    login-processing-url="/j_security_check"
+                    authentication-success-handler-ref="authenticationSuccessHandler"/>
+        <custom-filter before="FORM_LOGIN_FILTER" ref="verificationLogin"></custom-filter>
+        
+        <remember-me user-service-ref="userDao" key="e37f4b31-0c45-11dd-bd0b-0800200c9a66"/>
+
+
+        <!-- 重点 会话管理-->
+        <session-management>
+            <!-- spring security之并发控制 <concurrency-control  max-sessions:允许用户帐号登录的次数。范例限制用户只能登录一次。-->
+            <!-- 此值表示:用户第二次登录时,前一次的登录信息都被清空。-->
+            <!--   exception-if-maximum-exceeded:默认为false,-->
+            <!-- 当exception-if-maximum-exceeded="true"时系统会拒绝第二次登录。-->
+            <!-- session-registry-alias   spring security自定义sessionRegistry-->
+            <concurrency-control
+                    max-sessions="200000"
+                    error-if-maximum-exceeded="false"
+                    expired-url="/outline.html"
+                    session-registry-alias="sessionRegistry"
+                    session-registry-ref="sessionRegistry"/>
+        </session-management>
+
+    </http>
+
+    <!-- 实现了UserDetailsService的Bean -->
+    <authentication-manager alias="authenticationManager">
+
+        <!-- 正常用户验证 provider -->
+        <authentication-provider user-service-ref="userDao">
+            <!-- 登入 密码 -->
+            <password-encoder ref="passwordEncoder">
+                <salt-source ref="saltSource"/>
+            </password-encoder>
+        </authentication-provider>
+
+        <!-- 企业账号验证 provider -->
+        <authentication-provider ref="virAccountAuthenticationProvider">
+        </authentication-provider>
+
+        <!-- 新服务之窗backend provider -->
+        <authentication-provider ref="spuerdeskAppAuthenticationProvider">
+        </authentication-provider>
+
+    </authentication-manager>
+    <beans:bean id="verificationLogin" class="com.palmnest.webapp.filter.LoginFilterAuthentication">
+        <beans:property name="authenticationManager" ref="authenticationManager"/>   <!-- 身份验证  必须的 -->
+        <beans:property name="authenticationSuccessHandler" ref="authenticationSuccessHandler" />  <!-- 验证通过  必须的 -->
+         <beans:property name="authenticationFailureHandler" ref="authenticationFailureHandler" />   
+         
+    </beans:bean>
+
+    <!--  -->
+    <beans:bean id="authenticationSuccessHandler" class="com.palmnest.webapp.controller.SimpleLoginSuccessHandler"/>
+	  <beans:bean id="authenticationFailureHandler" class="com.palmnest.webapp.controller.LoginFailureHandler" />  
+    <beans:bean id="saltSource" class="org.springframework.security.authentication.dao.ReflectionSaltSource"
+                p:userPropertyToUse="username"/>
+
+    <!-- 配置MultipartResolver 用于文件上传 使用spring的CommosMultipartResolver -->
+    <beans:bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver"
+                p:defaultEncoding="UTF-8"
+                p:maxUploadSize="54000000"
+                p:uploadTempDir="fileUpload/temp"
+    >
+    </beans:bean>
+
+    <!-- 所以我的配置里面只需要加上session-registry-ref就好了 -->
+    <beans:bean id="sessionRegistry"
+                class="com.palmnest.core.security.support.SessionRegistryImpl" scope="singleton">
+        <!-- 发现有 RedisTemplate 后屏蔽 -->
+        <!--<beans:property name="cacheManager" ref="cacheManager"/>-->
+    </beans:bean>
+
+
+    <!-- Override the default password-encoder (SHA) by uncommenting the following and changing the class -->
+    <!-- 已转移至 super_service/src/main/resources/applicationContext-service.xml -->
+    <!-- <bean id="passwordEncoder" class="org.springframework.security.authentication.encoding.ShaPasswordEncoder"/> -->
+
+    <global-method-security>
+        <protect-pointcut expression="execution(* *..service.UserManager.getUsers(..))" access="ROLE_ADMIN"/>
+        <protect-pointcut expression="execution(* *..service.UserManager.removeUser(..))" access="ROLE_ADMIN"/>
+    </global-method-security>
+
+</beans:beans>

+ 37 - 37
src/main/webapp/scripts/admin/notice/noticeAppPublish.js

@@ -316,7 +316,7 @@ $(function () {
 					//$(".img-wrapper").css("background-image", "url(../images/admin/notice_cover.png)");
 					$(".app-publish-wrapper").eq(0).show().siblings().hide();
 					$(".choose-publish-con").hide();
-				} else if (noticeType == 2 || noticeType == 5) {
+				} else if (noticeType == 2 || noticeType == 5 || noticeType == 6) {
 					//$(".img-wrapper").css("background-image", "url(../images/admin/notice_cover.png)");
 					$(".app-publish-wrapper").hide();
 					$(".choose-publish-con").show();
@@ -326,8 +326,8 @@ $(function () {
 					contentType = 1; //选择公告和跳转链接时contentType传1
 					$(".app-publish-wrapper").eq(1).show().siblings().hide();
 					$(".choose-publish-con").hide();
-					
-					
+
+
 				}
 
 			});
@@ -343,7 +343,7 @@ $(function () {
 					//$(".img-wrapper").css("background-image", "url(../images/admin/notice_cover.png)");
 					$(".app-publish-wrapper").eq(3).show().siblings().hide();
 					$(".choose-publish-con").show();
-					if($("#state").val()==5){
+					if($("#state").val()==5 || $("#state").val()==6){
 						$(".app-publish-wrapper").eq(3).find('.port-wp').css('visibility','hidden');
 					}else{
 						$(".app-publish-wrapper").eq(3).find('.port-wp').css('visibility','visible');
@@ -352,17 +352,17 @@ $(function () {
 					//$(".img-wrapper").css("background-image", "url(../images/admin/notice_cover.png)");
 					$(".app-publish-wrapper").eq(2).show().siblings().hide();
 					$(".choose-publish-con").show();
-					if($("#state").val()==5){
+					if($("#state").val()==5 || $("#state").val()==6){
 						$(".app-publish-wrapper").eq(2).find('.port-wp').css('visibility','hidden');
 					}else{
 						$(".app-publish-wrapper").eq(2).find('.port-wp').css('visibility','visible');
 					}
-					
+
 				}
 			});
 			//公告选择公众号发布端口
 			// $(" #announcement .port-con .checkbox-wp .check-item").on("click",function(){
-			// 	if(!($("#announcement").is(':hidden')) && 
+			// 	if(!($("#announcement").is(':hidden')) &&
 			// 	($(".port-con").find('input:checkbox[name="public"]').prop("checked")||$(".port-con").find('input:checkbox[name="pushMsg"]').prop("checked"))){
 			// 		if($(this).data("type")==3 || $(this).data("type")==1){
 			// 			$("#announcement .public-extra-wp").show();
@@ -372,7 +372,7 @@ $(function () {
 			// 			 $("#announcement .search-wp").remove();
 			// 		}
 			// 		if($(this).data("type")==3){
-						
+
 			// 		}else{
 			// 			$("#announcement .public-extra-msglist").hide();
 			// 		}
@@ -381,13 +381,13 @@ $(function () {
 			// 		$("#announcement .public-extra-wp").hide();
 			// 		$("#announcement .public-extra-msglist").hide();
 			// 	}
-				
+
 			// });
 			//公告选择公众号发布端口 图文与模板消息只能选择1个 新需求 20211109
 			// var $dom =$("#announcement");
 			// $dom.find('input:checkbox[name="wx"]').prop("checked")
 			$(" #announcement .port-con .checkbox-wp .check-item").on("click",function(){
-				if(!($("#announcement").is(':hidden')) && 
+				if(!($("#announcement").is(':hidden')) &&
 				($("#announcement .port-con").find('input:checkbox[name="public"]').prop("checked")  )){//图文选中 模板消息不可以点击
 					console.log(4444444)
 					//图文选中 设置模板消息隐藏
@@ -397,7 +397,7 @@ $(function () {
 					//$('input:radio:first').attr('checked', 'checked');
 					//公众号所有粉丝 --隐藏部门的选中的值
 					// $("#announcement").find("input:radio[name='public']:first").prop('checked', true);
-					// $("#announcement .tv-choose-content").hide();	
+					// $("#announcement .tv-choose-content").hide();
 					$("#announcement .search-wp").remove();
 				}
 				// else if(!($("#announcement").is(':hidden')) &&  //图文不选中  模板消息可以点击
@@ -410,7 +410,7 @@ $(function () {
 				// 	$("#announcement .tv-choose-content").hide();
 				// 	$("#announcement .search-wp").remove();
 				// }
-				else if(!($("#announcement").is(':hidden')) &&  // 模板消息选中 图文不可以点击 
+				else if(!($("#announcement").is(':hidden')) &&  // 模板消息选中 图文不可以点击
 				( $("#announcement .port-con").find('input:checkbox[name="pushMsg"]').prop("checked"))){
 					console.log(33333)
 					$("#announcement .public-extra-wp").show();
@@ -428,7 +428,7 @@ $(function () {
 					$(".port-con").find('input:checkbox[name="public"]').show();
 					$(".port-con").find('input:checkbox[name="pushMsg"]').show();
 				}
-				
+
 			});
 			//banner 跳转链接选择公众号发布端口
 			$("#link .port-con .checkbox-wp .check-item").on("click",function(){
@@ -473,7 +473,7 @@ $(function () {
 				if(type==4){
 					$("#announcement .tv-choose-content").show();
 				}else{
-					$("#announcement .tv-choose-content").hide();	
+					$("#announcement .tv-choose-content").hide();
 				}
 			});
 
@@ -489,9 +489,9 @@ $(function () {
 					$("#graphic .search-wp").remove();
 				}
 				if(type==4){
-					$("#graphic .tv-choose-content").show();	
+					$("#graphic .tv-choose-content").show();
 				}else{
-					$("#graphic .tv-choose-content").hide();	
+					$("#graphic .tv-choose-content").hide();
 				}
 			});
 
@@ -507,9 +507,9 @@ $(function () {
 					$("#link .search-wp").remove();
 				}
 				if(type==4){
-					$("#link .tv-choose-content").show();	
+					$("#link .tv-choose-content").show();
 				}else{
-					$("#link .tv-choose-content").hide();	
+					$("#link .tv-choose-content").hide();
 				}
 			});
 			//各个公告切换
@@ -1025,8 +1025,8 @@ $(function () {
 
 
 			var  isPushTemplate=0
-				
-				
+
+
 			if(type==1){
 				//推送消息
 				if ($dom.find('input:checkbox[name="pushMsg"]').prop("checked")) {
@@ -1118,12 +1118,12 @@ $(function () {
 								return false;
 							}
 						}
-						
+
 					}
 
 					var depListNotice=$("#announcement .tv-choose-content").val()
 					if($dom.find("input:radio[name='public']:checked").data("type")==4 && depListNotice){
-						formData.append("deptGroupJson", depListNotice);	
+						formData.append("deptGroupJson", depListNotice);
 					}else{
 						formData.append("deptGroupJson", "");
 					}
@@ -1135,7 +1135,7 @@ $(function () {
 						formData.append("isMessageList", isMessageList);
 
 				} else if (type == 2) {
-					if(noticeType == 5){
+					if(noticeType == 5||noticeType == 6){
 						isApp = 0;
 						isWechat = 1;
 						positionTypeArr.push(2);
@@ -1204,7 +1204,7 @@ $(function () {
 						}
 					};
 				} else if (type == 3) {
-					if(noticeType == 5){
+					if(noticeType == 5||noticeType == 6){
 						isApp = 0;
 						isWechat = 1;
 						positionTypeArr.push(2);
@@ -1277,7 +1277,7 @@ $(function () {
 				formData.append("isApp", isApp);
 				formData.append("positionType", positionType);
 
-			
+
 
 				//添加审核类型
 				let approvetye=$("#approvalType").val()
@@ -1350,7 +1350,7 @@ $(function () {
 			console.log("部分选择",$("#announcement .tv-choose-content").val());
 			if (func == 'add') {
 				_this.throttle(_this.ajaxCreateApp(type, formData, ue, $dom), 5000);
-				
+
 			} else {
 				_this.ajaxCreatePreviewApp(type, formData, ue, $dom);
 				// _this.previewPhone(type);
@@ -1364,7 +1364,7 @@ $(function () {
 					handler.apply(this, arguments);
 					lastTime = nowTime;
 				}
-		 
+
 			}
 		},
 
@@ -1821,11 +1821,11 @@ $(function () {
 					$("#announcement .port-con").find('input:checkbox[name="pushMsg"]').hide();
 					if(data.publicObj==1){
 						$('#announcement input:radio[name="public"]').eq(0).prop("checked", true);
-						$("#announcement .tv-choose-content").hide();	
+						$("#announcement .tv-choose-content").hide();
 					}else if(data.publicObj==2){
 						var $dom = permPublish ? $('#announcement input:radio[name="public"]').eq(1) : $('#announcement input:radio[name="public"]').eq(0)
 						$dom.prop("checked", true);
-						$("#announcement .tv-choose-content").hide();	
+						$("#announcement .tv-choose-content").hide();
 					}else if(data.publicObj==3){
 						var $dom = permPublish ? $('#announcement input:radio[name="public"]').eq(2) : $('#announcement input:radio[name="public"]').eq(1)
 						   $dom.prop("checked", true);
@@ -1835,7 +1835,7 @@ $(function () {
 						_this.getProjectSearch($(".search-select-wp"),2,function(allData){
 				        	_this.searchChooseEvent(2,$(".search-select-wp"),allData,data.userIds)
 				        });
-						$("#announcement .tv-choose-content").hide();	
+						$("#announcement .tv-choose-content").hide();
 					}else if(data.publicObj==4){
 						var $dom = permPublish ? $('#announcement input:radio[name="public"]').eq(3) : $('#announcement input:radio[name="public"]').eq(1)
 						$dom.prop("checked", true);
@@ -1850,11 +1850,11 @@ $(function () {
 					$("#announcement .public-extra-msglist").hide();
 					if(data.publicObj==1){
 						$('#announcement input:radio[name="public"]').eq(0).prop("checked", true);
-						$("#announcement .tv-choose-content").hide();	
+						$("#announcement .tv-choose-content").hide();
 					}else if(data.publicObj==2){
 						var $dom = permPublish ? $('#announcement input:radio[name="public"]').eq(1) : $('#announcement input:radio[name="public"]').eq(0)
 						$dom.prop("checked", true);
-						$("#announcement .tv-choose-content").hide();	
+						$("#announcement .tv-choose-content").hide();
 					}else if(data.publicObj==3){
 						var $dom = permPublish ? $('#announcement input:radio[name="public"]').eq(2) : $('#announcement input:radio[name="public"]').eq(1)
 						   $dom.prop("checked", true);
@@ -1864,7 +1864,7 @@ $(function () {
 						_this.getProjectSearch($(".search-select-wp"),2,function(allData){
 				        	_this.searchChooseEvent(2,$(".search-select-wp"),allData,data.userIds)
 				        });
-						$("#announcement .tv-choose-content").hide();	
+						$("#announcement .tv-choose-content").hide();
 					}else if(data.publicObj==4){
 						var $dom = permPublish ? $('#announcement input:radio[name="public"]').eq(3) : $('#announcement input:radio[name="public"]').eq(1)
 						   $dom.prop("checked", true);
@@ -1896,7 +1896,7 @@ $(function () {
 					// $('#announcement input:radio[name="public"]').attr("disabled", true);
 					// $('#announcement input:radio[name="msg"]').attr("disabled", true);
 				}
-			} else if ((data.noticeType == 2 || data.noticeType == 5) && data.contentType == 1) {
+			} else if ((data.noticeType == 2 || data.noticeType == 5 || data.noticeType == 6) && data.contentType == 1) {
 
 				projectOrgId = !!data.orgId ? data.orgId+',' : data.orgIds;
 				var orgArr = projectOrgId.split(',');
@@ -1942,7 +1942,7 @@ $(function () {
 				if(data.isPushTemplate == 1){
 					if(data.publicObj==1){
 						$('#graphic input:radio[name="publicBanner"]').eq(0).prop("checked", true);
-						$("#graphic .tv-choose-content").hide();	
+						$("#graphic .tv-choose-content").hide();
 					}else if(data.publicObj==2){
 						$('#graphic input:radio[name="publicBanner"]').eq(1).prop("checked", true);
 						$("#graphic .tv-choose-content").hide();
@@ -1980,7 +1980,7 @@ $(function () {
 				if(data.isApp == 1){
 					$('#graphic input:checkbox[name="app2"]').prop("checked", true)
 				};
-			} else if ((data.noticeType == 2 || data.noticeType == 5) && data.contentType == 2) {
+			} else if ((data.noticeType == 2 || data.noticeType == 5 || data.noticeType == 6) && data.contentType == 2) {
 
 				projectOrgId = !!data.orgId ? data.orgId+',' : data.orgIds;
 				var orgArr = projectOrgId.split(',');
@@ -1999,7 +1999,7 @@ $(function () {
 				$("#link #showImg").attr("src",data.coverUrl)
 				$(".img-wrapper").css("background-image", "url(" + data.coverUrl + ")");
 				$(".app-publish-wrapper").eq(2).show().siblings().hide();
-				if(data.noticeType == 5){
+				if(data.noticeType == 5||data.noticeType == 6){
 					$(".app-publish-wrapper").eq(2).find('.port-wp').css('visibility','hidden');
 				}
 				$(".choose-publish-con").show();

+ 5 - 1
src/main/webapp/scripts/admin/notice/noticeAppVerify.js

@@ -625,7 +625,11 @@ $(function () {
                       return '生成链接'
                   }else if (data.notice_type == 5) {
                       return '楼闪送banner'
-                  }
+                  }else if (data.notice_type == 6) {
+					  return '周边商户banner'
+				  } else {
+                  	return ''
+				  }
               }
             },{
 							field: 'title',

+ 6 - 6
src/main/webapp/scripts/admin/orderDinner/dataStatistics.js

@@ -108,7 +108,7 @@ $(function () {
 		},
 		/**
 		 * 获取时间段的年份、季度、月,并渲染
-		 * @param type 
+		 * @param type
 		 * @param callback
 		 */
 		getTimeList: function (type, callback) {
@@ -125,7 +125,7 @@ $(function () {
 			} else if (type == 2) {
 				var start = new Date(startTime);
 				var end = new Date();
-				//				
+				//
 				while (start <= end) {
 					var quarter = _this.getQuarterStartMonth(start.getMonth()).quarter;
 					var month = _this.getQuarterStartMonth(start.getMonth()).quarterStartMonth;
@@ -161,14 +161,14 @@ $(function () {
 				console.log(timeArr);
 				$(".year-and-time").html(template.render(tpl.otherTpl)({ list: timeArr }))
 			};
-			//			  
+			//
 
 		},
 
 		/**
 		 * 获得本季度的月份和月份
 		 * @param nowMonth 当前月
-		 * 
+		 *
 		 */
 		getQuarterStartMonth: function (nowMonth) {
 			var quarterStartMonth = 0;
@@ -528,7 +528,7 @@ $(function () {
 
 						templet: '#indexTpl'
 					}, {
-						field: 'loginName',
+						field: 'mobile',
 						title: '手机号码'
 
 					}, {
@@ -650,4 +650,4 @@ $(function () {
 		}
 	};
 	mealManage.init();
-})
+})

+ 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)

+ 5 - 5
src/main/webapp/scripts/lib/plugins/noticePhotoClip/myCrop.js

@@ -151,7 +151,7 @@ window.onload = function () {
      		                 $dom.find("#showImg").data("url",data.data.preview);
      		            	 $dom.find(".img-wrapper").css("background-image", "url(" + fileImg + ")");
      		            	 $dom.find("#photoBtn").val("更换图片");
-     		            	 
+
      		            	 $dom.find("#inputImage").val("");
      		            	$("#imgCutConfirm").attr("disabled",false);
      		            	var typeImg = "image/" + '';
@@ -175,7 +175,7 @@ window.onload = function () {
      					$("#imgCutConfirm").attr("disabled",false);
      				}
      			});
-            }else if(($("#state").val()==2 || $("#state").val()==5) && $("#content").val()==1 ){//图文
+            }else if(($("#state").val()==2 || $("#state").val()==5 || $("#state").val()==6) && $("#content").val()==1 ){//图文
             	 $("#graphic #showImg").attr("src", fileImg);
                  //控制图片大小不大于1M
                  // if ((upload(fileImg, typeImg || "image/png").get("pictures")).size < 1024 * 1024) {
@@ -188,7 +188,7 @@ window.onload = function () {
                  //   console.log('图片大于1M')
                  //   layer.alert('图片大小须在1M以内!');
                  // }
-            }else if(($("#state").val()==2 || $("#state").val()==5) && $("#content").val()==2 ){//跳转链接
+            }else if(($("#state").val()==2 || $("#state").val()==5 || $("#state").val()==6) && $("#content").val()==2 ){//跳转链接
 	           	 $("#link #showImg").attr("src", fileImg);
 	           	 $("#link").find("#showImg").attr("src", fileImg);
 	             //控制图片大小不大于1M
@@ -233,7 +233,7 @@ window.onload = function () {
     inputImage.onchange = function () {
       var files = this.files;
       var file;
-      
+
       if (cropper && files && files.length) {
         file = files[0];
 
@@ -251,4 +251,4 @@ window.onload = function () {
     inputImage.parentNode.className += ' disabled';
   }
 
-};
+};