代码提交
This commit is contained in:
parent
e5ed5ea70d
commit
db2153b9af
|
|
@ -6,6 +6,7 @@ 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.StringUtils;
|
||||
import com.wuzhen.common.utils.poi.ExcelUtil;
|
||||
import com.wuzhen.framework.shiro.util.AuthorizationUtils;
|
||||
import com.wuzhen.system.domain.ActiveInfo;
|
||||
|
|
@ -20,11 +21,9 @@ import org.springframework.ui.ModelMap;
|
|||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 角色信息
|
||||
|
|
@ -54,10 +53,6 @@ public class ActiveInfoController extends BaseController
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@RequiresPermissions("active:info:view")
|
||||
@GetMapping()
|
||||
public String role()
|
||||
|
|
@ -71,11 +66,15 @@ public class ActiveInfoController extends BaseController
|
|||
public TableDataInfo list(ActiveInfo activeInfo)
|
||||
{
|
||||
startPage();
|
||||
|
||||
List<ActiveInfo> list = activeInfoService.selectActiveList(activeInfo);
|
||||
list.forEach(item->{
|
||||
if (item!=null&&!"".equals(item.getActiveDesc())&&item.getActiveDesc().length()>6){
|
||||
item.setActiveDesc(item.getActiveDesc().substring(0,6)+"...");
|
||||
}
|
||||
String startdate = item.getActiveStartDate();
|
||||
String enddate = item.getActiveEndDate();
|
||||
item.setActStatus(this.judgeDate(startdate,enddate));
|
||||
});
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
|
@ -142,6 +141,11 @@ public class ActiveInfoController extends BaseController
|
|||
if(activeInfo.getLsFilesName()!=null && !"".equals(activeInfo.getLsFilesName())){
|
||||
activeInfo.setListLsNames("http://"+this.getAdress()+":18000/profile/upload/ls/"+activeInfo.getLsFilesName());
|
||||
}
|
||||
|
||||
if(activeInfo.getFpFilesName()!=null && !"".equals(activeInfo.getFpFilesName())){
|
||||
activeInfo.setListFpNames("http://"+this.getAdress()+":18000/profile/upload/fp/"+activeInfo.getFpFilesName());
|
||||
}
|
||||
|
||||
mmap.put("active", activeInfo);
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
|
@ -172,30 +176,6 @@ public class ActiveInfoController extends BaseController
|
|||
@ResponseBody
|
||||
public AjaxResult firstSave(@Validated ActiveInfo activeInfo)
|
||||
{
|
||||
// MultipartFile file = activeInfo.getActiveFirstPic();
|
||||
// // 获取上传文件名
|
||||
// String filename = file.getOriginalFilename();
|
||||
// if (!"".equals(filename)){
|
||||
//
|
||||
// // 定义上传文件保存路径
|
||||
// String path = RuoYiConfig.getFPUploadPath();
|
||||
// // 新建文件
|
||||
// File filepath = new File(path, filename);
|
||||
// // 判断路径是否存在,如果不存在就创建一个
|
||||
// if (!filepath.getParentFile().exists()) {
|
||||
// filepath.getParentFile().mkdirs();
|
||||
// }
|
||||
// String picUrl = path + File.separator + filename;
|
||||
// try {
|
||||
// // 写入文件
|
||||
// file.transferTo(new File(picUrl));
|
||||
// } catch (IOException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// activeInfo.setActiveFirstPicUrl(fp+filename);
|
||||
// activeInfo.setIsFristPage("1");
|
||||
// }
|
||||
activeInfo.setIsFristPage("1");
|
||||
activeInfo.setUpdateBy(getLoginName());
|
||||
AuthorizationUtils.clearAllCachedAuthorizationInfo();
|
||||
return toAjax(activeInfoService.saveFistPage(activeInfo));
|
||||
|
|
@ -254,5 +234,50 @@ public class ActiveInfoController extends BaseController
|
|||
}
|
||||
return ipaddr;
|
||||
}
|
||||
// 2022-05-04 2022-05-18
|
||||
public static void main(String[] args) {
|
||||
judgeDate("2022-05-04","2022-05-08");
|
||||
}
|
||||
|
||||
private static String judgeDate(String startdate,String enddate) {
|
||||
String retStauts = "3";
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
if (StringUtils.isNotEmpty(startdate) && StringUtils.isNotEmpty(enddate)) {
|
||||
try {
|
||||
Date dateStart = simpleDateFormat.parse(startdate);
|
||||
Date dateEnd = simpleDateFormat.parse(enddate);
|
||||
dateEnd = dateAddOne(dateEnd);
|
||||
Date dateNow = new Date();
|
||||
|
||||
if (dateStart.after(dateNow)) {
|
||||
//未开始
|
||||
retStauts = "0";
|
||||
} else if ((dateStart.before(dateNow) && dateEnd.after(dateNow)) || (dateStart.equals(dateNow)) || (dateEnd.equals(dateNow))) {
|
||||
//进行中
|
||||
retStauts = "1";
|
||||
} else if (dateNow.after(dateEnd)) {
|
||||
//已结束
|
||||
retStauts = "2";
|
||||
}
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
}
|
||||
return retStauts;
|
||||
}
|
||||
|
||||
|
||||
/*日期加+1天*/
|
||||
public static Date dateAddOne(Date date) {
|
||||
Calendar calendar = new GregorianCalendar();
|
||||
calendar.setTime(date);
|
||||
//把日期往后增加一天,整数 往后推,负数往前移动
|
||||
calendar.add(calendar.DATE,1);
|
||||
//这个时间就是日期往后推一天的结果
|
||||
date=calendar.getTime();
|
||||
return date;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -61,7 +61,7 @@ spring:
|
|||
time-zone: GMT+8
|
||||
date-format: yyyy-MM-dd HH:mm:ss
|
||||
profiles:
|
||||
active: prd
|
||||
active: druid
|
||||
# 文件上传
|
||||
servlet:
|
||||
multipart:
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
<form class="form-horizontal m" id="form-role-add" enctype="multipart/form-data">
|
||||
<input id="lpFilesName" name="lpFilesName" type="hidden"/>
|
||||
<input id="lsFilesName" name="lsFilesName" type="hidden"/>
|
||||
<input id="fpFilesName" name="fpFilesName" type="hidden"/>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">活动标题:</label>
|
||||
<div class="col-sm-8">
|
||||
|
|
@ -34,6 +35,14 @@
|
|||
</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>
|
||||
|
|
@ -42,7 +51,6 @@
|
|||
<input id="singleFile" name="file" type="file">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
|
|
@ -66,6 +74,28 @@
|
|||
|
||||
</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" 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" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group draggable">
|
||||
<label class="col-sm-3 control-label">活动开始日期:</label>
|
||||
|
||||
|
|
@ -88,14 +118,17 @@
|
|||
</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}"></option>
|
||||
</select>
|
||||
</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}"></option>-->
|
||||
<!-- </select>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">活动地址:</label>
|
||||
<div class="col-sm-8">
|
||||
|
|
@ -126,7 +159,12 @@
|
|||
<script type="text/javascript">
|
||||
|
||||
function submitHandler() {
|
||||
add();
|
||||
//校验
|
||||
var c = check_c();
|
||||
if(c){
|
||||
add();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function add() {
|
||||
|
|
@ -150,7 +188,30 @@
|
|||
|
||||
$(function () {
|
||||
|
||||
// 单图上传
|
||||
|
||||
|
||||
// 海报单图上传
|
||||
$("#firstSingleFile").fileinput({
|
||||
uploadUrl: ctx + 'common/uploadsFp',
|
||||
maxFileCount: 1,
|
||||
layoutTemplates: {
|
||||
footer: '',//隐藏全部小图标
|
||||
},
|
||||
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('')
|
||||
$("#fpFilesName").val('');
|
||||
})
|
||||
|
||||
|
||||
// 列表单图上传
|
||||
$("#singleFile").fileinput({
|
||||
uploadUrl: ctx + 'common/uploadsLs',
|
||||
maxFileCount: 1,
|
||||
|
|
@ -236,6 +297,48 @@
|
|||
|
||||
});
|
||||
|
||||
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>
|
||||
|
|
|
|||
|
|
@ -16,6 +16,9 @@
|
|||
<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">
|
||||
|
|
@ -31,7 +34,27 @@
|
|||
|
||||
</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>
|
||||
|
|
@ -63,6 +86,15 @@
|
|||
</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">
|
||||
|
|
@ -90,14 +122,14 @@
|
|||
</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">-->
|
||||
<!-- <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>
|
||||
|
||||
|
|
@ -130,13 +162,15 @@
|
|||
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 status = $("select[name='status']").val();
|
||||
var fpFilesName = $("input[name='fpFilesName']").val();
|
||||
var remark = $("input[name='remark']").val();
|
||||
var address =$("textarea[name='address']").val();
|
||||
$.ajax({
|
||||
|
|
@ -148,13 +182,15 @@
|
|||
"activeTitle": activeTitle,
|
||||
"activeDesc": activeDesc,
|
||||
"address": address,
|
||||
"enrollStartDate": enrollStartDate,
|
||||
"enrollEndDate": enrollEndDate,
|
||||
"activeStartDate": activeStartDate,
|
||||
"activeEndDate": activeEndDate,
|
||||
"activeType": activeType,
|
||||
"isEnroll": isEnroll,
|
||||
"lpFilesName": lpFilesName,
|
||||
"lsFilesName": lsFilesName,
|
||||
"status": status,
|
||||
"fpFilesName": fpFilesName,
|
||||
"remark": remark
|
||||
},
|
||||
async : false,
|
||||
|
|
@ -168,7 +204,10 @@
|
|||
}
|
||||
|
||||
function submitHandler() {
|
||||
edit();
|
||||
var c = check_c();
|
||||
if(c){
|
||||
edit();
|
||||
}
|
||||
}
|
||||
|
||||
function initIdCardFile() {
|
||||
|
|
@ -332,6 +371,7 @@
|
|||
|
||||
initIdCardFile(); //调用上面的初始化方法
|
||||
initInputFileImg();
|
||||
fpFilesName();
|
||||
|
||||
});
|
||||
function getFileTypeFromUrl(url) {
|
||||
|
|
@ -351,6 +391,82 @@
|
|||
})
|
||||
}
|
||||
|
||||
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>
|
||||
|
||||
|
|
|
|||
|
|
@ -69,7 +69,12 @@
|
|||
|
||||
$(document).ready(function () {
|
||||
|
||||
var a = $("input[name='listFpNames']").val();
|
||||
|
||||
});
|
||||
|
||||
function fpFilesName(){
|
||||
|
||||
var a = $("input[name='listFpNames']").val();
|
||||
var b= [];
|
||||
if (a.endsWith('null')){
|
||||
b= []
|
||||
|
|
@ -101,7 +106,9 @@
|
|||
$.modal.msgSuccess("移除成功-2");
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -115,20 +115,40 @@
|
|||
},
|
||||
{
|
||||
field: 'status',
|
||||
title: '活动状态',
|
||||
title: '上下线状态',
|
||||
sortable: true,
|
||||
formatter: function(value, item, index) {
|
||||
if (item.status == '0') {
|
||||
return '未开始';
|
||||
return '未上线';
|
||||
}
|
||||
else if (item.status == '1') {
|
||||
return '进行中';
|
||||
return '已上线';
|
||||
} else if (item.status == '2') {
|
||||
return '已结束';
|
||||
return '已下线';
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
field: 'actStatus',
|
||||
title: '活动状态',
|
||||
sortable: true,
|
||||
formatter: function(value, item, index) {
|
||||
if (item.actStatus == '0') {
|
||||
return '未开始';
|
||||
}
|
||||
else if (item.actStatus == '1') {
|
||||
return '进行中';
|
||||
} else if (item.actStatus == '2') {
|
||||
return '已结束';
|
||||
}else {
|
||||
return item.actStatus;
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
field: 'status',
|
||||
title: '报名要求',
|
||||
|
|
@ -143,19 +163,16 @@
|
|||
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'isFristPage',
|
||||
title: '是否设置首页',
|
||||
sortable: true,
|
||||
formatter: function(value, item, index) {
|
||||
if (item.isFristPage == '0') {
|
||||
return '非首页';
|
||||
}
|
||||
else if (item.isFristPage == '1') {
|
||||
return '已为首页';
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
visible: editFlag == 'hidden' ? false : true,
|
||||
title: '是否设置首页',
|
||||
align: 'center',
|
||||
formatter: function (value, row, index) {
|
||||
return statusTools(row);
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
field: 'activeStartDate',
|
||||
title: '活动开始日期',
|
||||
|
|
@ -179,11 +196,11 @@
|
|||
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> ');
|
||||
actions.push('<a class="btn btn-info btn-xs ' + addFlag + '" href="javascript:void(0)" onclick="authFirstPage(\'' + row.id + '\')"><i class="fa fa-plus"></i>设为首页</a> ');
|
||||
<!-- actions.push('<a class="btn btn-info btn-xs ' + addFlag + '" href="javascript:void(0)" onclick="authFirstPage(\'' + row.id + '\')"><i class="fa fa-plus"></i>设为首页</a> ');-->
|
||||
var more = [];
|
||||
more.push("<a class='btn btn-default btn-xs " + editFlag + "' href='javascript:void(0)' onclick='online(" +row.id + ")'><i class='fa fa-check'></i>活动上线</a> ");
|
||||
more.push("<a class='btn btn-default btn-xs " + removeFlag + "' href='javascript:void(0)' onclick='Offline(" + row.id + ")'><i class='fa fa-close'></i>活动下线</a>");
|
||||
more.push("<a class='btn btn-default btn-xs " + editFlag + "' href='javascript:void(0)' onclick='$.operate.remove(" +row.id + ")'><i class='fa fa-check'></i>删除</a> ");
|
||||
actions.push('<a tabindex="0" class="btn btn-info btn-xs" role="button" data-container="body" data-placement="left" data-toggle="popover" data-html="true" data-trigger="hover" data-content="' + more.join('') + '"><i class="fa fa-chevron-circle-right"></i>更多操作</a>');
|
||||
return actions.join('');
|
||||
} else {
|
||||
|
|
@ -214,12 +231,12 @@
|
|||
$.modal.openTab("分配用户", url);
|
||||
}
|
||||
|
||||
/* 角色状态显示 */
|
||||
/* 设置首页 */
|
||||
function statusTools(row) {
|
||||
if (row.status == 1) {
|
||||
return '<i class=\"fa fa-toggle-off text-info fa-2x\" onclick="enable(\'' + row.roleId + '\')"></i> ';
|
||||
} else {
|
||||
return '<i class=\"fa fa-toggle-on text-info fa-2x\" onclick="disable(\'' + row.roleId + '\')"></i> ';
|
||||
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> ';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -237,10 +254,17 @@
|
|||
})
|
||||
}
|
||||
|
||||
/* 活动管理启用 */
|
||||
function enable(roleId) {
|
||||
$.modal.confirm("确认要启用角色吗?", function() {
|
||||
$.operate.post(prefix + "/changeStatus", { "id": id, "status": 0 });
|
||||
/* 设置为首页 */
|
||||
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' });
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@
|
|||
},
|
||||
{
|
||||
field: 'playbillAddress',
|
||||
title: '海报地址',
|
||||
title: '公司地址',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@
|
|||
},
|
||||
{
|
||||
field: 'playbillAddress',
|
||||
title: '海报地址',
|
||||
title: '公司地址',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -39,6 +39,15 @@ public class ActiveInfo extends BaseEntity {
|
|||
@Excel(name = "活动内容描述")
|
||||
private String activeDesc;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 活动状态
|
||||
*/
|
||||
private String actStatus;
|
||||
|
||||
|
||||
/**
|
||||
* 活动开始日期
|
||||
*/
|
||||
|
|
@ -53,6 +62,38 @@ public class ActiveInfo extends BaseEntity {
|
|||
@Excel(name = "活动结束日期")
|
||||
private String activeEndDate;
|
||||
|
||||
|
||||
/**
|
||||
* 报名开始日期
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "报名开始日期")
|
||||
private String enrollStartDate;
|
||||
|
||||
public String getEnrollStartDate() {
|
||||
return enrollStartDate;
|
||||
}
|
||||
|
||||
public void setEnrollStartDate(String enrollStartDate) {
|
||||
this.enrollStartDate = enrollStartDate;
|
||||
}
|
||||
|
||||
public String getEnrollEndDate() {
|
||||
return enrollEndDate;
|
||||
}
|
||||
|
||||
public void setEnrollEndDate(String enrollEndDate) {
|
||||
this.enrollEndDate = enrollEndDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* 报名结束日期
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "报名结束日期")
|
||||
private String enrollEndDate;
|
||||
|
||||
|
||||
/**
|
||||
* 海报地址
|
||||
*/
|
||||
|
|
@ -266,6 +307,15 @@ public class ActiveInfo extends BaseEntity {
|
|||
this.activeType = activeType;
|
||||
}
|
||||
|
||||
|
||||
public String getActStatus() {
|
||||
return actStatus;
|
||||
}
|
||||
|
||||
public void setActStatus(String actStatus) {
|
||||
this.actStatus = actStatus;
|
||||
}
|
||||
|
||||
// public MultipartFile[] getActivePic() {
|
||||
// return activePic;
|
||||
// }
|
||||
|
|
@ -301,26 +351,31 @@ public class ActiveInfo extends BaseEntity {
|
|||
this.isEnroll = isEnroll;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("activeTitle", getActiveTitle())
|
||||
.append("activeDesc", getActiveDesc())
|
||||
.append("activeStartDate", getActiveStartDate())
|
||||
.append("activeEndDate", getActiveEndDate())
|
||||
.append("activeType", getActiveType())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("fpFilesName", getFpFilesName())
|
||||
.append("lpFilesName", getLpFilesName())
|
||||
.append("lsFilesName", getLsFilesName())
|
||||
.append("remark", getRemark())
|
||||
.append("address", getAddress())
|
||||
.toString();
|
||||
return "ActiveInfo{" +
|
||||
"id=" + id +
|
||||
", activeTitle='" + activeTitle + '\'' +
|
||||
", activeDesc='" + activeDesc + '\'' +
|
||||
", activeStartDate='" + activeStartDate + '\'' +
|
||||
", activeEndDate='" + activeEndDate + '\'' +
|
||||
", enrollStartDate='" + enrollStartDate + '\'' +
|
||||
", enrollEndDate='" + enrollEndDate + '\'' +
|
||||
", activeType='" + activeType + '\'' +
|
||||
", lpFilesName='" + lpFilesName + '\'' +
|
||||
", fpFilesName='" + fpFilesName + '\'' +
|
||||
", lsFilesName='" + lsFilesName + '\'' +
|
||||
", listLpNames='" + listLpNames + '\'' +
|
||||
", listFpNames='" + listFpNames + '\'' +
|
||||
", listLsNames='" + listLsNames + '\'' +
|
||||
", activePicUrl='" + activePicUrl + '\'' +
|
||||
", activeFirstPic=" + activeFirstPic +
|
||||
", activeFirstPicUrl='" + activeFirstPicUrl + '\'' +
|
||||
", address='" + address + '\'' +
|
||||
", isEnroll='" + isEnroll + '\'' +
|
||||
", isFristPage='" + isFristPage + '\'' +
|
||||
", status='" + status + '\'' +
|
||||
", delFlag='" + delFlag + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ public class EnrollActiveUser extends BaseEntity {
|
|||
/**
|
||||
* 海报地址
|
||||
*/
|
||||
@Excel(name = "海报地址")
|
||||
@Excel(name = "公司地址")
|
||||
private String playbillAddress;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ public class EnrollUser extends BaseEntity {
|
|||
/**
|
||||
* 海报地址
|
||||
*/
|
||||
@Excel(name = "海报地址")
|
||||
@Excel(name = "公司地址")
|
||||
private String playbillAddress;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="activeDesc" column="active_desc" />
|
||||
<result property="activeStartDate" column="active_start_date" />
|
||||
<result property="activeEndDate" column="active_end_date" />
|
||||
<result property="enrollStartDate" column="enroll_start_date" />
|
||||
<result property="enrollEndDate" column="enroll_end_date" />
|
||||
<result property="activeType" column="active_type" />
|
||||
<result property="activePicUrl" column="active_pic_url" />
|
||||
<result property="activeFirstPicUrl" column="active_frist_pic_url" />
|
||||
|
|
@ -30,7 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectActiveVo">
|
||||
select r.id, r.active_title, r.active_desc,r.active_start_date,r.active_end_date, r.active_pic_url, r.active_frist_pic_url,r.is_frist_page, r.active_type, r.status, r.del_flag, r.create_time, r.remark, r.address,r.is_enroll,lp_files_name,ls_files_name,fp_files_name
|
||||
select r.id, r.active_title, r.active_desc,r.active_start_date,r.active_end_date, r.enroll_start_date,r.enroll_end_date, r.active_pic_url, r.active_frist_pic_url,r.is_frist_page, r.active_type, r.status, r.del_flag, r.create_time, r.remark, r.address,r.is_enroll,lp_files_name,ls_files_name,fp_files_name
|
||||
from active_info r
|
||||
</sql>
|
||||
|
||||
|
|
@ -92,6 +94,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="activeDesc != null and activeDesc != ''">active_desc = #{activeDesc},</if>
|
||||
<if test="activeStartDate != null and activeStartDate != ''">active_start_date = #{activeStartDate},</if>
|
||||
<if test="activeEndDate != null and activeEndDate != ''">active_end_date = #{activeEndDate},</if>
|
||||
<if test="enrollStartDate != null and enrollStartDate != ''">enroll_start_date = #{enrollStartDate},</if>
|
||||
<if test="enrollEndDate != null and enrollEndDate != ''">enroll_end_date = #{enrollEndDate},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="activePicUrl != null and activePicUrl != ''">active_pic_url = #{active_pic_url},</if>
|
||||
<if test="activeType != null and activeType != ''">active_type = #{activeType},</if>
|
||||
|
|
@ -100,6 +104,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="address != null and address != ''">address = #{address},</if>
|
||||
<if test="lpFilesName != null ">lp_files_name = #{lpFilesName},</if>
|
||||
<if test="lsFilesName != null ">ls_files_name = #{lsFilesName},</if>
|
||||
<if test="fpFilesName != null ">fp_files_name = #{fpFilesName},</if>
|
||||
<if test="isEnroll != null and isEnroll != ''">is_enroll = #{isEnroll},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
|
|
@ -110,8 +115,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<update id="saveFistPage" parameterType="ActiveInfo">
|
||||
update active_info
|
||||
<set>
|
||||
<if test="activeFirstPicUrl != null and activeFirstPicUrl != ''">active_frist_pic_url = #{activeFirstPicUrl},</if>
|
||||
<if test="fpFilesName != null and fpFilesName != ''">fp_files_name = #{fpFilesName},</if>
|
||||
<if test="isFristPage != null and isFristPage != ''">is_frist_page = #{isFristPage},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
update_time = sysdate()
|
||||
|
|
@ -125,6 +128,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="activeDesc != null and activeDesc != ''">active_desc,</if>
|
||||
<if test="activeStartDate != null and activeStartDate != ''">active_start_date,</if>
|
||||
<if test="activeEndDate != null and activeEndDate != ''">active_end_date,</if>
|
||||
<if test="enrollStartDate != null and enrollStartDate != ''">enroll_start_date,</if>
|
||||
<if test="enrollEndDate != null and enrollEndDate != ''">enroll_end_date,</if>
|
||||
<if test="activeType != null and activeType != ''">active_type,</if>
|
||||
<if test="activePicUrl != null and activePicUrl != ''">active_pic_url,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
|
|
@ -141,6 +146,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="activeDesc != null and activeDesc != ''">#{activeDesc},</if>
|
||||
<if test="activeStartDate != null and activeStartDate != ''">#{activeStartDate},</if>
|
||||
<if test="activeEndDate != null and activeEndDate != ''">#{activeEndDate},</if>
|
||||
<if test="enrollStartDate != null and enrollStartDate != ''">#{enrollStartDate},</if>
|
||||
<if test="enrollEndDate != null and enrollEndDate != ''">#{enrollEndDate},</if>
|
||||
<if test="activeType != null and activeType != ''">#{activeType},</if>
|
||||
<if test="activePicUrl != null and activePicUrl != ''">#{activePicUrl},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
|
|
|
|||
Loading…
Reference in New Issue