| | |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.beetl.ShiroExtUtil; |
| | | import com.stylefeng.guns.core.common.constant.factory.PageFactory; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | |
| | | import com.stylefeng.guns.core.log.LogObjectHolder; |
| | | import com.stylefeng.guns.core.util.SinataUtil; |
| | | import com.stylefeng.guns.modular.system.model.TNotices; |
| | | import com.stylefeng.guns.modular.system.service.ITNoticesService; |
| | | import com.stylefeng.guns.modular.system.util.DateUtil; |
| | | 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 org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.stylefeng.guns.core.log.LogObjectHolder; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import com.stylefeng.guns.modular.system.model.TNotices; |
| | | import com.stylefeng.guns.modular.system.service.ITNoticesService; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | |
| | | endTime = timeArray[1]; |
| | | } |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | if (ShiroKit.getUser().getRoleType() != 1){ |
| | | if (ShiroExtUtil.getUser().getRoleType() != 1) { |
| | | page.setRecords(null); |
| | | }else{ |
| | | page.setRecords(tNoticesService.getRollingNoticeList(page,beginTime,endTime,1,content)); |
| | |
| | | endTime = timeArray[1]; |
| | | } |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | if (ShiroKit.getUser().getRoleType() != 1){ |
| | | if (ShiroExtUtil.getUser().getRoleType() != 1) { |
| | | page.setRecords(null); |
| | | }else{ |
| | | page.setRecords(tNoticesService.getRollingNoticeList(page,beginTime,endTime,2,content)); |
| | |
| | | public Object add(TNotices tNotices) { |
| | | tNotices.setIsDelete(1); |
| | | tNotices.setInsertTime(new Date()); |
| | | tNotices.setInsertUser(ShiroKit.getUser().getId()); |
| | | tNotices.setInsertUser(ShiroExtUtil.getUser().getId()); |
| | | tNotices.setType(1); |
| | | tNoticesService.insert(tNotices); |
| | | return SUCCESS_TIP; |
| | |
| | | public Object addSystem(TNotices tNotices) { |
| | | tNotices.setIsDelete(1); |
| | | tNotices.setInsertTime(new Date()); |
| | | tNotices.setInsertUser(ShiroKit.getUser().getId()); |
| | | tNotices.setInsertUser(ShiroExtUtil.getUser().getId()); |
| | | tNotices.setType(2); |
| | | tNoticesService.insert(tNotices); |
| | | |
| | |
| | | } |
| | | tNotices.setIsShow(1); |
| | | tNotices.setUpdateTime(new Date()); |
| | | tNotices.setUpdateUser(ShiroKit.getUser().getId()); |
| | | tNotices.setUpdateUser(ShiroExtUtil.getUser().getId()); |
| | | tNoticesService.updateById(tNotices); |
| | | return SUCCESS_TIP; |
| | | } |
| | |
| | | tNotices.setIsDelete(2); |
| | | tNotices.setFlag("3"); |
| | | tNotices.setUpdateTime(new Date()); |
| | | tNotices.setUpdateUser(ShiroKit.getUser().getId()); |
| | | tNotices.setUpdateUser(ShiroExtUtil.getUser().getId()); |
| | | tNoticesService.updateById(tNotices); |
| | | return SUCCESS_TIP; |
| | | } |
| | |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(TNotices tNotices) { |
| | | tNotices.setUpdateUser(ShiroKit.getUser().getId()); |
| | | tNotices.setUpdateUser(ShiroExtUtil.getUser().getId()); |
| | | tNotices.setUpdateTime(new Date()); |
| | | tNoticesService.updateById(tNotices); |
| | | return SUCCESS_TIP; |
| | |
| | | @RequestMapping(value = "/updateSystem") |
| | | @ResponseBody |
| | | public Object updateSystem(TNotices tNotices) { |
| | | tNotices.setUpdateUser(ShiroKit.getUser().getId()); |
| | | tNotices.setUpdateUser(ShiroExtUtil.getUser().getId()); |
| | | tNotices.setUpdateTime(new Date()); |
| | | tNoticesService.updateById(tNotices); |
| | | |