Commit cb12baa3 by 416409548@qq.com

广告信息模块优化

parent 76730aff
......@@ -4,6 +4,26 @@
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="8" :sm="8">
<a-form-item label="展示时间">
<a-range-picker v-model="queryParam.createTimeRange" showTime
format="YYYY-MM-DD HH:mm:ss"
:placeholder="['开始时间', '结束时间']"
@change="onDateChange" />
</a-form-item>
</a-col>
<a-col :md="4" :sm="8">
<a-space style="float: left">
<a-button type="primary" @click="searchQuery">查询</a-button>
<a-button type="default" @click="searchReset">重置</a-button>
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
</a-space>
</a-col>
<a-col :md="12" :sm="8">
<a-space style="float: right">
<a-button @click="handleExportXls('广告信息导出')" type="primary">导出</a-button>
</a-space>
</a-col>
</a-row>
</a-form>
</div>
......@@ -68,24 +88,16 @@
</template>
<span slot="action" slot-scope="text, record">
<!-- <a @click="handleDetail(record)">详情</a> -->
<!-- <a-divider type="vertical" /> -->
<a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a-dropdown>
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
<a-menu slot="overlay">
<a-menu-item>
<a @click="handleDetail(record)">详情</a>
</a-menu-item>
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</span>
</a-table>
</div>
......@@ -109,6 +121,10 @@
data () {
return {
description: '广告屏信息发布管理页面',
// 查询条件
queryParam: {
createTimeRange:[],
},
// 表头
columns: [
{
......@@ -122,14 +138,29 @@
}
},
{
title:'广告屏设置id',
title:'设备编码',
align:"center",
dataIndex: 'code'
},
{
title:'设备名称',
align:"center",
dataIndex: 'name'
},
{
title:'设备ip',
align:"center",
dataIndex: 'ip'
},
{
title:'区域名称',
align:"center",
dataIndex: 'settingId'
dataIndex: 'districtName'
},
{
title:'信息类型',
align:"center",
dataIndex: 'type'
dataIndex: 'type_dictText'
},
{
title:'信息标题',
......@@ -141,7 +172,7 @@
align:"center",
dataIndex: 'startDate',
customRender:function (text) {
return !text?"":(text.length>10?text.substr(0,10):text)
return !text?"":(text)
}
},
{
......@@ -149,7 +180,7 @@
align:"center",
dataIndex: 'endDate',
customRender:function (text) {
return !text?"":(text.length>10?text.substr(0,10):text)
return !text?"":(text)
}
},
{
......@@ -158,29 +189,19 @@
dataIndex: 'content'
},
{
title:'创建人Id(sys_user)',
align:"center",
dataIndex: 'createUserId'
},
{
title:'修改人Id(sys_user)',
title:'创建人',
align:"center",
dataIndex: 'modifyUserId'
dataIndex: 'createUserId_dictText'
},
{
title:'修改时间',
title:'创建时间',
align:"center",
dataIndex: 'modifyTime',
dataIndex: 'createTime',
customRender:function (text) {
return !text?"":(text.length>10?text.substr(0,10):text)
return !text?"":(text)
}
},
{
title:'删除状态',
align:"center",
dataIndex: 'deleted'
},
{
title: '操作',
dataIndex: 'action',
align:"center",
......@@ -210,6 +231,14 @@
},
},
methods: {
onDateChange: function (value, dateString) {
console.log(dateString[0],dateString[1]);
this.queryParam.startDate=dateString[0];
this.queryParam.endDate=dateString[1];
},
onDateOk(value) {
console.log(value);
},
initDictConfig(){
},
getSuperFieldList(){
......
......@@ -4,53 +4,37 @@
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<a-col :span="24">
<a-form-model-item label="广告屏设置id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="settingId">
<a-input-number v-model="model.settingId" placeholder="请输入广告屏设置id" style="width: 100%" />
<a-form-model-item label="设备名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="name">
<a-select placeholder="设备名称选择" v-model="model.settingId">
<a-select-option v-for="route in routes" :key="route.id">
{{ route.name }}
</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="信息类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="type">
<a-input v-model="model.type" placeholder="请输入信息类型" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="信息标题" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="title">
<a-input v-model="model.title" placeholder="请输入信息标题" ></a-input>
<j-dict-select-tag v-model="model.type" placeholder="请输入信息类型" dictCode="advertising_screen_list_type"/>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="展示开始时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="startDate">
<j-date placeholder="请选择展示开始时间" v-model="model.startDate" style="width: 100%" />
<j-date placeholder="请选择展示开始时间" dateFormat="YYYY-MM-DD HH:mm:ss" showTime v-model="model.startDate" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="展示结束时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="endDate">
<j-date placeholder="请选择展示结束时间" v-model="model.endDate" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="内容" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="content">
<a-textarea v-model="model.content" rows="4" placeholder="请输入内容" />
<j-date placeholder="请选择展示结束时间" dateFormat="YYYY-MM-DD HH:mm:ss" showTime v-model="model.endDate" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="创建人Id(sys_user)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="createUserId">
<a-input v-model="model.createUserId" placeholder="请输入创建人Id(sys_user)" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="修改人Id(sys_user)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="modifyUserId">
<a-input v-model="model.modifyUserId" placeholder="请输入修改人Id(sys_user)" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="修改时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="modifyTime">
<j-date placeholder="请选择修改时间" v-model="model.modifyTime" style="width: 100%" />
<a-form-model-item label="信息标题" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="title">
<a-input v-model="model.title" placeholder="请输入信息标题" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="删除状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="deleted">
<a-input-number v-model="model.deleted" placeholder="请输入删除状态" style="width: 100%" />
<a-form-model-item label="内容" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="content">
<a-textarea v-model="model.content" rows="4" placeholder="请输入内容" />
</a-form-model-item>
</a-col>
</a-row>
......@@ -90,12 +74,31 @@
},
confirmLoading: false,
validatorRules: {
name: [
{ required: true, message: '设备名称不能为空' }
],
type: [
{ required: true, message: '信息类型不能为空' }
],
startDate: [
{ required: true, message: '开始时间不能为空' }
],
endDate: [
{ required: true, message: '结束时间不能为空' }
],
title: [
{ required: true, message: '信息标题不能为空' }
],
content: [
{ required: true, message: '内容不能为空' }
],
},
url: {
add: "/org.jeecg.pm/advertisingScreenAnnounce/add",
edit: "/org.jeecg.pm/advertisingScreenAnnounce/edit",
queryById: "/org.jeecg.pm/advertisingScreenAnnounce/queryById"
}
add: "/pm/advertisingScreenAnnounce/add",
edit: "/pm/advertisingScreenAnnounce/edit",
queryById: "/pm/advertisingScreenAnnounce/queryById"
},
routes:[]
}
},
computed: {
......@@ -106,6 +109,12 @@
created () {
//备份model原始值
this.modelDefault = JSON.parse(JSON.stringify(this.model));
getAction('/pm/advertisingScreenAnnounce/routesList')
.then((data) => {
this.routes = data.result;
console.log(this.routes);
});
},
methods: {
add () {
......@@ -144,6 +153,7 @@
})
},
}
}
</script>
\ No newline at end of file
......@@ -2,10 +2,13 @@ package org.jeecg.pm.controller;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.List;
import javax.persistence.Id;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
......@@ -13,9 +16,13 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.pm.entity.AdvertisingScreenAnnounce;
import org.jeecg.pm.entity.AdvertisingScreenAnnounceVo;
import org.jeecg.pm.entity.AdvertisingScreenSetting;
import org.jeecg.pm.service.IAdvertisingScreenAnnounceService;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.pm.service.IAdvertisingScreenSettingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
......@@ -36,6 +43,8 @@ import org.jeecg.common.aspect.annotation.AutoLog;
public class AdvertisingScreenAnnounceController extends JeecgController<AdvertisingScreenAnnounce, IAdvertisingScreenAnnounceService> {
@Autowired
private IAdvertisingScreenAnnounceService advertisingScreenAnnounceService;
@Autowired
private IAdvertisingScreenSettingService advertisingScreenSettingService;
/**
* 分页列表查询
......@@ -49,12 +58,12 @@ public class AdvertisingScreenAnnounceController extends JeecgController<Adverti
//@AutoLog(value = "广告屏信息发布-分页列表查询")
@ApiOperation(value="广告屏信息发布-分页列表查询", notes="广告屏信息发布-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<AdvertisingScreenAnnounce>> queryPageList(AdvertisingScreenAnnounce advertisingScreenAnnounce,
public Result<IPage<AdvertisingScreenAnnounceVo>> queryPageList(AdvertisingScreenAnnounce advertisingScreenAnnounce,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
Page<AdvertisingScreenAnnounce> page = new Page<AdvertisingScreenAnnounce>(pageNo, pageSize);
IPage<AdvertisingScreenAnnounce> pageList = advertisingScreenAnnounceService.pageList(page, advertisingScreenAnnounce);
Page<AdvertisingScreenAnnounceVo> page = new Page<AdvertisingScreenAnnounceVo>(pageNo, pageSize);
IPage<AdvertisingScreenAnnounceVo> pageList = advertisingScreenAnnounceService.pageList(page, advertisingScreenAnnounce);
return Result.OK(pageList);
}
......@@ -68,6 +77,9 @@ public class AdvertisingScreenAnnounceController extends JeecgController<Adverti
@ApiOperation(value="广告屏信息发布-添加", notes="广告屏信息发布-添加")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody AdvertisingScreenAnnounce advertisingScreenAnnounce) {
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
advertisingScreenAnnounce.setCreateUserId(sysUser.getId());
advertisingScreenAnnounce.setDeleted(false);
advertisingScreenAnnounceService.save(advertisingScreenAnnounce);
return Result.OK("添加成功!");
}
......@@ -154,4 +166,19 @@ public class AdvertisingScreenAnnounceController extends JeecgController<Adverti
return super.importExcel(request, response, AdvertisingScreenAnnounce.class);
}
/**
* 设置列表
*
* @return
*/
@ApiOperation(value="广告屏设置设备名称列表", notes="广告屏设置设备名称列表")
@GetMapping(value = "/routesList")
public Result<List<AdvertisingScreenSetting>> routesList() {
List<AdvertisingScreenSetting> list = advertisingScreenSettingService.list(new QueryWrapper<AdvertisingScreenSetting>().lambda()
.eq(AdvertisingScreenSetting::getDeleted, 0)
);
return Result.OK(list);
}
}
......@@ -34,11 +34,11 @@ public class AdvertisingScreenAnnounce implements Serializable {
/**id*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "id")
private Integer id;
private Long id;
/**广告屏设置id*/
@Excel(name = "广告屏设置id", width = 15)
@ApiModelProperty(value = "广告屏设置id")
private Integer settingId;
private Long settingId;
/**信息类型*/
@Excel(name = "信息类型", width = 15)
@ApiModelProperty(value = "信息类型")
......
......@@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
......@@ -36,7 +37,7 @@ public class AdvertisingScreenAnnounceVo implements Serializable {
/**广告屏设置id*/
@Excel(name = "广告屏设置id", width = 15)
@ApiModelProperty(value = "广告屏设置id")
private Long settingId;
private String settingId;
/**信息类型*/
/**设备编码*/
@Excel(name = "设备编码", width = 15)
......@@ -55,7 +56,8 @@ public class AdvertisingScreenAnnounceVo implements Serializable {
@ApiModelProperty(value = "区域名称")
private String districtName;
@Excel(name = "信息类型", width = 15)
@ApiModelProperty(value = "信息类型")
@ApiModelProperty(value = "信息类型 1通知 2异常")
@Dict(dicCode = "advertising_screen_list_type")
private String type;
/**信息标题*/
@Excel(name = "信息标题", width = 15)
......@@ -79,6 +81,7 @@ public class AdvertisingScreenAnnounceVo implements Serializable {
private String content;
/**创建人Id(sys_user)*/
@Excel(name = "创建人Id(sys_user)", width = 15)
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "id")
@ApiModelProperty(value = "创建人Id(sys_user)")
private String createUserId;
/**修改人Id(sys_user)*/
......@@ -86,8 +89,8 @@ public class AdvertisingScreenAnnounceVo implements Serializable {
@ApiModelProperty(value = "修改人Id(sys_user)")
private String modifyUserId;
/**创建时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@Excel(name = "展示结束时间", width = 15, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建时间")
private Date createTime;
/**修改时间*/
......
......@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.lettuce.core.dynamic.annotation.Param;
import org.jeecg.pm.entity.AdvertisingScreenAnnounce;
import org.jeecg.pm.entity.AdvertisingScreenAnnounceVo;
/**
* @Description: 广告屏信息发布
......@@ -14,7 +15,7 @@ import org.jeecg.pm.entity.AdvertisingScreenAnnounce;
*/
public interface AdvertisingScreenAnnounceMapper extends BaseMapper<AdvertisingScreenAnnounce> {
IPage<AdvertisingScreenAnnounce> pageList(@Param("page") Page page, @Param("pmAccessControlDeviceRecordDto") AdvertisingScreenAnnounce advertisingScreenAnnounce);
IPage<AdvertisingScreenAnnounceVo> pageList(@Param("page") Page page, @Param("pmAccessControlDeviceRecordDto") AdvertisingScreenAnnounce advertisingScreenAnnounce);
}
......@@ -2,7 +2,8 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.pm.mapper.AdvertisingScreenAnnounceMapper">
<select id="pageList" resultType="org.jeecg.pm.entity.AdvertisingScreenAnnounceVo">
SELECT ass.`code`,
SELECT ad.id,
ass.`code`,
ass.`name`,
ass.ip,
ass.district_name,
......@@ -16,8 +17,9 @@
ad.create_time
FROM `advertising_screen_setting` ass LEFT JOIN advertising_screen_announce ad ON ass.id = ad.setting_id
where ad.deleted = 0
<if test="advertisingScreenAnnounce.startDate!=null and advertisingScreenAnnounce.startDate!=''">
and unix_timestamp(ad.start_date) >= unix_timestamp(#{advertisingScreenAnnounce.startDate})
<if test="advertisingScreenAnnounce.startDate!=null and advertisingScreenAnnounce.endDate !=null" >
and ad.start_date >= #{advertisingScreenAnnounce.startDate}
and #{advertisingScreenAnnounce.endDate} >= ad.end_date
</if>
</select>
</mapper>
\ No newline at end of file
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.pm.entity.AdvertisingScreenAnnounce;
import org.jeecg.pm.entity.AdvertisingScreenAnnounceVo;
/**
* @Description: 广告屏信息发布
......@@ -19,6 +20,6 @@ public interface IAdvertisingScreenAnnounceService extends IService<AdvertisingS
* @param advertisingScreenAnnounce
* @return
*/
IPage<AdvertisingScreenAnnounce> pageList(Page page, AdvertisingScreenAnnounce advertisingScreenAnnounce);
IPage<AdvertisingScreenAnnounceVo> pageList(Page page, AdvertisingScreenAnnounce advertisingScreenAnnounce);
}
......@@ -3,6 +3,7 @@ package org.jeecg.pm.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.pm.entity.AdvertisingScreenAnnounce;
import org.jeecg.pm.entity.AdvertisingScreenAnnounceVo;
import org.jeecg.pm.mapper.AdvertisingScreenAnnounceMapper;
import org.jeecg.pm.service.IAdvertisingScreenAnnounceService;
import org.springframework.stereotype.Service;
......@@ -19,7 +20,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
public class AdvertisingScreenAnnounceServiceImpl extends ServiceImpl<AdvertisingScreenAnnounceMapper, AdvertisingScreenAnnounce> implements IAdvertisingScreenAnnounceService {
@Override
public IPage<AdvertisingScreenAnnounce> pageList(Page page, AdvertisingScreenAnnounce advertisingScreenAnnounce) {
public IPage<AdvertisingScreenAnnounceVo> pageList(Page page, AdvertisingScreenAnnounce advertisingScreenAnnounce) {
return baseMapper.pageList(page, advertisingScreenAnnounce);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment