| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | 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.util.DateUtil; |
| | | import com.stylefeng.guns.core.log.LogObjectHolder; |
| | | import com.stylefeng.guns.core.util.SinataUtil; |
| | | import com.stylefeng.guns.modular.system.model.TAdvertisement; |
| | | import com.stylefeng.guns.modular.system.model.TRegion; |
| | | import com.stylefeng.guns.modular.system.service.ITAdvertisementService; |
| | | import com.stylefeng.guns.modular.system.service.ITRegionService; |
| | | 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.TAdvertisement; |
| | | import com.stylefeng.guns.modular.system.service.ITAdvertisementService; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | @Controller |
| | | @RequestMapping("/tAdvertisement") |
| | | public class TAdvertisementController extends BaseController { |
| | | |
| | | |
| | | private String PREFIX = "/system/tAdvertisement/"; |
| | | |
| | | |
| | | @Autowired |
| | | private ITAdvertisementService tAdvertisementService; |
| | | |
| | | |
| | | @Resource |
| | | private ShiroExtUtil shiroExtUtil; |
| | | |
| | | @Autowired |
| | | private ITRegionService tRegionService; |
| | | |
| | | |
| | | /** |
| | | * 跳转到广告设置首页 |
| | | */ |
| | |
| | | @ResponseBody |
| | | public Object add(TAdvertisement tAdvertisement) { |
| | | tAdvertisement.setInsertTime(new Date()); |
| | | tAdvertisement.setInsertUser(ShiroExtUtil.getUser().getId()); |
| | | tAdvertisement.setInsertUser(shiroExtUtil.getUser().getId()); |
| | | tAdvertisementService.insert(tAdvertisement); |
| | | return SUCCESS_TIP; |
| | | } |
| | |
| | | @ResponseBody |
| | | public Object opt(@RequestParam Integer tAdvertisementId,@RequestParam Integer optType) { |
| | | TAdvertisement tAdvertisement = tAdvertisementService.selectById(tAdvertisementId); |
| | | if (SinataUtil.isNotEmpty(tAdvertisement)){ |
| | | if (1 == optType.intValue()){ //上线 |
| | | if (SinataUtil.isNotEmpty(tAdvertisement)) { |
| | | if (1 == optType.intValue()) { //上线 |
| | | tAdvertisement.setState(1); |
| | | }else if (2 == optType.intValue()){ //下线 |
| | | } else if (2 == optType.intValue()) { //下线 |
| | | tAdvertisement.setState(2); |
| | | } |
| | | tAdvertisement.setUpdateTime(new Date()); |
| | | tAdvertisement.setUpdateUser(ShiroExtUtil.getUser().getId()); |
| | | tAdvertisement.setUpdateUser(shiroExtUtil.getUser().getId()); |
| | | tAdvertisementService.updateById(tAdvertisement); |
| | | } |
| | | return SUCCESS_TIP; |
| | |
| | | @ResponseBody |
| | | public Object update(TAdvertisement tAdvertisement) { |
| | | tAdvertisement.setUpdateTime(new Date()); |
| | | tAdvertisement.setUpdateUser(ShiroExtUtil.getUser().getId()); |
| | | tAdvertisement.setUpdateUser(shiroExtUtil.getUser().getId()); |
| | | tAdvertisementService.updateById(tAdvertisement); |
| | | return SUCCESS_TIP; |
| | | } |