|
@@ -48,37 +48,42 @@ import java.util.List;
|
|
|
public class NotificationController extends BaseController {
|
|
|
|
|
|
@Autowired
|
|
|
- NotificationDao notificationDao;
|
|
|
+ private NotificationDao notificationDao;
|
|
|
@Autowired
|
|
|
- NotificationService notificationService;
|
|
|
+ private NotificationService notificationService;
|
|
|
@Autowired
|
|
|
- MessageCenterDao messageCenterDao;
|
|
|
+ private MessageCenterDao messageCenterDao;
|
|
|
@Autowired
|
|
|
- NewOrderService newOrderService;
|
|
|
+ private NewOrderService newOrderService;
|
|
|
@Autowired
|
|
|
- NewShopOrderDao newShopOrderDao;
|
|
|
+ private NewShopOrderDao newShopOrderDao;
|
|
|
@Autowired
|
|
|
- WeChatService weChatService;
|
|
|
+ private WeChatService weChatService;
|
|
|
@Value("${wwwServer}")
|
|
|
private String domain;
|
|
|
+
|
|
|
@RequestMapping(value = {"list", ""})
|
|
|
- public String list( Notification notifi,HttpServletRequest request, HttpServletResponse response, Model model) {
|
|
|
+ public String list(Notification notifi, HttpServletRequest request, HttpServletResponse response, Model model) {
|
|
|
|
|
|
- List<String> content=new ArrayList<>();
|
|
|
+ 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);
|
|
|
+ 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);
|
|
|
+ }
|
|
|
notificationDao.hides();
|
|
|
model.addAttribute("Notification", notifi);
|
|
|
model.addAttribute("page", page);
|
|
@@ -87,62 +92,68 @@ public class NotificationController extends BaseController {
|
|
|
|
|
|
|
|
|
/**
|
|
|
- *constraint加入缓存
|
|
|
+ * 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");
|
|
|
+ Jedis jedis = new Jedis("192.168.2.100", 6379);
|
|
|
+ if(domain.contains("-b")){
|
|
|
+ jedis=new Jedis("47.119.112.46", 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);
|
|
|
+ }
|
|
|
+ jedis.lpush("constraint", "0");
|
|
|
}
|
|
|
|
|
|
@Scheduled(cron = "0 0 11 * * ?")
|
|
|
//@Scheduled(cron = "0 0/10 * * * ?")
|
|
|
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();
|
|
|
+ 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 shopName= messageCenterDao.shopName(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,shopName , qualificationNo, time, name, pagePath);
|
|
|
- count++;
|
|
|
- }
|
|
|
- } catch (Exception e) {
|
|
|
- logger.error("【质证书失效消息推送】获取微信公众号access_token异常!", e);
|
|
|
+ try {
|
|
|
+ Integer userID = messageCenterDao.userID(pro.get(i).getShopID());
|
|
|
+ String shopName = messageCenterDao.shopName(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, shopName, qualificationNo, time, name, pagePath);
|
|
|
+ count++;
|
|
|
}
|
|
|
- if(count<=0) {
|
|
|
+ } 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 = SMSUtils.sendSms(1,bindMobile, content);
|
|
|
+ boolean sendSms = SMSUtils.sendSms(1, bindMobile, content);
|
|
|
if (sendSms) {
|
|
|
logger.info(">>>>>>>资质证书将于3个月后失效短信推送成功");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- for (int i=0;i<pro1.size();i++){
|
|
|
- name=pro1.get(i).getName();
|
|
|
+ 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 += "...";
|
|
@@ -151,7 +162,7 @@ public class NotificationController extends BaseController {
|
|
|
logger.info("**************************质证书失效消息推送************************************");
|
|
|
try {
|
|
|
Integer userID = messageCenterDao.userID(pro1.get(i).getShopID());
|
|
|
- String shopName= messageCenterDao.shopName(pro1.get(i).getShopID());
|
|
|
+ String shopName = messageCenterDao.shopName(pro1.get(i).getShopID());
|
|
|
String unionid = newShopOrderDao.UnionId(userID);
|
|
|
List<String> openidList = newShopOrderDao.getOpenidListByPermission(unionid);
|
|
|
String accessToken = weChatService.getAccessToken();
|
|
@@ -159,24 +170,24 @@ public class NotificationController extends BaseController {
|
|
|
String time = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(date);
|
|
|
String pagePath = "";
|
|
|
for (String openid : openidList) {
|
|
|
- weChatService.messteme(accessToken, openid,shopName , qualificationNo, time, name, pagePath);
|
|
|
+ weChatService.messteme(accessToken, openid, shopName, qualificationNo, time, name, pagePath);
|
|
|
count++;
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
logger.error("【质证书失效消息推送】获取微信公众号access_token异常!", e);
|
|
|
}
|
|
|
- if(count<=0) {
|
|
|
+ if (count <= 0) {
|
|
|
String bindMobile = messageCenterDao.Mobile(pro1.get(i).getShopID());
|
|
|
String content = "【采美365】 尊敬的采美供应商用户,您在采美上架的商品“" + name + "”资质证书将于1个月后失效,请及时登录采美网站上传新证书。";
|
|
|
- boolean sendSms = SMSUtils.sendSms(1,bindMobile, content);
|
|
|
+ boolean sendSms = SMSUtils.sendSms(1, bindMobile, content);
|
|
|
if (sendSms) {
|
|
|
logger.info(">>>>>>>资质证书将于1个月后失效短信推送成功");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- for (int i=0;i<pro2.size();i++){
|
|
|
- name=pro2.get(i).getName();
|
|
|
+ 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 += "...";
|
|
@@ -185,7 +196,7 @@ public class NotificationController extends BaseController {
|
|
|
logger.info("**************************质证书失效消息推送************************************");
|
|
|
try {
|
|
|
Integer userID = messageCenterDao.userID(pro2.get(i).getShopID());
|
|
|
- String shopName= messageCenterDao.shopName(pro2.get(i).getShopID());
|
|
|
+ String shopName = messageCenterDao.shopName(pro2.get(i).getShopID());
|
|
|
String unionid = newShopOrderDao.UnionId(userID);
|
|
|
List<String> openidList = newShopOrderDao.getOpenidListByPermission(unionid);
|
|
|
String accessToken = weChatService.getAccessToken();
|
|
@@ -193,33 +204,32 @@ public class NotificationController extends BaseController {
|
|
|
String time = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(date);
|
|
|
String pagePath = "";
|
|
|
for (String openid : openidList) {
|
|
|
- weChatService.messteme(accessToken, openid,shopName, qualificationNo, time, name, pagePath);
|
|
|
+ weChatService.messteme(accessToken, openid, shopName, qualificationNo, time, name, pagePath);
|
|
|
count++;
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
logger.error("【质证书失效消息推送】获取微信公众号access_token异常!", e);
|
|
|
}
|
|
|
- if(count<=0) {
|
|
|
+ if (count <= 0) {
|
|
|
String bindMobile = messageCenterDao.Mobile(pro2.get(i).getShopID());
|
|
|
String content = "【采美365】 尊敬的采美供应商用户,您在采美上架的商品“" + name + "”资质证书将于7天后失效,请及时登录采美网站上传新证书。";
|
|
|
- boolean sendSms = SMSUtils.sendSms(1,bindMobile, content);
|
|
|
+ boolean sendSms = SMSUtils.sendSms(1, bindMobile, content);
|
|
|
if (sendSms) {
|
|
|
logger.info(">>>>>>>资质证书将于7天后失效短信推送成功");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- for (int i=0;i<pro3.size();i++){
|
|
|
- name=pro3.get(i).getName();
|
|
|
+ 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 shopName= messageCenterDao.shopName(pro3.get(i).getShopID());
|
|
|
+ String shopName = messageCenterDao.shopName(pro3.get(i).getShopID());
|
|
|
String unionid = newShopOrderDao.UnionId(userID);
|
|
|
List<String> openidList = newShopOrderDao.getOpenidListByPermission(unionid);
|
|
|
String accessToken = weChatService.getAccessToken();
|
|
@@ -227,290 +237,280 @@ public class NotificationController extends BaseController {
|
|
|
String time = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(date);
|
|
|
String pagePath = "";
|
|
|
for (String openid : openidList) {
|
|
|
- weChatService.messteme(accessToken, openid,shopName , qualificationNo, time, name, pagePath);
|
|
|
+ weChatService.messteme(accessToken, openid, shopName, 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 = SMSUtils.sendSms(1,bindMobile, content);
|
|
|
- if(sendSms){
|
|
|
- logger.info(">>>>>>>资质证书将于今天后后失效短信推送成功");
|
|
|
+ if (count <= 0) {
|
|
|
+ String bindMobile = messageCenterDao.Mobile(pro3.get(i).getShopID());
|
|
|
+ String content = "【采美365】 尊敬的采美供应商用户,您在采美上架的商品“" + name + "”资质证书将于今天后失效,请及时登录采美网站上传新证书。";
|
|
|
+ boolean sendSms = SMSUtils.sendSms(1, bindMobile, content);
|
|
|
+ if (sendSms) {
|
|
|
+ logger.info(">>>>>>>资质证书将于今天后后失效短信推送成功");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
}
|
|
|
|
|
|
|
|
|
@RequestMapping(value = {"update"})
|
|
|
- public String update( Notification notification,HttpServletRequest request, HttpServletResponse response, Model model) {
|
|
|
+ public String update(Notification notification, HttpServletRequest request, HttpServletResponse response, Model model) {
|
|
|
notificationDao.Upnotification(notification);
|
|
|
- return "redirect:"+Global.getAdminPath()+"/sys/Notification/list";
|
|
|
+ return "redirect:" + Global.getAdminPath() + "/sys/Notification/list";
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = {"updates"})
|
|
|
- public void updates( Notification notification,HttpServletRequest request, HttpServletResponse response, Model model) {
|
|
|
+ public void updates(Notification notification, HttpServletRequest request, HttpServletResponse response, Model model) {
|
|
|
notificationDao.Upnotification(notification);
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = {"Idques"})
|
|
|
- public String Idques( Notification notification,HttpServletRequest request, HttpServletResponse response, Model model){
|
|
|
- String c= notificationDao.notificationId(notification);
|
|
|
-
|
|
|
+ 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;
|
|
|
+ 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;
|
|
|
+ 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";
|
|
|
+ notificationDao.hide(hide, Integer.parseInt(notification.getId()));
|
|
|
+ return "redirect:" + Global.getAdminPath() + "/sys/Notification/list";
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = {"hides"})
|
|
|
- public String hides( Notification notification,HttpServletRequest request, HttpServletResponse response, Model model){
|
|
|
+ public String hides(Notification notification, HttpServletRequest request, HttpServletResponse response, Model model) {
|
|
|
|
|
|
notificationDao.hides();
|
|
|
- return "redirect:"+Global.getAdminPath()+"/sys/Notification/list";
|
|
|
+ return "redirect:" + Global.getAdminPath() + "/sys/Notification/list";
|
|
|
}
|
|
|
+
|
|
|
@Scheduled(cron = "0 0 11 * * ?")
|
|
|
//@Scheduled(cron = "0 0/1 * * * ?")
|
|
|
- public void nottime(){
|
|
|
+ public void nottime() {
|
|
|
logger.info("》》》》》》》》》》》开始检测商品资质证书和上架费是否过期");
|
|
|
|
|
|
//械字号资质证书3个月后过期
|
|
|
- Integer count=0;
|
|
|
- String name="";
|
|
|
- String productID="";
|
|
|
- String shopID="";
|
|
|
- Date date=new Date();
|
|
|
+ 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> 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);
|
|
|
+ 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("47.119.112.46", 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);
|
|
|
+ } 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");
|
|
|
-
|
|
|
+ if (!"1".equals(jedis.rpop("constraint"))) {
|
|
|
+ jedis.lpush("constraint", "0");
|
|
|
}
|
|
|
- constraint=jedis.rpop("constraint");
|
|
|
+ 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.setProductId(pro.get(i).getProductID());
|
|
|
- messageCenter.setContent("该商品的资质证书将于3个月后失效,请及时登录采美网站上传新证书。");
|
|
|
- messageCenter.setTime(curDateStr);
|
|
|
- messageCenterDao.addMessageCenter(messageCenter);
|
|
|
-
|
|
|
- if(i!=0){
|
|
|
- name+=",";
|
|
|
- productID+=",";
|
|
|
- }
|
|
|
- name +="("+pro.get(i).getProductID().toString()+")"+pro.get(i).getName();
|
|
|
- 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.setProductId(pro1.get(i).getProductID());
|
|
|
- messageCenter.setContent("该商品的资质证书将于1个月后失效,请及时登录采美网站上传新证书。");
|
|
|
- messageCenter.setTime(curDateStr);
|
|
|
- messageCenterDao.addMessageCenter(messageCenter);
|
|
|
- if(i!=0){
|
|
|
- name+=",";
|
|
|
- productID+=",";
|
|
|
- }
|
|
|
- name +="("+pro1.get(i).getProductID().toString()+")"+pro1.get(i).getName();
|
|
|
- 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.setProductId(pro2.get(i).getProductID());
|
|
|
- messageCenter.setContent("该商品的资质证书将于7天后失效,请及时登录采美网站上传新证书。");
|
|
|
- messageCenter.setTime(curDateStr);
|
|
|
- messageCenterDao.addMessageCenter(messageCenter);
|
|
|
- if(i!=0){
|
|
|
- name+=",";
|
|
|
- productID+=",";
|
|
|
- }
|
|
|
- name +="("+pro2.get(i).getProductID().toString()+")"+pro2.get(i).getName();
|
|
|
- productID+=pro2.get(i).getProductID().toString();
|
|
|
+ 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.setProductId(pro.get(i).getProductID());
|
|
|
+ messageCenter.setContent("该商品的资质证书将于3个月后失效,请及时登录采美网站上传新证书。");
|
|
|
+ messageCenter.setTime(curDateStr);
|
|
|
+ messageCenterDao.addMessageCenter(messageCenter);
|
|
|
+ if (i != 0) {
|
|
|
+ name += ",";
|
|
|
+ productID += ",";
|
|
|
}
|
|
|
- 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.setProductId(pro3.get(i).getProductID());
|
|
|
- messageCenter.setContent("该商品的资质证书将于今天后失效,请及时登录采美网站上传新证书。");
|
|
|
- messageCenter.setTime(curDateStr);
|
|
|
- messageCenterDao.addMessageCenter(messageCenter);
|
|
|
- if(i!=0){
|
|
|
- name+=",";
|
|
|
- productID+=",";
|
|
|
- }
|
|
|
- name +="("+pro3.get(i).getProductID().toString()+")"+pro3.get(i).getName();
|
|
|
- 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).getName();
|
|
|
- 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="";
|
|
|
+ name += "(" + pro.get(i).getProductID().toString() + ")" + pro.get(i).getName();
|
|
|
+ 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.setProductId(pro1.get(i).getProductID());
|
|
|
+ messageCenter.setContent("该商品的资质证书将于1个月后失效,请及时登录采美网站上传新证书。");
|
|
|
+ messageCenter.setTime(curDateStr);
|
|
|
+ messageCenterDao.addMessageCenter(messageCenter);
|
|
|
+ if (i != 0) {
|
|
|
+ name += ",";
|
|
|
+ productID += ",";
|
|
|
}
|
|
|
- //上架费1个月后过期
|
|
|
- for (int i=0;i<product1.size();i++){
|
|
|
- if(i!=0){
|
|
|
- name+=",";
|
|
|
- shopID+=",";
|
|
|
- }
|
|
|
- name +=product1.get(i).getName();
|
|
|
- shopID+=product1.get(i).getShopID();
|
|
|
+ name += "(" + pro1.get(i).getProductID().toString() + ")" + pro1.get(i).getName();
|
|
|
+ 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.setProductId(pro2.get(i).getProductID());
|
|
|
+ messageCenter.setContent("该商品的资质证书将于7天后失效,请及时登录采美网站上传新证书。");
|
|
|
+ messageCenter.setTime(curDateStr);
|
|
|
+ messageCenterDao.addMessageCenter(messageCenter);
|
|
|
+ if (i != 0) {
|
|
|
+ name += ",";
|
|
|
+ productID += ",";
|
|
|
}
|
|
|
- if(!"".equals(name)){
|
|
|
- Notification notification=new Notification();
|
|
|
- notification.setTheme("以下供应商的上架费将于1个月后到期,请及时提醒供应商续费。");
|
|
|
- notification.setShopContent(name);
|
|
|
- notification.setShopID(shopID);
|
|
|
- notificationDao.addNotification(notification);
|
|
|
- name="";
|
|
|
- shopID="";
|
|
|
+ name += "(" + pro2.get(i).getProductID().toString() + ")" + pro2.get(i).getName();
|
|
|
+ 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.setProductId(pro3.get(i).getProductID());
|
|
|
+ messageCenter.setContent("该商品的资质证书将于今天后失效,请及时登录采美网站上传新证书。");
|
|
|
+ messageCenter.setTime(curDateStr);
|
|
|
+ messageCenterDao.addMessageCenter(messageCenter);
|
|
|
+ if (i != 0) {
|
|
|
+ name += ",";
|
|
|
+ productID += ",";
|
|
|
}
|
|
|
-//上架费7日后过期
|
|
|
- for (int i=0;i<product2.size();i++){
|
|
|
- if(i!=0){
|
|
|
- name+=",";
|
|
|
- shopID+=",";
|
|
|
- }
|
|
|
- name +=product2.get(i).getName();
|
|
|
- shopID+=product2.get(i).getShopID();
|
|
|
+ name += "(" + pro3.get(i).getProductID().toString() + ")" + pro3.get(i).getName();
|
|
|
+ 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 += ",";
|
|
|
}
|
|
|
- if(!"".equals(name)){
|
|
|
- Notification notification=new Notification();
|
|
|
- notification.setTheme("以下供应商的上架费将于7天后到期,请及时提醒供应商续费。");
|
|
|
- notification.setShopContent(name);
|
|
|
- notification.setShopID(shopID);
|
|
|
- notificationDao.addNotification(notification);
|
|
|
- name="";
|
|
|
- shopID="";
|
|
|
+ name += product.get(i).getName();
|
|
|
+ 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 += ",";
|
|
|
}
|
|
|
-//上架费今日后过期
|
|
|
- for (int i=0;i<product3.size();i++){
|
|
|
- if(i!=0){
|
|
|
- name+=",";
|
|
|
- shopID+=",";
|
|
|
- }
|
|
|
- name +=product3.get(i).getName();
|
|
|
- shopID+=product3.get(i).getShopID();
|
|
|
+ name += product1.get(i).getName();
|
|
|
+ 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 += ",";
|
|
|
}
|
|
|
- if(!"".equals(name)){
|
|
|
- Notification notification=new Notification();
|
|
|
- notification.setTheme("以下供应商的上架费将于今天后到期,请及时提醒供应商续费。");
|
|
|
- notification.setShopContent(name);
|
|
|
- notification.setShopID(shopID);
|
|
|
- notificationDao.addNotification(notification);
|
|
|
- name="";
|
|
|
- shopID="";
|
|
|
+ name += product2.get(i).getName();
|
|
|
+ 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 += ",";
|
|
|
}
|
|
|
-// }
|
|
|
- jedis.lpush("constraint","1");
|
|
|
+ name += product3.get(i).getName();
|
|
|
+ shopID += product3.get(i).getShopID();
|
|
|
}
|
|
|
-
|
|
|
+ if (!"".equals(name)) {
|
|
|
+ Notification notification = new Notification();
|
|
|
+ notification.setTheme("以下供应商的上架费将于今天后到期,请及时提醒供应商续费。");
|
|
|
+ notification.setShopContent(name);
|
|
|
+ notification.setShopID(shopID);
|
|
|
+ notificationDao.addNotification(notification);
|
|
|
+ }
|
|
|
+ jedis.lpush("constraint", "1");
|
|
|
}
|
|
|
+}
|
|
|
|