驳回按钮优化
parent
0aa332c755
commit
72d7a97fd0
|
|
@ -51,16 +51,27 @@ public class AppLoginController {
|
|||
public R<?> register(@RequestBody RegisterForm registerForm) {
|
||||
AppUser appUser = appUserService.selectAppUserByPhone(registerForm.getPhoneNumber());
|
||||
AppRegister register = appRegisterService.selectAppRegisterByphone(registerForm.getPhoneNumber());
|
||||
|
||||
Assert.notNull(registerForm.getSchoolId(), "学校id不能为空");
|
||||
Assert.isNull(appUser, "手机号已注册");
|
||||
Assert.isNull(register, "手机号已提交审核,请勿多次提交");
|
||||
// if (StringUtils.isNotEmpty(registerForm.getEmail())) {
|
||||
//
|
||||
// }
|
||||
|
||||
if (register != null && register.getStatus() != null) {
|
||||
|
||||
|
||||
switch (register.getStatus()) {
|
||||
case 0:
|
||||
return R.fail(201, "注册失败,您的账号正在审核中!");
|
||||
case 1:
|
||||
return R.fail(201, "您的账号已通过");
|
||||
case 2:
|
||||
return R.fail(201, "注册失败,您的账号已被驳回!");
|
||||
}
|
||||
}
|
||||
|
||||
AppRegister appRegister = setAppRegister(registerForm);
|
||||
appRegister.setInvitationCode(registerForm.getInvitationCode());
|
||||
int i = appRegisterService.insertAppRegister(appRegister);
|
||||
// redisService.deleteObject(registerForm.getPhoneNumber());
|
||||
|
||||
Assert.isTrue(i > 0, "注册失败");
|
||||
return R.ok(null,"注册成功,请等待审核结果!");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,10 +96,10 @@ public class AppRegisterController extends BaseController
|
|||
return toAjax(appRegisterService.passAppRegister(id));
|
||||
}
|
||||
|
||||
@GetMapping("/reject")
|
||||
public AjaxResult reject(@RequestParam("id") Long id)
|
||||
@PostMapping("/reject")
|
||||
public AjaxResult reject(@RequestBody AppRegister appRegister)
|
||||
{
|
||||
return toAjax(appRegisterService.rejectAppRegister(id));
|
||||
return toAjax(appRegisterService.rejectAppRegister(appRegister));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,4 +41,6 @@ public class AppUserDataVo
|
|||
|
||||
@Excel(name = "粉丝数量")
|
||||
private long fansNum;
|
||||
|
||||
private Long userId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.ruoyi.app.form;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
|
@ -34,4 +35,7 @@ public class RegisterForm {
|
|||
|
||||
@ApiModelProperty("学校证明")
|
||||
private String prove;
|
||||
|
||||
@JsonIgnore
|
||||
private Integer status;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ public interface IAppRegisterService
|
|||
|
||||
int passAppRegister(Long id);
|
||||
|
||||
int rejectAppRegister(Long id);
|
||||
int rejectAppRegister( AppRegister appRegister);
|
||||
|
||||
|
||||
AppRegister selectAppRegisterByphone(String phoneNumber);
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import com.ruoyi.app.domain.vo.AppRegisterVo;
|
|||
import com.ruoyi.app.mapper.AppSchoolMapper;
|
||||
import com.ruoyi.app.mapper.AppUserMapper;
|
||||
import com.ruoyi.common.core.utils.DateUtils;
|
||||
import com.ruoyi.common.core.utils.StringUtils;
|
||||
import com.ruoyi.common.core.utils.bean.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -137,12 +138,15 @@ public class AppRegisterServiceImpl implements IAppRegisterService
|
|||
}
|
||||
|
||||
@Override
|
||||
public int rejectAppRegister(Long id) {
|
||||
AppRegister appRegister = appRegisterMapper.selectAppRegisterById(id);
|
||||
Assert.isTrue(appRegister != null, "该申请不存在");
|
||||
assert appRegister != null;
|
||||
public int rejectAppRegister(AppRegister appRegister) {
|
||||
AppRegister register = appRegisterMapper.selectAppRegisterById(appRegister.getId());
|
||||
Assert.isTrue(register != null, "该申请不存在");
|
||||
assert register != null;
|
||||
Assert.isTrue(appRegister.getStatus() == 0, "该申请已驳回");
|
||||
appRegister.setStatus(2);
|
||||
if (StringUtils.isNotEmpty(appRegister.getRemark())) {
|
||||
register.setStatus(appRegister.getStatus());
|
||||
register.setRemark(appRegister.getRemark());
|
||||
}
|
||||
appRegister.setUpdateTime(DateUtils.getNowDate());
|
||||
return appRegisterMapper.updateAppRegister(appRegister);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -171,8 +171,9 @@ public class AppUserDynamicServiceImpl implements IAppUserDynamicService
|
|||
|
||||
AppUserCollect appUserCollect = new AppUserCollect();
|
||||
appUserCollect.setDynamicId(id);
|
||||
appUserCollect.setUserId(appUserDynamic.getAppId());
|
||||
List<AppUserCollect> appUserCollects = appUserCollectMapper.selectAppUserCollectList(appUserCollect);
|
||||
if (CollectionUtils.isNotEmpty(appUserCollects)){
|
||||
if (CollectionUtils.isEmpty(appUserCollects)) {
|
||||
appUserDynamicVo.setIsCollect(1);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,14 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
|
||||
// 查询App用户动态列表
|
||||
export function treeDynamic(query) {
|
||||
return request({
|
||||
url: '/app/comment/treeList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 查询App用户动态列表
|
||||
export function listDynamic(query) {
|
||||
return request({
|
||||
|
|
|
|||
|
|
@ -17,11 +17,11 @@ export function passRegister(id) {
|
|||
})
|
||||
}
|
||||
|
||||
export function rejectRegister(id) {
|
||||
export function rejectRegister(data) {
|
||||
return request({
|
||||
url: '/app/register/reject',
|
||||
params: { id: id },
|
||||
method: 'get'
|
||||
data: data,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,6 @@
|
|||
<!-- 动态详情 -->
|
||||
<template>
|
||||
<div>
|
||||
这是动态详情页面
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -72,20 +72,36 @@
|
|||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="dynamicList" @selection-change="handleSelectionChange">
|
||||
<el-table v-loading="loading" :data="dynamicList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="" align="center" prop="id" />
|
||||
<el-table-column label="用户名" align="center" prop="username" />
|
||||
<!-- <el-table-column label="内容" align="center" prop="content" />-->
|
||||
<el-table-column label="视频地址" align="center" prop="videoUrl" />
|
||||
<el-table-column label="关联话题" align="center" prop="topicId" />
|
||||
<el-table-column label="地区" align="center" prop="address" />
|
||||
<el-table-column label="隐私状态" align="center" prop="privacyStatus" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="更新人" align="center" prop="updateBy" />
|
||||
<el-table-column label="是否置顶" align="center" prop="isTop" />
|
||||
<el-table-column label="关联话题" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-for="(topic, index) in scope.row.appTopicList" :key="index">
|
||||
{{ topic.name }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="地区" align="center" prop="cityName" />
|
||||
<el-table-column label="置顶" align="center" key="isTop" prop="isTop">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.isTop"
|
||||
active-value="0"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949"
|
||||
inactive-value="1"
|
||||
></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-view"
|
||||
@click="handleDetail(scope.row)"
|
||||
>详情</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
|
|
@ -146,7 +162,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { listDynamic, getDynamic, delDynamic, addDynamic, updateDynamic } from "@/api/app/dynamic";
|
||||
import { listDynamic, getDynamic, delDynamic, addDynamic, updateDynamic , treeDynamic } from "@/api/app/dynamic";
|
||||
|
||||
export default {
|
||||
name: "Dynamic",
|
||||
|
|
@ -183,6 +199,9 @@ export default {
|
|||
updateBy: null,
|
||||
isTop: null
|
||||
},
|
||||
treeParam: {
|
||||
dynamicId:''
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
|
|
@ -243,6 +262,22 @@ export default {
|
|||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 详情按钮操作 跳转到新页面*/
|
||||
handleDetail(row) {
|
||||
const id = row.id || row.ids;
|
||||
|
||||
this.$router.push({path: '/app/dynamic/detail'});
|
||||
this.queryParams.dynamicId = id;
|
||||
treeDynamic(this.queryParams).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "App用户动态详情";
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@
|
|||
<el-table-column label="地址" align="center" prop="address"/>
|
||||
<el-table-column label="学校" align="center" prop="schoolName"/>
|
||||
<el-table-column label="邮箱" align="center" prop="email"/>
|
||||
<el-table-column label="操作" align="center" prop="status">
|
||||
<el-table-column label="操作" align="center" prop="status" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<!-- 状态为0时显示 为1时显示已通过,为2时显示已驳回并且不可点击-->
|
||||
<el-button
|
||||
|
|
@ -171,18 +171,25 @@
|
|||
size="mini"
|
||||
type="error"
|
||||
icon="el-icon-finished"
|
||||
@click="handleReject(scope.row)"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>驳回
|
||||
</el-button>
|
||||
<!-- <el-button-->
|
||||
<!-- size="mini"-->
|
||||
<!-- type="error"-->
|
||||
<!-- icon="el-icon-finished"-->
|
||||
<!-- @click="handleDelete(scope.row)"-->
|
||||
<!-- >删除</el-button>-->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
|
||||
<el-form-item label="驳回原因" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入驳回原因" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
|
|
@ -242,8 +249,11 @@ export default {
|
|||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 驳回原因
|
||||
rejectForm: {},
|
||||
// 表单校验
|
||||
rules: {},
|
||||
showDialog: false,
|
||||
schoolOptions: []
|
||||
};
|
||||
},
|
||||
|
|
@ -325,8 +335,9 @@ export default {
|
|||
const id = row.id || this.ids
|
||||
getRegister(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.form.status = 2;
|
||||
this.open = true;
|
||||
this.title = "修改注册审核";
|
||||
this.title = "驳回审核";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
|
|
|
|||
Loading…
Reference in New Issue