| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.common.constant.factory.PageFactory; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | | import com.stylefeng.guns.core.util.SinataUtil; |
| | | import com.stylefeng.guns.modular.system.model.TDriver; |
| | | import com.stylefeng.guns.modular.system.model.TSystemNotice; |
| | | import com.stylefeng.guns.modular.system.model.TUser; |
| | | import com.stylefeng.guns.modular.system.service.ITDriverService; |
| | | import com.stylefeng.guns.modular.system.service.ITSystemNoticeService; |
| | | import com.stylefeng.guns.modular.system.service.ITUserService; |
| | | import com.stylefeng.guns.modular.system.util.JpushUtil; |
| | | import com.stylefeng.guns.modular.system.util.task.base.QuartzManager; |
| | | import com.stylefeng.guns.modular.system.util.task.base.TimeJobType; |
| | | import com.stylefeng.guns.modular.system.util.task.jobs.AddNotice; |
| | |
| | | |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | @Autowired |
| | | private ITDriverService driverService; |
| | | |
| | | @Autowired |
| | | private ITUserService tUserService; |
| | | |
| | | @Autowired |
| | | private ITSystemNoticeService noticeService; |
| | | /** |
| | | * 新增系统公告 |
| | | */ |
| | |
| | | tNotices.setIsUser(isUser); |
| | | tNotices.setIsDriver(isDriver); |
| | | tNoticesService.insert(tNotices); |
| | | if (tNotices.getIsUser() == 2){ |
| | | List<TUser> tUsers = tUserService.selectList(new EntityWrapper<TUser>().eq("state",1) |
| | | .ne("flag",3)); |
| | | //发送公告给用户 |
| | | for (TUser user : tUsers){ |
| | | TSystemNotice notice = new TSystemNotice(); |
| | | notice.setType(1); |
| | | notice.setUserType(1); |
| | | notice.setNoticesId(tNotices.getId()); |
| | | notice.setContent(tNotices.getContent()); |
| | | notice.setUserId(user.getId()); |
| | | notice.setInsertTime(new Date()); |
| | | notice.setRead(1); |
| | | noticeService.insert(notice); |
| | | |
| | | /*Map<String,Object> map = new HashMap<String,Object>(); |
| | | map.put("sound", userInfo.getIsVoice()); //是否有声音 1=否 2=是 |
| | | map.put("vibrate", userInfo.getIsShake()); //是否有震动 1=否 2=是 |
| | | map.put("type", 2); //消息类型 1=互动 2=公告 |
| | | map.put("id", record.getId()); //对象ID |
| | | JpushUtil.SendPushWithCustomForTransmission(String.valueOf(userInfo.getId()),"【超级过客】提醒您,您有一条新的公告消息。","通知消息",map);*/ |
| | | } |
| | | } |
| | | if (tNotices.getIsDriver() == 2){ |
| | | List<TDriver> tDrivers = driverService.selectList(new EntityWrapper<TDriver>().eq("authState",2) |
| | | .ne("flag",3)); |
| | | //发送公告给用户 |
| | | for (TDriver driver : tDrivers){ |
| | | TSystemNotice notice = new TSystemNotice(); |
| | | notice.setType(1); |
| | | notice.setUserType(2); |
| | | notice.setNoticesId(tNotices.getId()); |
| | | notice.setContent(tNotices.getContent()); |
| | | notice.setUserId(driver.getId()); |
| | | notice.setInsertTime(new Date()); |
| | | notice.setRead(1); |
| | | noticeService.insert(notice); |
| | | |
| | | /*Map<String,Object> map = new HashMap<String,Object>(); |
| | | map.put("sound", userInfo.getIsVoice()); //是否有声音 1=否 2=是 |
| | | map.put("vibrate", userInfo.getIsShake()); //是否有震动 1=否 2=是 |
| | | map.put("type", 2); //消息类型 1=互动 2=公告 |
| | | map.put("id", record.getId()); //对象ID |
| | | JpushUtil.SendPushWithCustomForTransmission(String.valueOf(userInfo.getId()),"【超级过客】提醒您,您有一条新的公告消息。","通知消息",map);*/ |
| | | |
| | | // if (tNotices.getIsBroadcast() == 1){ |
| | | // //增加极光推送 |
| | | // JpushUtil.SendPushWithCustomForSh("DRIVER"+driver.getId().toString(),tNotices.getTitle(),"通知消息",null); |
| | | // } |
| | | |
| | | } |
| | | } |
| | | if (tNotices.getIsShow() == 1){ //发布 |
| | | //定时1秒后执行 |
| | | Map<String,Object> maps=new HashMap<>(); |