|
@@ -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";
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|