浏览代码

站内消息提交

Duan_xu 2 年之前
父节点
当前提交
173f4fe2f2
共有 25 个文件被更改,包括 1464 次插入37 次删除
  1. 78 14
      src/main/java/com/caimei/modules/coupon/web/CmCouponController.java
  2. 2 0
      src/main/java/com/caimei/modules/order/dao/NewShopOrderDao.java
  3. 12 4
      src/main/java/com/caimei/modules/order/service/CmReturnedPurchaseService.java
  4. 1 0
      src/main/java/com/caimei/modules/order/service/NewOrderService.java
  5. 262 0
      src/main/java/com/caimei/modules/order/service/WeChatService.java
  6. 2 0
      src/main/java/com/caimei/modules/product/dao/ProductNewDao.java
  7. 27 1
      src/main/java/com/caimei/modules/product/entity/Product.java
  8. 37 0
      src/main/java/com/caimei/modules/product/service/ProductNewService.java
  9. 1 1
      src/main/java/com/caimei/modules/product/web/ProductNewController.java
  10. 16 2
      src/main/java/com/caimei/modules/supervip/service/CmSvipGiveService.java
  11. 1 1
      src/main/java/com/caimei/modules/supervip/web/CmSvipGiveController.java
  12. 41 0
      src/main/java/com/caimei/modules/sys/dao/NotificationDao.java
  13. 126 0
      src/main/java/com/caimei/modules/sys/entity/Notification.java
  14. 32 0
      src/main/java/com/caimei/modules/sys/service/NotificationService.java
  15. 487 0
      src/main/java/com/caimei/modules/sys/web/NotificationController.java
  16. 5 0
      src/main/java/com/caimei/modules/user/dao/MessageCenterDao.java
  17. 35 4
      src/main/java/com/caimei/modules/user/web/NewCmShopController.java
  18. 39 3
      src/main/java/com/caimei/modules/user/web/newUser/AgencyController.java
  19. 5 0
      src/main/resources/mappings/modules/order/ShopOrderMapper.xml
  20. 8 0
      src/main/resources/mappings/modules/product/ProductNewMapper.xml
  21. 66 0
      src/main/resources/mappings/modules/sys/Notification.xml
  22. 13 0
      src/main/resources/mappings/modules/user/MessageCenter.xml
  23. 2 2
      src/main/webapp/WEB-INF/views/modules/product-new/productEdit.jsp
  24. 138 0
      src/main/webapp/WEB-INF/views/modules/sys/Notification.jsp
  25. 28 5
      src/main/webapp/WEB-INF/views/modules/sys/sysIndex.jsp

+ 78 - 14
src/main/java/com/caimei/modules/coupon/web/CmCouponController.java

@@ -5,6 +5,9 @@ import com.caimei.modules.coupon.entity.CmCouponAssociate;
 import com.caimei.modules.coupon.entity.CmCouponRedemptionCode;
 import com.caimei.modules.coupon.redis.RedisLearn;
 import com.caimei.modules.coupon.service.CmCouponService;
+import com.caimei.modules.order.dao.NewShopOrderDao;
+import com.caimei.modules.order.service.NewOrderService;
+import com.caimei.modules.order.service.WeChatService;
 import com.caimei.modules.product.entity.Product;
 import com.caimei.modules.product.service.ProductService;
 import com.caimei.modules.user.dao.CmUserDao;
@@ -58,6 +61,12 @@ public class CmCouponController extends BaseController {
     private ProductService productService;
     @Autowired
     private MessageCenterDao messageCenterDao;
+    @Autowired
+    private NewOrderService newOrderService;
+    @Autowired
+    private NewShopOrderDao newShopOrderDao;
+    @Autowired
+    private WeChatService weChatService;
 
     @ModelAttribute
     public CmCoupon get(@RequestParam(required = false) String id) {
@@ -133,14 +142,8 @@ public class CmCouponController extends BaseController {
     }
 
     //优惠券站内消息推送
-    private void consumer(CmCoupon cmCoupon,List<Integer> clubIds) {
-        Jedis jedis = new Jedis("172.31.165.23",6379);
-        if(jedis==null){
-            Jedis jedisno=new Jedis("192.168.2.100", 6379);
-            if(jedisno==null){
-                Jedis jedisto=new Jedis("172.31.165.27",6379);
-            }
-        }
+    private void consumer(CmCoupon cmCoupon,List<Integer> clubIds){
+            Jedis jedis=new Jedis("192.168.2.100", 6379);
         // 消费消息
         while (true) {
             clubIds.forEach(clubIdb -> {
@@ -156,7 +159,7 @@ public class CmCouponController extends BaseController {
                     String catego = "";
                     Integer ts = (date.compareTo(cmCoupon.getStartDate()));
                     if (ts >= 0) {
-                        if ("90".equals(user.getClubStatus())) {
+                        if ("90".equals(user.getClubStatus()) && 0==cmCoupon.getCouponType()) {
                             CmCoupon coupon = messageCenterDao.CouponList(0);//查询优惠券信息
                             if (coupon != null) {
                                 String curDateStr = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(date);
@@ -171,10 +174,21 @@ public class CmCouponController extends BaseController {
                                 messageCenter.setCouponMessageType(1);
                                 messageCenter.setCouponFee(coupon.getCouponAmount().doubleValue());
                                 messageCenterDao.addMessageCenter(messageCenter);
+                                String content = "短信模板:【采美365】采美平台送您"+coupon.getCouponAmount()+"元优惠券,众多大牌正品等着您,快戳采美网站链接www.caimei365.com/M2Tr98CG 或微信搜索“采美采购商城”小程序登录采美平台领取下单吧。关注公众号“采美网”获取更多优惠和精彩资讯。";
+                                boolean sendSms = false;
+                                try {
+                                    sendSms = newOrderService.getSendSms(9, user.getBindMobile(), content);
+                                } catch (Exception e) {
+                                    e.printStackTrace();
+                                }
+                                if(sendSms){
+                                    logger.info(">>>>>>>发送成功");
+                                }
                                 jedis.del(clubIdc);
                                 coumt++;
                             }
-                        } else if ("90".equals(user.getClubStatus()) && coumt == 0) {
+                        }
+                        if ("90".equals(user.getClubStatus()) && coumt == 0 && 1==cmCoupon.getCouponType()) {
                             CmCoupon coupon = messageCenterDao.CouponList(1);//查询优惠券信息
                             if (coupon != null) {
                                 String curDateStr = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(date);
@@ -195,10 +209,22 @@ public class CmCouponController extends BaseController {
                                 messageCenter.setCouponMessageType(1);
                                 messageCenter.setCouponFee(coupon.getCouponAmount().doubleValue());
                                 messageCenterDao.addMessageCenter(messageCenter);
+                                String content = "短信模板:【采美365】采美平台"+catego+"类商品大优惠,采美平台送您"+coupon.getCouponAmount()+"元优惠券,快戳采美网站链接www.caimei365.com/M2Tr98CG 或微信搜索“采美采购商城”小程序登录采美平台领取吧。关注公众号“采美网”获取更多优惠和精彩资讯。";
+                                boolean sendSms = false;
+                                try {
+                                    sendSms = newOrderService.getSendSms(9, user.getBindMobile(), content);
+                                } catch (Exception e) {
+                                    e.printStackTrace();
+                                }
+                                if(sendSms){
+                                    logger.info(">>>>>>>发送成功");
+                                }
+
                                 jedis.del(clubIdc);
                                 coumt++;
                             }
-                        } else if (coumt == 0) {
+                        }
+                        if (coumt == 0 && 2==cmCoupon.getCouponType()) {
                             CmCoupon coupon = messageCenterDao.CouponList(2);//查询优惠券信息
                             if (coupon != null) {
                                 String curDateStr = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(date);
@@ -214,11 +240,24 @@ public class CmCouponController extends BaseController {
                                     messageCenter.setCouponMessageType(1);
                                     messageCenter.setCouponFee(coupon.getCouponAmount().doubleValue());
                                     messageCenterDao.addMessageCenter(messageCenter);
+
+                                    String content = "短信模板:【采美365】为了答谢您对采美平台的支持,采美平台送您"+coupon.getCouponAmount()+"元优惠券,快戳采美网站链接www.caimei365.com/M2Tr98CG 或微信搜索“采美采购商城”小程序登录采美平台领取吧。关注公众号“采美网”获取更多优惠和精彩资讯。";
+                                    boolean sendSms = false;
+                                    try {
+                                        sendSms = newOrderService.getSendSms(9, user.getBindMobile(), content);
+                                    } catch (Exception e) {
+                                        e.printStackTrace();
+                                    }
+                                    if(sendSms){
+                                        logger.info(">>>>>>>发送成功");
+                                    }
+
                                     jedis.del(clubIdc);
                                     coumt++;
                                 }
                             }
-                        } else if ("90".equals(user.getClubStatus()) && coumt == 0) {
+                        }
+                        if ("90".equals(user.getClubStatus()) && coumt == 0 && 3==cmCoupon.getCouponType()) {
                             CmCoupon coupon = messageCenterDao.CouponList(3);//查询优惠券信息
                             if (coupon != null) {
                                 String curDateStr = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(date);
@@ -233,10 +272,23 @@ public class CmCouponController extends BaseController {
                                 messageCenter.setCouponMessageType(1);
                                 messageCenter.setCouponFee(coupon.getCouponAmount().doubleValue());
                                 messageCenterDao.addMessageCenter(messageCenter);
+
+                                String content = "短信模板:【采美365】采美平台为了回馈客户,赠送您"+coupon.getCouponAmount()+"元的店铺专属优惠券,快戳采美网站链接www.caimei365.com/M2Tr98CG 或微信搜索“采美采购商城”小程序登录采美平台领取吧。关注公众号“采美网”获取更多优惠和精彩资讯。";
+                                boolean sendSms = false;
+                                try {
+                                    sendSms = newOrderService.getSendSms(9, user.getBindMobile(), content);
+                                } catch (Exception e) {
+                                    e.printStackTrace();
+                                }
+                                if(sendSms){
+                                    logger.info(">>>>>>>发送成功");
+                                }
+
                                 jedis.del(clubIdc);
                                 coumt++;
                             }
-                        } else if (coumt == 0) {
+                        }
+                        if (coumt == 0 && 4==cmCoupon.getCouponType()) {
                             CmCoupon coupon = messageCenterDao.CouponList(4);//查询优惠券信息
                             if (coupon != null) {
                                 String startDate = sdf.format(coupon.getStartDate());
@@ -255,6 +307,18 @@ public class CmCouponController extends BaseController {
                                         messageCenter.setCouponMessageType(1);
                                         messageCenter.setCouponFee(coupon.getCouponAmount().doubleValue());
                                         messageCenterDao.addMessageCenter(messageCenter);
+
+                                        String content = "短信模板:【采美365】恭喜成功注册采美平台。采美平台赠送您"+coupon.getCouponAmount()+"元新用户优惠券,快戳采美网站链接www.caimei365.com/M2Tr98CG 或微信搜索“采美采购商城”小程序登录采美平台领取吧。关注公众号“采美网”获取更多优惠和精彩资讯。";
+                                        boolean sendSms = false;
+                                        try {
+                                            sendSms = newOrderService.getSendSms(9, user.getBindMobile(), content);
+                                        } catch (Exception e) {
+                                            e.printStackTrace();
+                                        }
+                                        if(sendSms){
+                                            logger.info(">>>>>>>发送成功");
+                                        }
+
                                         jedis.del(clubIdc);
                                         coumt++;
                                     }
@@ -275,7 +339,7 @@ public class CmCouponController extends BaseController {
         }
         List<Integer> clubIds = messageCenterDao.ClubIds();
         new Thread(() -> consumer(cmCoupon,clubIds)).start();
-       // 生产者
+
         RedisLearn.producer(clubIds);
 
 

+ 2 - 0
src/main/java/com/caimei/modules/order/dao/NewShopOrderDao.java

@@ -30,6 +30,8 @@ public interface NewShopOrderDao extends CrudDao<NewShopOrder> {
 
     String FromUnionId(Integer orderId);
 
+    String UnionId(Integer userID);
+
     int updateByShopOrderNo(NewShopOrder newShopOrder);
 
     int updateStatusByOrderID(@Param("orderID") Integer orderID, @Param("status") Integer status);

+ 12 - 4
src/main/java/com/caimei/modules/order/service/CmReturnedPurchaseService.java

@@ -712,9 +712,13 @@ public class CmReturnedPurchaseService extends CrudService<CmReturnedPurchaseDao
                         messageCenter.setTime(curDateStr);
                         messageCenterDao.addMessageCenter(messageCenter);
                         //部分退
+                        String name=newOrder.getProductName();
+                        if (name.length() > 10) {
+                            name = org.apache.commons.lang3.StringUtils.strip(name.substring(0, 11));
+                            name += "...";
+                        }
                         String shortLink = newOrderService.getShortLink(8, 9, wwwServer + "user/order/detail.html?orderId=" + newOrder.getOrderID());
-                        String content = "订单(订单编号:" + newOrder.getOrderNo() + ")已部分退款成功,本次退款金额¥" + returnedPurchase.getRefundFee() + "。您可关注采美公众号或者访问采美微信小程序和网站查看订单。" +
-                                "平台公众号:微信搜索“采美365网”; 微信小程序:微信搜索“采美采购商城”;网址:www.caimei365.com/t/" + shortLink;
+                        String content = "【采美365】订单("+name+"等"+productCount+"件商品)已全部退款成功,退款金额¥"+returnedPurchase.getRefundFee()+"。您可点击采美网址www.caimei.com 或使用微信小程序“采美采购商城”查看订单。";
                         sendSms = newOrderService.getSendSms(9, user.getBindMobile(), content);
                     } else if ("2".equals(newOrder.getRefundType())) {
 
@@ -733,9 +737,13 @@ public class CmReturnedPurchaseService extends CrudService<CmReturnedPurchaseDao
                         messageCenter.setTime(curDateStr);
                         messageCenterDao.addMessageCenter(messageCenter);
                         //全部退
+                        String name=newOrder.getProductName();
+                        if (name.length() > 10) {
+                            name = org.apache.commons.lang3.StringUtils.strip(name.substring(0, 11));
+                            name += "...";
+                        }
                         String shortLink = newOrderService.getShortLink(8, 10, wwwServer + "user/order/detail.html?orderId=" + newOrder.getOrderID());
-                        String content = "订单(订单编号:" + newOrder.getOrderNo() + ")已全部退款成功,退款金额¥" + returnedPurchase.getRefundFee() + "。您可关注采美公众号或者访问采美微信小程序和网站查看订单。" +
-                                "平台公众号:微信搜索“采美365网”; 微信小程序:微信搜索“采美采购商城”;网址:www.caimei365.com/t/" + shortLink;
+                        String content = "【采美365】订单("+name+"等"+productCount+"件商品)已全部退款成功,退款金额¥"+returnedPurchase.getRefundFee()+"。您可点击采美网址www.caimei.com 或使用微信小程序“采美采购商城”查看订单。";
                         sendSms = newOrderService.getSendSms(10, user.getBindMobile(), content);
                     }
                     if (!sendSms) {

+ 1 - 0
src/main/java/com/caimei/modules/order/service/NewOrderService.java

@@ -926,6 +926,7 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
         list.add("15814011616");
         list.add("13100721916");
         list.add("15113936829");
+        list.add("18175515644");
         if (config.equals("product") || list.contains(mobile)) {
             if (StringUtils.isNotBlank(mobile) && mobile.length() == 11) {
                 String regex = "^(1[3-9]\\d{9}$)";

+ 262 - 0
src/main/java/com/caimei/modules/order/service/WeChatService.java

@@ -95,4 +95,266 @@ public class WeChatService {
             logger.info(">>>>>>>>>推送微信模板消息失败:",e);
         }
     }
+
+    /**
+     * 资质机构认证成功消息推送
+     * @param accessToken
+     * @param openid
+     * @param pagePath 跳转链接
+     */
+    public void sendTemplateMsg(String accessToken, String openid ,String auditTime, String pagePath) {
+        JSONObject first = new JSONObject();
+        first.put("value", "认证成功通知");
+        JSONObject keyword1 = new JSONObject();
+        keyword1.put("value", "恭喜您成功成为采美资质机构");
+        JSONObject keyword2 = new JSONObject();
+        keyword2.put("value", "资质机构");
+        JSONObject keyword3 = new JSONObject();
+        keyword3.put("value", "审核通过");
+        JSONObject keyword4 = new JSONObject();
+        keyword4.put("value", auditTime);
+        JSONObject remark = new JSONObject();
+        remark.put("value", "认证成功后,您将享受到更多的优惠机会。");
+
+        JSONObject data = new JSONObject();
+        data.put("first", first);
+        data.put("keyword1", keyword1);
+        data.put("keyword2", keyword2);
+        data.put("keyword3", keyword3);
+        data.put("keyword4", keyword4);
+        data.put("remark", remark);
+
+        JSONObject miniProgram = new JSONObject();
+        miniProgram.put("appid", "wxf3cd4ae0cdd11c36");
+        miniProgram.put("pagepath", pagePath);
+
+        JSONObject json = new JSONObject();
+        json.put("touser", openid);
+        json.put("template_id", "kfzhVTJ6sNOJSgwk8x7Z9_m8S2LRzDfAGtiUgGyO8Zk");
+        json.put("url", "https://www.caimei365.com/");
+        json.put("miniprogram", miniProgram);
+        json.put("data", data);
+        // json 字符串
+        String jsonString = json.toJSONString();
+        logger.info(">>>>>>>>推送微信模板消息:" + jsonString);
+        try {
+            String requestUrl = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="+accessToken;
+            // 发送请求
+            String result = RequestUtil.httpRequest(requestUrl, "POST", jsonString);
+            logger.info(">>>>>>>>推送结果:" + result);
+        } catch (Exception e) {
+            logger.info(">>>>>>>>>推送微信模板消息失败:",e);
+        }
+    }
+
+    /**
+     * 资质机构认证失败消息推送
+     * @param accessToken
+     * @param openid
+     * @param pagePath 跳转链接
+     */
+    public void sendTemplateMessg(String accessToken, String openid, String auditResult,String auditTime, String pagePath) {
+        JSONObject first = new JSONObject();
+        first.put("value", "认证失败通知");
+        JSONObject keyword1 = new JSONObject();
+        keyword1.put("value", "您升级采美资质机构认证失败");
+        JSONObject keyword2 = new JSONObject();
+        keyword2.put("value", "资质机构");
+        JSONObject keyword3 = new JSONObject();
+        keyword3.put("value", "审核未通过");
+        JSONObject keyword4 = new JSONObject();
+        keyword4.put("value", auditTime);
+        JSONObject keyword5 = new JSONObject();
+        keyword5.put("value", auditResult);
+        JSONObject remark = new JSONObject();
+        remark.put("value", " ");
+
+        JSONObject data = new JSONObject();
+        data.put("first", first);
+        data.put("keyword1", keyword1);
+        data.put("keyword2", keyword2);
+        data.put("keyword3", keyword3);
+        data.put("keyword4", keyword4);
+        data.put("keyword5", keyword5);
+        data.put("remark", remark);
+
+        JSONObject miniProgram = new JSONObject();
+        miniProgram.put("appid", "wxf3cd4ae0cdd11c36");
+        miniProgram.put("pagepath", pagePath);
+
+        JSONObject json = new JSONObject();
+        json.put("touser", openid);
+        json.put("template_id", "btBvh1LIzTPMIpZNPNIupQnMcMw8_ziyQ6CGV68eN7s");
+        json.put("url", "https://www.caimei365.com/");
+        json.put("miniprogram", miniProgram);
+        json.put("data", data);
+        // json 字符串
+        String jsonString = json.toJSONString();
+        logger.info(">>>>>>>>推送微信模板消息:" + jsonString);
+        try {
+            String requestUrl = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="+accessToken;
+            // 发送请求
+            String result = RequestUtil.httpRequest(requestUrl, "POST", jsonString);
+            logger.info(">>>>>>>>推送结果:" + result);
+        } catch (Exception e) {
+            logger.info(">>>>>>>>>推送微信模板消息失败:",e);
+        }
+    }
+
+    /**
+     * 供应商审核失败消息推送
+     * @param accessToken
+     * @param openid
+     * @param pagePath 跳转链接
+     */
+    public void sendTemplate(String accessToken, String openid,String shopName,String auditNote,String auditTime, String pagePath) {
+        JSONObject first = new JSONObject();
+        first.put("value", "审核失败通知");
+        JSONObject keyword1 = new JSONObject();
+        keyword1.put("value", "您提交的供应商账号注册申请审核失败。");
+        JSONObject keyword2 = new JSONObject();
+        keyword2.put("value", shopName);
+        JSONObject keyword3 = new JSONObject();
+        keyword3.put("value", "账号注册");
+        JSONObject keyword4 = new JSONObject();
+        keyword4.put("value", auditNote);
+        JSONObject keyword5 = new JSONObject();
+        keyword5.put("value", auditTime);
+        JSONObject remark = new JSONObject();
+        remark.put("value", "请修改重新提交审核。");
+
+        JSONObject data = new JSONObject();
+        data.put("first", first);
+        data.put("keyword1", keyword1);
+        data.put("keyword2", keyword2);
+        data.put("keyword3", keyword3);
+        data.put("keyword4", keyword4);
+        data.put("keyword5", keyword5);
+        data.put("remark", remark);
+
+        JSONObject miniProgram = new JSONObject();
+        miniProgram.put("appid", "wxf3cd4ae0cdd11c36");
+        miniProgram.put("pagepath", pagePath);
+
+        JSONObject json = new JSONObject();
+        json.put("touser", openid);
+        json.put("template_id", "ph3XjF5o2QPuANQW2XlO7PRYU7Y9t-3fAX5TSqwTftk");
+        json.put("url", "https://www.caimei365.com/");
+        json.put("miniprogram", miniProgram);
+        json.put("data", data);
+        // json 字符串
+        String jsonString = json.toJSONString();
+        logger.info(">>>>>>>>推送微信模板消息:" + jsonString);
+        try {
+            String requestUrl = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="+accessToken;
+            // 发送请求
+            String result = RequestUtil.httpRequest(requestUrl, "POST", jsonString);
+            logger.info(">>>>>>>>推送结果:" + result);
+        } catch (Exception e) {
+            logger.info(">>>>>>>>>推送微信模板消息失败:",e);
+        }
+    }
+
+    /**
+     * 商品审核未通过消息推送
+     * @param accessToken
+     * @param openid
+     * @param pagePath 跳转链接
+     */
+    public void sendTemp(String accessToken, String openid,String name,String auditTime, String pagePath) {
+        JSONObject first = new JSONObject();
+        first.put("value", "商品审核未通过通知");
+        JSONObject keyword1 = new JSONObject();
+        keyword1.put("value", "抱歉,您发布的商品未通过审核");
+        JSONObject keyword2 = new JSONObject();
+        keyword2.put("value", "审核未通过");
+        JSONObject keyword3 = new JSONObject();
+        keyword3.put("value", auditTime);
+        JSONObject keyword4 = new JSONObject();
+        keyword4.put("value", name);
+
+        JSONObject data = new JSONObject();
+        data.put("first", first);
+        data.put("keyword1", keyword1);
+        data.put("keyword2", keyword2);
+        data.put("keyword3", keyword3);
+        data.put("keyword4", keyword4);
+
+        JSONObject miniProgram = new JSONObject();
+        miniProgram.put("appid", "wxf3cd4ae0cdd11c36");
+        miniProgram.put("pagepath", pagePath);
+
+        JSONObject json = new JSONObject();
+        json.put("touser", openid);
+        json.put("template_id", "oGiOHlJgx0L8rWmq6wqXHUIZjIzuPkiRu2xbqTE26Tg");
+        json.put("url", "https://www.caimei365.com/");
+        json.put("miniprogram", miniProgram);
+        json.put("data", data);
+        // json 字符串
+        String jsonString = json.toJSONString();
+        logger.info(">>>>>>>>推送微信模板消息:" + jsonString);
+        try {
+            String requestUrl = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="+accessToken;
+            // 发送请求
+            String result = RequestUtil.httpRequest(requestUrl, "POST", jsonString);
+            logger.info(">>>>>>>>推送结果:" + result);
+        } catch (Exception e) {
+            logger.info(">>>>>>>>>推送微信模板消息失败:",e);
+        }
+    }
+
+    /**
+     * 商品审核未通过消息推送
+     * @param accessToken
+     * @param openid
+     * @param pagePath 跳转链接
+     */
+    public void messteme(String accessToken, String openid,String name,String qualificationNo,String auditTime,String proName, String pagePath) {
+        JSONObject first = new JSONObject();
+        first.put("value", "证书到期提醒");
+        JSONObject keyword1 = new JSONObject();
+        keyword1.put("value", "您好,您有商品资质证书即将到期。");
+        JSONObject keyword2 = new JSONObject();
+        keyword2.put("value", name);
+        JSONObject keyword3 = new JSONObject();
+        keyword3.put("value", "医疗器械注册证");
+        JSONObject keyword4 = new JSONObject();
+        keyword4.put("value", qualificationNo);
+        JSONObject keyword5 = new JSONObject();
+        keyword4.put("value", auditTime);
+        JSONObject keyword6 = new JSONObject();
+        keyword4.put("value", proName);
+
+        JSONObject data = new JSONObject();
+        data.put("first", first);
+        data.put("keyword1", keyword1);
+        data.put("keyword2", keyword2);
+        data.put("keyword3", keyword3);
+        data.put("keyword4", keyword4);
+        data.put("keyword5", keyword5);
+        data.put("keyword6", keyword6);
+
+        JSONObject miniProgram = new JSONObject();
+        miniProgram.put("appid", "wxf3cd4ae0cdd11c36");
+        miniProgram.put("pagepath", pagePath);
+
+        JSONObject json = new JSONObject();
+        json.put("touser", openid);
+        json.put("template_id", "gpD9TqBpkgaw3YSM_JPk4WSTwKZY0hxrBCH0SjzNKY4");
+        json.put("url", "https://www.caimei365.com/");
+        json.put("miniprogram", miniProgram);
+        json.put("data", data);
+        // json 字符串
+        String jsonString = json.toJSONString();
+        logger.info(">>>>>>>>推送微信模板消息:" + jsonString);
+        try {
+            String requestUrl = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="+accessToken;
+            // 发送请求
+            String result = RequestUtil.httpRequest(requestUrl, "POST", jsonString);
+            logger.info(">>>>>>>>推送结果:" + result);
+        } catch (Exception e) {
+            logger.info(">>>>>>>>>推送微信模板消息失败:",e);
+        }
+    }
+
 }

+ 2 - 0
src/main/java/com/caimei/modules/product/dao/ProductNewDao.java

@@ -69,4 +69,6 @@ public interface ProductNewDao extends CrudDao<Product> {
     List<SplitCode> findSecondSplitCode(String id);
 
     void addProductData(@Param("productId") Integer productId,@Param("costPrice") String costPrice,@Param("costProportional") String costProportional,@Param("taxPoint") String taxPoint,@Param("supplierTaxPoint") String supplierTaxPoint);
+
+    Product validIList(Integer productID);
 }

+ 27 - 1
src/main/java/com/caimei/modules/product/entity/Product.java

@@ -135,12 +135,14 @@ public class Product extends DataEntity<Product> {
     private Integer svipFlag;    //超级会员商品标识:1是,2不是
     private Integer publishIdentity; //发布者身份 1,个人,2.公司
     private String companyName; //公司名称
+    private String mobile;//联系方式主要用与信息推送
+    private Integer userId;//用户id主要用与信息推送
     private String image1;
     private String image2;
     private String image3;
     private String image4;
     private String image5;
-
+    private String receiptID;//上架费关联id
     //以下参数是搜索回显参数
     private String searchName;
     private String searchShopName;
@@ -1648,4 +1650,28 @@ public class Product extends DataEntity<Product> {
     public void setSearchType(Integer searchType) {
         this.searchType = searchType;
     }
+
+    public String getMobile() {
+        return mobile;
+    }
+
+    public void setMobile(String mobile) {
+        this.mobile = mobile;
+    }
+
+    public Integer getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Integer userId) {
+        this.userId = userId;
+    }
+
+    public String getReceiptID() {
+        return receiptID;
+    }
+
+    public void setReceiptID(String receiptID) {
+        this.receiptID = receiptID;
+    }
 }

+ 37 - 0
src/main/java/com/caimei/modules/product/service/ProductNewService.java

@@ -11,6 +11,9 @@ import com.caimei.modules.hehe.entity.CmHeheProduct;
 import com.caimei.modules.newhome.dao.NewPageFloorDao;
 import com.caimei.modules.newhome.entity.NewPageFloorImage;
 import com.caimei.modules.opensearch.GenerateUtils;
+import com.caimei.modules.order.dao.NewShopOrderDao;
+import com.caimei.modules.order.service.NewOrderService;
+import com.caimei.modules.order.service.WeChatService;
 import com.caimei.modules.product.dao.CmPromotionDao;
 import com.caimei.modules.product.dao.ProductDao;
 import com.caimei.modules.product.dao.ProductNewDao;
@@ -71,6 +74,12 @@ public class ProductNewService extends CrudService<ProductNewDao, Product> {
     private NewPageFloorDao newPageFloorDao;
     @Autowired
     private ProductService productService;
+    @Autowired
+    private NewOrderService newOrderService;
+    @Autowired
+    private NewShopOrderDao newShopOrderDao;
+    @Autowired
+    private WeChatService weChatService;
     @Value("${wwwServer}")
     private String domain;
     @Override
@@ -223,6 +232,34 @@ public class ProductNewService extends CrudService<ProductNewDao, Product> {
         SimpleDateFormat formatters = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         String createDates = formatters.format(new Date());
         product.setNewshowTime(createDates);
+        Product pro=new Product();
+        pro=productNewDao.validIList(productID);
+        if("8".equals(validFlag)){
+            if("1".equals(pro.getValidFlag())){
+                String content = "【采美365】您有商品未通过审核,暂时不能上架采美商城。请登录采美平台修改商品信息后重新发布。";
+               boolean sendSms = newOrderService.getSendSms(9, pro.getMobile(), content);
+               if(sendSms){
+                   logger.info(">>>>>>>发送成功");
+               }
+            }
+            try {
+                logger.info("********供应商审核失败微信公众号推送********");
+                String unionid = newShopOrderDao.UnionId(pro.getUserId());
+                List<String> openidList = newShopOrderDao.getOpenidListByPermission(unionid);
+                logger.info("userid>>>>>>>>>>>>>>>" + pro.getUserId() + "unionid》》》》》》》》》》" + unionid + "openid》》》》》》》》》" + openidList);
+                String accessToken = weChatService.getAccessToken();
+                Date date=new Date();
+                String auditTime = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(date);
+
+                String pagePath = "https://www.caimei365.com/";
+                for (String openid : openidList) {
+                    weChatService.sendTemp(accessToken, openid,pro.getName(),auditTime, pagePath);
+                }
+            } catch (Exception e) {
+                logger.error("【供应商审核失败通知】获取微信公众号access_token异常!", e);
+            }
+        }
+
 
         NewPageFloorImage floorImage=new NewPageFloorImage();
         floorImage.setFloorId(productNewDao.newFloorId());

+ 1 - 1
src/main/java/com/caimei/modules/product/web/ProductNewController.java

@@ -455,7 +455,7 @@ public class ProductNewController extends BaseController {
     public String productSave(Product product, ProductDetailInfo productDetailInfo, RedirectAttributes redirectAttributes) {
 
        if("2".equals(product.getProductType())){
-           product.setVisibility("4");
+           product.setVisibility("3");
            product.setPriceFlag("3");
        }
         // 组合搜索关键词

+ 16 - 2
src/main/java/com/caimei/modules/supervip/service/CmSvipGiveService.java

@@ -1,13 +1,16 @@
 package com.caimei.modules.supervip.service;
 
+import com.caimei.modules.order.service.NewOrderService;
 import com.caimei.modules.supervip.dao.CmSvipHistoryDao;
 import com.caimei.modules.supervip.entity.CmSvipGive;
 import com.caimei.modules.supervip.entity.CmSvipHistory;
+import com.caimei.modules.user.dao.MessageCenterDao;
 import com.thinkgem.jeesite.common.service.CrudService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import javax.annotation.Resource;
 import java.util.Calendar;
 import java.util.Date;
 
@@ -17,9 +20,12 @@ public class CmSvipGiveService extends CrudService<CmSvipHistoryDao, CmSvipHisto
 
     @Autowired
     private CmSvipHistoryDao svipDao;
-
+    @Autowired
+    private MessageCenterDao messageCenterDao;
+    @Resource
+    private NewOrderService newOrderService;
     @Transactional(readOnly = false)
-    public void saveGive(CmSvipGive cmSvipGive) {
+    public void saveGive(CmSvipGive cmSvipGive) throws Exception {
         //cm_svip_user加用户,cm_svip_history插入一条记录
         CmSvipHistory cmSvipHistory = new CmSvipHistory();
         Date now = new Date();
@@ -34,6 +40,14 @@ public class CmSvipGiveService extends CrudService<CmSvipHistoryDao, CmSvipHisto
         cmSvipHistory.setPayWay("5");
         cmSvipHistory.setPayTime(now);
         CmSvipHistory user = svipDao.findVipUser(cmSvipGive.getUserId());
+
+       String bindMobile= messageCenterDao.contractMobile(cmSvipGive.getUserId());
+
+        String content = "【采美365】您已获得采美平台赠送的"+cmSvipHistory.getGiveMonth()+"个月超级会员服务,快戳采美网站链接www.caimei365.com/M2Tr98CG 或微信搜索“采美采购商城”小程序登录采美平台畅享会员特权吧。关注公众号“采美网”可获取更多优惠和精彩资讯。";
+       boolean sendSms = newOrderService.getSendSms(9, bindMobile, content);
+      if(sendSms){
+          logger.info(">>>>>>>获得采美平台赠送的超级会员短信推送成功");
+      }
         if (null != user) {
             //不为空update
             CmSvipHistory endTimeFlag = svipDao.findEndTime(Long.valueOf(cmSvipGive.getUserId()));

+ 1 - 1
src/main/java/com/caimei/modules/supervip/web/CmSvipGiveController.java

@@ -35,7 +35,7 @@ public class CmSvipGiveController extends BaseController {
     }
 
     @RequestMapping(value = "save")
-    public String save(CmSvipGive cmSvipGive, HttpServletRequest request, HttpServletResponse response, Model model) {
+    public String save(CmSvipGive cmSvipGive, HttpServletRequest request, HttpServletResponse response, Model model)throws Exception {
         if (StringUtils.isBlank(cmSvipGive.getUserId()) || null == cmSvipGive.getMonth()) {
             model.addAttribute("message", "参数错误或缺少参数");
             return "modules/super/cmSvipGiveForm";

+ 41 - 0
src/main/java/com/caimei/modules/sys/dao/NotificationDao.java

@@ -0,0 +1,41 @@
+package com.caimei.modules.sys.dao;
+
+import com.caimei.modules.product.entity.Product;
+import com.caimei.modules.sys.entity.Notification;
+import com.thinkgem.jeesite.common.persistence.CrudDao;
+import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2022/7/20
+ */
+@MyBatisDao
+public interface NotificationDao extends CrudDao<Notification> {
+
+    //查询几月后过期
+    List<Product> productTypeCount(Integer yat);
+    //查询几日后过期
+    List<Product> productTypeCount1(Integer yat);
+   //查询上架费几月后过期
+    List<Product> productTypeCount2(Integer yat);
+    //查询上架费几日后过期
+    List<Product> productTypeCount3(Integer yat);
+
+    List<Notification>notification(Notification notification);
+
+    String notificationId(Notification notification);
+
+    void Upnotification(Notification notification);
+
+    void hide(@Param("hide")Integer hide, @Param("Id") Integer Id);
+
+    void addNotification(Notification notification);
+
+    Integer count();
+
+}

+ 126 - 0
src/main/java/com/caimei/modules/sys/entity/Notification.java

@@ -0,0 +1,126 @@
+package com.caimei.modules.sys.entity;
+
+import com.thinkgem.jeesite.common.persistence.DataEntity;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2022/7/20
+ */
+public class Notification extends DataEntity<Notification> {
+
+    private String Id;
+
+    private String theme;
+
+    private String newTime;
+
+    private String shopContent;
+
+    private String porductID;
+
+    private String shopID;
+
+    private String[] contents;
+
+    private String[] porductIDs;
+
+    private String[] shopIDs;
+
+    private Integer hide;
+
+    public Integer getHide() {
+        return hide;
+    }
+
+    public void setHide(Integer hide) {
+        this.hide = hide;
+    }
+
+    public String getShopID() {
+        return shopID;
+    }
+
+    public void setShopID(String shopID) {
+        this.shopID = shopID;
+    }
+
+    public String[] getShopIDs() {
+        return shopIDs;
+    }
+
+    public void setShopIDs(String[] shopIDs) {
+        this.shopIDs = shopIDs;
+    }
+
+    public String[] getPorductIDs() {
+        return porductIDs;
+    }
+
+    public void setPorductIDs(String[] porductIDs) {
+        this.porductIDs = porductIDs;
+    }
+
+    public String getPorductID() {
+        return porductID;
+    }
+
+    public void setPorductID(String porductID) {
+        this.porductID = porductID;
+    }
+
+    public String getShopContent() {
+        return shopContent;
+    }
+
+    @Override
+    public String getId() {
+        return Id;
+    }
+
+    @Override
+    public void setId(String id) {
+        Id = id;
+    }
+
+    public void setShopContent(String shopContent) {
+        this.shopContent = shopContent;
+    }
+
+    public Integer getSaved() {
+        return saved;
+    }
+
+    public void setSaved(Integer saved) {
+        this.saved = saved;
+    }
+
+    private Integer saved;
+
+
+
+    public String getTheme() {
+        return theme;
+    }
+
+    public void setTheme(String theme) {
+        this.theme = theme;
+    }
+
+    public String getNewTime() {
+        return newTime;
+    }
+
+    public void setNewTime(String newTime) {
+        this.newTime = newTime;
+    }
+
+    public String[] getContents() {
+        return contents;
+    }
+
+    public void setContents(String[] contents) {
+        this.contents = contents;
+    }
+}

+ 32 - 0
src/main/java/com/caimei/modules/sys/service/NotificationService.java

@@ -0,0 +1,32 @@
+package com.caimei.modules.sys.service;
+
+import com.caimei.modules.sys.dao.NotificationDao;
+import com.caimei.modules.sys.entity.Notification;
+import com.thinkgem.jeesite.common.persistence.Page;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2022/7/20
+ */
+@Service
+@Transactional(readOnly = true)
+public class NotificationService {
+
+    @Autowired
+    NotificationDao notificationDao;
+
+    public Page<Notification> notificationPagen(Page<Notification> page, Notification notification) {
+        notification.setPage(page);
+       List<Notification> list= notificationDao.notification(notification);
+        page.setList(list);
+        return page;
+    }
+
+}

+ 487 - 0
src/main/java/com/caimei/modules/sys/web/NotificationController.java

@@ -0,0 +1,487 @@
+package com.caimei.modules.sys.web;
+
+import com.caimei.modules.basesetting.entity.Province;
+import com.caimei.modules.order.dao.NewShopOrderDao;
+import com.caimei.modules.order.entity.NewShopOrder;
+import com.caimei.modules.order.service.NewOrderService;
+import com.caimei.modules.order.service.WeChatService;
+import com.caimei.modules.product.entity.Product;
+import com.caimei.modules.sys.dao.NotificationDao;
+import com.caimei.modules.sys.entity.Notification;
+import com.caimei.modules.sys.service.NotificationService;
+import com.caimei.modules.user.dao.MessageCenterDao;
+import com.caimei.modules.user.entity.MessageCenter;
+import com.caimei.utils.StringUtils;
+import com.thinkgem.jeesite.common.config.Global;
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.web.BaseController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+import redis.clients.jedis.Jedis;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.ws.soap.Addressing;
+import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2022/7/20
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/sys/Notification")
+public class NotificationController extends BaseController {
+
+    @Autowired
+    NotificationDao notificationDao;
+    @Autowired
+    NotificationService notificationService;
+    @Autowired
+    MessageCenterDao messageCenterDao;
+    @Autowired
+    NewOrderService newOrderService;
+    @Autowired
+    NewShopOrderDao newShopOrderDao;
+    @Autowired
+    WeChatService weChatService;
+    @Value("${wwwServer}")
+    private String domain;
+    @RequestMapping(value = {"list", ""})
+    public String list( Notification notifi,HttpServletRequest request, HttpServletResponse response, Model model) {
+
+
+        //械字号资质证书3个月后过期
+        Integer count=0;
+        String name="";
+        String productID="";
+        String shopID="";
+        Date date=new Date();
+        String curDateStr = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(date);
+        //资质证书
+       List<Product>pro=notificationDao.productTypeCount(3);
+        List<Product>pro1=notificationDao.productTypeCount(1);
+        List<Product>pro2=notificationDao.productTypeCount1(7);
+        List<Product>pro3=notificationDao.productTypeCount1(1);
+        //上架费
+        List<Product>product=notificationDao.productTypeCount2(3);
+        List<Product>product1=notificationDao.productTypeCount2(1);
+        List<Product>product2=notificationDao.productTypeCount3(7);
+        List<Product>product3=notificationDao.productTypeCount3(1);
+//
+        Jedis jedis=null;
+        String constraint="";
+        if(domain.contains("-b")){
+             jedis=new Jedis("172.31.165.27", 6379);
+             jedis.auth("6#xsI%b4o@5c3RoE");
+        }else if(domain.contains("localhost")){
+             jedis=new Jedis("192.168.2.100", 6379);
+        }else {
+
+            jedis=new Jedis("172.31.165.23", 6379);
+        }
+
+        if(!"1".equals(jedis.rpop("constraint"))){
+            jedis.lpush("constraint","0");
+
+        }
+        constraint=jedis.rpop("constraint");
+        System.out.println(jedis.rpop("constraint"));
+      if("0".equals(constraint)){
+       for (int i=0;i<pro.size();i++){
+
+           MessageCenter messageCenter = new MessageCenter();
+           messageCenter.setShopId(pro.get(i).getShopID());
+           messageCenter.setClubId(null);
+           messageCenter.setUserType(2);
+           messageCenter.setMessageType(2);
+           messageCenter.setShopMessType(5);
+           messageCenter.setContent("该商品的资质证书将于3个月后失效,请及时登录采美网站上传新证书。");
+           messageCenter.setTime(curDateStr);
+           messageCenterDao.addMessageCenter(messageCenter);
+
+           if(i!=0){
+               name+=",";
+               productID+=",";
+           }
+          name +="("+pro.get(i).getProductID().toString()+")"+pro.get(i).getProductName();
+           productID+=pro.get(i).getProductID().toString();
+    }
+        if(!"".equals(name)){
+            Notification notification=new Notification();
+            notification.setTheme("以下械字号商品的资质证书将于3个月后失效,请及时提醒供应商更换证书。");
+            notification.setShopContent(name);
+            notification.setPorductID(productID);
+            notificationDao.addNotification(notification);
+            name="";
+            productID="";
+        }
+        //械字号资质证书1个月后过期
+        for (int i=0;i<pro1.size();i++){
+
+            MessageCenter messageCenter = new MessageCenter();
+            messageCenter.setShopId(pro1.get(i).getShopID());
+            messageCenter.setClubId(null);
+            messageCenter.setUserType(2);
+            messageCenter.setMessageType(2);
+            messageCenter.setShopMessType(5);
+            messageCenter.setContent("该商品的资质证书将于1个月后失效,请及时登录采美网站上传新证书。");
+            messageCenter.setTime(curDateStr);
+            messageCenterDao.addMessageCenter(messageCenter);
+            if(i!=0){
+                name+=",";
+                productID+=",";
+            }
+            name +="("+pro1.get(i).getProductID().toString()+")"+pro.get(i).getProductName();
+            productID+=pro1.get(i).getProductID().toString();
+        }
+        if(!"".equals(name)){
+            Notification notification=new Notification();
+            notification.setTheme("以下械字号商品的资质证书将于1个月后失效,请及时提醒供应商更换证书。");
+            notification.setShopContent(name);
+            notification.setPorductID(productID);
+            notificationDao.addNotification(notification);
+            name="";
+            productID="";
+        }
+//械字号资质证书7日后过期
+        for (int i=0;i<pro2.size();i++){
+
+            MessageCenter messageCenter = new MessageCenter();
+            messageCenter.setShopId(pro2.get(i).getShopID());
+            messageCenter.setClubId(null);
+            messageCenter.setUserType(2);
+            messageCenter.setMessageType(2);
+            messageCenter.setShopMessType(5);
+            messageCenter.setContent("该商品的资质证书将于7天后失效,请及时登录采美网站上传新证书。");
+            messageCenter.setTime(curDateStr);
+            messageCenterDao.addMessageCenter(messageCenter);
+            if(i!=0){
+                name+=",";
+                productID+=",";
+            }
+            name +="("+pro2.get(i).getProductID().toString()+")"+pro.get(i).getProductName();
+            productID+=pro2.get(i).getProductID().toString();
+        }
+        if(!"".equals(name)){
+            Notification notification=new Notification();
+            notification.setTheme("以下械字号商品的资质证书将于7天后失效,请及时提醒供应商更换证书。");
+            notification.setShopContent(name);
+            notification.setPorductID(productID);
+            notificationDao.addNotification(notification);
+            name="";
+            productID="";
+        }
+//械字号资质证书今日后过期
+        for (int i=0;i<pro3.size();i++){
+            MessageCenter messageCenter = new MessageCenter();
+            messageCenter.setShopId(pro3.get(i).getShopID());
+            messageCenter.setClubId(null);
+            messageCenter.setUserType(2);
+            messageCenter.setMessageType(2);
+            messageCenter.setShopMessType(5);
+            messageCenter.setContent("该商品的资质证书将于今天后失效,请及时登录采美网站上传新证书。");
+            messageCenter.setTime(curDateStr);
+            messageCenterDao.addMessageCenter(messageCenter);
+            if(i!=0){
+                name+=",";
+                productID+=",";
+            }
+            name +="("+pro3.get(i).getProductID().toString()+")"+pro.get(i).getProductName();
+            productID+=pro3.get(i).getProductID().toString();
+        }
+        if(!"".equals(name)){
+            Notification notification=new Notification();
+            notification.setTheme("以下械字号商品的资质证书将于今天后失效,请及时提醒供应商更换证书。");
+            notification.setShopContent(name);
+            notification.setPorductID(productID);
+            notificationDao.addNotification(notification);
+            name="";
+            productID="";
+        }
+        //上架费
+        for (int i=0;i<product.size();i++){
+            if(i!=0){
+                name+=",";
+                shopID+=",";
+            }
+            name +=product.get(i).getShopName();
+            shopID+=product.get(i).getShopID();
+        }
+        if(!"".equals(name)){
+            Notification notification=new Notification();
+            notification.setTheme("以下供应商的上架费将于3个月后到期,请及时提醒供应商续费。");
+            notification.setShopContent(name);
+            notification.setShopID(shopID);
+            notificationDao.addNotification(notification);
+            name="";
+            shopID="";
+        }
+        //上架费1个月后过期
+        for (int i=0;i<product1.size();i++){
+            if(i!=0){
+                name+=",";
+                shopID+=",";
+            }
+            name +=product1.get(i).getShopName();
+            shopID+=product1.get(i).getShopID();
+        }
+        if(!"".equals(name)){
+            Notification notification=new Notification();
+            notification.setTheme("以下供应商的上架费将于1个月后到期,请及时提醒供应商续费。");
+            notification.setShopContent(name);
+            notification.setShopID(shopID);
+            notificationDao.addNotification(notification);
+            name="";
+            shopID="";
+        }
+//上架费7日后过期
+        for (int i=0;i<product2.size();i++){
+            if(i!=0){
+                name+=",";
+                shopID+=",";
+            }
+            name +=product2.get(i).getShopName();
+            shopID+=product2.get(i).getShopID();
+        }
+        if(!"".equals(name)){
+            Notification notification=new Notification();
+            notification.setTheme("以下供应商的上架费将于7天后到期,请及时提醒供应商续费。");
+            notification.setShopContent(name);
+            notification.setShopID(shopID);
+            notificationDao.addNotification(notification);
+            name="";
+            shopID="";
+        }
+//上架费今日后过期
+        for (int i=0;i<product3.size();i++){
+            if(i!=0){
+                name+=",";
+                shopID+=",";
+            }
+            name +=product3.get(i).getShopName();
+            shopID+=product3.get(i).getShopID();
+        }
+        if(!"".equals(name)){
+            Notification notification=new Notification();
+            notification.setTheme("以下供应商的上架费将于今天后到期,请及时提醒供应商续费。");
+            notification.setShopContent(name);
+            notification.setShopID(shopID);
+            notificationDao.addNotification(notification);
+            name="";
+            shopID="";
+        }
+      }
+        jedis.lpush("constraint","1");
+      List<String> content=new ArrayList<>();
+        Page<Notification> page = notificationService.notificationPagen(new Page<Notification>(request, response), notifi);
+
+            String[] IdArr=null;
+            String[] porductIDs=null;
+            String[] shopIDs=null;
+             for (int i = 0; i < page.getList().size(); i++) {
+                IdArr =page.getList().get(i).getShopContent().split(",");
+                if(page.getList().get(i).getPorductID()!=null){porductIDs=page.getList().get(i).getPorductID().split(",");}
+                 if(page.getList().get(i).getShopID()!=null){shopIDs=page.getList().get(i).getShopID().split(",");}
+
+                page.getList().get(i).setContents(IdArr);
+                page.getList().get(i).setPorductIDs(porductIDs);
+                 page.getList().get(i).setShopIDs(shopIDs);
+            }
+
+        model.addAttribute("Notification", notifi);
+        model.addAttribute("page", page);
+        return "modules/sys/Notification";
+    }
+
+    /**
+     *constraint加入缓存
+     */
+    @Scheduled(cron = "0 0 23 * * ?")
+    public void Open() {
+//        Jedis jedis=new Jedis("172.31.165.27", 6379);
+//        jedis.auth("6#xsI%b4o@5c3RoE");
+        Jedis jedis=new Jedis("192.168.2.100", 6379);
+        jedis.lpush("constraint","0");
+    }
+
+    @Scheduled(cron = "0 0 11 * * ?")
+    public void mess() throws Exception {
+        Date date=new Date();
+        String name="";
+        Integer count=0;
+        List<Product>pro=notificationDao.productTypeCount(3);
+        List<Product>pro1=notificationDao.productTypeCount(1);
+        List<Product>pro2=notificationDao.productTypeCount1(7);
+        List<Product>pro3=notificationDao.productTypeCount1(1);
+        for (int i=0;i<pro.size();i++){
+            name=pro.get(i).getName();
+            if (name.length() > 10) {
+                name = StringUtils.strip(name.substring(0, 11));
+                name += "...";
+            }
+
+            logger.info("**************************质证书失效消息推送************************************");
+                try {
+                    Integer userID = messageCenterDao.userID(pro.get(i).getShopID());
+                    String unionid = newShopOrderDao.UnionId(userID);
+                    List<String> openidList = newShopOrderDao.getOpenidListByPermission(unionid);
+                    String accessToken = weChatService.getAccessToken();
+                    String qualificationNo = pro.get(i).getQualificationNo();
+                    String time = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(date);
+                    String pagePath = "";
+                    for (String openid : openidList) {
+                        weChatService.messteme(accessToken, openid,pro.get(i).getShopName() , qualificationNo, time, name, pagePath);
+                        count++;
+                    }
+                } catch (Exception e) {
+                    logger.error("【质证书失效消息推送】获取微信公众号access_token异常!", e);
+                }
+            if(count<=0) {
+                String bindMobile = messageCenterDao.Mobile(pro.get(i).getShopID());
+                String content = "【采美365】 尊敬的采美供应商用户,您在采美上架的商品“" + name + "”资质证书将于3个月后失效,请及时登录采美网站上传新证书。";
+                boolean sendSms = newOrderService.getSendSms(9, bindMobile, content);
+                if (sendSms) {
+                    logger.info(">>>>>>>资质证书将于3个月后失效短信推送成功");
+                }
+            }
+        }
+
+        for (int i=0;i<pro1.size();i++){
+            name=pro1.get(i).getName();
+            if (name.length() > 10) {
+                name = StringUtils.strip(name.substring(0, 11));
+                name += "...";
+            }
+
+            logger.info("**************************质证书失效消息推送************************************");
+            try {
+                Integer userID = messageCenterDao.userID(pro1.get(i).getShopID());
+                String unionid = newShopOrderDao.UnionId(userID);
+                List<String> openidList = newShopOrderDao.getOpenidListByPermission(unionid);
+                String accessToken = weChatService.getAccessToken();
+                String qualificationNo = pro1.get(i).getQualificationNo();
+                String time = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(date);
+                String pagePath = "";
+                for (String openid : openidList) {
+                    weChatService.messteme(accessToken, openid,pro1.get(i).getShopName() , qualificationNo, time, name, pagePath);
+                    count++;
+                }
+            } catch (Exception e) {
+                logger.error("【质证书失效消息推送】获取微信公众号access_token异常!", e);
+            }
+            if(count<=0) {
+                String bindMobile = messageCenterDao.Mobile(pro1.get(i).getShopID());
+                String content = "【采美365】 尊敬的采美供应商用户,您在采美上架的商品“" + name + "”资质证书将于1个月后失效,请及时登录采美网站上传新证书。";
+                boolean sendSms = newOrderService.getSendSms(9, bindMobile, content);
+                if (sendSms) {
+                    logger.info(">>>>>>>资质证书将于1个月后失效短信推送成功");
+                }
+            }
+        }
+
+        for (int i=0;i<pro2.size();i++){
+            name=pro2.get(i).getName();
+            if (name.length() > 10) {
+                name = StringUtils.strip(name.substring(0, 11));
+                name += "...";
+            }
+
+            logger.info("**************************质证书失效消息推送************************************");
+            try {
+                Integer userID = messageCenterDao.userID(pro2.get(i).getShopID());
+                String unionid = newShopOrderDao.UnionId(userID);
+                List<String> openidList = newShopOrderDao.getOpenidListByPermission(unionid);
+                String accessToken = weChatService.getAccessToken();
+                String qualificationNo = pro2.get(i).getQualificationNo();
+                String time = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(date);
+                String pagePath = "";
+                for (String openid : openidList) {
+                    weChatService.messteme(accessToken, openid,pro2.get(i).getShopName() , qualificationNo, time, name, pagePath);
+                    count++;
+                }
+            } catch (Exception e) {
+                logger.error("【质证书失效消息推送】获取微信公众号access_token异常!", e);
+            }
+            if(count<=0) {
+                String bindMobile = messageCenterDao.Mobile(pro2.get(i).getShopID());
+                String content = "【采美365】 尊敬的采美供应商用户,您在采美上架的商品“" + name + "”资质证书将于7天后失效,请及时登录采美网站上传新证书。";
+                boolean sendSms = newOrderService.getSendSms(9, bindMobile, content);
+                if (sendSms) {
+                    logger.info(">>>>>>>资质证书将于7天后失效短信推送成功");
+                }
+            }
+        }
+
+        for (int i=0;i<pro3.size();i++){
+            name=pro3.get(i).getName();
+            if (name.length() > 10) {
+                name = StringUtils.strip(name.substring(0, 11));
+                name += "...";
+            }
+
+            logger.info("**************************质证书失效消息推送************************************");
+            try {
+                Integer userID = messageCenterDao.userID(pro3.get(i).getShopID());
+                String unionid = newShopOrderDao.UnionId(userID);
+                List<String> openidList = newShopOrderDao.getOpenidListByPermission(unionid);
+                String accessToken = weChatService.getAccessToken();
+                String qualificationNo = pro3.get(i).getQualificationNo();
+                String time = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(date);
+                String pagePath = "";
+                for (String openid : openidList) {
+                    weChatService.messteme(accessToken, openid,pro3.get(i).getShopName() , qualificationNo, time, name, pagePath);
+                    count++;
+                }
+            } catch (Exception e) {
+                logger.error("【质证书失效消息推送】获取微信公众号access_token异常!", e);
+            }
+if(count<=0){
+            String bindMobile= messageCenterDao.Mobile(pro3.get(i).getShopID());
+            String content = "【采美365】 尊敬的采美供应商用户,您在采美上架的商品“"+name+"”资质证书将于今天后失效,请及时登录采美网站上传新证书。";
+            boolean sendSms = newOrderService.getSendSms(9, bindMobile, content);
+            if(sendSms){
+                logger.info(">>>>>>>资质证书将于今天后后失效短信推送成功");
+            }
+        }
+        }
+
+    }
+
+
+    @RequestMapping(value = {"update"})
+    public String update( Notification notification,HttpServletRequest request, HttpServletResponse response, Model model) {
+        notificationDao.Upnotification(notification);
+        return "redirect:"+Global.getAdminPath()+"/sys/Notification/list";
+    }
+
+    @RequestMapping(value = {"Idques"})
+    public String Idques( Notification notification,HttpServletRequest request, HttpServletResponse response, Model model){
+         String c= notificationDao.notificationId(notification);
+
+        model.addAttribute("shopContent", c);
+        return "redirect:"+Global.getAdminPath()+"/sys/Notification/list?shopContent="+c;
+    }
+
+    @RequestMapping(value = {"hide"})
+    public String hide( Notification notification,HttpServletRequest request, HttpServletResponse response, Model model){
+        Integer hide=null;
+        if(notification.getHide() == 0){
+            hide=1;
+        }else{
+            hide=0;
+        }
+        notificationDao.hide(hide,Integer.parseInt(notification.getId()));
+        return "redirect:"+Global.getAdminPath()+"/sys/Notification/list";
+    }
+
+    }

+ 5 - 0
src/main/java/com/caimei/modules/user/dao/MessageCenterDao.java

@@ -35,4 +35,9 @@ public interface MessageCenterDao extends CrudDao<MessageCenter> {
     List<Integer> ClubIds();
 
     CmCoupon CouponList(Integer couponType);
+
+    String contractMobile(String userID);
+    String Mobile(Integer shopID);
+
+    Integer userID(Integer shopID);
 }

+ 35 - 4
src/main/java/com/caimei/modules/user/web/NewCmShopController.java

@@ -2,7 +2,10 @@ package com.caimei.modules.user.web;
 
 import com.caimei.constants.ShopStatus;
 import com.caimei.modules.opensearch.CoreServiceUitls;
+import com.caimei.modules.order.dao.NewShopOrderDao;
 import com.caimei.modules.order.entity.CmDiscernReceipt;
+import com.caimei.modules.order.service.NewOrderService;
+import com.caimei.modules.order.service.WeChatService;
 import com.caimei.modules.sys.utils.CmMsgUtils;
 import com.caimei.modules.sys.utils.SMSUtils;
 import com.caimei.modules.user.dao.CmUserDao;
@@ -69,7 +72,12 @@ public class NewCmShopController extends BaseController {
     private SysLogService sysLogService;
     @Autowired
     private MessageCenterDao messageCenterDao;
-
+    @Autowired
+    NewOrderService newOrderService;
+    @Autowired
+    NewShopOrderDao newShopOrderDao;
+    @Autowired
+    WeChatService weChatService;
 
     @ModelAttribute
     public NewCmShop get(@RequestParam(required = false) String id) {
@@ -337,7 +345,7 @@ public class NewCmShopController extends BaseController {
                     }
                 }
                 manufacturerStatus = "90";
-                smsMessage = "恭喜您成功通过资料审核,您可以使用账号" + mobile + "在采美登录您的企业账号,开始愉快的采购之旅。";
+                smsMessage = "【采美365】您提供的资料已审核通过,恭喜您成为采美平台供应商用户。您可通过申请时填写的手机号和密码登录采美平台管理您的账户。";
             }
             if (StringUtils.equals("2", auditStatus)) {
                 //获取操作时间
@@ -358,7 +366,25 @@ public class NewCmShopController extends BaseController {
                     }
                 }
                 manufacturerStatus = "92";
-                smsMessage = "很遗憾,您的资料信息有误,未通过审核,请登录采美修改资料信息。";
+                smsMessage = "【采美365】您提供的资料未通过审核,申请采美平台供应商账户失败。请使用申请时填写的手机号和密码登录采美平台进行信息修改后,重新提交审核。";
+                try {
+                    logger.info("********供应商审核失败微信公众号推送********");
+                    String unionid = newShopOrderDao.UnionId(userId);
+                    List<String> openidList = newShopOrderDao.getOpenidListByPermission(unionid);
+                    logger.info("userid>>>>>>>>>>>>>>>" + userId + "unionid》》》》》》》》》》" + unionid + "openid》》》》》》》》》" + openidList);
+                    String accessToken = weChatService.getAccessToken();
+                    String auditTime = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(date);
+
+                    String pagePath = "/pages/login/apply-supplier";
+                    for (String openid : openidList) {
+                        weChatService.sendTemplate(accessToken, openid,newCmShops.getName(),auditNote,auditTime, pagePath);
+                    }
+                } catch (Exception e) {
+                    logger.error("【供应商审核失败通知】获取微信公众号access_token异常!", e);
+                }
+
+
+
             }
             // 更新用户信息
             newCmShopService.updateUserAudit(auditStatus, auditNote, format, manufacturerStatus, userId, "1");
@@ -372,7 +398,12 @@ public class NewCmShopController extends BaseController {
 
 
             if (StringUtils.isNotEmpty(mobile)) {
-                SMSUtils.sendSms(mobile, smsMessage);
+                boolean sendSms = newOrderService.getSendSms(9, mobile, smsMessage);
+                if(sendSms){
+                    logger.info(">>>>>>>获得采美平台赠送的超级会员短信推送成功");
+                }else {
+                    SMSUtils.sendSms(mobile, smsMessage);
+                }
             }
         } catch (Exception e) {
             e.printStackTrace();

+ 39 - 3
src/main/java/com/caimei/modules/user/web/newUser/AgencyController.java

@@ -3,6 +3,8 @@ package com.caimei.modules.user.web.newUser;
 import com.caimei.constants.ClubStatus;
 import com.caimei.dfs.image.beens.ImageUploadInfo;
 import com.caimei.modules.common.utils.UploadUtils;
+import com.caimei.modules.order.dao.NewShopOrderDao;
+import com.caimei.modules.order.service.WeChatService;
 import com.caimei.modules.product.service.CmShoporderService;
 import com.caimei.modules.project.model.ServiceProviderModel;
 import com.caimei.modules.sys.utils.CmMsgUtils;
@@ -83,7 +85,10 @@ public class AgencyController extends BaseController {
     private SysLogService sysLogService;
     @Autowired
     private MessageCenterDao messageCenterDao;
-
+    @Autowired
+    private NewShopOrderDao newShopOrderDao;
+    @Autowired
+    private WeChatService weChatService;
     @ModelAttribute
     public NewCmClub get(@RequestParam(required = false) String id) {
         NewCmClub entity = null;
@@ -865,6 +870,23 @@ public class AgencyController extends BaseController {
                 auditStatus = "1";
                 companyUser.setRegisterUserTypeID("3");
                 companyUser.setUserPermission(userPermission);
+
+                try {
+                    logger.info("********资质机构审核成功微信公众号推送********");
+                    Integer userID = companyUserID;
+                    String unionid = newShopOrderDao.UnionId(userID);
+                    List<String> openidList = newShopOrderDao.getOpenidListByPermission(unionid);
+                    logger.info("userid>>>>>>>>>>>>>>>" + userID + "unionid》》》》》》》》》》" + unionid + "openid》》》》》》》》》" + openidList);
+                    String accessToken = weChatService.getAccessToken();
+                    String auditTime = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(date);
+
+                    String pagePath = "https://www.caimei365.com/";
+                    for (String openid : openidList) {
+                        weChatService.sendTemplateMsg(accessToken, openid,auditTime, pagePath);
+                    }
+                } catch (Exception e) {
+                    logger.error("【资质机构审核成功通知】获取微信公众号access_token异常!", e);
+                }
                 //审核通过升级为会员机构
                 companyUser.setUserIdentity(2);
                 smsMessage = "恭喜您成功升级为资质机构用户!快戳采美网站链接www.caimei365.com或微信搜索“采美采购商城”小程序登录采美平台享受更多更好的服务吧。" +
@@ -883,8 +905,22 @@ public class AgencyController extends BaseController {
                 messageCenter.setContent(null);
                 messageCenter.setTime(curDateStr);
                 messageCenterDao.addMessageCenter(messageCenter);
-
-
+                try {
+                    logger.info("********资质机构审核失败微信公众号推送********");
+                    Integer userID = companyUserID;
+                    String unionid = newShopOrderDao.UnionId(userID);
+                    List<String> openidList = newShopOrderDao.getOpenidListByPermission(unionid);
+                    logger.info("userid>>>>>>>>>>>>>>>" + userID + "unionid》》》》》》》》》》" + unionid + "openid》》》》》》》》》" + openidList);
+                    String accessToken = weChatService.getAccessToken();
+                    String auditTime = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(date);
+                    String auditResult=auditNote;
+                    String pagePath = "https://www.caimei365.com/";
+                    for (String openid : openidList) {
+                        weChatService.sendTemplateMessg(accessToken, openid,auditResult,auditTime, pagePath);
+                    }
+                } catch (Exception e) {
+                    logger.error("【资质机构审核失败通知】获取微信公众号access_token异常!", e);
+                }
                 //审核未通过,普通机构权限
                 userPermission = 5;
                 companyUser.setUserPermission(userPermission);

+ 5 - 0
src/main/resources/mappings/modules/order/ShopOrderMapper.xml

@@ -1158,6 +1158,11 @@
     <select id="FromUnionId" resultType="java.lang.String">
         SELECT unionID FROM `cm_order` WHERE orderID=#{orderId}
     </select>
+
+    <select id="UnionId" resultType="java.lang.String">
+        SELECT unionID FROM `cm_order` WHERE userID=#{userID}
+    </select>
+
     <select id="getProductOrder" resultType="java.lang.String">
         SELECT productID
         FROM `cm_order_product`

+ 8 - 0
src/main/resources/mappings/modules/product/ProductNewMapper.xml

@@ -832,5 +832,13 @@
                  left join product p on p.shopID = css.shopId
         where p.productID = #{id}
     </select>
+
+    <select id="validIList" resultType="com.caimei.modules.product.entity.Product">
+        select p.*,s.contractMobile as mobile,s.userID as userId,s.name as shopName
+        from product p
+        left join shop s on p.shopID = s.shopId
+        where p.productID = #{productID}
+    </select>
+
 </mapper>
 

+ 66 - 0
src/main/resources/mappings/modules/sys/Notification.xml

@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.caimei.modules.sys.dao.NotificationDao">
+
+	<select id="productTypeCount" resultType="com.caimei.modules.product.entity.Product">
+		SELECT * FROM `product` WHERE productType=2 AND  DATE_ADD(NOW(), INTERVAL #{yat} MONTH) > qualificationTime AND qualificationTime > NOW()
+	</select>
+
+	<select id="productTypeCount1" resultType="com.caimei.modules.product.entity.Product">
+		SELECT * FROM `product` WHERE productType=2 AND  DATE_ADD(NOW(), INTERVAL #{yat} DAY) > qualificationTime AND qualificationTime > NOW()
+	</select>
+
+	<select id="productTypeCount2" resultType="com.caimei.modules.product.entity.Product">
+		SELECT * FROM `cm_discern_receipt`
+		WHERE newReceiptType=1 AND DATE_ADD(NOW(), INTERVAL #{yat} MONTH)>DATE_ADD(receiptDate, INTERVAL 1 YEAR)  AND  DATE_ADD(receiptDate, INTERVAL 1 YEAR) > NOW()
+	</select>
+
+	<select id="productTypeCount3" resultType="com.caimei.modules.product.entity.Product">
+		SELECT * FROM `cm_discern_receipt`
+		WHERE newReceiptType=1 AND DATE_ADD(NOW(), INTERVAL #{yat} DAY)>DATE_ADD(receiptDate, INTERVAL 1 YEAR)  AND  DATE_ADD(receiptDate, INTERVAL 1 YEAR) > NOW()
+	</select>
+
+	<select id="notification" resultType="com.caimei.modules.sys.entity.Notification">
+		SELECT * FROM `notification`
+		<where>
+			<if test="theme!=null and theme!=''">
+				and theme LIKE CONCAT('%',#{theme},'%')
+			</if>
+		</where>
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+			</otherwise>
+		</choose>
+	</select>
+	<select id="notificationId" resultType="java.lang.String">
+		SELECT shopContent FROM `notification`
+		where id=#{id}
+	</select>
+
+	<update id="Upnotification">
+		UPDATE notification SET saved=1
+		<where>
+		    <if test="id!=null">
+		and	id=#{id}
+            </if>
+	   </where>
+	</update>
+
+	<update id="hide">
+		UPDATE notification SET hide=#{hide},saved=1
+		where id=#{Id}
+
+	</update>
+
+	<insert id="addNotification">
+		INSERT INTO notification(theme,newTime,shopContent,porductID,shopID) VALUES (#{theme},NOW(),#{shopContent},#{porductID},#{shopID})
+	</insert>
+
+	<select id="count" resultType="java.lang.Integer">
+		select count(*) from notification where saved=1
+	</select>
+
+</mapper>

+ 13 - 0
src/main/resources/mappings/modules/user/MessageCenter.xml

@@ -14,6 +14,15 @@
         SELECT clubID FROM `user` WHERE userId=#{userId}
     </select>
 
+    <select id="contractMobile" resultType="java.lang.String">
+        SELECT contractMobile FROM club WHERE userID=#{UserID}
+    </select>
+
+    <select id="Mobile" resultType="java.lang.String">
+        SELECT contractMobile FROM shop WHERE shoprID=#{shopID}
+    </select>
+
+
     <select id="clubList" resultType="com.caimei.modules.user.entity.CmUser">
         SELECT * FROM `user` WHERE clubId=#{clubId}  LIMIT 1
     </select>
@@ -25,6 +34,10 @@
         SELECT clubID FROM `user` WHERE YEAR(loginTime)>YEAR(NOW())-3 AND clubID IS NOT NULL
     </select>
 
+    <select id="userID" resultType="java.lang.Integer">
+        select userID from shop where shopID=#{shopID}
+    </select>
+
     <select id="CouponList" resultType="com.caimei.modules.coupon.entity.CmCoupon">
         SELECT * FROM cm_coupon WHERE couponType=#{couponType}
                                   AND NOW() >= startDate

+ 2 - 2
src/main/webapp/WEB-INF/views/modules/product-new/productEdit.jsp

@@ -892,7 +892,7 @@
         if (productType=="2"){
             $("#s2id_priceFlag").val(3);
             $("#s2id_visibility").val(4);
-            $("#visibility").prev().find(".select2-chosen").text("仅对医美机构开放");
+            $("#visibility").prev().find(".select2-chosen").text("所有人可见");
             $("#priceFlag").prev().find(".select2-chosen").text("仅对医美机构开放");
             $("#priceFlag").prop("disabled",true);
             $("#visibility").prop("disabled",true);
@@ -904,7 +904,7 @@
             if(val == '2'){
                 $("#priceFlag").val(3);
                 $("#visibility").val(4);
-                $("#visibility").prev().find(".select2-chosen").text("仅对医美机构开放");
+                $("#visibility").prev().find(".select2-chosen").text("所有人可见");
                 $("#priceFlag").prev().find(".select2-chosen").text("仅对医美机构开放");
                 $("#priceFlag").prop("disabled",true);
                 $("#visibility").prop("disabled",true);

+ 138 - 0
src/main/webapp/WEB-INF/views/modules/sys/Notification.jsp

@@ -0,0 +1,138 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
+<html>
+<head>
+    <title>通知中心</title>
+    <meta name="decorator" content="default"/>
+    <style type="text/css">
+        .table th {
+            text-align: center;
+        }
+
+        .table td {
+            text-align: center;
+        }
+
+        #redi {
+            width: 10px;
+
+            height: 10px;
+
+            font: 12px/18px Arial;
+
+            border-radius: 7px;
+
+            display: inline-block;
+
+            vertical-align: middle;
+
+            position: relative;
+
+        }
+
+    </style>
+    <script type="text/javascript">
+        $(document).ready(function () {
+            // $(".chopContent").hide()
+        });
+
+        function page(n, s) {
+            $("#pageNo").val(n);
+            $("#pageSize").val(s);
+            $("#searchForm").submit();
+            return false;
+        }
+
+        function connct(id,hide) {
+            alert(id)
+            window.location.href = "${ctx}/sys/Notification/hide?id=" + id+"&hide="+hide;
+        }
+
+        function butt() {
+            window.location.href = "${ctx}/sys/Notification/update";
+            alertx("已清除所有未读消息")
+        }
+
+
+    </script>
+</head>
+<body>
+<ul class="nav nav-tabs">
+    <li class="active"><a href="${ctx}/sys/Notification/list">通知中心</a></li>
+</ul>
+<form:form id="searchForm" modelAttribute="Notification" action="${ctx}/sys/Notification/list" method="post"
+           class="breadcrumb form-search">
+    <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
+    <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
+    <div class="ul-form">
+        <label>主题:</label>
+        <form:input path="theme" htmlEscape="false" maxlength="20" class="input-medium"/>
+        <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
+        <button type="button" onclick="butt()" class="btn btn-primary">清除未读消息</button>
+        <div class="clearfix"></div>
+    </div>
+</form:form>
+<sys:message content="${message}"/>
+<table id="contentTable" class="table table-striped table-bordered table-condensed">
+    <thead>
+    <tr>
+        <th style="float: left"></th>
+        <th></th>
+        <%--		<th style="float: right"></th>--%>
+    </tr>
+    </thead>
+    <tbody>
+    <c:forEach items="${page.list}" var="list">
+
+        <tr>
+            <input type="hidden" value="${list.id}">
+            <td colspan="2">
+                <c:if test="${list.saved eq 1}">
+					<span style="float: left; background: dimgrey" id="redi"></span>
+					<span style="float: left; color: dimgrey">${list.theme}</span><span style="float: right">${list.newTime}</span>
+				</c:if>
+                <c:if test="${list.saved eq 0}">
+					<span style="float: left; background: red" id="redi"></span>
+					<span style="float: left; color: #0d0d0d">${list.theme}</span><span style="float: right">${list.newTime}</span>
+				</c:if>
+              <br>
+                <c:if test="${list.hide eq 1}">
+                <c:if test="${not empty list.porductID}">
+                    <c:forEach items="${list.contents}" var="age" varStatus="loop">
+                        <c:forEach items="${list.porductIDs}" var="age1" varStatus="s">
+                            <c:if test="${s.index==loop.index}">
+				<span id="chopContent" style="float: left;">
+				<a style="color: #0d0d0d; text-decoration: underline"
+                   href="${ctx}/product/new/productEdit?id=${age1}">${age},</a>
+			</span>
+                            </c:if>
+                        </c:forEach>
+                    </c:forEach>
+                </c:if>
+                <c:if test="${not empty list.shopID}">
+                    <c:forEach items="${list.contents}" var="age" varStatus="loop">
+                        <c:forEach items="${list.shopIDs}" var="age1" varStatus="s">
+                            <c:if test="${s.index==loop.index}">
+				<span id="chopContent" style="float: left;">
+				<a style="color: #0d0d0d; text-decoration: underline"
+                   href="${ctx}/user/newCmShop/maintenanceList?shopID=${age1}&shopName=${age}">${age},</a>
+			</span>
+                            </c:if>
+                        </c:forEach>
+                    </c:forEach>
+                </c:if>
+            </td>
+            </c:if>
+            <td><a onclick="connct(${list.id},${list.hide})" style="float: right">></a></td>
+
+                <%--			<td>--%>
+                <%--					--%>
+                <%--			</td>--%>
+        </tr>
+    </c:forEach>
+
+    </tbody>
+</table>
+<div class="pagination">${page}</div>
+</body>
+</html>

+ 28 - 5
src/main/webapp/WEB-INF/views/modules/sys/sysIndex.jsp

@@ -13,6 +13,25 @@
 		#footer {margin:8px 0 0 0;padding:3px 0 0 0;font-size:11px;text-align:center;border-top:2px solid #0663A2;}
 		#footer, #footer a {color:#999;} #left{overflow-x:hidden;overflow-y:auto;} #left .collapse{position:static;}
 		#userControl>li>a{/*color:#fff;*/text-shadow:none;} #userControl>li>a:hover, #user #userControl>li.open>a{background:transparent;}
+		#redi {
+			width: 10px;
+
+			height: 10px;
+
+			font: 12px/18px Arial;
+
+			border-radius: 7px;
+
+			display: inline-block;
+
+			vertical-align: middle;
+
+			position: relative;
+
+			background: red;
+
+
+		}
 	</style>
 	<script type="text/javascript">
 		$(document).ready(function() {
@@ -160,6 +179,10 @@
 						</ul>
 						<!--[if lte IE 6]><script type="text/javascript">$('#themeSwitch').hide();</script><![endif]-->
 					</li>
+					<li>
+						<span id="redi"></span>
+						<a href="${ctx}/sys/Notification" target="mainFrame"><i class="icon-bell"></i></a>
+					</li>
 					<li id="userInfo" class="dropdown">
 						<a class="dropdown-toggle" data-toggle="dropdown" href="#" title="个人信息">您好, ${fns:getUser().name}&nbsp;<span id="notifyNum" class="label label-info hide"></span></a>
 						<ul class="dropdown-menu">
@@ -213,7 +236,7 @@
 	    </div>
 	    <div class="container-fluid">
 			<div id="content" class="row-fluid">
-				<div id="left"><%-- 
+				<div id="left"><%--
 					<iframe id="menuFrame" name="menuFrame" src="" style="overflow:visible;" scrolling="yes" frameborder="no" width="100%" height="650"></iframe> --%>
 				</div>
 				<div id="openClose" class="close">&nbsp;</div>
@@ -226,7 +249,7 @@
 			</div>
 		</div>
 	</div>
-	<script type="text/javascript"> 
+	<script type="text/javascript">
 		var leftWidth = 160; // 左侧窗口大小
 		var tabTitleHeight = 33; // 页签的高度
 		var htmlObj = $("html"), mainObj = $("#main");
@@ -238,7 +261,7 @@
 			htmlObj.css({"overflow-x":strs[1] < minWidth ? "auto" : "hidden", "overflow-y":strs[0] < minHeight ? "auto" : "hidden"});
 			mainObj.css("width",strs[1] < minWidth ? minWidth - 10 : "auto");
 			frameObj.height((strs[0] < minHeight ? minHeight : strs[0]) - headerObj.height() - footerObj.height() - (strs[1] < minWidth ? 42 : 28));
-			$("#openClose").height($("#openClose").height() - 5);// <c:if test="${tabmode eq '1'}"> 
+			$("#openClose").height($("#openClose").height() - 5);// <c:if test="${tabmode eq '1'}">
 			$(".jericho_tab iframe").height($("#right").height() - tabTitleHeight); // </c:if>
 			wSizeWidth();
 		}
@@ -249,11 +272,11 @@
 			}else{
 				$("#right").width("100%");
 			}
-		}// <c:if test="${tabmode eq '1'}"> 
+		}// <c:if test="${tabmode eq '1'}">
 		function openCloseClickCallBack(b){
 			$.fn.jerichoTab.resize();
 		} // </c:if>
 	</script>
 	<script src="${ctxStatic}/common/wsize.min.js" type="text/javascript"></script>
 </body>
-</html>
+</html>