New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | 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.RequestParam; |
| | | import com.stylefeng.guns.modular.system.model.TBroadcast; |
| | | import com.stylefeng.guns.modular.system.service.ITBroadcastService; |
| | | |
| | | /** |
| | | * 控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2023-03-16 10:38:00 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/tBroadcast") |
| | | public class TBroadcastController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/tBroadcast/"; |
| | | |
| | | @Autowired |
| | | private ITBroadcastService tBroadcastService; |
| | | |
| | | /** |
| | | * 跳转到首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "tBroadcast.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加 |
| | | */ |
| | | @RequestMapping("/tBroadcast_add") |
| | | public String tBroadcastAdd() { |
| | | return PREFIX + "tBroadcast_add.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改 |
| | | */ |
| | | @RequestMapping("/tBroadcast_update/{tBroadcastId}") |
| | | public String tBroadcastUpdate(@PathVariable Integer tBroadcastId, Model model) { |
| | | TBroadcast tBroadcast = tBroadcastService.selectById(tBroadcastId); |
| | | model.addAttribute("item",tBroadcast); |
| | | LogObjectHolder.me().set(tBroadcast); |
| | | return PREFIX + "tBroadcast_edit.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String condition) { |
| | | return tBroadcastService.selectList(null); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | */ |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add(TBroadcast tBroadcast) { |
| | | tBroadcastService.insert(tBroadcast); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer tBroadcastId) { |
| | | tBroadcastService.deleteById(tBroadcastId); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(TBroadcast tBroadcast) { |
| | | tBroadcastService.updateById(tBroadcast); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 详情 |
| | | */ |
| | | @RequestMapping(value = "/detail/{tBroadcastId}") |
| | | @ResponseBody |
| | | public Object detail(@PathVariable("tBroadcastId") Integer tBroadcastId) { |
| | | return tBroadcastService.selectById(tBroadcastId); |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | 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.RequestParam; |
| | | import com.stylefeng.guns.modular.system.model.TCommercial; |
| | | import com.stylefeng.guns.modular.system.service.ITCommercialService; |
| | | |
| | | /** |
| | | * 控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2023-03-16 10:38:08 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/tCommercial") |
| | | public class TCommercialController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/tCommercial/"; |
| | | |
| | | @Autowired |
| | | private ITCommercialService tCommercialService; |
| | | |
| | | /** |
| | | * 跳转到首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "tCommercial.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加 |
| | | */ |
| | | @RequestMapping("/tCommercial_add") |
| | | public String tCommercialAdd() { |
| | | return PREFIX + "tCommercial_add.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改 |
| | | */ |
| | | @RequestMapping("/tCommercial_update/{tCommercialId}") |
| | | public String tCommercialUpdate(@PathVariable Integer tCommercialId, Model model) { |
| | | TCommercial tCommercial = tCommercialService.selectById(tCommercialId); |
| | | model.addAttribute("item",tCommercial); |
| | | LogObjectHolder.me().set(tCommercial); |
| | | return PREFIX + "tCommercial_edit.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String condition) { |
| | | return tCommercialService.selectList(null); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | */ |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add(TCommercial tCommercial) { |
| | | tCommercialService.insert(tCommercial); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer tCommercialId) { |
| | | tCommercialService.deleteById(tCommercialId); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(TCommercial tCommercial) { |
| | | tCommercialService.updateById(tCommercial); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 详情 |
| | | */ |
| | | @RequestMapping(value = "/detail/{tCommercialId}") |
| | | @ResponseBody |
| | | public Object detail(@PathVariable("tCommercialId") Integer tCommercialId) { |
| | | return tCommercialService.selectById(tCommercialId); |
| | | } |
| | | } |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.base.tips.SuccessTip; |
| | | import com.stylefeng.guns.core.log.LogObjectHolder; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.shiro.ShiroUser; |
| | | import com.stylefeng.guns.core.shiro.factory.IShiro; |
| | | import com.stylefeng.guns.core.shiro.factory.ShiroFactroy; |
| | | import com.stylefeng.guns.modular.system.controller.util.ExcelUtil; |
| | | import com.stylefeng.guns.modular.system.enums.TBillStateEnum; |
| | | import com.stylefeng.guns.modular.system.model.TBill; |
| | | import com.stylefeng.guns.modular.system.model.User; |
| | | import com.stylefeng.guns.modular.system.service.ITBillService; |
| | | import com.stylefeng.guns.modular.system.service.IUserService; |
| | | import com.stylefeng.guns.modular.system.util.AESUtils; |
| | | import com.stylefeng.guns.modular.system.util.DateUtil; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
| | | import org.apache.shiro.authc.SimpleAuthenticationInfo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.OutputStream; |
| | | import java.math.BigDecimal; |
| | | import java.text.DateFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | | import com.stylefeng.guns.modular.system.enums.UserTypeEnum; |
| | | import com.stylefeng.guns.modular.system.model.TDriver; |
| | | import com.stylefeng.guns.modular.system.model.TSystemBulletinUser; |
| | | import com.stylefeng.guns.modular.system.service.ITDriverService; |
| | | import com.stylefeng.guns.modular.system.service.ITSystemBulletinUserService; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.StringUtils; |
| | | 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.RequestParam; |
| | | import com.stylefeng.guns.modular.system.model.TSystemBulletin; |
| | | import com.stylefeng.guns.modular.system.service.ITSystemBulletinService; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2023-03-16 10:38:23 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/tSystemBulletin") |
| | | public class TSystemBulletinController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/tSystemBulletin/"; |
| | | |
| | | @Autowired |
| | | private ITSystemBulletinService tSystemBulletinService; |
| | | @Autowired |
| | | private ITDriverService tDriverService; |
| | | @Autowired |
| | | private ITSystemBulletinUserService tSystemBulletinUserService; |
| | | |
| | | /** |
| | | * 跳转到首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "tSystemBulletin.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加 |
| | | */ |
| | | @RequestMapping("/tSystemBulletin_add") |
| | | public String tSystemBulletinAdd() { |
| | | return PREFIX + "tSystemBulletin_add.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改 |
| | | */ |
| | | @RequestMapping("/tSystemBulletin_update/{tSystemBulletinId}") |
| | | public String tSystemBulletinUpdate(@PathVariable Integer tSystemBulletinId, Model model) { |
| | | TSystemBulletin tSystemBulletin = tSystemBulletinService.selectById(tSystemBulletinId); |
| | | model.addAttribute("item",tSystemBulletin); |
| | | LogObjectHolder.me().set(tSystemBulletin); |
| | | return PREFIX + "tSystemBulletin_edit.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String createTime,String content) { |
| | | |
| | | EntityWrapper<TSystemBulletin> wrapper = new EntityWrapper<>(); |
| | | |
| | | if(StringUtils.hasLength(content)){ |
| | | wrapper.like("content",content); |
| | | } |
| | | if(StringUtils.hasLength(createTime)){ |
| | | String[] split = createTime.split(" - "); |
| | | Date startTime = DateUtil.getDate_str4(split[0]); |
| | | Date endTime = DateUtil.getDate_str4(split[1]); |
| | | wrapper.between("createTime",startTime,endTime); |
| | | } |
| | | return tSystemBulletinService.selectList(wrapper); |
| | | } |
| | | |
| | | /** |
| | | * 获取列表 |
| | | */ |
| | | @RequestMapping(value = "/list-back") |
| | | @ResponseBody |
| | | public Object listBack(String condition) { |
| | | return tSystemBulletinService.selectList(null); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | */ |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Object add(TSystemBulletin tSystemBulletin) { |
| | | tSystemBulletin.setState(1); |
| | | tSystemBulletin.setCreateTime(new Date()); |
| | | tSystemBulletin.setStatus(1); |
| | | tSystemBulletinService.insert(tSystemBulletin); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 新增发送 |
| | | */ |
| | | @RequestMapping(value = "/addSend") |
| | | @ResponseBody |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Object addSend(TSystemBulletin tSystemBulletin) { |
| | | tSystemBulletin.setState(2); |
| | | tSystemBulletin.setCreateTime(new Date()); |
| | | tSystemBulletin.setStatus(1); |
| | | tSystemBulletinService.insert(tSystemBulletin); |
| | | tSystemBulletinService.sendBulletin(tSystemBulletin); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 编辑发送 |
| | | */ |
| | | @RequestMapping(value = "/editSend") |
| | | @ResponseBody |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Object editSend(TSystemBulletin tSystemBulletin) { |
| | | tSystemBulletin.setState(2); |
| | | tSystemBulletinService.updateById(tSystemBulletin); |
| | | tSystemBulletinService.sendBulletin(tSystemBulletin); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer tSystemBulletinId) { |
| | | tSystemBulletinService.deleteById(tSystemBulletinId); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(TSystemBulletin tSystemBulletin) { |
| | | tSystemBulletinService.updateById(tSystemBulletin); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 详情 |
| | | */ |
| | | @RequestMapping(value = "/detail/{tSystemBulletinId}") |
| | | @ResponseBody |
| | | public Object detail(@PathVariable("tSystemBulletinId") Integer tSystemBulletinId) { |
| | | return tSystemBulletinService.selectById(tSystemBulletinId); |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.dao; |
| | | |
| | | import com.stylefeng.guns.modular.system.model.TBroadcast; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 广播 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author stylefeng |
| | | * @since 2023-03-16 |
| | | */ |
| | | public interface TBroadcastMapper extends BaseMapper<TBroadcast> { |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.dao; |
| | | |
| | | import com.stylefeng.guns.modular.system.model.TCommercial; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 广告 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author stylefeng |
| | | * @since 2023-03-16 |
| | | */ |
| | | public interface TCommercialMapper extends BaseMapper<TCommercial> { |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.dao; |
| | | |
| | | import com.stylefeng.guns.modular.system.model.TSystemBulletin; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 系统公告 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author stylefeng |
| | | * @since 2023-03-16 |
| | | */ |
| | | public interface TSystemBulletinMapper extends BaseMapper<TSystemBulletin> { |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.dao; |
| | | |
| | | import com.stylefeng.guns.modular.system.model.TSystemBulletinUser; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 系统公告-用户关系 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author stylefeng |
| | | * @since 2023-03-16 |
| | | */ |
| | | public interface TSystemBulletinUserMapper extends BaseMapper<TSystemBulletinUser> { |
| | | |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.stylefeng.guns.modular.system.dao.TBroadcastMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.TBroadcast"> |
| | | <id column="id" property="id" /> |
| | | <result column="content" property="content" /> |
| | | <result column="sort" property="sort" /> |
| | | <result column="status" property="status" /> |
| | | <result column="createTime" property="createTime" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, content, sort, status, createTime |
| | | </sql> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.stylefeng.guns.modular.system.dao.TCommercialMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.TCommercial"> |
| | | <id column="id" property="id" /> |
| | | <result column="type" property="type" /> |
| | | <result column="name" property="name" /> |
| | | <result column="url" property="url" /> |
| | | <result column="device" property="device" /> |
| | | <result column="isJump" property="isJump" /> |
| | | <result column="jumpType" property="jumpType" /> |
| | | <result column="jumpUrl" property="jumpUrl" /> |
| | | <result column="html" property="html" /> |
| | | <result column="sort" property="sort" /> |
| | | <result column="status" property="status" /> |
| | | <result column="createTime" property="createTime" /> |
| | | <result column="createUserId" property="createUserId" /> |
| | | <result column="updateTime" property="updateTime" /> |
| | | <result column="updateUserId" property="updateUserId" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, type, name, url, device, isJump, jumpType, jumpUrl, html, sort, status, createTime, createUserId, updateTime, updateUserId |
| | | </sql> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.stylefeng.guns.modular.system.dao.TSystemBulletinMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.TSystemBulletin"> |
| | | <id column="id" property="id" /> |
| | | <result column="introduce" property="introduce" /> |
| | | <result column="img" property="img" /> |
| | | <result column="content" property="content" /> |
| | | <result column="status" property="status" /> |
| | | <result column="createTime" property="createTime" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, introduce, img, content, status, createTime |
| | | </sql> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.stylefeng.guns.modular.system.dao.TSystemBulletinUserMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.TSystemBulletinUser"> |
| | | <id column="id" property="id" /> |
| | | <result column="systemBulletinId" property="systemBulletinId" /> |
| | | <result column="userType" property="userType" /> |
| | | <result column="userId" property="userId" /> |
| | | <result column="isRead" property="isRead" /> |
| | | <result column="status" property="status" /> |
| | | <result column="createTime" property="createTime" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, systemBulletinId, userType, userId, isRead, status, createTime |
| | | </sql> |
| | | |
| | | </mapper> |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import java.util.Date; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.activerecord.Model; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p> |
| | | * 广播 |
| | | * </p> |
| | | * |
| | | * @author stylefeng |
| | | * @since 2023-03-16 |
| | | */ |
| | | @TableName("t_broadcast") |
| | | public class TBroadcast extends Model<TBroadcast> { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 消息内容 |
| | | */ |
| | | private String content; |
| | | /** |
| | | * 排序 |
| | | */ |
| | | private Integer sort; |
| | | /** |
| | | * 状态(1=正常,2=冻结,3=删除) |
| | | */ |
| | | private Integer status; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | private Date createTime; |
| | | |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Integer id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getContent() { |
| | | return content; |
| | | } |
| | | |
| | | public void setContent(String content) { |
| | | this.content = content; |
| | | } |
| | | |
| | | public Integer getSort() { |
| | | return sort; |
| | | } |
| | | |
| | | public void setSort(Integer sort) { |
| | | this.sort = sort; |
| | | } |
| | | |
| | | public Integer getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(Integer status) { |
| | | this.status = status; |
| | | } |
| | | |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "TBroadcast{" + |
| | | "id=" + id + |
| | | ", content=" + content + |
| | | ", sort=" + sort + |
| | | ", status=" + status + |
| | | ", createTime=" + createTime + |
| | | "}"; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import java.util.Date; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.activerecord.Model; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p> |
| | | * 广告 |
| | | * </p> |
| | | * |
| | | * @author stylefeng |
| | | * @since 2023-03-16 |
| | | */ |
| | | @TableName("t_commercial") |
| | | public class TCommercial extends Model<TCommercial> { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 类型(1=弹窗广告,2=底部广告) |
| | | */ |
| | | private Integer type; |
| | | /** |
| | | * 名称 |
| | | */ |
| | | private String name; |
| | | /** |
| | | * 广告地址 |
| | | */ |
| | | private String url; |
| | | /** |
| | | * 设备(1=小程序,2=司机端) |
| | | */ |
| | | private Integer device; |
| | | /** |
| | | * 是否跳转(0=否,1=是) |
| | | */ |
| | | private Integer isJump; |
| | | /** |
| | | * 跳转类型(1=内部跳转,2=外部跳转) |
| | | */ |
| | | private Integer jumpType; |
| | | /** |
| | | * 跳转连接 |
| | | */ |
| | | private String jumpUrl; |
| | | /** |
| | | * 富文本 |
| | | */ |
| | | private String html; |
| | | /** |
| | | * 排序 |
| | | */ |
| | | private Integer sort; |
| | | /** |
| | | * 状态(1=正常,2=冻结,3=删除) |
| | | */ |
| | | private Integer status; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | private Date createTime; |
| | | /** |
| | | * 添加人员id |
| | | */ |
| | | private Integer createUserId; |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | private Date updateTime; |
| | | /** |
| | | * 更新人员id |
| | | */ |
| | | private Integer updateUserId; |
| | | |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Integer id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public Integer getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(Integer type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getUrl() { |
| | | return url; |
| | | } |
| | | |
| | | public void setUrl(String url) { |
| | | this.url = url; |
| | | } |
| | | |
| | | public Integer getDevice() { |
| | | return device; |
| | | } |
| | | |
| | | public void setDevice(Integer device) { |
| | | this.device = device; |
| | | } |
| | | |
| | | public Integer getIsJump() { |
| | | return isJump; |
| | | } |
| | | |
| | | public void setIsJump(Integer isJump) { |
| | | this.isJump = isJump; |
| | | } |
| | | |
| | | public Integer getJumpType() { |
| | | return jumpType; |
| | | } |
| | | |
| | | public void setJumpType(Integer jumpType) { |
| | | this.jumpType = jumpType; |
| | | } |
| | | |
| | | public String getJumpUrl() { |
| | | return jumpUrl; |
| | | } |
| | | |
| | | public void setJumpUrl(String jumpUrl) { |
| | | this.jumpUrl = jumpUrl; |
| | | } |
| | | |
| | | public String getHtml() { |
| | | return html; |
| | | } |
| | | |
| | | public void setHtml(String html) { |
| | | this.html = html; |
| | | } |
| | | |
| | | public Integer getSort() { |
| | | return sort; |
| | | } |
| | | |
| | | public void setSort(Integer sort) { |
| | | this.sort = sort; |
| | | } |
| | | |
| | | public Integer getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(Integer status) { |
| | | this.status = status; |
| | | } |
| | | |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public Integer getCreateUserId() { |
| | | return createUserId; |
| | | } |
| | | |
| | | public void setCreateUserId(Integer createUserId) { |
| | | this.createUserId = createUserId; |
| | | } |
| | | |
| | | public Date getUpdateTime() { |
| | | return updateTime; |
| | | } |
| | | |
| | | public void setUpdateTime(Date updateTime) { |
| | | this.updateTime = updateTime; |
| | | } |
| | | |
| | | public Integer getUpdateUserId() { |
| | | return updateUserId; |
| | | } |
| | | |
| | | public void setUpdateUserId(Integer updateUserId) { |
| | | this.updateUserId = updateUserId; |
| | | } |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "TCommercial{" + |
| | | "id=" + id + |
| | | ", type=" + type + |
| | | ", name=" + name + |
| | | ", url=" + url + |
| | | ", device=" + device + |
| | | ", isJump=" + isJump + |
| | | ", jumpType=" + jumpType + |
| | | ", jumpUrl=" + jumpUrl + |
| | | ", html=" + html + |
| | | ", sort=" + sort + |
| | | ", status=" + status + |
| | | ", createTime=" + createTime + |
| | | ", createUserId=" + createUserId + |
| | | ", updateTime=" + updateTime + |
| | | ", updateUserId=" + updateUserId + |
| | | "}"; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import java.util.Date; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.activerecord.Model; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p> |
| | | * 系统公告 |
| | | * </p> |
| | | * |
| | | * @author stylefeng |
| | | * @since 2023-03-16 |
| | | */ |
| | | @TableName("t_system_bulletin") |
| | | public class TSystemBulletin extends Model<TSystemBulletin> { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 标题 |
| | | */ |
| | | private String introduce; |
| | | /** |
| | | * 图片 |
| | | */ |
| | | private String img; |
| | | /** |
| | | * 内容 |
| | | */ |
| | | private String content; |
| | | /** |
| | | * 状态(1=正常,2=冻结,3=删除) |
| | | */ |
| | | private Integer status; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | private Date createTime; |
| | | /** |
| | | * 是否发送 1未发送 2已发送 |
| | | */ |
| | | private Integer state; |
| | | |
| | | public Integer getState() { |
| | | return state; |
| | | } |
| | | |
| | | public void setState(Integer state) { |
| | | this.state = state; |
| | | } |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Integer id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getIntroduce() { |
| | | return introduce; |
| | | } |
| | | |
| | | public void setIntroduce(String introduce) { |
| | | this.introduce = introduce; |
| | | } |
| | | |
| | | public String getImg() { |
| | | return img; |
| | | } |
| | | |
| | | public void setImg(String img) { |
| | | this.img = img; |
| | | } |
| | | |
| | | public String getContent() { |
| | | return content; |
| | | } |
| | | |
| | | public void setContent(String content) { |
| | | this.content = content; |
| | | } |
| | | |
| | | public Integer getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(Integer status) { |
| | | this.status = status; |
| | | } |
| | | |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "TSystemBulletin{" + |
| | | "id=" + id + |
| | | ", introduce=" + introduce + |
| | | ", img=" + img + |
| | | ", content=" + content + |
| | | ", status=" + status + |
| | | ", createTime=" + createTime + |
| | | "}"; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import java.util.Date; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.activerecord.Model; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p> |
| | | * 系统公告-用户关系 |
| | | * </p> |
| | | * |
| | | * @author stylefeng |
| | | * @since 2023-03-16 |
| | | */ |
| | | @TableName("t_system_bulletin_user") |
| | | public class TSystemBulletinUser extends Model<TSystemBulletinUser> { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | /** |
| | | * 系统公告 |
| | | */ |
| | | private Integer systemBulletinId; |
| | | /** |
| | | * 用户类型(1=用户,2=司机) |
| | | */ |
| | | private Integer userType; |
| | | /** |
| | | * 用户id |
| | | */ |
| | | private Integer userId; |
| | | /** |
| | | * 阅读(0=否,1=是) |
| | | */ |
| | | private Integer isRead; |
| | | /** |
| | | * 状态(1=正常,2=冻结,3=删除) |
| | | */ |
| | | private Integer status; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | private Date createTime; |
| | | |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public Integer getSystemBulletinId() { |
| | | return systemBulletinId; |
| | | } |
| | | |
| | | public void setSystemBulletinId(Integer systemBulletinId) { |
| | | this.systemBulletinId = systemBulletinId; |
| | | } |
| | | |
| | | public Integer getUserType() { |
| | | return userType; |
| | | } |
| | | |
| | | public void setUserType(Integer userType) { |
| | | this.userType = userType; |
| | | } |
| | | |
| | | public Integer getUserId() { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(Integer userId) { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | public Integer getIsRead() { |
| | | return isRead; |
| | | } |
| | | |
| | | public void setIsRead(Integer isRead) { |
| | | this.isRead = isRead; |
| | | } |
| | | |
| | | public Integer getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(Integer status) { |
| | | this.status = status; |
| | | } |
| | | |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "TSystemBulletinUser{" + |
| | | "id=" + id + |
| | | ", systemBulletinId=" + systemBulletinId + |
| | | ", userType=" + userType + |
| | | ", userId=" + userId + |
| | | ", isRead=" + isRead + |
| | | ", status=" + status + |
| | | ", createTime=" + createTime + |
| | | "}"; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service; |
| | | |
| | | import com.stylefeng.guns.modular.system.model.TBroadcast; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | |
| | | /** |
| | | * <p> |
| | | * 广播 服务类 |
| | | * </p> |
| | | * |
| | | * @author stylefeng |
| | | * @since 2023-03-16 |
| | | */ |
| | | public interface ITBroadcastService extends IService<TBroadcast> { |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service; |
| | | |
| | | import com.stylefeng.guns.modular.system.model.TCommercial; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | |
| | | /** |
| | | * <p> |
| | | * 广告 服务类 |
| | | * </p> |
| | | * |
| | | * @author stylefeng |
| | | * @since 2023-03-16 |
| | | */ |
| | | public interface ITCommercialService extends IService<TCommercial> { |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service; |
| | | |
| | | import com.stylefeng.guns.modular.system.model.TSystemBulletin; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | |
| | | /** |
| | | * <p> |
| | | * 系统公告 服务类 |
| | | * </p> |
| | | * |
| | | * @author stylefeng |
| | | * @since 2023-03-16 |
| | | */ |
| | | public interface ITSystemBulletinService extends IService<TSystemBulletin> { |
| | | |
| | | /** |
| | | * 发送消息给司机 |
| | | * @param tSystemBulletin |
| | | */ |
| | | void sendBulletin(TSystemBulletin tSystemBulletin); |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service; |
| | | |
| | | import com.stylefeng.guns.modular.system.model.TSystemBulletinUser; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | |
| | | /** |
| | | * <p> |
| | | * 系统公告-用户关系 服务类 |
| | | * </p> |
| | | * |
| | | * @author stylefeng |
| | | * @since 2023-03-16 |
| | | */ |
| | | public interface ITSystemBulletinUserService extends IService<TSystemBulletinUser> { |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.stylefeng.guns.modular.system.model.TBroadcast; |
| | | import com.stylefeng.guns.modular.system.dao.TBroadcastMapper; |
| | | import com.stylefeng.guns.modular.system.service.ITBroadcastService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 广播 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author stylefeng |
| | | * @since 2023-03-16 |
| | | */ |
| | | @Service |
| | | public class TBroadcastServiceImpl extends ServiceImpl<TBroadcastMapper, TBroadcast> implements ITBroadcastService { |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.stylefeng.guns.modular.system.model.TCommercial; |
| | | import com.stylefeng.guns.modular.system.dao.TCommercialMapper; |
| | | import com.stylefeng.guns.modular.system.service.ITCommercialService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 广告 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author stylefeng |
| | | * @since 2023-03-16 |
| | | */ |
| | | @Service |
| | | public class TCommercialServiceImpl extends ServiceImpl<TCommercialMapper, TCommercial> implements ITCommercialService { |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.modular.system.dao.TDriverMapper; |
| | | import com.stylefeng.guns.modular.system.enums.UserTypeEnum; |
| | | import com.stylefeng.guns.modular.system.model.TDriver; |
| | | import com.stylefeng.guns.modular.system.model.TSystemBulletin; |
| | | import com.stylefeng.guns.modular.system.dao.TSystemBulletinMapper; |
| | | import com.stylefeng.guns.modular.system.model.TSystemBulletinUser; |
| | | import com.stylefeng.guns.modular.system.service.ITSystemBulletinService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.modular.system.service.ITSystemBulletinUserService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 系统公告 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author stylefeng |
| | | * @since 2023-03-16 |
| | | */ |
| | | @Service |
| | | public class TSystemBulletinServiceImpl extends ServiceImpl<TSystemBulletinMapper, TSystemBulletin> implements ITSystemBulletinService { |
| | | |
| | | @Autowired |
| | | private ITSystemBulletinUserService tSystemBulletinUserService; |
| | | @Autowired |
| | | private TDriverMapper tDriverMapper; |
| | | |
| | | @Override |
| | | public void sendBulletin(TSystemBulletin tSystemBulletin) { |
| | | // 判断发送状态 |
| | | if(2 == tSystemBulletin.getState()){ |
| | | // 查找所有司机 |
| | | List<TDriver> list = tDriverMapper.selectList(new EntityWrapper<TDriver>()); |
| | | List<TSystemBulletinUser> tSystemBulletinUsers = new ArrayList<>(list.size()); |
| | | for (TDriver tDriver : list) { |
| | | TSystemBulletinUser tSystemBulletinUser = new TSystemBulletinUser(); |
| | | tSystemBulletinUser.setCreateTime(new Date()); |
| | | tSystemBulletinUser.setStatus(1); |
| | | tSystemBulletinUser.setSystemBulletinId(tSystemBulletin.getId()); |
| | | tSystemBulletinUser.setUserId(tDriver.getId()); |
| | | tSystemBulletinUser.setUserType(UserTypeEnum.DRIVER.getCode()); |
| | | tSystemBulletinUser.setIsRead(0); |
| | | tSystemBulletinUsers.add(tSystemBulletinUser); |
| | | } |
| | | tSystemBulletinUserService.insertBatch(tSystemBulletinUsers); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.stylefeng.guns.modular.system.model.TSystemBulletinUser; |
| | | import com.stylefeng.guns.modular.system.dao.TSystemBulletinUserMapper; |
| | | import com.stylefeng.guns.modular.system.service.ITSystemBulletinUserService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 系统公告-用户关系 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author stylefeng |
| | | * @since 2023-03-16 |
| | | */ |
| | | @Service |
| | | public class TSystemBulletinUserServiceImpl extends ServiceImpl<TSystemBulletinUserMapper, TSystemBulletinUser> implements ITSystemBulletinUserService { |
| | | |
| | | } |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-title"> |
| | | <h5>管理</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <div class="row"> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="condition" name="名称" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#button name="搜索" icon="fa-search" clickFun="TBroadcast.search()"/> |
| | | </div> |
| | | </div> |
| | | <div class="hidden-xs" id="TBroadcastTableToolbar" role="group"> |
| | | @if(shiro.hasPermission("/tBroadcast/add")){ |
| | | <#button name="添加" icon="fa-plus" clickFun="TBroadcast.openAddTBroadcast()"/> |
| | | @} |
| | | @if(shiro.hasPermission("/tBroadcast/update")){ |
| | | <#button name="修改" icon="fa-edit" clickFun="TBroadcast.openTBroadcastDetail()" space="true"/> |
| | | @} |
| | | @if(shiro.hasPermission("/tBroadcast/delete")){ |
| | | <#button name="删除" icon="fa-remove" clickFun="TBroadcast.delete()" space="true"/> |
| | | @} |
| | | </div> |
| | | <#table id="TBroadcastTable"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tBroadcast/tBroadcast.js"></script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal"> |
| | | |
| | | <div class="row"> |
| | | <div class="col-sm-6 b-r"> |
| | | <#input id="id" name="主键" underline="true"/> |
| | | <#input id="content" name="消息内容" underline="true"/> |
| | | <#input id="sort" name="排序"/> |
| | | </div> |
| | | |
| | | <div class="col-sm-6"> |
| | | <#input id="status" name="状态(1=正常,2=冻结,3=删除)" underline="true"/> |
| | | <#input id="createTime" name="添加时间" underline="true"/> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10"> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TBroadcastInfoDlg.addSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TBroadcastInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tBroadcast/tBroadcast_info.js"></script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal"> |
| | | |
| | | <div class="row"> |
| | | <div class="col-sm-6 b-r"> |
| | | <#input id="id" name="主键" value="${item.id}" underline="true"/> |
| | | <#input id="content" name="消息内容" value="${item.content}" underline="true"/> |
| | | <#input id="sort" name="排序" value="${item.sort}" /> |
| | | </div> |
| | | |
| | | <div class="col-sm-6"> |
| | | <#input id="status" name="状态(1=正常,2=冻结,3=删除)" value="${item.status}" underline="true"/> |
| | | <#input id="createTime" name="添加时间" value="${item.createTime}" /> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10"> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TBroadcastInfoDlg.editSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TBroadcastInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tBroadcast/tBroadcast_info.js"></script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-title"> |
| | | <h5>管理</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <div class="row"> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="condition" name="名称" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#button name="搜索" icon="fa-search" clickFun="TCommercial.search()"/> |
| | | </div> |
| | | </div> |
| | | <div class="hidden-xs" id="TCommercialTableToolbar" role="group"> |
| | | @if(shiro.hasPermission("/tCommercial/add")){ |
| | | <#button name="添加" icon="fa-plus" clickFun="TCommercial.openAddTCommercial()"/> |
| | | @} |
| | | @if(shiro.hasPermission("/tCommercial/update")){ |
| | | <#button name="修改" icon="fa-edit" clickFun="TCommercial.openTCommercialDetail()" space="true"/> |
| | | @} |
| | | @if(shiro.hasPermission("/tCommercial/delete")){ |
| | | <#button name="删除" icon="fa-remove" clickFun="TCommercial.delete()" space="true"/> |
| | | @} |
| | | </div> |
| | | <#table id="TCommercialTable"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tCommercial/tCommercial.js"></script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal"> |
| | | |
| | | <div class="row"> |
| | | <div class="col-sm-6 b-r"> |
| | | <#input id="id" name="主键" underline="true"/> |
| | | <#input id="type" name="类型(1=弹窗广告,2=底部广告)" underline="true"/> |
| | | <#input id="name" name="名称" underline="true"/> |
| | | <#input id="url" name="广告地址" underline="true"/> |
| | | <#input id="device" name="设备(1=小程序,2=司机端)" underline="true"/> |
| | | <#input id="isJump" name="是否跳转(0=否,1=是)" underline="true"/> |
| | | <#input id="jumpType" name="跳转类型(1=内部跳转,2=外部跳转)" underline="true"/> |
| | | <#input id="jumpUrl" name="跳转连接"/> |
| | | </div> |
| | | |
| | | <div class="col-sm-6"> |
| | | <#input id="html" name="富文本" underline="true"/> |
| | | <#input id="sort" name="排序" underline="true"/> |
| | | <#input id="status" name="状态(1=正常,2=冻结,3=删除)" underline="true"/> |
| | | <#input id="createTime" name="添加时间" underline="true"/> |
| | | <#input id="createUserId" name="添加人员id" underline="true"/> |
| | | <#input id="updateTime" name="更新时间" underline="true"/> |
| | | <#input id="updateUserId" name="更新人员id" underline="true"/> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10"> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TCommercialInfoDlg.addSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TCommercialInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tCommercial/tCommercial_info.js"></script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal"> |
| | | |
| | | <div class="row"> |
| | | <div class="col-sm-6 b-r"> |
| | | <#input id="id" name="主键" value="${item.id}" underline="true"/> |
| | | <#input id="type" name="类型(1=弹窗广告,2=底部广告)" value="${item.type}" underline="true"/> |
| | | <#input id="name" name="名称" value="${item.name}" underline="true"/> |
| | | <#input id="url" name="广告地址" value="${item.url}" underline="true"/> |
| | | <#input id="device" name="设备(1=小程序,2=司机端)" value="${item.device}" underline="true"/> |
| | | <#input id="isJump" name="是否跳转(0=否,1=是)" value="${item.isJump}" underline="true"/> |
| | | <#input id="jumpType" name="跳转类型(1=内部跳转,2=外部跳转)" value="${item.jumpType}" underline="true"/> |
| | | <#input id="jumpUrl" name="跳转连接" value="${item.jumpUrl}" /> |
| | | </div> |
| | | |
| | | <div class="col-sm-6"> |
| | | <#input id="html" name="富文本" value="${item.html}" underline="true"/> |
| | | <#input id="sort" name="排序" value="${item.sort}" underline="true"/> |
| | | <#input id="status" name="状态(1=正常,2=冻结,3=删除)" value="${item.status}" underline="true"/> |
| | | <#input id="createTime" name="添加时间" value="${item.createTime}" underline="true"/> |
| | | <#input id="createUserId" name="添加人员id" value="${item.createUserId}" underline="true"/> |
| | | <#input id="updateTime" name="更新时间" value="${item.updateTime}" underline="true"/> |
| | | <#input id="updateUserId" name="更新人员id" value="${item.updateUserId}" /> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10"> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TCommercialInfoDlg.editSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TCommercialInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tCommercial/tCommercial_info.js"></script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-title"> |
| | | <h5>管理</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <div class="row"> |
| | | <div class="col-sm-2"> |
| | | <#NameCon id="createTime" name="添加时间" /> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <#NameCon id="content" name="消息内容" /> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <#button name="搜索" icon="fa-search" clickFun="TSystemBulletin.search()"/> |
| | | <#button name="重置" icon="fa-trash" clickFun="TSystemBulletin.resetSearch()"/> |
| | | </div> |
| | | </div> |
| | | <div class="hidden-xs" id="TSystemBulletinTableToolbar" role="group"> |
| | | @if(shiro.hasPermission("/tSystemBulletin/add")){ |
| | | <#button name="添加" icon="fa-plus" clickFun="TSystemBulletin.openAddTSystemBulletin()"/> |
| | | @} |
| | | @if(shiro.hasPermission("/tSystemBulletin/update")){ |
| | | <#button name="修改" icon="fa-edit" clickFun="TSystemBulletin.openTSystemBulletinDetail()" space="true"/> |
| | | @} |
| | | @if(shiro.hasPermission("/tSystemBulletin/delete")){ |
| | | <#button name="删除" icon="fa-remove" clickFun="TSystemBulletin.delete()" space="true"/> |
| | | @} |
| | | </div> |
| | | <#table id="TSystemBulletinTable"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tSystemBulletin/tSystemBulletin.js"></script> |
| | | <script type="text/javascript"> |
| | | laydate.render({ |
| | | elem: '#createTime', |
| | | type: 'date', |
| | | range: true |
| | | }); |
| | | </script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-title"> |
| | | <h5>添加</h5> |
| | | </div> |
| | | <div class="ibox-content" id="systemBulletinInfoForm"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <input hidden id="areaId" value="areaId"> |
| | | <div class="col-sm-12" style="cursor: pointer;text-align: left;"> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group"> |
| | | <div class="initialLevel col-sm-1 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label" >介绍:</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <textarea id="introduce" name="introduce" type="text" placeholder="最多50个字" maxlength="50" style="width:100%;height: 80px" required></textarea> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group"> |
| | | <div class="initialLevel col-sm-1 control-label form-group" > |
| | | <label class="control-label" >图片:</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <#uploadImg id="img"/> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group"> |
| | | <div class="initialLevel col-sm-6 control-label form-group" > |
| | | <textarea type="text/plain" id="content" name="content" style="width:100%;height:350px;"></textarea> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10" style="text-align: center"> |
| | | <#button btnCss="info" name="保存" id="ensure" icon="fa-check" clickFun="TSystemBulletinInfoDlg.addSubmit()"/> |
| | | <#button btnCss="danger" name="发送" id="send" icon="fa-check" clickFun="TSystemBulletinInfoDlg.addSend()"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tSystemBulletin/tSystemBulletin_info.js"></script> |
| | | <script src="${ctxPath}/static/js/ueditor/jsp/ueditor.all.js"></script> |
| | | <script type="text/javascript"> |
| | | $(function () { |
| | | var idCardPositive = new $WebUpload("img"); |
| | | idCardPositive.setUploadBarId("progressBar"); |
| | | idCardPositive.init(); |
| | | }); |
| | | </script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-title"> |
| | | <h5>编辑</h5> |
| | | </div> |
| | | <div class="ibox-content" id="systemBulletinInfoForm"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <div class="col-sm-12" style="cursor: pointer;text-align: left;"> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group"> |
| | | <div class="initialLevel col-sm-1 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label" >介绍:</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <textarea id="introduce" name="introduce" type="text" maxlength="50" style="width:300px;height: 80px" required>${item.introduce}</textarea> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group"> |
| | | <div class="initialLevel col-sm-1 control-label form-group" > |
| | | <label class="control-label" >图片:</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <#uploadImg id="img" fileImg="${item.img}"/> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group"> |
| | | <div class="initialLevel col-sm-6 control-label form-group" > |
| | | <textarea type="text/plain" id="content" name="content" value="${item.content}" style="width:100%;height:350px;"></textarea> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10" style="text-align: center"> |
| | | <#button btnCss="info" name="保存" id="ensure" icon="fa-check" clickFun="TSystemBulletinInfoDlg.editSubmit()"/> |
| | | <#button btnCss="danger" name="发送" id="send" icon="fa-check" clickFun="TSystemBulletinInfoDlg.send()"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tSystemBulletin/tSystemBulletin_info.js"></script> |
| | | <script src="${ctxPath}/static/js/ueditor/jsp/ueditor.all.js"></script> |
| | | <script type="text/javascript"> |
| | | $(function () { |
| | | var idCardPositive = new $WebUpload("img"); |
| | | idCardPositive.setUploadBarId("progressBar"); |
| | | idCardPositive.init(); |
| | | }); |
| | | </script> |
| | | @} |
New file |
| | |
| | | /** |
| | | * 管理初始化 |
| | | */ |
| | | var TBroadcast = { |
| | | id: "TBroadcastTable", //表格id |
| | | seItem: null, //选中的条目 |
| | | table: null, |
| | | layerIndex: -1 |
| | | }; |
| | | |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | TBroadcast.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: '主键', field: 'id', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '消息内容', field: 'content', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '排序', field: 'sort', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '状态(1=正常,2=冻结,3=删除)', field: 'status', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '添加时间', field: 'createTime', visible: true, align: 'center', valign: 'middle'} |
| | | ]; |
| | | }; |
| | | |
| | | /** |
| | | * 检查是否选中 |
| | | */ |
| | | TBroadcast.check = function () { |
| | | var selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | if(selected.length == 0){ |
| | | Feng.info("请先选中表格中的某一记录!"); |
| | | return false; |
| | | }else{ |
| | | TBroadcast.seItem = selected[0]; |
| | | return true; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 点击添加 |
| | | */ |
| | | TBroadcast.openAddTBroadcast = function () { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '添加', |
| | | area: ['800px', '420px'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tBroadcast/tBroadcast_add' |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | | |
| | | /** |
| | | * 打开查看详情 |
| | | */ |
| | | TBroadcast.openTBroadcastDetail = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '详情', |
| | | area: ['800px', '420px'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tBroadcast/tBroadcast_update/' + TBroadcast.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | TBroadcast.delete = function () { |
| | | if (this.check()) { |
| | | var ajax = new $ax(Feng.ctxPath + "/tBroadcast/delete", function (data) { |
| | | Feng.success("删除成功!"); |
| | | TBroadcast.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("删除失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("tBroadcastId",this.seItem.id); |
| | | ajax.start(); |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 查询列表 |
| | | */ |
| | | TBroadcast.search = function () { |
| | | var queryData = {}; |
| | | queryData['condition'] = $("#condition").val(); |
| | | TBroadcast.table.refresh({query: queryData}); |
| | | }; |
| | | |
| | | $(function () { |
| | | var defaultColunms = TBroadcast.initColumn(); |
| | | var table = new BSTable(TBroadcast.id, "/tBroadcast/list", defaultColunms); |
| | | table.setPaginationType("client"); |
| | | TBroadcast.table = table.init(); |
| | | }); |
New file |
| | |
| | | /** |
| | | * 初始化详情对话框 |
| | | */ |
| | | var TBroadcastInfoDlg = { |
| | | tBroadcastInfoData : {} |
| | | }; |
| | | |
| | | /** |
| | | * 清除数据 |
| | | */ |
| | | TBroadcastInfoDlg.clearData = function() { |
| | | this.tBroadcastInfoData = {}; |
| | | } |
| | | |
| | | /** |
| | | * 设置对话框中的数据 |
| | | * |
| | | * @param key 数据的名称 |
| | | * @param val 数据的具体值 |
| | | */ |
| | | TBroadcastInfoDlg.set = function(key, val) { |
| | | this.tBroadcastInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val; |
| | | return this; |
| | | } |
| | | |
| | | /** |
| | | * 设置对话框中的数据 |
| | | * |
| | | * @param key 数据的名称 |
| | | * @param val 数据的具体值 |
| | | */ |
| | | TBroadcastInfoDlg.get = function(key) { |
| | | return $("#" + key).val(); |
| | | } |
| | | |
| | | /** |
| | | * 关闭此对话框 |
| | | */ |
| | | TBroadcastInfoDlg.close = function() { |
| | | parent.layer.close(window.parent.TBroadcast.layerIndex); |
| | | } |
| | | |
| | | /** |
| | | * 收集数据 |
| | | */ |
| | | TBroadcastInfoDlg.collectData = function() { |
| | | this |
| | | .set('id') |
| | | .set('content') |
| | | .set('sort') |
| | | .set('status') |
| | | .set('createTime'); |
| | | } |
| | | |
| | | /** |
| | | * 提交添加 |
| | | */ |
| | | TBroadcastInfoDlg.addSubmit = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tBroadcast/add", function(data){ |
| | | Feng.success("添加成功!"); |
| | | window.parent.TBroadcast.table.refresh(); |
| | | TBroadcastInfoDlg.close(); |
| | | },function(data){ |
| | | Feng.error("添加失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set(this.tBroadcastInfoData); |
| | | ajax.start(); |
| | | } |
| | | |
| | | /** |
| | | * 提交修改 |
| | | */ |
| | | TBroadcastInfoDlg.editSubmit = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tBroadcast/update", function(data){ |
| | | Feng.success("修改成功!"); |
| | | window.parent.TBroadcast.table.refresh(); |
| | | TBroadcastInfoDlg.close(); |
| | | },function(data){ |
| | | Feng.error("修改失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set(this.tBroadcastInfoData); |
| | | ajax.start(); |
| | | } |
| | | |
| | | $(function() { |
| | | |
| | | }); |
New file |
| | |
| | | /** |
| | | * 管理初始化 |
| | | */ |
| | | var TCommercial = { |
| | | id: "TCommercialTable", //表格id |
| | | seItem: null, //选中的条目 |
| | | table: null, |
| | | layerIndex: -1 |
| | | }; |
| | | |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | TCommercial.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: '主键', field: 'id', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '类型(1=弹窗广告,2=底部广告)', field: 'type', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '名称', field: 'name', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '广告地址', field: 'url', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '设备(1=小程序,2=司机端)', field: 'device', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '是否跳转(0=否,1=是)', field: 'isJump', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '跳转类型(1=内部跳转,2=外部跳转)', field: 'jumpType', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '跳转连接', field: 'jumpUrl', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '富文本', field: 'html', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '排序', field: 'sort', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '状态(1=正常,2=冻结,3=删除)', field: 'status', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '添加时间', field: 'createTime', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '添加人员id', field: 'createUserId', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '更新时间', field: 'updateTime', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '更新人员id', field: 'updateUserId', visible: true, align: 'center', valign: 'middle'} |
| | | ]; |
| | | }; |
| | | |
| | | /** |
| | | * 检查是否选中 |
| | | */ |
| | | TCommercial.check = function () { |
| | | var selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | if(selected.length == 0){ |
| | | Feng.info("请先选中表格中的某一记录!"); |
| | | return false; |
| | | }else{ |
| | | TCommercial.seItem = selected[0]; |
| | | return true; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 点击添加 |
| | | */ |
| | | TCommercial.openAddTCommercial = function () { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '添加', |
| | | area: ['800px', '420px'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tCommercial/tCommercial_add' |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | | |
| | | /** |
| | | * 打开查看详情 |
| | | */ |
| | | TCommercial.openTCommercialDetail = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '详情', |
| | | area: ['800px', '420px'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tCommercial/tCommercial_update/' + TCommercial.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | TCommercial.delete = function () { |
| | | if (this.check()) { |
| | | var ajax = new $ax(Feng.ctxPath + "/tCommercial/delete", function (data) { |
| | | Feng.success("删除成功!"); |
| | | TCommercial.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("删除失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("tCommercialId",this.seItem.id); |
| | | ajax.start(); |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 查询列表 |
| | | */ |
| | | TCommercial.search = function () { |
| | | var queryData = {}; |
| | | queryData['condition'] = $("#condition").val(); |
| | | TCommercial.table.refresh({query: queryData}); |
| | | }; |
| | | |
| | | $(function () { |
| | | var defaultColunms = TCommercial.initColumn(); |
| | | var table = new BSTable(TCommercial.id, "/tCommercial/list", defaultColunms); |
| | | table.setPaginationType("client"); |
| | | TCommercial.table = table.init(); |
| | | }); |
New file |
| | |
| | | /** |
| | | * 初始化详情对话框 |
| | | */ |
| | | var TCommercialInfoDlg = { |
| | | tCommercialInfoData : {} |
| | | }; |
| | | |
| | | /** |
| | | * 清除数据 |
| | | */ |
| | | TCommercialInfoDlg.clearData = function() { |
| | | this.tCommercialInfoData = {}; |
| | | } |
| | | |
| | | /** |
| | | * 设置对话框中的数据 |
| | | * |
| | | * @param key 数据的名称 |
| | | * @param val 数据的具体值 |
| | | */ |
| | | TCommercialInfoDlg.set = function(key, val) { |
| | | this.tCommercialInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val; |
| | | return this; |
| | | } |
| | | |
| | | /** |
| | | * 设置对话框中的数据 |
| | | * |
| | | * @param key 数据的名称 |
| | | * @param val 数据的具体值 |
| | | */ |
| | | TCommercialInfoDlg.get = function(key) { |
| | | return $("#" + key).val(); |
| | | } |
| | | |
| | | /** |
| | | * 关闭此对话框 |
| | | */ |
| | | TCommercialInfoDlg.close = function() { |
| | | parent.layer.close(window.parent.TCommercial.layerIndex); |
| | | } |
| | | |
| | | /** |
| | | * 收集数据 |
| | | */ |
| | | TCommercialInfoDlg.collectData = function() { |
| | | this |
| | | .set('id') |
| | | .set('type') |
| | | .set('name') |
| | | .set('url') |
| | | .set('device') |
| | | .set('isJump') |
| | | .set('jumpType') |
| | | .set('jumpUrl') |
| | | .set('html') |
| | | .set('sort') |
| | | .set('status') |
| | | .set('createTime') |
| | | .set('createUserId') |
| | | .set('updateTime') |
| | | .set('updateUserId'); |
| | | } |
| | | |
| | | /** |
| | | * 提交添加 |
| | | */ |
| | | TCommercialInfoDlg.addSubmit = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tCommercial/add", function(data){ |
| | | Feng.success("添加成功!"); |
| | | window.parent.TCommercial.table.refresh(); |
| | | TCommercialInfoDlg.close(); |
| | | },function(data){ |
| | | Feng.error("添加失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set(this.tCommercialInfoData); |
| | | ajax.start(); |
| | | } |
| | | |
| | | /** |
| | | * 提交修改 |
| | | */ |
| | | TCommercialInfoDlg.editSubmit = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tCommercial/update", function(data){ |
| | | Feng.success("修改成功!"); |
| | | window.parent.TCommercial.table.refresh(); |
| | | TCommercialInfoDlg.close(); |
| | | },function(data){ |
| | | Feng.error("修改失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set(this.tCommercialInfoData); |
| | | ajax.start(); |
| | | } |
| | | |
| | | $(function() { |
| | | |
| | | }); |
New file |
| | |
| | | /** |
| | | * 管理初始化 |
| | | */ |
| | | var TSystemBulletin = { |
| | | id: "TSystemBulletinTable", //表格id |
| | | seItem: null, //选中的条目 |
| | | table: null, |
| | | layerIndex: -1 |
| | | }; |
| | | |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | TSystemBulletin.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: '主键', field: 'id', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '标题', field: 'introduce', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '添加时间', field: 'createTime', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '图片', field: 'img', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '消息内容', field: 'content', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '状态', field: 'status', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '状态', field: 'state', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | if (row.state === 1){ |
| | | return '<span>未发送</span>' |
| | | }else if (row.state === 2){ |
| | | return '<span>已发送</span>' |
| | | } |
| | | } |
| | | }, |
| | | {title: '操作', visible: true, align: 'center', valign: 'middle',width:150, |
| | | formatter: function (value, row) { |
| | | if (row.state === 1){ |
| | | return '<a href="#" onclick="TSystemBulletin.openTSystemBulletinDetail('+row.id+')" style="color:blue">编辑</a>' +' ' + |
| | | '<a href="#" onclick="TSystemBulletin.delete('+row.id+')" style="color:red">删除</a>' |
| | | }else if (row.state === 2){ |
| | | return '<a href="#" onclick="TSystemBulletin.delete('+row.id+')" style="color:red">删除</a>' |
| | | } |
| | | } |
| | | } |
| | | ]; |
| | | }; |
| | | |
| | | /** |
| | | * 检查是否选中 |
| | | */ |
| | | TSystemBulletin.check = function () { |
| | | var selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | if(selected.length == 0){ |
| | | Feng.info("请先选中表格中的某一记录!"); |
| | | return false; |
| | | }else{ |
| | | TSystemBulletin.seItem = selected[0]; |
| | | return true; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 点击添加 |
| | | */ |
| | | TSystemBulletin.openAddTSystemBulletin = function () { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '添加', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tSystemBulletin/tSystemBulletin_add' |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | | |
| | | /** |
| | | * 打开查看详情 |
| | | */ |
| | | TSystemBulletin.openTSystemBulletinDetail = function (id) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '详情', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tSystemBulletin/tSystemBulletin_update/' + id |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | TSystemBulletin.delete = function (id) { |
| | | var ajax = new $ax(Feng.ctxPath + "/tSystemBulletin/delete", function (data) { |
| | | Feng.success("删除成功!"); |
| | | TSystemBulletin.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("删除失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("tSystemBulletinId",id); |
| | | ajax.start(); |
| | | }; |
| | | |
| | | /** |
| | | * 查询列表 |
| | | */ |
| | | TSystemBulletin.search = function () { |
| | | var queryData = {}; |
| | | queryData['createTime'] = $("#createTime").val(); |
| | | queryData['content'] = $("#content").val(); |
| | | TSystemBulletin.table.refresh({query: queryData}); |
| | | }; |
| | | |
| | | /** |
| | | * 重置 |
| | | */ |
| | | TSystemBulletin.resetSearch = function (){ |
| | | $("#createTime").val(''); |
| | | $("#content").val(''); |
| | | TSystemBulletin.search(); |
| | | } |
| | | |
| | | $(function () { |
| | | var defaultColunms = TSystemBulletin.initColumn(); |
| | | var table = new BSTable(TSystemBulletin.id, "/tSystemBulletin/list", defaultColunms); |
| | | table.setPaginationType("client"); |
| | | TSystemBulletin.table = table.init(); |
| | | }); |
New file |
| | |
| | | /** |
| | | * 初始化详情对话框 |
| | | */ |
| | | var TSystemBulletinInfoDlg = { |
| | | tSystemBulletinInfoData : {}, |
| | | validateFields: { |
| | | introduce: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: '介绍不能为空' |
| | | } |
| | | } |
| | | }, |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 验证数据是否为空 |
| | | */ |
| | | TSystemBulletinInfoDlg.validate = function () { |
| | | $('#systemBulletinInfoForm').data("bootstrapValidator").resetForm(); |
| | | $('#systemBulletinInfoForm').bootstrapValidator('validate'); |
| | | return $("#systemBulletinInfoForm").data('bootstrapValidator').isValid(); |
| | | }; |
| | | |
| | | /** |
| | | * 清除数据 |
| | | */ |
| | | TSystemBulletinInfoDlg.clearData = function() { |
| | | this.tSystemBulletinInfoData = {}; |
| | | } |
| | | |
| | | /** |
| | | * 设置对话框中的数据 |
| | | * |
| | | * @param key 数据的名称 |
| | | * @param val 数据的具体值 |
| | | */ |
| | | TSystemBulletinInfoDlg.set = function(key, val) { |
| | | this.tSystemBulletinInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val; |
| | | return this; |
| | | } |
| | | |
| | | /** |
| | | * 设置对话框中的数据 |
| | | * |
| | | * @param key 数据的名称 |
| | | * @param val 数据的具体值 |
| | | */ |
| | | TSystemBulletinInfoDlg.get = function(key) { |
| | | return $("#" + key).val(); |
| | | } |
| | | |
| | | /** |
| | | * 关闭此对话框 |
| | | */ |
| | | TSystemBulletinInfoDlg.close = function() { |
| | | parent.layer.close(window.parent.TSystemBulletin.layerIndex); |
| | | } |
| | | |
| | | /** |
| | | * 收集数据 |
| | | */ |
| | | TSystemBulletinInfoDlg.collectData = function() { |
| | | this |
| | | .set('id') |
| | | .set('introduce') |
| | | .set('img') |
| | | .set('content') |
| | | .set('status') |
| | | .set('state') |
| | | .set('createTime'); |
| | | } |
| | | |
| | | /** |
| | | * 提交添加 |
| | | */ |
| | | TSystemBulletinInfoDlg.addSubmit = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tSystemBulletin/add", function(data){ |
| | | Feng.success("添加成功!"); |
| | | window.parent.TSystemBulletin.table.refresh(); |
| | | TSystemBulletinInfoDlg.close(); |
| | | },function(data){ |
| | | Feng.error("添加失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set(this.tSystemBulletinInfoData); |
| | | ajax.start(); |
| | | } |
| | | |
| | | /** |
| | | * 提交添加 |
| | | */ |
| | | TSystemBulletinInfoDlg.addSend = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tSystemBulletin/addSend", function(data){ |
| | | Feng.success("发送成功!"); |
| | | window.parent.TSystemBulletin.table.refresh(); |
| | | TSystemBulletinInfoDlg.close(); |
| | | },function(data){ |
| | | Feng.error("发送失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set(this.tSystemBulletinInfoData); |
| | | ajax.start(); |
| | | } |
| | | |
| | | /** |
| | | * 提交修改 |
| | | */ |
| | | TSystemBulletinInfoDlg.editSubmit = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tSystemBulletin/update", function(data){ |
| | | Feng.success("修改成功!"); |
| | | window.parent.TSystemBulletin.table.refresh(); |
| | | TSystemBulletinInfoDlg.close(); |
| | | },function(data){ |
| | | Feng.error("修改失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set(this.tSystemBulletinInfoData); |
| | | ajax.start(); |
| | | } |
| | | |
| | | /** |
| | | * 提交修改 |
| | | */ |
| | | TSystemBulletinInfoDlg.editSend = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tSystemBulletin/editSend", function(data){ |
| | | Feng.success("发送成功!"); |
| | | window.parent.TSystemBulletin.table.refresh(); |
| | | TSystemBulletinInfoDlg.close(); |
| | | },function(data){ |
| | | Feng.error("发送失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set(this.tSystemBulletinInfoData); |
| | | ajax.start(); |
| | | } |
| | | |
| | | $(function() { |
| | | UE.getEditor('content'); |
| | | Feng.initValidator("systemBulletinInfoForm", TSystemBulletinInfoDlg.validateFields); |
| | | }); |