驳回按钮优化

main
王宇航 2024-05-10 09:45:04 +08:00
parent 0aa332c755
commit 72d7a97fd0
12 changed files with 121 additions and 38 deletions

View File

@ -51,16 +51,27 @@ public class AppLoginController {
public R<?> register(@RequestBody RegisterForm registerForm) { public R<?> register(@RequestBody RegisterForm registerForm) {
AppUser appUser = appUserService.selectAppUserByPhone(registerForm.getPhoneNumber()); AppUser appUser = appUserService.selectAppUserByPhone(registerForm.getPhoneNumber());
AppRegister register = appRegisterService.selectAppRegisterByphone(registerForm.getPhoneNumber()); AppRegister register = appRegisterService.selectAppRegisterByphone(registerForm.getPhoneNumber());
Assert.notNull(registerForm.getSchoolId(), "学校id不能为空"); Assert.notNull(registerForm.getSchoolId(), "学校id不能为空");
Assert.isNull(appUser, "手机号已注册"); 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 appRegister = setAppRegister(registerForm);
appRegister.setInvitationCode(registerForm.getInvitationCode()); appRegister.setInvitationCode(registerForm.getInvitationCode());
int i = appRegisterService.insertAppRegister(appRegister); int i = appRegisterService.insertAppRegister(appRegister);
// redisService.deleteObject(registerForm.getPhoneNumber());
Assert.isTrue(i > 0, "注册失败"); Assert.isTrue(i > 0, "注册失败");
return R.ok(null,"注册成功,请等待审核结果!"); return R.ok(null,"注册成功,请等待审核结果!");
} }

View File

@ -96,10 +96,10 @@ public class AppRegisterController extends BaseController
return toAjax(appRegisterService.passAppRegister(id)); return toAjax(appRegisterService.passAppRegister(id));
} }
@GetMapping("/reject") @PostMapping("/reject")
public AjaxResult reject(@RequestParam("id") Long id) public AjaxResult reject(@RequestBody AppRegister appRegister)
{ {
return toAjax(appRegisterService.rejectAppRegister(id)); return toAjax(appRegisterService.rejectAppRegister(appRegister));
} }
} }

View File

@ -41,4 +41,6 @@ public class AppUserDataVo
@Excel(name = "粉丝数量") @Excel(name = "粉丝数量")
private long fansNum; private long fansNum;
private Long userId;
} }

View File

@ -1,5 +1,6 @@
package com.ruoyi.app.form; package com.ruoyi.app.form;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@ -34,4 +35,7 @@ public class RegisterForm {
@ApiModelProperty("学校证明") @ApiModelProperty("学校证明")
private String prove; private String prove;
@JsonIgnore
private Integer status;
} }

View File

@ -62,7 +62,7 @@ public interface IAppRegisterService
int passAppRegister(Long id); int passAppRegister(Long id);
int rejectAppRegister(Long id); int rejectAppRegister( AppRegister appRegister);
AppRegister selectAppRegisterByphone(String phoneNumber); AppRegister selectAppRegisterByphone(String phoneNumber);

View File

@ -10,6 +10,7 @@ import com.ruoyi.app.domain.vo.AppRegisterVo;
import com.ruoyi.app.mapper.AppSchoolMapper; import com.ruoyi.app.mapper.AppSchoolMapper;
import com.ruoyi.app.mapper.AppUserMapper; import com.ruoyi.app.mapper.AppUserMapper;
import com.ruoyi.common.core.utils.DateUtils; import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.common.core.utils.bean.BeanUtils; import com.ruoyi.common.core.utils.bean.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -137,12 +138,15 @@ public class AppRegisterServiceImpl implements IAppRegisterService
} }
@Override @Override
public int rejectAppRegister(Long id) { public int rejectAppRegister(AppRegister appRegister) {
AppRegister appRegister = appRegisterMapper.selectAppRegisterById(id); AppRegister register = appRegisterMapper.selectAppRegisterById(appRegister.getId());
Assert.isTrue(appRegister != null, "该申请不存在"); Assert.isTrue(register != null, "该申请不存在");
assert appRegister != null; assert register != null;
Assert.isTrue(appRegister.getStatus() == 0, "该申请已驳回"); 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()); appRegister.setUpdateTime(DateUtils.getNowDate());
return appRegisterMapper.updateAppRegister(appRegister); return appRegisterMapper.updateAppRegister(appRegister);
} }

View File

@ -171,8 +171,9 @@ public class AppUserDynamicServiceImpl implements IAppUserDynamicService
AppUserCollect appUserCollect = new AppUserCollect(); AppUserCollect appUserCollect = new AppUserCollect();
appUserCollect.setDynamicId(id); appUserCollect.setDynamicId(id);
appUserCollect.setUserId(appUserDynamic.getAppId());
List<AppUserCollect> appUserCollects = appUserCollectMapper.selectAppUserCollectList(appUserCollect); List<AppUserCollect> appUserCollects = appUserCollectMapper.selectAppUserCollectList(appUserCollect);
if (CollectionUtils.isNotEmpty(appUserCollects)){ if (CollectionUtils.isEmpty(appUserCollects)) {
appUserDynamicVo.setIsCollect(1); appUserDynamicVo.setIsCollect(1);
} }

View File

@ -1,5 +1,14 @@
import request from '@/utils/request' import request from '@/utils/request'
// 查询App用户动态列表
export function treeDynamic(query) {
return request({
url: '/app/comment/treeList',
method: 'get',
params: query
})
}
// 查询App用户动态列表 // 查询App用户动态列表
export function listDynamic(query) { export function listDynamic(query) {
return request({ return request({

View File

@ -17,11 +17,11 @@ export function passRegister(id) {
}) })
} }
export function rejectRegister(id) { export function rejectRegister(data) {
return request({ return request({
url: '/app/register/reject', url: '/app/register/reject',
params: { id: id }, data: data,
method: 'get' method: 'post'
}) })
} }

View File

@ -0,0 +1,6 @@
<!-- 动态详情 -->
<template>
<div>
这是动态详情页面
</div>
</template>

View File

@ -74,18 +74,34 @@
<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 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="username" />
<!-- <el-table-column label="内容" align="center" prop="content" />--> <el-table-column label="关联话题" align="center">
<el-table-column label="视频地址" align="center" prop="videoUrl" /> <template slot-scope="scope">
<el-table-column label="关联话题" align="center" prop="topicId" /> <el-tag v-for="(topic, index) in scope.row.appTopicList" :key="index">
<el-table-column label="地区" align="center" prop="address" /> {{ topic.name }}
<el-table-column label="隐私状态" align="center" prop="privacyStatus" /> </el-tag>
<el-table-column label="备注" align="center" prop="remark" /> </template>
<el-table-column label="更新人" align="center" prop="updateBy" /> </el-table-column>
<el-table-column label="是否置顶" align="center" prop="isTop" /> <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"> <el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleDetail(scope.row)"
>详情</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
@ -146,7 +162,7 @@
</template> </template>
<script> <script>
import { listDynamic, getDynamic, delDynamic, addDynamic, updateDynamic } from "@/api/app/dynamic"; import { listDynamic, getDynamic, delDynamic, addDynamic, updateDynamic , treeDynamic } from "@/api/app/dynamic";
export default { export default {
name: "Dynamic", name: "Dynamic",
@ -183,6 +199,9 @@ export default {
updateBy: null, updateBy: null,
isTop: null isTop: null
}, },
treeParam: {
dynamicId:''
},
// //
form: {}, form: {},
// //
@ -242,6 +261,22 @@ export default {
this.ids = selection.map(item => item.id) this.ids = selection.map(item => item.id)
this.single = selection.length!==1 this.single = selection.length!==1
this.multiple = !selection.length 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() { handleAdd() {

View File

@ -139,7 +139,7 @@
<el-table-column label="地址" align="center" prop="address"/> <el-table-column label="地址" align="center" prop="address"/>
<el-table-column label="学校" align="center" prop="schoolName"/> <el-table-column label="学校" align="center" prop="schoolName"/>
<el-table-column label="邮箱" align="center" prop="email"/> <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"> <template slot-scope="scope">
<!-- 状态为0时显示 为1时显示已通过为2时显示已驳回并且不可点击--> <!-- 状态为0时显示 为1时显示已通过为2时显示已驳回并且不可点击-->
<el-button <el-button
@ -171,18 +171,25 @@
size="mini" size="mini"
type="error" type="error"
icon="el-icon-finished" icon="el-icon-finished"
@click="handleReject(scope.row)" @click="handleUpdate(scope.row)"
>驳回 >驳回
</el-button> </el-button>
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="error"-->
<!-- icon="el-icon-finished"-->
<!-- @click="handleDelete(scope.row)"-->
<!-- >删除</el-button>-->
</template> </template>
</el-table-column> </el-table-column>
</el-table> </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 <pagination
v-show="total>0" v-show="total>0"
@ -242,8 +249,11 @@ export default {
}, },
// //
form: {}, form: {},
//
rejectForm: {},
// //
rules: {}, rules: {},
showDialog: false,
schoolOptions: [] schoolOptions: []
}; };
}, },
@ -325,8 +335,9 @@ export default {
const id = row.id || this.ids const id = row.id || this.ids
getRegister(id).then(response => { getRegister(id).then(response => {
this.form = response.data; this.form = response.data;
this.form.status = 2;
this.open = true; this.open = true;
this.title = "修改注册审核"; this.title = "驳回审核";
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */