huwhois 5 ans auparavant
Parent
commit
50a55374d7

+ 18 - 6
src/main/java/io/renren/modules/admin/attenders/controller/AttendersController.java

@ -2,12 +2,14 @@ package io.renren.modules.admin.attenders.controller;
2 2
3 3
import java.util.Arrays;
4 4
import java.util.Map;
5
import java.util.Date;
5 6
6 7
import org.apache.shiro.authz.annotation.RequiresPermissions;
7 8
import org.springframework.beans.factory.annotation.Autowired;
8 9
import org.springframework.web.bind.annotation.PathVariable;
9 10
import org.springframework.web.bind.annotation.RequestBody;
10 11
import org.springframework.web.bind.annotation.RequestMapping;
12
import org.springframework.web.bind.annotation.PostMapping;
11 13
import org.springframework.web.bind.annotation.RequestParam;
12 14
import org.springframework.web.bind.annotation.RestController;
13 15
@ -60,6 +62,8 @@ public class AttendersController {
60 62
    @RequestMapping("/save")
61 63
    @RequiresPermissions("admin:attenders:save")
62 64
    public R save(@RequestBody AttendersEntity attenders){
65
        attenders.setCreateTime(new Date());
66
        attenders.setCreateId(getUserId());
63 67
		attendersService.save(attenders);
64 68
65 69
        return R.ok();
@ -71,7 +75,9 @@ public class AttendersController {
71 75
    @RequestMapping("/update")
72 76
    @RequiresPermissions("admin:attenders:update")
73 77
    public R update(@RequestBody AttendersEntity attenders){
74
		attendersService.updateById(attenders);
78
		attenders.setModifyTime(new Date());
79
        attenders.setModifyId(getUserId());
80
        attendersService.updateById(attenders);
75 81
76 82
        return R.ok();
77 83
    }
@ -79,12 +85,18 @@ public class AttendersController {
79 85
    /**
80 86
     * 删除
81 87
     */
82
    @RequestMapping("/delete")
83
    @RequiresPermissions("admin:attenders:delete")
84
    public R delete(@RequestBody Long[] ids){
85
		attendersService.removeByIds(Arrays.asList(ids));
88
    // @RequestMapping("/delete")
89
    // @RequiresPermissions("admin:attenders:delete")
90
    // public R delete(@RequestBody Long[] ids){
91
	// 	attendersService.removeByIds(Arrays.asList(ids));
92
93
    //     return R.ok();
94
    // }
86 95
96
    @PostMapping("/delete")
97
    @RequiresPermissions("admin:member:delete")
98
    public R delete(@RequestBody Long[] ids){
99
        attendersService.delete(ids);
87 100
        return R.ok();
88 101
    }
89
90 102
}

+ 5 - 0
src/main/java/io/renren/modules/admin/attenders/service/AttendersService.java

@ -16,5 +16,10 @@ import java.util.Map;
16 16
public interface AttendersService extends IService<AttendersEntity> {
17 17
18 18
    PageUtils queryPage(Map<String, Object> params);
19
20
    /**
21
	 * 删除用户(逻辑删除)
22
	 */
23
	void delete(Long[] ids);
19 24
}
20 25

+ 5 - 0
src/main/java/io/renren/modules/admin/attenders/service/impl/AttendersServiceImpl.java

@ -2,6 +2,7 @@ package io.renren.modules.admin.attenders.service.impl;
2 2
3 3
import org.springframework.stereotype.Service;
4 4
import java.util.Map;
5
import java.util.Arrays;
5 6
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
6 7
import com.baomidou.mybatisplus.core.metadata.IPage;
7 8
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -26,4 +27,8 @@ public class AttendersServiceImpl extends ServiceImpl<AttendersDao, AttendersEnt
26 27
        return new PageUtils(page);
27 28
    }
28 29
30
    @Override
31
    public void delete(Long[] ids) {
32
        baseMapper.deleteBatchIds(Arrays.asList(ids));
33
    }
29 34
}