记得上下班打卡 | git大法好,push需谨慎

Commit 86d13a22 authored by 胡佳晨's avatar 胡佳晨

提交审核 志愿者

parent 8e25f119
...@@ -16,6 +16,8 @@ import java.util.List; ...@@ -16,6 +16,8 @@ import java.util.List;
public class SmileVolunteersDetailsVo implements Cloneable { public class SmileVolunteersDetailsVo implements Cloneable {
@ApiModelProperty(value = "用户id", example = "") @ApiModelProperty(value = "用户id", example = "")
private String uid; private String uid;
@ApiModelProperty(value = "活动Id", example = "")
private String projectId;
@ApiModelProperty(value = "活动名称", example = "") @ApiModelProperty(value = "活动名称", example = "")
private String projectName; private String projectName;
@ApiModelProperty(value = "姓名", example = "") @ApiModelProperty(value = "姓名", example = "")
...@@ -56,7 +58,8 @@ public class SmileVolunteersDetailsVo implements Cloneable { ...@@ -56,7 +58,8 @@ public class SmileVolunteersDetailsVo implements Cloneable {
} }
public SmileVolunteersDetailsVo copy(SmileVolunteers source, List<SmileVolunteersTeam> teamList,String projectName) { public SmileVolunteersDetailsVo copy(SmileVolunteers source, List<SmileVolunteersTeam> teamList,String projectName) {
this.setUid(source.getProjectId()); this.setUid(source.getUid());
this.setProjectId(source.getProjectId());
this.setProjectName(projectName); this.setProjectName(projectName);
this.setName(source.getName()); this.setName(source.getName());
this.setImg(source.getImg()); this.setImg(source.getImg());
......
...@@ -210,10 +210,16 @@ public class SmileVolunteersController extends BaseController { ...@@ -210,10 +210,16 @@ public class SmileVolunteersController extends BaseController {
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "mid", value = "mid"), @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "mid", value = "mid"),
}) })
public String detailsVolunteers(String mid, ModelMap mmap) { public String detailsVolunteers(@PathVariable("mid")String mid, ModelMap mmap) {
SmileVolunteersDetailsVo data = volunteersService.details(mid); SmileVolunteersDetailsVo data = volunteersService.details(mid);
mmap.put("smileVolunteersDetailsVo", data); mmap.put("smileVolunteersDetailsVo", data);
return prefix + "/details"; SmileVTSParam param = new SmileVTSParam();
param.setPageNum(1);
param.setPageSize(40);
TableDataInfo tableDataInfo = volunteersTeamService.list(param);
List<SmileVolunteersTeam> list = (List<SmileVolunteersTeam>) tableDataInfo.getRows();
mmap.put("listData", list);
return prefix + "/edit";
} }
@PostMapping("/audit") @PostMapping("/audit")
......
...@@ -1154,7 +1154,11 @@ var table = { ...@@ -1154,7 +1154,11 @@ var table = {
// 修改信息,以tab页展现 // 修改信息,以tab页展现
editTab: function(id) { editTab: function(id) {
table.set(); table.set();
$.modal.openTab("修改" + table.options.modalName, $.operate.editUrl(id)); if(table.options.modalName.indexOf("审核")!=-1){
$.modal.openTab("" + table.options.modalName, $.operate.editUrl(id));
}else{
$.modal.openTab("修改" + table.options.modalName, $.operate.editUrl(id));
}
}, },
// 修改信息 全屏 // 修改信息 全屏
editFull: function(id) { editFull: function(id) {
......
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="include :: header('修改职责组')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-volunteers-edit" th:object="${smileVolunteersDetailsVo}">
<input name="projectId" th:value="*{projectId}" type="hidden">
<input name="uid" th:value="*{uid}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label is-required">审核状态:</label>
<div class="col-sm-8">
<input name="status" class="form-control" type="text" th:if="*{status==0}" th:value="待审核" readonly
required>
<input name="status" class="form-control" type="text" th:if="*{status==1}" th:value="通过" readonly
required>
<input name="status" class="form-control" type="text" th:if="*{status==2}" th:value="拒绝" readonly
required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">姓名:</label>
<div class="col-sm-8">
<input name="name" class="form-control" type="text" th:value="*{name}" readonly required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">头像:</label>
<div class="col-sm-8">
<input name="img" class="form-control" type="text" th:value="*{img}" readonly required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">证件号:</label>
<div class="col-sm-8">
<input name="idCard" class="form-control" type="text" th:value="*{idCard}" readonly required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">性别:</label>
<div class="col-sm-8">
<input name="sex" class="form-control" type="text" th:if="*{sex==0}" th:value="未知" readonly required>
<input name="sex" class="form-control" type="text" th:if="*{sex==1}" th:value="男" readonly required>
<input name="sex" class="form-control" type="text" th:if="*{sex==2}" th:value="女" readonly required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">学校:</label>
<div class="col-sm-8">
<input name="school" class="form-control" type="text" th:value="*{school}" readonly required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">学校地址:</label>
<div class="col-sm-8">
<input name="schoolAddress" class="form-control" type="text" th:value="*{schoolAddress}" readonly
required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">专长:</label>
<div class="col-sm-8">
<input name="specialty" class="form-control" type="text" th:value="*{specialty}" readonly required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">特长:</label>
<div class="col-sm-8">
<input name="specialty2" class="form-control" type="text" th:value="*{specialty2}" readonly required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">手机号:</label>
<div class="col-sm-8">
<input name="phone" class="form-control" type="text" th:value="*{phone}" readonly required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">项目名称:</label>
<div class="col-sm-8">
<input name="projectName" class="form-control" type="text" th:value="*{projectName}" readonly required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">自我介绍:</label>
<div class="col-sm-8">
<input name="introduce" class="form-control" type="text" th:value="*{introduce}" readonly required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">申请时间:</label>
<div class="col-sm-8">
<input name="createdAt" class="form-control" type="text" th:value="*{createdAt}" readonly required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">用户申请职责组:</label>
<table id="team-table_user" th:border="1">
<tr>
<td>名称</td>
<td>介绍</td>
<tr/>
<div th:each="item : ${smileVolunteersDetailsVo.teamArray}">
<tr class="content-tr">
<td th:value="${item.name}" th:text="${item.name}">
</td>
<td th:text="${item.introduce}">
</td>
</tr>
</div>
</table>
</div>
<div class="form-group" th:if="*{status==0}">
<label class="col-sm-3 control-label is-required">可分配申请职责组:</label>
<table id="team-table" th:border="1">
<tr>
<td>名称</td>
<td>介绍</td>
<td>选中</td>
<tr/>
<div th:each="item : ${listData}">
<tr class="content-tr">
<td th:value="${item.name}" th:text="${item.name}">
</td>
<td th:text="${item.introduce}">
</td>
<td>
<td>
<input name="teamCheck" type="radio" th:value="${item.teamId}"> 选中</label>
</td>
</tr>
</div>
</table>
</div>
<button type="button" class="btn btn-w-m btn-success" onclick="submitHandler(1)" th:if="*{status==0}">
通过
</button>
<button type="button" class="btn btn-w-m btn-warning" onclick="submitHandler(2)" th:if="*{status==0}">
拒绝
</button>
</form>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
var smilePrefix = ctx + "smile/volunteers";
$("#form-roadShow-edit").validate({
focusCleanup: true
});
function submitHandler(status) {
var teamIds = $("input[name^='teamCheck']:checked").val()
var uid = $("input[name^='uid']").val()
var projectId = $("input[name^='projectId']").val()
if (status === 1 && typeof (teamIds) == "undefined") {
alert("请分配职责组");
} else {
$.operate.post(smilePrefix + "/audit",
{
"projectId": projectId,
"uid": uid,
"teamId": teamIds,
"status": status
}, function (res) {
location.reload();
});
}
}
</script>
</body>
</html>
\ No newline at end of file
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
<li> <li>
<label>审核状态:</label> <label>审核状态:</label>
<select name="status"> <select name="status">
<option value="-1">全部</option>
<option value="0">待审核</option> <option value="0">待审核</option>
<option value="1">通过审核</option> <option value="1">通过审核</option>
<option value="2">未通过待审核</option> <option value="2">未通过待审核</option>
...@@ -52,9 +53,9 @@ ...@@ -52,9 +53,9 @@
$(function () { $(function () {
var options = { var options = {
url: prefix + "/list", url: prefix + "/list",
detailUrl: prefix + "/details/{id}", updateUrl: prefix + "/details/{id}",
// sortName: "sort", // sortName: "sort",
modalName: "演出", modalName: "审核志愿者",
orderSc: "desc", orderSc: "desc",
orderItem: "created_at", orderItem: "created_at",
columns: [{ columns: [{
...@@ -78,11 +79,29 @@ ...@@ -78,11 +79,29 @@
}, },
{ {
field: 'sex', field: 'sex',
title: '性别' title: '性别',
formatter: function (value, row, index) {
if (value == 1) {
return '男';
} else if (value == 2) {
return '女';
} else {
return '未知';
}
}
}, },
{ {
field: 'status', field: 'status',
title: '状态' title: '状态',
formatter: function (value, row, index) {
if (value == 1) {
return '通过';
} else if (value == 2) {
return '拒绝';
} else {
return '待审核';
}
}
}, },
{ {
field: 'school', field: 'school',
...@@ -102,7 +121,7 @@ ...@@ -102,7 +121,7 @@
align: 'center', align: 'center',
formatter: function (value, row, index) { formatter: function (value, row, index) {
var actions = []; var actions = [];
actions.push('<a class="btn btn-warning btn-xs " href="javascript:void(0)" onclick="$.operate.edit(\'' + row.performancesId + '\')"><i class="fa fa-remove"></i>同步</a>'); actions.push('<a class="btn btn-warning btn-xs " href="javascript:void(0)" onclick="$.operate.editTab(\'' + row.mid + '\')"><i class="fa fa-remove"></i>管理</a>');
return actions.join(''); return actions.join('');
} }
}] }]
......
...@@ -161,9 +161,13 @@ ...@@ -161,9 +161,13 @@
}) })
function submitHandler() { function submitHandler() {
document.getElementById("teamIdArray").value = teamIds.join(","); if(teamIds.length===0){
if ($.validate.form()) { alert("未选择职责组");
$.operate.save(smilePrefix + "/project/insert", $('#form-team-add').serialize()); }else {
document.getElementById("teamIdArray").value = teamIds.join(",");
if ($.validate.form()) {
$.operate.save(smilePrefix + "/project/insert", $('#form-team-add').serialize());
}
} }
} }
</script> </script>
......
...@@ -169,9 +169,13 @@ ...@@ -169,9 +169,13 @@
}) })
function submitHandler() { function submitHandler() {
document.getElementById("teamIdArray").value = teamIds.join(","); if(teamIds.length===0){
if ($.validate.form()) { alert("未选择职责组");
$.operate.save(smilePrefix + "/project/update", $('#form-project-edit').serialize()); }else {
document.getElementById("teamIdArray").value = teamIds.join(",");
if ($.validate.form()) {
$.operate.save(smilePrefix + "/project/update", $('#form-project-edit').serialize());
}
} }
} }
</script> </script>
......
...@@ -39,7 +39,7 @@ public class SmileVolunteersServiceImpl extends ServiceImpl<SmileVolunteersMappe ...@@ -39,7 +39,7 @@ public class SmileVolunteersServiceImpl extends ServiceImpl<SmileVolunteersMappe
public TableDataInfo list(SmileVSParam param) { public TableDataInfo list(SmileVSParam param) {
try { try {
TableDataInfo rspData = new TableDataInfo(); TableDataInfo rspData = new TableDataInfo();
PageHelper.startPage(param.getPageNum(), param.getPageSize()); // PageHelper.startPage(param.getPageNum(), param.getPageSize());
LambdaQueryWrapper<SmileVolunteers> wrappers = Wrappers.lambdaQuery(SmileVolunteers.class); LambdaQueryWrapper<SmileVolunteers> wrappers = Wrappers.lambdaQuery(SmileVolunteers.class);
if (param.getTitle() != null && !param.getTitle().equals("")) { if (param.getTitle() != null && !param.getTitle().equals("")) {
List<String> projectIdArray = volunteersProjectMapper.selectList(Wrappers.lambdaQuery(SmileVolunteersProject.class).like(SmileVolunteersProject::getTitle, param.getTitle())).stream().map(SmileVolunteersProject::getProjectId).collect(Collectors.toList()); List<String> projectIdArray = volunteersProjectMapper.selectList(Wrappers.lambdaQuery(SmileVolunteersProject.class).like(SmileVolunteersProject::getTitle, param.getTitle())).stream().map(SmileVolunteersProject::getProjectId).collect(Collectors.toList());
...@@ -54,7 +54,7 @@ public class SmileVolunteersServiceImpl extends ServiceImpl<SmileVolunteersMappe ...@@ -54,7 +54,7 @@ public class SmileVolunteersServiceImpl extends ServiceImpl<SmileVolunteersMappe
if (param.getStatus() != null && !param.getStatus().equals(-1)) { if (param.getStatus() != null && !param.getStatus().equals(-1)) {
wrappers.eq(SmileVolunteers::getStatus, param.getStatus()); wrappers.eq(SmileVolunteers::getStatus, param.getStatus());
} }
List<SmileVolunteers> data = volunteersMapper.selectList(wrappers); List<SmileVolunteers> data = volunteersMapper.selectList(wrappers.orderByDesc(SmileVolunteers::getCreatedAt));
rspData.setCode(0); rspData.setCode(0);
rspData.setRows(data); rspData.setRows(data);
rspData.setTotal(data.size()); rspData.setTotal(data.size());
......
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