代码提交
This commit is contained in:
parent
db2153b9af
commit
2131a93287
|
|
@ -46,6 +46,7 @@ public class ZtApplication implements WebMvcConfigurer
|
|||
registry.addResourceHandler("/lp/**").addResourceLocations("file:" + RuoYiConfig.getLPUploadPath()+"/");
|
||||
registry.addResourceHandler("/ls/**").addResourceLocations("file:" + RuoYiConfig.getLSUploadPath()+"/");
|
||||
registry.addResourceHandler("/fp/**").addResourceLocations("file:" + RuoYiConfig.getFPUploadPath()+"/");
|
||||
registry.addResourceHandler("/ba/**").addResourceLocations("file:" + RuoYiConfig.getBAUploadPath()+"/");
|
||||
// System.out.println( RuoYiConfig.getLPUploadPath()+"/");
|
||||
// registry.addResourceHandler("/**").addResourceLocations("file:" + RuoYiConfig.getProfile());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,116 @@
|
|||
package com.wuzhen.web.controller.busi;
|
||||
|
||||
import com.wuzhen.common.annotation.Log;
|
||||
import com.wuzhen.common.core.controller.BaseController;
|
||||
import com.wuzhen.common.core.domain.AjaxResult;
|
||||
import com.wuzhen.common.core.page.TableDataInfo;
|
||||
import com.wuzhen.common.enums.BusinessType;
|
||||
import com.wuzhen.common.utils.poi.ExcelUtil;
|
||||
import com.wuzhen.system.domain.AdvertInfo;
|
||||
import com.wuzhen.system.service.AdvertDataService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 数据广告信息
|
||||
*
|
||||
* @author zhengzheng
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/advert/info")
|
||||
public class AdvertDataController extends BaseController
|
||||
{
|
||||
private String prefix = "advert/info";
|
||||
|
||||
@Autowired
|
||||
private AdvertDataService advertDataService;
|
||||
|
||||
@RequiresPermissions("advert:info:view")
|
||||
@GetMapping()
|
||||
public String dictData()
|
||||
{
|
||||
return prefix + "/index";
|
||||
}
|
||||
|
||||
@PostMapping("/list")
|
||||
@RequiresPermissions("advert:info:list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(AdvertInfo advertInfo)
|
||||
{
|
||||
startPage();
|
||||
List<AdvertInfo> list = advertDataService.selectAdvertDataList(advertInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@Log(title = "广告数据", businessType = BusinessType.EXPORT)
|
||||
@RequiresPermissions("advert:info:export")
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(AdvertInfo advertInfo)
|
||||
{
|
||||
List<AdvertInfo> list = advertDataService.selectAdvertDataList(advertInfo);
|
||||
ExcelUtil<AdvertInfo> util = new ExcelUtil<AdvertInfo>(AdvertInfo.class);
|
||||
return util.exportExcel(list, "广告数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增广告类型
|
||||
*/
|
||||
@GetMapping("/add")
|
||||
public String add(ModelMap mmap)
|
||||
{
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存广告类型
|
||||
*/
|
||||
@Log(title = "广告数据", businessType = BusinessType.INSERT)
|
||||
@RequiresPermissions("advert:info:add")
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(@Validated AdvertInfo advertInfo)
|
||||
{
|
||||
advertInfo.setCreateBy(getLoginName());
|
||||
return toAjax(advertDataService.insertAdvertData(advertInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改广告类型
|
||||
*/
|
||||
@RequiresPermissions("advert:info:edit")
|
||||
@GetMapping("/edit/{id}")
|
||||
public String edit(@PathVariable("id") Long id, ModelMap mmap)
|
||||
{
|
||||
mmap.put("dict", advertDataService.selectAdvertDataById(id));
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存广告类型
|
||||
*/
|
||||
@Log(title = "广告数据", businessType = BusinessType.UPDATE)
|
||||
@RequiresPermissions("advert:info:edit")
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(@Validated AdvertInfo advertInfo)
|
||||
{
|
||||
advertInfo.setUpdateBy(getLoginName());
|
||||
return toAjax(advertDataService.updateAdvertData(advertInfo));
|
||||
}
|
||||
|
||||
@Log(title = "广告数据", businessType = BusinessType.DELETE)
|
||||
@RequiresPermissions("advert:info:remove")
|
||||
@PostMapping("/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(String ids)
|
||||
{
|
||||
advertDataService.deleteAdvertDataByIds(ids);
|
||||
return success();
|
||||
}
|
||||
}
|
||||
|
|
@ -136,6 +136,46 @@ public class CommonController
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通用上传请求(多个)
|
||||
*/
|
||||
@PostMapping("/uploadsBanner")
|
||||
@ResponseBody
|
||||
public AjaxResult uploadFilesBanner(List<MultipartFile> files) throws Exception
|
||||
{
|
||||
try
|
||||
{
|
||||
// 上传文件路径
|
||||
String filePath = RuoYiConfig.getBAUploadPath();
|
||||
List<String> urls = new ArrayList<String>();
|
||||
List<String> fileNames = new ArrayList<String>();
|
||||
List<String> newFileNames = new ArrayList<String>();
|
||||
List<String> originalFilenames = new ArrayList<String>();
|
||||
for (MultipartFile file : files)
|
||||
{
|
||||
// 上传并返回新文件名称
|
||||
String fileName = FileUploadUtils.upload(filePath, file);
|
||||
String url = serverConfig.getUrl() + fileName;
|
||||
urls.add(url);
|
||||
fileNames.add(fileName);
|
||||
newFileNames.add(FileUtils.getName(fileName));
|
||||
originalFilenames.add(file.getOriginalFilename());
|
||||
}
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("urls", StringUtils.join(urls, FILE_DELIMETER));
|
||||
ajax.put("fileNames", StringUtils.join(fileNames, FILE_DELIMETER));
|
||||
ajax.put("newFileNames", StringUtils.join(newFileNames, FILE_DELIMETER));
|
||||
ajax.put("originalFilenames", StringUtils.join(originalFilenames, FILE_DELIMETER));
|
||||
return ajax;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return AjaxResult.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 通用上传请求(多个)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ public class WebConfig implements WebMvcConfigurer {
|
|||
registry.addResourceHandler("/lp/**").addResourceLocations("file:" + RuoYiConfig.getLPUploadPath()+"/");
|
||||
registry.addResourceHandler("/ls/**").addResourceLocations("file:" + RuoYiConfig.getLSUploadPath()+"/");
|
||||
registry.addResourceHandler("/fp/**").addResourceLocations("file:" + RuoYiConfig.getFPUploadPath()+"/");
|
||||
registry.addResourceHandler("/ba/**").addResourceLocations("file:" + RuoYiConfig.getBAUploadPath()+"/");
|
||||
// System.out.println( RuoYiConfig.getLPUploadPath()+"/");
|
||||
// registry.addResourceHandler("/**").addResourceLocations("file:" + RuoYiConfig.getProfile());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@ wuzhen:
|
|||
copyrightYear: 2022
|
||||
# 实例演示开关
|
||||
demoEnabled: false
|
||||
# 文件路径 示例( Windows配置 D:/images11,Linux配置 /home/ruoyi/uploadPath)
|
||||
profile: /www/wwwroot
|
||||
# 文件路径 示例( Windows配置 D:/images11,Linux配置 /www/wwwroot)
|
||||
profile: D:/images11
|
||||
fp: http://47.94.96.229:18001/fp/
|
||||
lp: http://47.94.96.229:18001/lp/
|
||||
# 获取ip地址开关
|
||||
|
|
|
|||
|
|
@ -0,0 +1,135 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('新增广告位')" />
|
||||
<th:block th:include="include :: bootstrap-fileinput-css"/>
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-dict-add">
|
||||
<input id="bannerPicUrl" name="bannerPicUrl" type="hidden"/>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">广告标题:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="bannerTitle" id="bannerTitle" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">广告位类型:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="bannerType" class="form-control m-b" th:with="type=${@dict.getType('sys_banner_type')}">
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">广告跳转地址:</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea name="address" maxlength="500" class="form-control" rows="3"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">广告位图片:</label>
|
||||
|
||||
<div class="col-sm-8">
|
||||
<div class="file-loading">
|
||||
<input id="multipleFile" name="files" type="file" multiple>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">备注:</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea id="remark" name="remark" class="form-control"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<th:block th:include="include :: bootstrap-fileinput-js"/>
|
||||
<script type="text/javascript">
|
||||
var prefix = ctx + "advert/info";
|
||||
|
||||
<!-- $("#form-dict-add").validate({-->
|
||||
<!-- rules:{-->
|
||||
<!-- dictSort:{-->
|
||||
<!-- digits:true-->
|
||||
<!-- },-->
|
||||
<!-- },-->
|
||||
<!-- focusCleanup: true-->
|
||||
<!-- });-->
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/add", $('#form-dict-add').serialize());
|
||||
}
|
||||
}
|
||||
|
||||
$(function () {
|
||||
|
||||
// TODO: 上传
|
||||
// 多图上传
|
||||
var cacheImgs = {};
|
||||
$("#multipleFile").fileinput({
|
||||
uploadUrl: ctx + 'common/uploadsBanner',
|
||||
showUploadedThumbs: true,
|
||||
showUpload: false,
|
||||
uploadAsync: false
|
||||
}).on('filebatchuploadsuccess', function (event, data, previewId, index) {
|
||||
console.log('filebatchuploadsuccess', event, data, previewId, index);
|
||||
var rsp = data.response;
|
||||
var urls = rsp.newFileNames || '';
|
||||
var value = $("#bannerPicUrl").val() || '';
|
||||
var list = [];
|
||||
if (value) {
|
||||
var list = value.split(',');
|
||||
}
|
||||
list = list.concat(urls.split(','))
|
||||
$("#lpFilesName").val(list.join(','));
|
||||
var a = $("#bannerPicUrl").val();
|
||||
alert(rsp.newFileNames);
|
||||
alert(a);
|
||||
}).on('fileuploaded', function (event, data, previewId, index) {
|
||||
cacheImgs[previewId] = data.response.newFileNames;
|
||||
var rsp = data.response;
|
||||
var value = $("#bannerPicUrl").val() || '';
|
||||
var list = [];
|
||||
var res = [];
|
||||
var r_val = rsp.newFileNames;
|
||||
var list = value.split(',');
|
||||
list.forEach(function (item) {
|
||||
if ((item !== r_val) && (item !=='') ) {
|
||||
res.push(item);
|
||||
}
|
||||
})
|
||||
res.push(r_val);
|
||||
console.log('end:', res);
|
||||
$("#lpFilesName").val(res);
|
||||
var c = $("#bannerPicUrl").val();
|
||||
console.log('fileuploaded: c:', c);
|
||||
}).on('filesuccessremove', function (event, data, previewId, index) {
|
||||
|
||||
var urls = cacheImgs[data];
|
||||
delete cacheImgs[data];
|
||||
var value = $("#bannerPicUrl").val() || '';;
|
||||
var list = value.split(',');
|
||||
var res = [];
|
||||
list.forEach(function (item) {
|
||||
if ((item !== urls) && (item !=='')) {
|
||||
res.push(item);
|
||||
}
|
||||
})
|
||||
$("#lpFilesName").val(res);
|
||||
var d = $("#bannerPicUrl").val();
|
||||
console.log('filesuccessremove: d:', d);
|
||||
}).on('filecleared', function (event, data, msg) {
|
||||
alert('全部删除');
|
||||
$("#bannerPicUrl").val('');
|
||||
})
|
||||
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,475 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('修改活动信息')" />
|
||||
<th:block th:include="include :: ztree-css" />
|
||||
<th:block th:include="include :: datetimepicker-css" />
|
||||
<th:block th:include="include :: bootstrap-fileinput-css"/>
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-role-edit" th:object="${active}">
|
||||
<input id="roleId" name="id" type="hidden" th:field="*{id}" />
|
||||
<input id="lpFilesName" name="lpFilesName" type="hidden" th:field="*{lpFilesName}"/>
|
||||
<input id="listLpNames" name="listLpNames" type="hidden" th:field="*{listLpNames}"/>
|
||||
|
||||
<input id="lsFilesName" name="lsFilesName" type="hidden" th:field="*{lsFilesName}"/>
|
||||
<input id="listLsNames" name="listLsNames" type="hidden" th:field="*{listLsNames}"/>
|
||||
|
||||
<input id="fpFilesName" name="fpFilesName" type="hidden" th:field="*{fpFilesName}"/>
|
||||
<input id="listFpNames" name="listFpNames" type="hidden" th:field="*{listFpNames}"/>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">活动标题:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="activeTitle" id="activeTitle" th:field="*{activeTitle}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">活动内容描述:</label>
|
||||
|
||||
<div class="col-sm-8">
|
||||
<textarea name="activeDesc" maxlength="500" class="form-control" rows="3">[[*{activeDesc}]]</textarea>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group draggable">
|
||||
<label class="col-sm-3 control-label">报名开始日期:</label>
|
||||
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group date">
|
||||
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
||||
<input class="form-control" type="text" name="enrollStartDate" id="enrollStartDate" th:field="*{enrollStartDate}" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group draggable">
|
||||
<label class="col-sm-3 control-label">报名结束日期:</label>
|
||||
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group date">
|
||||
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
||||
<input class="form-control" type="text" name="enrollEndDate" id="enrollEndDate" th:field="*{enrollEndDate}" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group draggable">
|
||||
<label class="col-sm-3 control-label">活动开始日期:</label>
|
||||
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group date">
|
||||
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
||||
<input class="form-control" type="text" name="activeStartDate" id="activeStartDate" th:field="*{activeStartDate}" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group draggable">
|
||||
<label class="col-sm-3 control-label">活动结束日期:</label>
|
||||
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group date">
|
||||
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
||||
<input class="form-control" type="text" name="activeEndDate" id="activeEndDate" th:field="*{activeEndDate}" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">活动类型:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="activeType" class="form-control m-b" th:with="type=${@dict.getType('sys_active_type')}">
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{activeType}"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">海报图片上传:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="file-loading">
|
||||
<input id="firstSingleFile" name="file" type="file">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">活动列表图片上传:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="file-loading">
|
||||
<input id="singleFile" name="file" type="file">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">报名要求:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="isEnroll" class="form-control m-b" th:with="type=${@dict.getType('sya_active_enroll')}">
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{isEnroll}"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">活动明细图片:</label>
|
||||
|
||||
<div class="col-sm-8">
|
||||
<div class="file-loading">
|
||||
<input id="multipleFile" name="files" type="file" multiple>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- <div class="form-group">-->
|
||||
<!-- <label class="col-sm-3 control-label is-required">活动状态:</label>-->
|
||||
<!-- <div class="col-sm-8">-->
|
||||
<!-- <select name="status" class="form-control m-b" th:with="type=${@dict.getType('sys_active_status')}">-->
|
||||
<!-- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{status}"></option>-->
|
||||
<!-- </select>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">活动地址:</label>
|
||||
|
||||
<div class="col-sm-8">
|
||||
<textarea name="address" maxlength="500" class="form-control" rows="3">[[*{address}]]</textarea>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">备注:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="remark" name="remark" class="form-control" type="text" th:field="*{remark}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<th:block th:include="include :: datetimepicker-js" />
|
||||
<script th:src="@{/js/jquery-ui-1.10.4.min.js}"></script>
|
||||
<th:block th:include="include :: datetimepicker-js" />
|
||||
<th:block th:include="include :: bootstrap-fileinput-js"/>
|
||||
<script th:src="@{/ajax/libs/beautifyhtml/beautifyhtml.js}"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){setup_draggable();$("#n-columns").on("change",function(){var v=$(this).val();if(v==="1"){var $col=$(".form-body .col-md-12").toggle(true);$(".form-body .col-md-6 .draggable").each(function(i,el){$(this).remove().appendTo($col)});$(".form-body .col-md-6").toggle(false)}else{var $col=$(".form-body .col-md-6").toggle(true);$(".form-body .col-md-12 .draggable").each(function(i,el){$(this).remove().appendTo(i%2?$col[1]:$col[0])});$(".form-body .col-md-12").toggle(false)}});$("#copy-to-clipboard").on("click",function(){var $copy=$(".form-body").clone().appendTo(document.body);$copy.find(".tools, :hidden").remove();$.each(["draggable","droppable","sortable","dropped","ui-sortable","ui-draggable","ui-droppable","form-body"],function(i,c){$copy.find("."+c).removeClass(c).removeAttr("style")});var html=html_beautify($copy.html());$copy.remove();$modal=get_modal(html).modal("show");$modal.find(".btn").remove();$modal.find(".modal-title").html("复制HTML代码");$modal.find(":input:first").select().focus();return false})});var setup_draggable=function(){$(".draggable").draggable({appendTo:"body",helper:"clone"});$(".droppable").droppable({accept:".draggable",helper:"clone",hoverClass:"droppable-active",drop:function(event,ui){$(".empty-form").remove();var $orig=$(ui.draggable);if(!$(ui.draggable).hasClass("dropped")){var $el=$orig.clone().addClass("dropped").css({"position":"static","left":null,"right":null}).appendTo(this);if($el.find("label").hasClass("radio-box")){$el=$el.html('<label class="col-sm-3 control-label">单选框:</label>'+'<div class="col-sm-9">'+'<label class="radio-box"><input type="radio" checked="" value="option1" id="optionsRadios1" name="optionsRadios">选项1</label>'+'<label class="radio-box"><input type="radio" value="option2" id="optionsRadios2" name="optionsRadios">选项2</label>'+"</div>")}else{if($el.find("label").hasClass("check-box")){$el=$el.html('<label class="col-sm-3 control-label">复选框:</label>'+'<div class="col-sm-9">'+'<label class="check-box">'+'<input type="checkbox" value="option1" id="inlineCheckbox1">选项1</label>'+'<label class="check-box">'+'<input type="checkbox" value="option2" id="inlineCheckbox2">选项2</label>'+'<label class="check-box">'+'<input type="checkbox" value="option3" id="inlineCheckbox3">选项3</label>'+"</div>")}}var id=$orig.find(":input").attr("id");if(id){id=id.split("-").slice(0,-1).join("-")+"-"+(parseInt(id.split("-").slice(-1)[0])+1);$orig.find(":input").attr("id",id);$orig.find("label").attr("for",id)}$('<p class="tools col-sm-12 col-sm-offset-3"> <a class="edit-link">编辑HTML<a> | <a class="remove-link">移除</a></p>').appendTo($el)}else{if($(this)[0]!=$orig.parent()[0]){var $el=$orig.clone().css({"position":"static","left":null,"right":null}).appendTo(this);$orig.remove()}}}}).sortable()};var get_modal=function(content){var modal=$('<div class="modal" style="overflow: auto;" tabindex="-1"> <div class="modal-dialog"><div class="modal-content"><div class="modal-header"><a type="button" class="close" data-dismiss="modal" aria-hidden="true">×</a><h4 class="modal-title">编辑HTML</h4></div><div class="modal-body ui-front"> <textarea class="form-control textarea-show-src" style="min-height: 200px; margin-bottom: 10px;font-family: Monaco, Fixed"></textarea><button class="btn btn-success">更新HTML</button></div></div></div></div>').appendTo(document.body);var doms=document.getElementsByClassName("textarea-show-src");for(var i=0;i<doms.length;i++){doms.item(i).innerHTML=content}return modal};$(document).on("click",".edit-link",function(ev){var $el=$(this).parent().parent();var $el_copy=$el.clone();var $edit_btn=$el_copy.find(".edit-link").parent().remove();var $modal=get_modal(html_beautify($el_copy.html())).modal("show");$modal.find(":input:first").focus();$modal.find(".btn-success").click(function(ev2){var html=$modal.find("textarea").val();if(!html){$el.remove()}else{$el.html(html);$edit_btn.appendTo($el)}$modal.modal("hide");return false})});$(document).on("click",".remove-link",function(ev){$(this).parent().parent().remove()});$(".input-group.date").datetimepicker({format:"yyyy-mm-dd",minView:"month",autoclose:true});
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
function edit() {
|
||||
var id = $("input[name='id']").val();
|
||||
var activeTitle = $("input[name='activeTitle']").val();
|
||||
var activeDesc =$("textarea[name='activeDesc']").val();
|
||||
var enrollStartDate = $("input[name='enrollStartDate']").val();
|
||||
var enrollEndDate = $("input[name='enrollEndDate']").val();
|
||||
var activeStartDate = $("input[name='activeStartDate']").val();
|
||||
var activeEndDate = $("input[name='activeEndDate']").val();
|
||||
var activeType = $("select[name='activeType']").val();
|
||||
var isEnroll = $("select[name='isEnroll']").val();
|
||||
var lpFilesName = $("input[name='lpFilesName']").val();
|
||||
var lsFilesName = $("input[name='lsFilesName']").val();
|
||||
var fpFilesName = $("input[name='fpFilesName']").val();
|
||||
var remark = $("input[name='remark']").val();
|
||||
var address =$("textarea[name='address']").val();
|
||||
$.ajax({
|
||||
cache : true,
|
||||
type : "POST",
|
||||
url : ctx + "active/info/edit",
|
||||
data : {
|
||||
"id": id,
|
||||
"activeTitle": activeTitle,
|
||||
"activeDesc": activeDesc,
|
||||
"address": address,
|
||||
"enrollStartDate": enrollStartDate,
|
||||
"enrollEndDate": enrollEndDate,
|
||||
"activeStartDate": activeStartDate,
|
||||
"activeEndDate": activeEndDate,
|
||||
"activeType": activeType,
|
||||
"isEnroll": isEnroll,
|
||||
"lpFilesName": lpFilesName,
|
||||
"lsFilesName": lsFilesName,
|
||||
"fpFilesName": fpFilesName,
|
||||
"remark": remark
|
||||
},
|
||||
async : false,
|
||||
error : function(request) {
|
||||
$.modal.alertError("系统错误");
|
||||
},
|
||||
success : function(data) {
|
||||
$.operate.successCallback(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function submitHandler() {
|
||||
var c = check_c();
|
||||
if(c){
|
||||
edit();
|
||||
}
|
||||
}
|
||||
|
||||
function initIdCardFile() {
|
||||
//测试图片回显
|
||||
var a = $("input[name='listLpNames']").val();
|
||||
var initialList = eval("("+a+")");
|
||||
var previewJson = new Array();//回显文件数组
|
||||
var initPreviewConfig = new Array();
|
||||
if (initialList != null && initialList.length) {
|
||||
for (var i = 0; i < initialList.length; i++) {
|
||||
previewJson[i] = initialList[i].filepath;
|
||||
//alert(initialList[i].filepath);
|
||||
//组装图片配置
|
||||
var tjson = {
|
||||
type: getFileTypeFromUrl(initialList[i].filepath),
|
||||
caption: initialList[i].filename, // 展示的文件名
|
||||
url: 'idcardremove', // 删除url 必填,可以写一个空方法,不然无法删除初始化图片
|
||||
key: initialList[i].id, // 删除时Ajax向后台传递的参数
|
||||
/* extra: function() {
|
||||
return {"id":id};
|
||||
} */ //这里也可以携带格外的参数
|
||||
};
|
||||
initPreviewConfig[i] = tjson;
|
||||
}
|
||||
}
|
||||
// 多图上传
|
||||
var cacheImgs = {};
|
||||
var g_value = $("#lpFilesName").val() || '';
|
||||
var g_list = g_value.split(',');
|
||||
$("#multipleFile").fileinput({
|
||||
uploadUrl: ctx + 'common/uploadsLp',//上传路径
|
||||
fileActionSettings: {
|
||||
uploadClass: 'hideBtn'
|
||||
},
|
||||
overwriteInitial: false,
|
||||
initialPreviewAsData: true,
|
||||
initialPreview: previewJson,
|
||||
initialPreviewConfig: initPreviewConfig,
|
||||
// uploadAsync:false, 需要使用异步
|
||||
layoutTemplates: {
|
||||
actionUpload: '',//去除上传预览缩略图中的上传图片
|
||||
},
|
||||
showPreview: true,//是否显示预览
|
||||
showUpload: false,//不显示底部上传按钮
|
||||
showRemove: false,//不显示底部清空按钮
|
||||
showCaption: true,//显示底部上传按钮左侧文本(完全是为了美观)
|
||||
}).on('filebatchuploadsuccess', function (event, data, previewId, index) {
|
||||
var rsp = data.response;
|
||||
}).on('fileuploaded', function (event, data, previewId, index) {
|
||||
|
||||
cacheImgs[previewId] = data.response.newFileNames;
|
||||
var rsp = data.response;
|
||||
var value = $("#lpFilesName").val() || '';
|
||||
var list = [];
|
||||
var res = [];
|
||||
var r_val = rsp.newFileNames;
|
||||
var list = value.split(',');
|
||||
list.forEach(function (item) {
|
||||
if ((item !== r_val) && (item !=='') ) {
|
||||
res.push(item);
|
||||
}
|
||||
})
|
||||
res.push(r_val);
|
||||
console.log('end:', res);
|
||||
$("#lpFilesName").val(res);
|
||||
var c = $("#lpFilesName").val();
|
||||
console.log('fileuploaded: c:', c);
|
||||
|
||||
}).on('filebatchselected', function (event, files) {
|
||||
$(this).fileinput("upload");//这里会根据uploadAsync值自动去执行对应的回调函
|
||||
}).on('filebatchuploaderror', function (event, data, msg) {
|
||||
//批量上传失败提示
|
||||
var _maxRequestSize = 10240;
|
||||
_allFileSize = 0;
|
||||
if (_allFileSize > _maxRequestSize) {
|
||||
msg = "上传文件总大小(" + (_allFileSize / 1024).toFixed(2) + "MB)超出限制(" + (_maxRequestSize / 1024).toFixed(2) + "MB)";
|
||||
$('#input-id').fileinput('clear');
|
||||
$.modal.msgWarning(msg);
|
||||
}
|
||||
}).on('fileclear', function (event, previewId, extra) {
|
||||
//拒绝移除 如果给移除上传控件所有内容的功能,则系统会重新初始化回显的文件,那么我的 initInputFileImg()函数完全不起作用了,所以,禁用它
|
||||
return false;
|
||||
}).on('fileerror', function (event, data, msg) {
|
||||
console.log("--------------------fileerror--------------------");
|
||||
console.log(data);
|
||||
console.log(msg);
|
||||
$.modal.msgError("上传失败");
|
||||
}).on('filepreremove', function (event, key) {
|
||||
$.modal.msgSuccess("移除成功-1");
|
||||
}).on('filebeforedelete', function (event, key) {
|
||||
$.modal.msgSuccess("移除成功-2");
|
||||
console.log('filebeforedelete',event,key);
|
||||
var value = $("#lpFilesName").val() || '';
|
||||
var list = value.split(',');
|
||||
var res = [];
|
||||
for (var i = 0; i < list.length; i++) {
|
||||
if(list[i]!==g_list[key]){
|
||||
res.push(list[i]);
|
||||
}
|
||||
}
|
||||
$("#lpFilesName").val(res);
|
||||
var f = $("#lpFilesName").val();
|
||||
console.log('filesuccessremove: f:', f);
|
||||
}).on('filesuccessremove', function (event, data, previewId, index) {
|
||||
$.modal.msgSuccess("移除成功-3");
|
||||
var urls = cacheImgs[data];
|
||||
delete cacheImgs[data];
|
||||
var value = $("#lpFilesName").val() || '';
|
||||
var list = value.split(',');
|
||||
var res = [];
|
||||
list.forEach(function (item) {
|
||||
if ((item !== urls) && (item !=='')) {
|
||||
res.push(item);
|
||||
}
|
||||
})
|
||||
$("#lpFilesName").val(res);
|
||||
var d = $("#lpFilesName").val();
|
||||
console.log('filesuccessremove: d:', d);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
var a = $("input[name='listLsNames']").val();
|
||||
var b= [];
|
||||
if (a.endsWith('null')){
|
||||
b= []
|
||||
}else{
|
||||
b= [a]
|
||||
}
|
||||
console.log('a:', a);
|
||||
// 单图上传
|
||||
$("#singleFile").fileinput({
|
||||
uploadUrl: ctx + 'common/uploadsLs',
|
||||
maxFileCount: 1,
|
||||
initialPreviewAsData: true,
|
||||
initialPreview: b,
|
||||
layoutTemplates: {
|
||||
footer: '',//隐藏全部小图标
|
||||
},
|
||||
showRemove: true, //不显示底部清空按钮
|
||||
autoReplace: true
|
||||
}).on('fileuploaded', function (event, data, previewId, index) {
|
||||
var rsp = data.response;
|
||||
$("#lsFilesName").val(rsp.newFileName);
|
||||
log.info("return lsFilesName url:" + rsp.url)
|
||||
log.info("reutrn lsFilesName fileName:" + rsp.fileName)
|
||||
log.info("reutrn lsFilesName newFileName:" + rsp.newFileName)
|
||||
log.info("return lsFilesName originalFilename:" + rsp.originalFilename)
|
||||
}).on('fileremoved', function (event, id, index) {
|
||||
$("input[name='" + event.currentTarget.id + "']").val('')
|
||||
}).on('filebeforedelete', function (event, key) {
|
||||
$.modal.msgSuccess("移除成功-2");
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
initIdCardFile(); //调用上面的初始化方法
|
||||
initInputFileImg();
|
||||
fpFilesName();
|
||||
|
||||
});
|
||||
function getFileTypeFromUrl(url) {
|
||||
if (url.endsWith('gif') || url.endsWith('jpg') || url.endsWith('jpeg') || url.endsWith('png')) {
|
||||
return 'image';
|
||||
}
|
||||
if (url.endsWith('mp4')) {
|
||||
return 'video';
|
||||
}
|
||||
}
|
||||
|
||||
//回显文件 对应的div里追加 hidden_img
|
||||
function initInputFileImg(){
|
||||
$(".file-sortable").each(function(){
|
||||
var tempFileName = $(this).find('.kv-file-content').find('.file-preview-image').attr("src");
|
||||
$(this).find('.kv-file-content').eq(0).parent().append("<span class='hidden_img hidden_img_init' hidden >"+tempFileName+"</span>");
|
||||
})
|
||||
}
|
||||
|
||||
function fpFilesName(){
|
||||
var c = $("input[name='listFpNames']").val();
|
||||
var d= [];
|
||||
if (c.endsWith('null')){
|
||||
d= []
|
||||
}else{
|
||||
d= [c]
|
||||
}
|
||||
console.log('c:', d);
|
||||
// 单图上传
|
||||
$("#firstSingleFile").fileinput({
|
||||
uploadUrl: ctx + 'common/uploadsFp',
|
||||
maxFileCount: 1,
|
||||
initialPreviewAsData: true,
|
||||
initialPreview: d,
|
||||
layoutTemplates: {
|
||||
footer: '',//隐藏全部小图标
|
||||
},
|
||||
showRemove: true, //不显示底部清空按钮
|
||||
autoReplace: true
|
||||
}).on('fileuploaded', function (event, data, previewId, index) {
|
||||
var rsp = data.response;
|
||||
$("#fpFilesName").val(rsp.newFileName);
|
||||
log.info("return url:" + rsp.url)
|
||||
log.info("reutrn fileName:" + rsp.fileName)
|
||||
log.info("reutrn newFileName:" + rsp.newFileName)
|
||||
log.info("return originalFilename:" + rsp.originalFilename)
|
||||
}).on('fileremoved', function (event, id, index) {
|
||||
$("input[name='" + event.currentTarget.id + "']").val('')
|
||||
}).on('filebeforedelete', function (event, key) {
|
||||
$.modal.msgSuccess("移除成功-2");
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
function check_c() {
|
||||
var enrollStartDate = $("input[name='enrollStartDate']").val();
|
||||
var enrollEndDate = $("input[name='enrollEndDate']").val();
|
||||
var activeStartDate = $("input[name='activeStartDate']").val();
|
||||
var activeEndDate = $("input[name='activeEndDate']").val();
|
||||
if (enrollStartDate == null || enrollStartDate == "") {
|
||||
//为空
|
||||
$.modal.alertWarning("报名开始日期不能为空");
|
||||
return false;
|
||||
}
|
||||
if (enrollEndDate == null || enrollEndDate == "") {
|
||||
//为空
|
||||
$.modal.alertWarning("报名结束日期不能为空");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(enrollEndDate<enrollStartDate){
|
||||
$.modal.alertWarning("报名结束日期不能早于报名开始日期");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (activeStartDate == null || activeStartDate == "") {
|
||||
//为空
|
||||
$.modal.alertWarning("活动开始日期不能为空");
|
||||
return false;
|
||||
}
|
||||
if (activeEndDate == null || activeEndDate == "") {
|
||||
//为空
|
||||
$.modal.alertWarning("活动结束日期不能为空");
|
||||
return false;
|
||||
}
|
||||
if(activeEndDate<activeStartDate){
|
||||
$.modal.alertWarning("活动结束日期不能早于活动开始日期");
|
||||
return false;
|
||||
}
|
||||
if(enrollEndDate>activeEndDate){
|
||||
$.modal.alertWarning("报名结束日期不能晚于活动结束日期");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,185 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||
<head>
|
||||
<th:block th:include="include :: header('广告列表')"/>
|
||||
</head>
|
||||
<body class="gray-bg">
|
||||
<div class="container-div">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 search-collapse">
|
||||
<form id="role-form">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
广告标题:<input type="text" name="activeTitle"/>
|
||||
</li>
|
||||
<li>
|
||||
广告类型:<select name="status" th:with="type=${@dict.getType('sys_banner_type')}">
|
||||
<option value="">所有</option>
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
|
||||
th:value="${dict.dictValue}"></option>
|
||||
</select>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
|
||||
class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
|
||||
class="fa fa-refresh"></i> 重置</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="btn-group-sm" id="toolbar" role="group">
|
||||
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="active:info:add">
|
||||
<i class="fa fa-plus"></i> 新增
|
||||
</a>
|
||||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()"
|
||||
shiro:hasPermission="active:info:edit">
|
||||
<i class="fa fa-edit"></i> 修改
|
||||
</a>
|
||||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()"
|
||||
shiro:hasPermission="active:info:remove">
|
||||
<i class="fa fa-remove"></i> 删除
|
||||
</a>
|
||||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="active:info:export">
|
||||
<i class="fa fa-download"></i> 导出
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<th:block th:include="include :: footer"/>
|
||||
<script th:inline="javascript">
|
||||
var editFlag = [[${@permission.hasPermi('advert:info:list')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('advert:info:remove')}]];
|
||||
var addFlag = [[${@permission.hasPermi('advert:info:list')}]];
|
||||
var prefix = ctx + "advert/info";
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
url: prefix + "/list",
|
||||
createUrl: prefix + "/add",
|
||||
updateUrl: prefix + "/edit/{id}",
|
||||
removeUrl: prefix + "/remove",
|
||||
exportUrl: prefix + "/export",
|
||||
modalName: "活动",
|
||||
columns: [{
|
||||
checkbox: true
|
||||
},
|
||||
{
|
||||
field: 'id',
|
||||
title: '广告编号'
|
||||
},
|
||||
{
|
||||
field: 'bannerTitle',
|
||||
title: '广告标题',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
field: 'address',
|
||||
title: '广告跳转地址',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
field: 'bannerType',
|
||||
title: '活动类型',
|
||||
sortable: true,
|
||||
formatter: function(value, item, index) {
|
||||
if (item.bannerType == '0') {
|
||||
return '<span class="label label-success">微信小程序</span>';
|
||||
}
|
||||
else if (item.bannerType == '1') {
|
||||
return '<span class="label label-primary">app</span>';
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
field: 'createTime',
|
||||
title: '创建时间',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
if (row.roleId != 1) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||
return actions.join('');
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
|
||||
/* 角色管理-分配数据权限 */
|
||||
function authDataScope(roleId) {
|
||||
var url = prefix + '/authDataScope/' + roleId;
|
||||
$.modal.open("分配数据权限", url);
|
||||
}
|
||||
|
||||
|
||||
/* 设置首页 */
|
||||
function authFirstPage(roleId) {
|
||||
var url = prefix + '/first/'+roleId;
|
||||
$.modal.open("增加首页", url);
|
||||
}
|
||||
|
||||
/* 角色管理-分配用户 */
|
||||
function authUser(roleId) {
|
||||
var url = prefix + '/authUser/' + roleId;
|
||||
$.modal.openTab("分配用户", url);
|
||||
}
|
||||
|
||||
/* 设置首页 */
|
||||
function statusTools(row) {
|
||||
if (row.isFristPage == '0') {
|
||||
return '<i class=\"fa fa-toggle-off text-info fa-2x\" onclick="enable(\'' + row.id + '\')"></i> ';
|
||||
} else{
|
||||
return '<i class=\"fa fa-toggle-on text-info fa-2x\" onclick="disable(\'' + row.id + '\')"></i> ';
|
||||
}
|
||||
}
|
||||
|
||||
/* 活动管理-上线 */
|
||||
function online(id) {
|
||||
$.modal.confirm("确认要设置活动上线吗?", function() {
|
||||
$.operate.post(prefix + "/changeStatus", { "id": id, "status": 1 });
|
||||
})
|
||||
}
|
||||
|
||||
/* 活动管理-下线 */
|
||||
function Offline(id) {
|
||||
$.modal.confirm("确认要设置活动下线吗?", function() {
|
||||
$.operate.post(prefix + "/changeStatus", { "id": id, "status": 2 });
|
||||
})
|
||||
}
|
||||
|
||||
/* 设置为首页 */
|
||||
function enable(id) {
|
||||
$.modal.confirm("确认要设置海报图此为首页?", function() {
|
||||
$.operate.post(prefix + "/firstSave", { "id": id, "isFristPage": '1' });
|
||||
})
|
||||
}
|
||||
|
||||
/* 设置取消首页 */
|
||||
function disable(id) {
|
||||
$.modal.confirm("确认要取消此首页?", function() {
|
||||
$.operate.post(prefix + "/firstSave", { "id": id, "isFristPage": '0' });
|
||||
})
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -158,6 +158,16 @@ public class RuoYiConfig
|
|||
return getProfile() + "/upload/lp";
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取广告上传路径
|
||||
*/
|
||||
public static String getBAUploadPath()
|
||||
{
|
||||
return getProfile() + "/upload/ba";
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取列表上传路径
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,108 @@
|
|||
package com.wuzhen.system.domain;
|
||||
|
||||
import com.wuzhen.common.annotation.Excel;
|
||||
import com.wuzhen.common.annotation.Excel.ColumnType;
|
||||
import com.wuzhen.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 广告信息 Advert_info
|
||||
*
|
||||
* @author zhengzheng
|
||||
*/
|
||||
public class AdvertInfo extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 广告ID
|
||||
*/
|
||||
@Excel(name = "广告ID", cellType = ColumnType.NUMERIC)
|
||||
private Long id;
|
||||
|
||||
|
||||
/**
|
||||
* 广告标题
|
||||
*/
|
||||
@Excel(name = "广告标题")
|
||||
private String bannerTitle;
|
||||
|
||||
|
||||
/**
|
||||
* 跳转类型
|
||||
*/
|
||||
@Excel(name = "跳转类型")
|
||||
private String bannerType;
|
||||
|
||||
|
||||
|
||||
private String bannerPicUrl;
|
||||
|
||||
|
||||
/**
|
||||
* 广告跳转地址
|
||||
*/
|
||||
@Excel(name = "广告跳转地址")
|
||||
private String address;
|
||||
|
||||
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
private String delFlag;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getBannerTitle() {
|
||||
return bannerTitle;
|
||||
}
|
||||
|
||||
public void setBannerTitle(String bannerTitle) {
|
||||
this.bannerTitle = bannerTitle;
|
||||
}
|
||||
|
||||
public String getBannerType() {
|
||||
return bannerType;
|
||||
}
|
||||
|
||||
public void setBannerType(String bannerType) {
|
||||
this.bannerType = bannerType;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getDelFlag() {
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
public void setDelFlag(String delFlag) {
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public String getBannerPicUrl() {
|
||||
return bannerPicUrl;
|
||||
}
|
||||
|
||||
public void setBannerPicUrl(String bannerPicUrl) {
|
||||
this.bannerPicUrl = bannerPicUrl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "AdvertInfo{" +
|
||||
"id=" + id +
|
||||
", bannerTitle='" + bannerTitle + '\'' +
|
||||
", bannerType='" + bannerType + '\'' +
|
||||
", address='" + address + '\'' +
|
||||
", delFlag='" + delFlag + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
package com.wuzhen.system.mapper;
|
||||
|
||||
import com.wuzhen.common.core.domain.entity.SysDictData;
|
||||
import com.wuzhen.system.domain.AdvertInfo;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 广告表 数据层
|
||||
*
|
||||
* @author zhengzheng
|
||||
*/
|
||||
public interface AdvertDataMapper
|
||||
{
|
||||
/**
|
||||
* 根据条件分页查询广告数据
|
||||
*
|
||||
* @param advertInfo 广告数据信息
|
||||
* @return 广告数据集合信息
|
||||
*/
|
||||
public List<AdvertInfo> selectAdvertDataList(AdvertInfo advertInfo);
|
||||
|
||||
|
||||
/**
|
||||
* 批量删除广告数据
|
||||
*
|
||||
* @param ids 需要删除的数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAdvertDataByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 新增广告数据信息
|
||||
*
|
||||
* @param advertInfo 广告数据信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAdvertData(AdvertInfo advertInfo);
|
||||
|
||||
/**
|
||||
* 修改广告数据信息
|
||||
*
|
||||
* @param advertInfo 广告数据信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAdvertData(AdvertInfo advertInfo);
|
||||
|
||||
|
||||
/**
|
||||
* 根据广告数据ID查询信息
|
||||
*
|
||||
* @param id 广告数据ID
|
||||
* @return 广告数据
|
||||
*/
|
||||
public AdvertInfo selectAdvertDataById(Long id);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
package com.wuzhen.system.service;
|
||||
|
||||
import com.wuzhen.common.core.domain.entity.SysDictData;
|
||||
import com.wuzhen.system.domain.AdvertInfo;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 广告位 业务层
|
||||
*
|
||||
* @author zhengzheng
|
||||
*/
|
||||
public interface AdvertDataService
|
||||
{
|
||||
/**
|
||||
* 根据条件分页查询广告位
|
||||
*
|
||||
* @param advertInfo 广告位信息
|
||||
* @return 广告位集合信息
|
||||
*/
|
||||
public List<AdvertInfo> selectAdvertDataList(AdvertInfo advertInfo);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 批量删除广告位数据
|
||||
*
|
||||
* @param ids 需要删除的数据
|
||||
*/
|
||||
public void deleteAdvertDataByIds(String ids);
|
||||
|
||||
/**
|
||||
* 新增保存广告位数据信息
|
||||
*
|
||||
* @param advertInfo 广告位数据信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAdvertData(AdvertInfo advertInfo);
|
||||
|
||||
/**
|
||||
* 修改保存广告位数据信息
|
||||
*
|
||||
* @param advertInfo 广告位数据信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAdvertData(AdvertInfo advertInfo);
|
||||
|
||||
|
||||
/**
|
||||
* 根据广告数据ID查询信息
|
||||
*
|
||||
* @param dictCode 广告数据ID
|
||||
* @return 广告数据
|
||||
*/
|
||||
public AdvertInfo selectAdvertDataById(Long dictCode);
|
||||
}
|
||||
|
|
@ -123,18 +123,6 @@ public class ActiveInfoServiceImpl implements IActiveInfoService {
|
|||
@Transactional
|
||||
public int deleteActiveByIds(String ids) {
|
||||
Long[] ids_arr = Convert.toLongArray(ids);
|
||||
// for (Long roleId : roleIds) {
|
||||
// checkRoleAllowed(new SysRole(roleId));
|
||||
// checkRoleDataScope(roleId);
|
||||
// SysRole role = selectRoleById(roleId);
|
||||
// if (countUserRoleByRoleId(roleId) > 0) {
|
||||
// throw new ServiceException(String.format("%1$s已分配,不能删除", role.getRoleName()));
|
||||
// }
|
||||
// }
|
||||
// // 删除角色与菜单关联
|
||||
// roleMenuMapper.deleteRoleMenu(roleIds);
|
||||
// // 删除角色与部门关联
|
||||
// roleDeptMapper.deleteRoleDept(roleIds);
|
||||
return activeInfoMapper.deleteActiveByIds(ids_arr);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,80 @@
|
|||
package com.wuzhen.system.service.impl;
|
||||
|
||||
import com.wuzhen.common.core.domain.entity.SysDictData;
|
||||
import com.wuzhen.common.core.text.Convert;
|
||||
import com.wuzhen.system.domain.AdvertInfo;
|
||||
import com.wuzhen.system.mapper.AdvertDataMapper;
|
||||
import com.wuzhen.system.service.AdvertDataService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 广告 业务层处理
|
||||
*
|
||||
* @author zhengzheng
|
||||
*/
|
||||
@Service
|
||||
public class AdvertDataServiceImpl implements AdvertDataService
|
||||
{
|
||||
@Autowired
|
||||
private AdvertDataMapper advertDataMapper;
|
||||
|
||||
/**
|
||||
* 根据条件分页查询广告数据
|
||||
*
|
||||
* @param advertInfo 广告数据信息
|
||||
* @return 广告数据集合信息
|
||||
*/
|
||||
@Override
|
||||
public List<AdvertInfo> selectAdvertDataList(AdvertInfo advertInfo)
|
||||
{
|
||||
return advertDataMapper.selectAdvertDataList(advertInfo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 批量删除广告数据
|
||||
*
|
||||
* @param ids 需要删除的数据
|
||||
*/
|
||||
@Override
|
||||
public void deleteAdvertDataByIds(String ids)
|
||||
{
|
||||
Long[] ids_arr = Convert.toLongArray(ids);
|
||||
advertDataMapper.deleteAdvertDataByIds(ids_arr);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存广告数据信息
|
||||
*
|
||||
* @param data 广告数据信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertAdvertData(AdvertInfo data)
|
||||
{
|
||||
int row = advertDataMapper.insertAdvertData(data);
|
||||
return row;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存广告数据信息
|
||||
*
|
||||
* @param data 广告数据信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateAdvertData(AdvertInfo data)
|
||||
{
|
||||
int row = advertDataMapper.updateAdvertData(data);
|
||||
return row;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AdvertInfo selectAdvertDataById(Long dictCode) {
|
||||
AdvertInfo advertInfo = advertDataMapper.selectAdvertDataById(dictCode);
|
||||
return advertInfo;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,85 @@
|
|||
<?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.wuzhen.system.mapper.AdvertDataMapper">
|
||||
|
||||
<resultMap type="AdvertInfo" id="AdvertDataResult">
|
||||
<id property="id" column="id" />
|
||||
<result property="bannerTitle" column="banner_title" />
|
||||
<result property="bannerType" column="banner_type" />
|
||||
<result property="bannerPicUrl" column="banner_pic_url" />
|
||||
<result property="address" column="address" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAdvertDataVo">
|
||||
select id, banner_title, banner_type, banner_pic_url, address, del_flag, create_by, create_time, update_by, update_time, remark
|
||||
from banner_info
|
||||
</sql>
|
||||
|
||||
<select id="selectAdvertDataList" parameterType="AdvertInfo" resultMap="AdvertDataResult">
|
||||
<include refid="selectAdvertDataVo"/>
|
||||
<where>
|
||||
<if test="bannerType != null and bannerType != ''">
|
||||
AND banner_type = #{bannerType}
|
||||
</if>
|
||||
<if test="bannerTitle != null and bannerTitle != ''">
|
||||
AND banner_title like concat('%', #{bannerTitle}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<delete id="deleteAdvertDataByIds" parameterType="String">
|
||||
delete from banner_info where id in
|
||||
<foreach collection="array" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<update id="updateAdvertData" parameterType="AdvertInfo">
|
||||
update banner_info
|
||||
<set>
|
||||
<if test="bannerTitle != null">banner_title = #{bannerTitle},</if>
|
||||
<if test="bannerType != null and bannerType != ''">banner_type = #{bannerType},</if>
|
||||
<if test="bannerPicUrl != null and bannerPicUrl != ''">banner_pic_url = #{bannerPicUrl},</if>
|
||||
<if test="address != null">address = #{address},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<insert id="insertAdvertData" parameterType="AdvertInfo">
|
||||
insert into banner_info(
|
||||
<if test="bannerTitle != null">banner_title,</if>
|
||||
<if test="bannerType != null and bannerType != ''">banner_type,</if>
|
||||
<if test="bannerPicUrl != null and bannerPicUrl != ''">banner_pic_url,</if>
|
||||
<if test="address != null and address != ''">address,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="bannerTitle != null">#{bannerTitle},</if>
|
||||
<if test="bannerType != null and bannerType != ''">#{bannerType},</if>
|
||||
<if test="bannerPicUrl != null and bannerPicUrl != ''">#{bannerPicUrl},</if>
|
||||
<if test="address != null and address != ''">#{address},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<select id="selectAdvertDataById" parameterType="Long" resultMap="AdvertDataResult">
|
||||
<include refid="selectAdvertDataVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue