Przeglądaj źródła

推送版本bugfix

Duan_xu 2 lat temu
rodzic
commit
652e8e446f

+ 195 - 172
src/main/java/com/caimei/modules/coupon/web/CmCouponController.java

@@ -10,6 +10,7 @@ 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.sys.utils.SMSUtils;
 import com.caimei.modules.user.dao.CmUserDao;
 import com.caimei.modules.user.dao.MessageCenterDao;
 import com.caimei.modules.user.dao.NewCmClubDao;
@@ -26,6 +27,7 @@ import com.thinkgem.jeesite.common.web.BaseController;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
@@ -40,8 +42,12 @@ import javax.servlet.http.HttpServletResponse;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
+import java.util.Calendar;
 import java.util.Date;
 import java.util.List;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledThreadPoolExecutor;
 
 /**
  * 优惠券管理Controller
@@ -94,6 +100,7 @@ public class CmCouponController extends BaseController {
         if (null == cmCoupon.getMoneyCouponFlag()) {
             cmCoupon.setMoneyCouponFlag(2);
         }
+
         Page<CmCoupon> page = cmCouponService.findPage(new Page<CmCoupon>(request, response), cmCoupon);
         model.addAttribute("page", page);
         if (0 == cmCoupon.getCouponType()) {
@@ -104,9 +111,11 @@ public class CmCouponController extends BaseController {
             return "modules/coupon/couponCategoryList";
         } else if (2 == cmCoupon.getCouponType()) {
             //用户专享券
+
             return "modules/coupon/couponUserExclusiveList";
         } else if (3 == cmCoupon.getCouponType()) {
             //店铺券
+
             return "modules/coupon/couponShopList";
         } else if (4 == cmCoupon.getCouponType()) {
             //新用户券
@@ -154,184 +163,82 @@ public class CmCouponController extends BaseController {
     //优惠券站内消息推送
     private void consumer(CmCoupon cmCoupon, List<Integer> clubIds) {
         // 消费消息
-        while (true) {
             clubIds.forEach(clubIdb -> {
-                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);
-                }
-                // 获取消息
-                String clubIdc = jedis.rpop("mess" + clubIdb.toString());
-                Integer clubId = Integer.parseInt(clubIdc);
-                if (clubId != null) {
-                    Date date = new Date();
-                    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
-                    CmUser user = messageCenterDao.clubList(clubId);
-                    int coumt = 0;//计数五种消息只推送一条
-                    String catego = "";
-                    Integer ts = (date.compareTo(cmCoupon.getStartDate()));
-                    if (ts >= 0) {
-                        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);
-                                MessageCenter messageCenter = new MessageCenter();
-                                messageCenter.setShopId(null);
-                                messageCenter.setClubId(clubId);
-                                messageCenter.setUserType(1);
-                                messageCenter.setMessageType(4);
-                                messageCenter.setContent(null);
-                                messageCenter.setTime(curDateStr);
-                                messageCenter.setCouponType(0);
-                                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("mess" + clubIdc);
-                                coumt++;
-                            }
-                        }
-                        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);
-                                MessageCenter messageCenter = new MessageCenter();
-                                messageCenter.setShopId(null);
-                                messageCenter.setClubId(clubId);
-                                messageCenter.setUserType(1);
-                                messageCenter.setMessageType(4);
-                                if (coupon != null && "1".equals(coupon.getCategoryType())) {
-                                    catego = "产品";
-                                }
-                                if (coupon != null && "2".equals(coupon.getCategoryType())) {
-                                    catego = "仪器";
-                                }
-                                messageCenter.setContent(catego);
-                                messageCenter.setTime(curDateStr);
-                                messageCenter.setCouponType(1);
-                                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("mess" + clubIdc);
-                                coumt++;
-                            }
+                        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 (coumt == 0 && 2 == cmCoupon.getCouponType()) {
-                            CmCoupon coupon = messageCenterDao.CouponList(2);//查询优惠券信息
-                            if (coupon != null) {
-                                if(coupon.getUserId()!=null){
-                                Integer clubc=messageCenterDao.clubIdCule(coupon.getUserId());
-                                String curDateStr = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(date);
-                                MessageCenter messageCenter = new MessageCenter();
-                                if (coupon != null && coupon.getUserId() != null) {
-                                    messageCenter.setShopId(null);
-                                    messageCenter.setClubId(clubc);
-                                    messageCenter.setUserType(1);
-                                    messageCenter.setMessageType(4);
-                                    messageCenter.setContent(null);
-                                    messageCenter.setTime(curDateStr);
-                                    messageCenter.setCouponType(2);
-                                    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(">>>>>>>发送成功");
+                        // 获取消息
+                        String clubIdc = jedis.rpop("mess" + clubIdb.toString());
+                        Integer clubId = clubIdb;
+                        if (clubId != null) {
+                            Date date = new Date();
+                            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
+                            CmUser user = messageCenterDao.clubList(clubId);
+                            int coumt = 0;//计数五种消息只推送一条
+                            String catego = "";
+                            Integer ts = (date.compareTo(cmCoupon.getStartDate()));
+                            if (ts >= 0) {
+                                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);
+                                        MessageCenter messageCenter = new MessageCenter();
+                                        messageCenter.setShopId(null);
+                                        messageCenter.setClubId(clubIdb);
+                                        messageCenter.setUserType(1);
+                                        messageCenter.setMessageType(4);
+                                        messageCenter.setContent(null);
+                                        messageCenter.setTime(curDateStr);
+                                        messageCenter.setCouponType(0);
+                                        messageCenter.setCouponMessageType(1);
+                                        messageCenter.setCouponFee(cmCoupon.getCouponAmount().doubleValue());
+                                        messageCenterDao.addMessageCenter(messageCenter);
+                                        String content = "采美平台送您" + cmCoupon.getCouponAmount() + "元优惠券,众多大牌正品等着您,快戳采美网站链接www.caimei365.com/M2Tr98CG 或微信搜索“采美采购商城”小程序登录采美平台领取下单吧。关注公众号“采美网”获取更多优惠和精彩资讯。";
+                                        boolean sendSms = false;
+                                        try {
+                                            sendSms = SMSUtils.sendSms(user.getBindMobile(), content);
+                                        } catch (Exception e) {
+                                            e.printStackTrace();
+                                        }
+                                        if (sendSms) {
+                                            logger.info(">>>>>>>发送成功");
+                                        }
+                                        jedis.del("mess" + clubIdc);
+                                        coumt++;
                                     }
-
-                                    jedis.del("mess" + clubIdc);
-                                    coumt++;
                                 }
-                            }
-                        }
-                        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);
-                                MessageCenter messageCenter = new MessageCenter();
-                                messageCenter.setShopId(null);
-                                messageCenter.setClubId(clubId);
-                                messageCenter.setUserType(1);
-                                messageCenter.setMessageType(4);
-                                messageCenter.setContent(user.getName());
-                                messageCenter.setTime(curDateStr);
-                                messageCenter.setCouponType(3);
-                                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("mess" + clubIdc);
-                                coumt++;
-                            }
-                        }
-                        if (coumt == 0 && 4 == cmCoupon.getCouponType()) {
-                            CmCoupon coupon = messageCenterDao.CouponList(4);//查询优惠券信息
-                            if (coupon != null) {
-                                String startDate = sdf.format(coupon.getStartDate());
-                                int num = startDate.compareTo(user.getRegisterTime());
-                                if (num >= 0) {
-                                    String curDateStr = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(date);
-                                    MessageCenter messageCenter = new MessageCenter();
-                                    if (coupon != null && coupon.getUserId() != null) {
+                                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);
+                                        MessageCenter messageCenter = new MessageCenter();
                                         messageCenter.setShopId(null);
-                                        messageCenter.setClubId(clubId);
+                                        messageCenter.setClubId(clubIdb);
                                         messageCenter.setUserType(1);
                                         messageCenter.setMessageType(4);
-                                        messageCenter.setContent(null);
+                                        if (cmCoupon != null && "1".equals(cmCoupon.getCategoryType())) {
+                                            catego = "产品";
+                                        }
+                                        if (cmCoupon != null && "2".equals(cmCoupon.getCategoryType())) {
+                                            catego = "仪器";
+                                        }
+                                        messageCenter.setContent(catego);
                                         messageCenter.setTime(curDateStr);
-                                        messageCenter.setCouponType(4);
+                                        messageCenter.setCouponType(1);
                                         messageCenter.setCouponMessageType(1);
-                                        messageCenter.setCouponFee(coupon.getCouponAmount().doubleValue());
+                                        messageCenter.setCouponFee(cmCoupon.getCouponAmount().doubleValue());
                                         messageCenterDao.addMessageCenter(messageCenter);
-
-                                        String content = "【采美365】恭喜成功注册采美平台。采美平台赠送您" + coupon.getCouponAmount() + "元新用户优惠券,快戳采美网站链接www.caimei365.com/M2Tr98CG 或微信搜索“采美采购商城”小程序登录采美平台领取吧。关注公众号“采美网”获取更多优惠和精彩资讯。";
+                                        String content = "采美平台" + catego + "类商品大优惠,采美平台送您" + cmCoupon.getCouponAmount() + "元优惠券,快戳采美网站链接www.caimei365.com/M2Tr98CG 或微信搜索“采美采购商城”小程序登录采美平台领取吧。关注公众号“采美网”获取更多优惠和精彩资讯。";
                                         boolean sendSms = false;
                                         try {
-                                            sendSms = newOrderService.getSendSms(9, user.getBindMobile(), content);
+                                            sendSms = SMSUtils.sendSms(user.getBindMobile(), content);
                                         } catch (Exception e) {
                                             e.printStackTrace();
                                         }
@@ -343,28 +250,144 @@ public class CmCouponController extends BaseController {
                                         coumt++;
                                     }
                                 }
+                                if (coumt == 0 && 2 == cmCoupon.getCouponType()) {
+                                    CmCoupon coupon = messageCenterDao.CouponList(2);//查询用户专享优惠券信息
+                                    if (coupon != null && cmCoupon.getUserId() != null) {
+                                        if (coupon.getUserId().equals(cmCoupon.getUserId())) {
+                                            Integer clubc = messageCenterDao.clubIdCule(cmCoupon.getUserId());
+                                            String curDateStr = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(date);
+
+
+                                            jedis.del("mess" + clubIdc);
+                                            coumt++;
+                                        }
+                                    }
+                                }
+                                if ("90".equals(user.getClubStatus()) && coumt == 0 && 3 == cmCoupon.getCouponType()) {
+                                    CmCoupon coupon = messageCenterDao.CouponList(3);//查询店铺优惠券信息
+                                    if (coupon.getShopId() != null) {
+                                        String curDateStr = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(date);
+                                        String shopName = messageCenterDao.shopName(cmCoupon.getShopId());
+                                        Integer userID = messageCenterDao.userID(coupon.getShopId());
+                                        Integer clubID = messageCenterDao.clubIdCule(userID);
+                                        MessageCenter messageCenter = new MessageCenter();
+                                        messageCenter.setShopId(null);
+                                        messageCenter.setClubId(clubIdb);
+                                        messageCenter.setUserType(1);
+                                        messageCenter.setMessageType(4);
+                                        messageCenter.setContent(shopName);
+                                        messageCenter.setTime(curDateStr);
+                                        messageCenter.setCouponType(3);
+                                        messageCenter.setCouponMessageType(1);
+                                        messageCenter.setCouponFee(cmCoupon.getCouponAmount().doubleValue());
+                                        messageCenterDao.addMessageCenter(messageCenter);
+                                        String content = "采美平台为了回馈客户,赠送您" + cmCoupon.getCouponAmount() + "元的店铺专属优惠券,快戳采美网站链接www.caimei365.com/M2Tr98CG 或微信搜索“采美采购商城”小程序登录采美平台领取吧。关注公众号“采美网”获取更多优惠和精彩资讯。";
+                                        boolean sendSms = false;
+                                        try {
+                                            sendSms = SMSUtils.sendSms(user.getBindMobile(), content);
+                                        } catch (Exception e) {
+                                            e.printStackTrace();
+                                        }
+                                        if (sendSms) {
+                                            logger.info(">>>>>>>发送成功");
+                                        }
+                                    }
+                                    jedis.del("mess" + clubIdc);
+                                    coumt++;
+                                }
+                            if (coumt == 0 && 4 == cmCoupon.getCouponType()) {
+                                CmCoupon coupon = messageCenterDao.CouponList(4);//查询优惠券信息
+                                if (coupon != null) {
+                                    String startDate = sdf.format(coupon.getStartDate());
+                                    Calendar calendars = Calendar.getInstance();
+                                    Date receiptime = new Date();
+                                    try {
+                                        receiptime = sdf.parse(user.getRegisterTime());
+                                    } catch (ParseException e) {
+                                        e.printStackTrace();
+                                    }
+                                    calendars.setTime(receiptime);
+                                    calendars.add(Calendar.HOUR, -6);
+                                    String hTimes=sdf.format(calendars.getTime());
+                                    int num = startDate.compareTo(hTimes);
+                                    if (num >= 0) {
+                                        String curDateStr = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(date);
+                                        MessageCenter messageCenter = new MessageCenter();
+                                        if (coupon != null && coupon.getUserId() != null) {
+                                            messageCenter.setShopId(null);
+                                            messageCenter.setClubId(clubIdb);
+                                            messageCenter.setUserType(1);
+                                            messageCenter.setMessageType(4);
+                                            messageCenter.setContent(null);
+                                            messageCenter.setTime(curDateStr);
+                                            messageCenter.setCouponType(4);
+                                            messageCenter.setCouponMessageType(1);
+                                            messageCenter.setCouponFee(cmCoupon.getCouponAmount().doubleValue());
+                                            messageCenterDao.addMessageCenter(messageCenter);
+
+                                            String content = "恭喜成功注册采美平台。采美平台赠送您" + cmCoupon.getCouponAmount() + "元新用户优惠券,快戳采美网站链接www.caimei365.com/M2Tr98CG 或微信搜索“采美采购商城”小程序登录采美平台领取吧。关注公众号“采美网”获取更多优惠和精彩资讯。";
+                                            boolean sendSms = false;
+                                            try {
+                                                sendSms = SMSUtils.sendSms(user.getBindMobile(), content);
+                                            } catch (Exception e) {
+                                                e.printStackTrace();
+                                            }
+                                            if (sendSms) {
+                                                logger.info(">>>>>>>发送成功");
+                                            }
+                                            jedis.del("mess" + clubIdc);
+                                            coumt++;
+                                        }
+                                    }
+                                }
                             }
                         }
                     }
-                }
                 jedis.del("mess" + clubIdc);
                 System.out.println(jedis.rpop("mess" + clubIdc));
             });
-        }
 
         }
 
-//    }
-
-
     @RequestMapping(value = "save")
     public String save(CmCoupon cmCoupon, Model model, RedirectAttributes redirectAttributes) throws ParseException {
         if (!beanValidator(model, cmCoupon)) {
             return form(cmCoupon, model);
         }
+        Date date=new Date();
+        String curDateStr = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(date);
+//        ExecutorService pool = Executors.newFixedThreadPool(3);
         List<Integer> clubIds = messageCenterDao.ClubIds();
-        new Thread(() -> consumer(cmCoupon, clubIds)).start();
+
+//        new Thread(() -> consumer(cmCoupon, clubIds)).start();
+        consumer(cmCoupon, clubIds);
+
         RedisLearn.producer(clubIds);
+        MessageCenter messageCenter = new MessageCenter();
+        if (cmCoupon.getUserId() != null) {
+            Integer clubc = messageCenterDao.clubIdCule(cmCoupon.getUserId());
+            CmUser user = messageCenterDao.clubList(clubc);
+            messageCenter.setShopId(null);
+            messageCenter.setClubId(clubc);
+            messageCenter.setUserType(1);
+            messageCenter.setMessageType(4);
+            messageCenter.setContent(null);
+            messageCenter.setTime(curDateStr);
+            messageCenter.setCouponType(2);
+            messageCenter.setCouponMessageType(1);
+            messageCenter.setCouponFee(cmCoupon.getCouponAmount().doubleValue());
+            messageCenterDao.addMessageCenter(messageCenter);
+            String content = "为了答谢您对采美平台的支持,采美平台送您" + cmCoupon.getCouponAmount() + "元优惠券,快戳采美网站链接www.caimei365.com/M2Tr98CG 或微信搜索“采美采购商城”小程序登录采美平台领取吧。关注公众号“采美网”获取更多优惠和精彩资讯。";
+            boolean sendSms = false;
+            try {
+                sendSms =  SMSUtils.sendSms( user.getBindMobile(), content);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            if (sendSms) {
+                logger.info(">>>>>>>发送成功");
+            }
+        }
 
         cmCouponService.save(cmCoupon);
         addMessage(redirectAttributes, "保存优惠券成功");

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

@@ -717,7 +717,7 @@ public class CmReturnedPurchaseService extends CrudService<CmReturnedPurchaseDao
                         //部分退
                         String name=newOrder.getProductName();
                         if (name.length() > 10) {
-                            name = org.apache.commons.lang3.StringUtils.strip(name.substring(0, 11));
+                            name = StringUtils.strip(name.substring(0, 11));
                             name += "...";
                         }
                         String shortLink = newOrderService.getShortLink(8, 9, wwwServer + "user/order/detail.html?orderId=" + newOrder.getOrderID());

+ 20 - 11
src/main/java/com/caimei/modules/sys/web/NotificationController.java

@@ -97,7 +97,6 @@ public class NotificationController extends BaseController {
         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);
@@ -112,7 +111,7 @@ public class NotificationController extends BaseController {
                name+=",";
                productID+=",";
            }
-          name +="("+pro.get(i).getProductID().toString()+")"+pro.get(i).getProductName();
+          name +="("+pro.get(i).getProductID().toString()+")"+pro.get(i).getName();
            productID+=pro.get(i).getProductID().toString();
     }
         if(!"".equals(name)){
@@ -140,7 +139,7 @@ public class NotificationController extends BaseController {
                 name+=",";
                 productID+=",";
             }
-            name +="("+pro1.get(i).getProductID().toString()+")"+pro.get(i).getProductName();
+            name +="("+pro1.get(i).getProductID().toString()+")"+pro.get(i).getName();
             productID+=pro1.get(i).getProductID().toString();
         }
         if(!"".equals(name)){
@@ -168,7 +167,7 @@ public class NotificationController extends BaseController {
                 name+=",";
                 productID+=",";
             }
-            name +="("+pro2.get(i).getProductID().toString()+")"+pro.get(i).getProductName();
+            name +="("+pro2.get(i).getProductID().toString()+")"+pro.get(i).getName();
             productID+=pro2.get(i).getProductID().toString();
         }
         if(!"".equals(name)){
@@ -195,7 +194,7 @@ public class NotificationController extends BaseController {
                 name+=",";
                 productID+=",";
             }
-            name +="("+pro3.get(i).getProductID().toString()+")"+pro.get(i).getProductName();
+            name +="("+pro3.get(i).getProductID().toString()+")"+pro.get(i).getName();
             productID+=pro3.get(i).getProductID().toString();
         }
         if(!"".equals(name)){
@@ -314,7 +313,7 @@ public class NotificationController extends BaseController {
     }
 
 //    @Scheduled(cron = "0 0 11 * * ?")
-//@Scheduled(cron = "0 0/2 * * * ?")
+@Scheduled(cron = "0 0/3 * * * ?")
     public void mess() throws Exception {
         Date date=new Date();
         String name="";
@@ -468,6 +467,11 @@ if(count<=0){
         return "redirect:"+Global.getAdminPath()+"/sys/Notification/list";
     }
 
+    @RequestMapping(value = {"updates"})
+    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);
@@ -494,7 +498,8 @@ if(count<=0){
         notificationDao.hides();
         return "redirect:"+Global.getAdminPath()+"/sys/Notification/list";
     }
-//    @Scheduled(cron = "0 0/2 * * * ?")
+//    @Scheduled(cron = "0 0/15 * * * ?")
+@Scheduled(cron = "0 0/3 * * * ?")
     public void time(){
         logger.info("》》》》》》》》》》》开始检测商品资质证书和上架费是否过期");
         //械字号资质证书3个月后过期
@@ -541,6 +546,7 @@ if(count<=0){
                 messageCenter.setUserType(2);
                 messageCenter.setMessageType(2);
                 messageCenter.setShopMessType(5);
+                messageCenter.setProductId(pro.get(i).getProductID());
                 messageCenter.setContent("该商品的资质证书将于3个月后失效,请及时登录采美网站上传新证书。");
                 messageCenter.setTime(curDateStr);
                 messageCenterDao.addMessageCenter(messageCenter);
@@ -549,7 +555,7 @@ if(count<=0){
                     name+=",";
                     productID+=",";
                 }
-                name +="("+pro.get(i).getProductID().toString()+")"+pro.get(i).getProductName();
+                name +="("+pro.get(i).getProductID().toString()+")"+pro.get(i).getName();
                 productID+=pro.get(i).getProductID().toString();
             }
             if(!"".equals(name)){
@@ -570,6 +576,7 @@ if(count<=0){
                 messageCenter.setUserType(2);
                 messageCenter.setMessageType(2);
                 messageCenter.setShopMessType(5);
+                messageCenter.setProductId(pro1.get(i).getProductID());
                 messageCenter.setContent("该商品的资质证书将于1个月后失效,请及时登录采美网站上传新证书。");
                 messageCenter.setTime(curDateStr);
                 messageCenterDao.addMessageCenter(messageCenter);
@@ -577,7 +584,7 @@ if(count<=0){
                     name+=",";
                     productID+=",";
                 }
-                name +="("+pro1.get(i).getProductID().toString()+")"+pro.get(i).getProductName();
+                name +="("+pro1.get(i).getProductID().toString()+")"+pro.get(i).getName();
                 productID+=pro1.get(i).getProductID().toString();
             }
             if(!"".equals(name)){
@@ -598,6 +605,7 @@ if(count<=0){
                 messageCenter.setUserType(2);
                 messageCenter.setMessageType(2);
                 messageCenter.setShopMessType(5);
+                messageCenter.setProductId(pro2.get(i).getProductID());
                 messageCenter.setContent("该商品的资质证书将于7天后失效,请及时登录采美网站上传新证书。");
                 messageCenter.setTime(curDateStr);
                 messageCenterDao.addMessageCenter(messageCenter);
@@ -605,7 +613,7 @@ if(count<=0){
                     name+=",";
                     productID+=",";
                 }
-                name +="("+pro2.get(i).getProductID().toString()+")"+pro.get(i).getProductName();
+                name +="("+pro2.get(i).getProductID().toString()+")"+pro.get(i).getName();
                 productID+=pro2.get(i).getProductID().toString();
             }
             if(!"".equals(name)){
@@ -625,6 +633,7 @@ if(count<=0){
                 messageCenter.setUserType(2);
                 messageCenter.setMessageType(2);
                 messageCenter.setShopMessType(5);
+                messageCenter.setProductId(pro3.get(i).getProductID());
                 messageCenter.setContent("该商品的资质证书将于今天后失效,请及时登录采美网站上传新证书。");
                 messageCenter.setTime(curDateStr);
                 messageCenterDao.addMessageCenter(messageCenter);
@@ -632,7 +641,7 @@ if(count<=0){
                     name+=",";
                     productID+=",";
                 }
-                name +="("+pro3.get(i).getProductID().toString()+")"+pro.get(i).getProductName();
+                name +="("+pro3.get(i).getProductID().toString()+")"+pro.get(i).getName();
                 productID+=pro3.get(i).getProductID().toString();
             }
             if(!"".equals(name)){

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

@@ -214,50 +214,40 @@ public class NewCmShopController extends BaseController {
                 receiptDate+=" 00:00:01";
             }
             Date receipttime = formatter.parse(receiptDate);
+
             if(null==cmDiscern){
             //缴纳时间加一年==到期时间
             calendar.setTime(receipttime);
             calendar.add(Calendar.YEAR, 1);
             dateStrings= formatter.format(calendar.getTime());
-            num = dateStrings.compareTo(dateString);
-            }else {
+                calendars.setTime(receipttime);
+                calendars.add(Calendar.DATE, 1);
+                validityDate= formatter.format(calendars.getTime());
+                cmDiscernReceipt.setValidityDate(validityDate);
+                cmDiscernReceipt.setExpirationDate(dateStrings);
+                newCmShopService.cmreceipt(cmDiscernReceipt);
+            }
+            if(null!=cmDiscern) {
                 String receipt=cmDiscern.getExpirationDate();
                 if(!receipt.contains(":")){
                     receipt+=" 00:00:01";
                 }
+                calendars.setTime(receipttime);
+                calendars.add(Calendar.DATE, -1);
+                String letdele= formatter.format(calendars.getTime());
                 Date rece = formatter.parse(receipt);
                 calendar.setTime(rece);
                 calendar.add(Calendar.YEAR, 1);
                 dateStrings= formatter.format(calendar.getTime());
-                num = dateStrings.compareTo(dateString);
-            }
-            //到期时间如果小于当前时间就是过期了生效时间需要加1天
-            if (num < 0) {
-                calendars.setTime(receipttime);
-                calendars.add(Calendar.DATE, 1);
-                validityDate= formatter.format(calendars.getTime());
-                cmDiscernReceipt.setValidityDate(validityDate);
-                cmDiscernReceipt.setExpirationDate(dateStrings);
-            }
-            //到期时间如果大于当前时间就是续费了生效是到期时间需要加1年
-            if (num > 0) {
-                Date times = formatter.parse(receiptDate);
-                calendars.setTime(times);
-                calendars.add(Calendar.DATE, 1);
-                validityDate= formatter.format(calendars.getTime());
-                cmDiscernReceipt.setValidityDate(validityDate);
-
-                Date timed = formatter.parse(dateStrings);
-                calendar.setTime(timed);
-                calendar.add(Calendar.DATE, 1);
-                dateStrings= formatter.format(calendar.getTime());
-                cmDiscernReceipt.setExpirationDate(dateStrings);
+                num = letdele.compareTo(dateString);
+                logger.info(">>>>>>"+num);
+                if(num>0){
+                    cmDiscernReceipt.setValidityDate(cmDiscern.getExpirationDate());
+                    cmDiscernReceipt.setExpirationDate(dateStrings);
+                    newCmShopService.cmreceipt(cmDiscernReceipt);
+                }
             }
-            newCmShopService.cmreceipt(cmDiscernReceipt);
-
 
-            discernReceipt.getList().get(i).setValidityDate(cmDiscernReceipt.getValidityDate());
-            discernReceipt.getList().get(i).setExpirationDate(cmDiscernReceipt.getExpirationDate());
             cmDiscernReceipt.setReceiptID(discernReceipt.getList().get(i).getReceiptID());
             cmDiscernReceipt.setLinkMan(discernReceipt.getList().get(i).getLinkMan());
             System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"+num);
@@ -270,8 +260,6 @@ public class NewCmShopController extends BaseController {
 
     @RequestMapping(value = "Removethelastfee")
     public String Removethelastfee(CmDiscernReceipt cmDiscernReceipt,Model model) {
-
-
         CmOperationalLogs sysLog = new CmOperationalLogs();
         Date currentTime = new Date();
         SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
@@ -279,10 +267,12 @@ public class NewCmShopController extends BaseController {
         String dateString = formatter.format(currentTime);
         cmDiscernReceipt.setReceiptDate(dateString);
         cmDiscernReceipt.setReceStatct(2);
+        cmDiscernReceipt.setValidityDate(dateString);
         newCmShopService.Removethelastfee(cmDiscernReceipt);
 
         //获取操作时间
         sysLog.setOperationtime(new Date());
+        newCmShopService.cmreceipt(cmDiscernReceipt);
 
         //获取操作员
         SystemAuthorizingRealm.Principal principal = UserUtils.getPrincipal();
@@ -299,7 +289,7 @@ public class NewCmShopController extends BaseController {
             }
 
         }
-        return "redirect:" + Global.getAdminPath() + "/user/maintenanceList";
+        return "redirect:" + Global.getAdminPath() + "/user/newCmShop/maintenanceList?shopID="+cmDiscernReceipt.getShopID()+"&shopName"+cmDiscernReceipt.getShopName();
     }
     @RequestMapping(value = "Removethelast")
     public String Removethelast(CmDiscernReceipt cmDiscernReceipt,Model model)
@@ -371,6 +361,18 @@ public class NewCmShopController extends BaseController {
                 }
                 manufacturerStatus = "90";
                 smsMessage = "您提供的资料已审核通过,恭喜您成为采美平台供应商用户。您可通过申请时填写的手机号和密码登录采美平台管理您的账户。";
+                String curDateStr = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(date);
+                MessageCenter messageCenter = new MessageCenter();
+                messageCenter.setShopId(shopId);
+                messageCenter.setClubId(null);
+                messageCenter.setUserType(2);
+                messageCenter.setMessageType(2);
+                messageCenter.setShopMessType(1);
+                messageCenter.setContent(null);
+                messageCenter.setTime(curDateStr);
+                messageCenterDao.addMessageCenter(messageCenter);
+
+
             }
             if (StringUtils.equals("2", auditStatus)) {
                 //获取操作时间
@@ -395,7 +397,7 @@ public class NewCmShopController extends BaseController {
                 try {
                     logger.info("********供应商审核失败微信公众号推送********");
                     String unionid = newShopOrderDao.UnionId(userId);
-                    List<String> openidList = newShopOrderDao.getOpenidListByPermission("ox_1SwWx9u-HFIAZkQVFsE4NBRE0");
+                    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);
@@ -419,16 +421,6 @@ public class NewCmShopController extends BaseController {
             newCmShopService.updateShopAudit(auditStatus, auditNote, format, name, manufacturerStatus, shopId);
             map.put("success", true);
             map.put("msg", "审核成功");
-            String curDateStr = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(date);
-            MessageCenter messageCenter = new MessageCenter();
-            messageCenter.setShopId(shopId);
-            messageCenter.setClubId(null);
-            messageCenter.setUserType(2);
-            messageCenter.setMessageType(2);
-            messageCenter.setShopMessType(1);
-            messageCenter.setContent(null);
-            messageCenter.setTime(curDateStr);
-            messageCenterDao.addMessageCenter(messageCenter);
             if (StringUtils.isNotEmpty(mobile)) {
                 boolean sendSms = newOrderService.getSendSms(9, mobile, smsMessage);
                 if(sendSms){

+ 7 - 4
src/main/resources/mappings/modules/sys/Notification.xml

@@ -11,13 +11,15 @@
 	</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 * FROM `cm_discern_receipt` a
+						  LEFT JOIN cm_receipt s ON s.receiptID = a.id
+		WHERE a.newReceiptType=1 AND DATE_ADD(NOW(), INTERVAL #{yat} MONTH)>s.dateStrings  AND  s.dateStrings > NOW() AND a.receStatct=0
 	</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 * FROM `cm_discern_receipt` a
+		LEFT JOIN cm_receipt s ON s.receiptID = a.id
+		WHERE a.newReceiptType=1 AND DATE_ADD(NOW(), INTERVAL #{yat} DAY)>s.dateStrings  AND  s.dateStrings > NOW() AND a.receStatct=0
 	</select>
 
 	<select id="notification" resultType="com.caimei.modules.sys.entity.Notification">
@@ -27,6 +29,7 @@
 				and theme LIKE CONCAT('%',#{theme},'%')
 			</if>
 		</where>
+		ORDER BY newTime desc
 		<choose>
 			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
 				ORDER BY ${page.orderBy}

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

@@ -35,8 +35,8 @@
     </select>
 
     <select id="ClubIds" resultType="java.lang.Integer">
-        SELECT clubID FROM `user` WHERE YEAR(loginTime)>YEAR(NOW())-3 AND clubID IS NOT NULL
-#         ORDER BY clubID DESC
+        SELECT DISTINCT clubID FROM `user` WHERE YEAR(loginTime)>YEAR(NOW())-3 AND clubID IS NOT NULL
+        ORDER BY clubID DESC
     </select>
 
     <select id="userID" resultType="java.lang.Integer">

+ 3 - 2
src/main/resources/mappings/modules/user/NewCmShopMapper.xml

@@ -442,9 +442,10 @@
 
     <select id="maintenanceList" resultType="CmDiscernReceipt">
         SELECT
-        a.id as receiptID,a.shopID,a.receiptAmount,a.receiptDate,a.receStatct,s.linkMan
+        c.validityDate as validityDate, c.dateStrings as expirationDate,a.id as receiptID,a.shopID,a.receiptAmount,a.receiptDate,a.receStatct,s.linkMan
         FROM cm_discern_receipt a
         LEFT JOIN shop s ON s.shopID = a.shopID
+        LEFT JOIN cm_receipt c ON c.receiptID = a.id
         <where>
             AND a.shopID=#{shopID}
             AND a.newReceiptType=1
@@ -454,7 +455,7 @@
             <if test="endTime != null and endTime != ''">
                 AND (a.receiptDate &lt; #{endTime} OR a.receiptDate = #{endTime})
             </if>
-            and a.receStatct is not null
+            and a.receiptDate is not null
             ORDER BY a.receiptDate DESC
         </where>
         <choose>

+ 47 - 26
src/main/webapp/WEB-INF/views/modules/sys/Notification.jsp

@@ -12,29 +12,33 @@
         .table td {
             text-align: center;
         }
-
-        #redi {
+        .notice-cell{
+            cursor: pointer;
+        }
+        .notice-cell-hide{
+            display: none;
+        }
+        .radius {
             width: 10px;
-
             height: 10px;
-
             font: 12px/18px Arial;
-
             border-radius: 7px;
-
             display: inline-block;
-
             vertical-align: middle;
-
             position: relative;
-
+            margin: 6px;
+        }
+        .radius.none{
+            background: #666666;
+        }
+        .radius.red{
+            background: red;
         }
 
     </style>
     <script type="text/javascript">
         $(document).ready(function () {
             // $(".chopContent").hide()
-
         });
 
         function page(n, s) {
@@ -45,18 +49,41 @@
         }
 
         function connct(id, hide) {
-            window.location.href = "${ctx}/sys/Notification/hide?id=" + id + "&hide=" + hide;
+            <%--window.location.href = "${ctx}/sys/Notification/hide?id=" + id + "&hide=" + hide;--%>
         }
 
         function butt() {
-            window.location.href = "${ctx}/sys/Notification/update";
+            window.location.replace(window.location.href= "${ctx}/sys/Notification/update");
+            <%--window.location.href = "${ctx}/sys/Notification/update";--%>
             alertx("已清除所有未读消息")
         }
-
+        $(function () {
+            $('.notice-cell').each(function (index,el) {
+                var _that = $(this)
+                _that.click(function () {
+                    _that.find('.notice-cell-hide').toggle();
+                    var dataId = _that.attr('data-id');
+                    var dataSaved = _that.attr('data-saved');
+                    if(dataSaved === 1){
+                        return
+                    }else{
+                        $.ajax({
+                            url: "${ctx}/sys/Notification/updates?id="+dataId,
+                            data: {},
+                            type: "get",
+                            async: false,
+                            success: function (data) {
+                                _that.find('.radius').css({background:'#666666'});
+                            }
+                        });
+                    }
+                })
+            })
+        })
 
     </script>
 </head>
-<body>
+<body οnunlοad="window.opener.location.reload();">
 <ul class="nav nav-tabs">
     <li class="active"><a href="${ctx}/sys/Notification/list">通知中心</a></li>
 </ul>
@@ -84,27 +111,26 @@
     <tbody>
     <c:forEach items="${page.list}" var="list">
 
-        <tr>
+        <tr class="notice-cell" data-id="${list.id}" data-saved="${list.saved}">
             <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;" class="radius none"></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;" class="radius red"></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"
+				<a style="color: #0d0d0d; text-decoration: underline" class="notice-cell-hide"
                    href="${ctx}/product/new/productEdit?id=${age1}">${age},</a>
 			</span>
                             </c:if>
@@ -116,7 +142,7 @@
                         <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"
+				<a style="color: #0d0d0d; text-decoration: underline" class="notice-cell-hide"
                    href="${ctx}/user/newCmShop/maintenanceList?shopID=${age1}&shopName=${age}">${age},</a>
 			</span>
                             </c:if>
@@ -124,12 +150,7 @@
                     </c:forEach>
                 </c:if>
             </td>
-<%--            </c:if>--%>
-            <td><a onclick="connct(${list.id},${list.hide})" style="float: right">></a></td>
-
-                <%--			<td>--%>
-                <%--					--%>
-                <%--			</td>--%>
+            <td><i class="icon-chevron-right"></i></td>
         </tr>
     </c:forEach>
 

+ 13 - 9
src/main/webapp/WEB-INF/views/modules/sys/sysIndex.jsp

@@ -14,17 +14,19 @@
 		#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;
-			border-radius: 7px;
-			display: block;
+			width: 14px;
+			border-radius: 9px;
+			display: inline-block;
 			vertical-align: middle;
 			position: absolute;
 			background: red;
-			right: 6px;
-			top: 15px;
-			height: 10px;
+			right: 2px;
+			top: 10px;
+			height: 14px;
 			color: #f1f1f1;
-			font-size: 3px;
+			font-size: 12px;
+			line-height: 14px;
+			text-align: center;
 		}
 	</style>
 	<script type="text/javascript">
@@ -177,9 +179,11 @@
 						<a href="${ctx}/sys/Notification/list" target="mainFrame" style="position: relative;">
 							<i class="icon-bell"></i>
 							<c:if test="${count != 0}">
-								<span id="redi">${count}</span>
 								<c:if test="${count > 99}">
-							<span id="redi">99</span>
+							<span id="redi">99+</span>
+								</c:if>
+								<c:if test="${count < 99}">
+									<span id="redi">${count}</span>
 								</c:if>
 							</c:if>
 						</a>

+ 6 - 7
src/main/webapp/WEB-INF/views/modules/user/maintenanceList.jsp

@@ -213,16 +213,16 @@
 		<c:if test="${discernReceipt.receStatct eq 2}">
 			<td>免除上架费</td>
 			<td>${discernReceipt.receiptDate}</td>
-			<td>${discernReceipt.validityDate}</td>
+			<td>${discernReceipt.receiptDate}</td>
 			<td>--</td>
 			<td>
-				<a href="javascript:void(0);" onclick="offoceb(${discernReceipt.receiptID},'${CmDiscernReceipt.shopName}','${CmDiscernReceipt.linkMan}')">取消</a>
+				<a href="javascript:void(0);" onclick="offoceb(${discernReceipt.receiptID},'${CmDiscernReceipt.shopName}','${CmDiscernReceipt.linkMan}','${CmDiscernReceipt.shopID}')">取消</a>
 			</td>
 		</c:if>
 		<c:if test="${discernReceipt.receStatct eq 1}">
 			<td>免除上架费<span style="color: red">(已取消)</span></td>
 			<td>${discernReceipt.receiptDate}</td>
-			<td>${discernReceipt.validityDate}</td>
+			<td>${discernReceipt.receiptDate}</td>
 			<td>--</td>
 			<td>
 				--
@@ -252,11 +252,10 @@
 			}
 		} ,{ buttons: {  '确定': 1,'取消':2}});
 	}
-	function offoceb(id,linkMan,shopName) {
-		$.jBox.confirm("确定取消免除该供应商上架费吗??","提示",function(v,h,f){
-
+	function offoceb(id,linkMan,shopName,shopID) {
+		$.jBox.confirm("确定取消免除该供应商上架费吗?","提示",function(v,h,f){
 			if(v === 1){
-				window.location.href="${ctx}/user/newCmShop/Removethelast?receiptID="+id+"&linkMan="+linkMan+"&shopName="+shopName;
+				window.location.href="${ctx}/user/newCmShop/Removethelast?receiptID="+id+"&linkMan="+linkMan+"&shopName="+shopName+"&shopID="+shopID;
 			}
 		} ,{ buttons: {  '确定': 1,'取消':2}});
 	}