Commit 065a7028 by Java-曹文达

用户查看 用户删除开发

parent 8f8a0bb6
......@@ -198,6 +198,20 @@ public class UserApiController {
return result;
}
/**
* @Author:cwd
* 删除用户
* @Date: 2019.4.4
* @return
*/
@RequestMapping(value = "/deleteUser",method = RequestMethod.POST)
@ResponseBody
public Result deleteUser(User user){
Result result= userInfoService.deleteUser(user);
return result;
}
......
......@@ -35,4 +35,6 @@ public interface UserInfoMapper extends BaseMapper<BpmCompany>{
List<User> userList(@Param("userName") String userName);
void addUser(User user);
void deleteUser(User user);
}
......@@ -104,7 +104,8 @@
username,
email,
telephone,
last_time lastTime
last_time lastTime,
content
FROM
`user`
where 1=1
......@@ -126,4 +127,8 @@
(#{userUuid},#{username},#{password},#{email},#{telephone})
</insert>
<delete id="deleteUser" parameterType="com.bbd.bpm.domain.User">
DELETE FROM user where id=#{id}
</delete>
</mapper>
\ No newline at end of file
......@@ -90,4 +90,12 @@ public interface UserInfoService {
* @param user
*/
Result addUser(User user);
/**
* @Author:cwd
* 删除用户
* @Date: 2019.4.4
* @return
* @param user
*/
Result deleteUser(User user);
}
......@@ -324,6 +324,30 @@ public class UserInfoServiceImpl implements UserInfoService{
}
}
/**
* @Author:cwd
* 删除用户
* @Date: 2019.4.4
* @return
* @param user
*/
@Override
public Result deleteUser(User user) {
Result result=new Result();
try{
userInfoMapper.deleteUser(user);
result.setSuccess(true);
result.setCode("200");
result.setMessage("删除用户成功");
return result;
}catch (Exception e){
e.printStackTrace();
result.setSuccess(false);
result.setCode("500");
result.setMessage("删除用户失败");
return result;
}
}
/**
* 获取菜单树
......
......@@ -59,7 +59,7 @@
<script type="text/javascript">
$(function(){
$.post(
"/bpm/user/userList",
"/bpm/user/content",
{
pageSize:10,
pageNum:1,
......@@ -113,15 +113,15 @@
var total = data.total;
data = data.list;
var content = '';
content += '<tr><th>用户编号</th><th style="width: 15%">用户标识</th><th style="width: 8%">用户名称</th><th>邮箱</th><th style="width: 8%">手机</th><th style="width: 8%">创建时间</th><th>操作</th></tr>';
content += '<tr><th>用户编号</th><th style="width: 15%">用户标识</th><th style="width: 8%">用户名称</th><th>邮箱</th><th>用户描述</th><th style="width: 8%">手机</th><th style="width: 8%">创建时间</th><th>操作</th></tr>';
if(data!=null){
for (var i in data) {
content += '<tr>';
content += '<td class="product_name" style="width: 5%;">'+data[i].id+'</td>';
content += '<td class="product_num">'+data[i].userUuid+'</td><td class="product_num">'+data[i].username+'</td>';
content += '<td class="product_num">'+data[i].email+'</td><td class="product_num">'+data[i].telephone+'</td>';
content += '<td class="product_num">'+data[i].email+'</td><td class="product_num">'+data[i].content+'</td><td class="product_num">'+data[i].telephone+'</td>';
content += '<td class="product_num">'+data[i].lastTime+'</td>';
content += '<td class="cao_zuo"><span onclick="toActivityDetail('+data[i].id+')">查看</span><span onclick="deleteDeployMent('+data[i].id+')">删除</span></td></tr>';
content += '<td class="cao_zuo"><span onclick="toActivityDetail(\''+data[i].username+'\',\''+data[i].email+'\',\''+data[i].telephone+'\',\''+data[i].lastTime+'\',\''+data[i].content+'\')">查看</span><span onclick="deleteUser('+data[i].id+',\''+data[i].username+'\')">删除</span></td></tr>';
}
$('#pages').text(pages);
$('#total').text(total);
......@@ -161,25 +161,55 @@
}
/*跳转活动详情页 */
function toActivityDetail(id) {
location.href="/activityManage/toActivityInfo?activityId="+id+"&type=1";
function toActivityDetail(username,email,telephone,lastTime,content) {
var content = '<div class="add"><span>用户名称:<span>'+username+'</span></span></div>' +
'<div class="add"><span>邮箱:<span>'+email+'</span></div>' +
'<div class="add"><span>用户描述:<span>'+content+'</span></span></div>' +
'<div class="add"><span>手机号:<span>'+telephone+'</span></span></div>' +
'<div class="add"><span>创建时间:<span>'+lastTime+'</span></span></div>';
layer.open({
id:1,
type: 1,
title:'用户详情',
skin:'layui-layer-rim',
area:['300px', '200px'],
tipsMore: true,
content: content
});
}
/*删除用户 */
function deleteUser(id) {
$.post("/api/bpm/model/deleteModel",
{
modelId:id
},function (data) {
if(data.code==200){
layer.msg('删除成功');
location.reload();
}else {
layer.msg('删除失败');
location.reload();
}
},'json')
function deleteUser(id ,name) {
layer.open({
id:1,
type: 1,
title:'确认删除吗',
skin:'layui-layer-rim',
area:['300px', '165px'],
content: '<div style="margin-top: 22px;margin-left: 8px;">您确定删除'+name+"吗?</div>"
,
btn:['保存','取消'],
btn1: function (index,layero) {
$.post("/bpm/user/deleteUser",
{
id:id
},function (data) {
if(data.code==200){
parent.layer.msg('删除成功!', { icon: 1, time: 1000 }, function () {
location.reload();
});
}else {
parent.layer.msg('删除失败!', { icon: 2, time: 1000 }, function () {
location.reload();
});
}
},'json')
},
btn2:function (index,layero) {
layer.close(index);
}
});
}
</script>
\ No newline at end of file
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