huwhois 4 years ago
parent
commit
b897f6e029

+ 0 - 1
src/main/java/io/renren/RenrenApplication.java

11
import org.springframework.boot.SpringApplication;
11
import org.springframework.boot.SpringApplication;
12
import org.springframework.boot.autoconfigure.SpringBootApplication;
12
import org.springframework.boot.autoconfigure.SpringBootApplication;
13
13
14
15
@SpringBootApplication
14
@SpringBootApplication
16
public class RenrenApplication {
15
public class RenrenApplication {
17
16

+ 7 - 17
src/main/java/io/renren/modules/admin/controller/MemberController.java

26
import io.renren.modules.admin.service.MemberService;
26
import io.renren.modules.admin.service.MemberService;
27
import io.renren.modules.sys.controller.AbstractController;
27
import io.renren.modules.sys.controller.AbstractController;
28
import io.renren.modules.admin.service.AttendersService;
28
import io.renren.modules.admin.service.AttendersService;
29
import io.renren.modules.admin.service.EmployeeService;
30
import io.renren.modules.admin.entity.EmployeeEntity;
31
29
32
/**
30
/**
33
 * 会员表
31
 * 会员表
40
@RequestMapping("/admin/member")
38
@RequestMapping("/admin/member")
41
@Api("会员管理")
39
@Api("会员管理")
42
public class MemberController extends AbstractController  {
40
public class MemberController extends AbstractController  {
41
    
43
    @Autowired
42
    @Autowired
44
    private MemberService memberService;
43
    private MemberService memberService;
45
    @Autowired
46
    private EmployeeService employeeService;
47
    @Autowired
48
    private AttendersService attendersService;
49
44
50
    /**
45
    /**
51
     * 列表
46
     * 列表
55
    @ApiOperation("列表")
50
    @ApiOperation("列表")
56
    public R list(@RequestParam Map<String, Object> params){
51
    public R list(@RequestParam Map<String, Object> params){
57
        PageUtils page = memberService.queryPage(params);
52
        PageUtils page = memberService.queryPage(params);
58
                
53
59
        return R.ok().put("page", page);
54
        return R.ok().put("page", page);
60
    }
55
    }
61
56
66
    @RequiresPermissions("admin:member:info")
61
    @RequiresPermissions("admin:member:info")
67
    @ApiOperation("个人信息")
62
    @ApiOperation("个人信息")
68
    public R info(@PathVariable("id") Long id){
63
    public R info(@PathVariable("id") Long id){
69
		MemberEntity member = memberService.getById(id);
70
71
        List<Map<String, Object>> meetingList = attendersService.getMeetingListByMemberId(id);
72
        Long servicerId = member.getServicerId();
73
        EmployeeEntity employee = new EmployeeEntity();
74
        if (servicerId != 0) {
75
            employee = employeeService.getById(servicerId);
76
        }
64
        MemberEntity member = memberService.getById(id);
65
        member.setPassword("");
66
        List<Map<String, Object>> meetingList = memberService.getMeetingListById(id);
77
        
67
        
78
        return R.ok().put("member", member).put("meetingList", meetingList).put("employee", employee);
68
        return R.ok().put("member", member).put("meetingList", meetingList);
79
    }
69
    }
80
70
81
    /**
71
    /**
121
    }
111
    }
122
112
123
    @PostMapping("/status")
113
    @PostMapping("/status")
124
    @RequiresPermissions("admin:member:status")
114
    @RequiresPermissions("admin:member:update")
125
    @ApiOperation("改变审核状态")
115
    @ApiOperation("改变审核状态")
126
    public R status(@RequestBody Map<String, Object> params){   
116
    public R status(@RequestBody Map<String, Object> params){   
127
        Long id = Long.valueOf(params.get("id").toString());
117
        Long id = Long.valueOf(params.get("id").toString());

+ 6 - 0
src/main/java/io/renren/modules/admin/dao/MemberDao.java

38
     */
38
     */
39
    @Select("select id,truename,organization,position,job_title as jiobTitle,phone,email from member where is_del=0;")
39
    @Select("select id,truename,organization,position,job_title as jiobTitle,phone,email from member where is_del=0;")
40
    List<Map<String, Object>> selectList();
40
    List<Map<String, Object>> selectList();
41
42
    /**
43
     * 根据会员id, 查询获取最近参加的会议
44
     */
45
    @Select("SELECT a.id as aid,a.meeting_id,m.name_cn FROM attenders a JOIN meeting m ON a.meeting_id=m.id WHERE a.member_id=#{Id} ORDER BY a.id;")
46
    List<Map<String, Object>> getMeetingListById(Long Id);
41
}
47
}

+ 8 - 17
src/main/java/io/renren/modules/admin/entity/MemberEntity.java

3
import java.io.Serializable;
3
import java.io.Serializable;
4
import java.util.Date;
4
import java.util.Date;
5
import com.baomidou.mybatisplus.annotation.TableId;
5
import com.baomidou.mybatisplus.annotation.TableId;
6
import com.baomidou.mybatisplus.annotation.TableLogic;
7
import com.baomidou.mybatisplus.annotation.TableName;
6
import com.baomidou.mybatisplus.annotation.TableName;
8
import com.fasterxml.jackson.annotation.JsonIgnore;
7
import com.fasterxml.jackson.annotation.JsonIgnore;
9
8
85
	 * 办公电话
84
	 * 办公电话
86
	 */
85
	 */
87
	private String officephone;
86
	private String officephone;
88
	/**
89
	 * 其他联系方式
90
	 */
91
	private String otherphone;
92
	/**
93
	 * 负责人id
94
	 */
95
	private Long servicerId;
96
	/**
87
	/**
97
	 * 备注
88
	 * 备注
98
	 */
89
	 */
99
	private String note;
90
	private String note;
91
	/**
92
	 * 是否通过审核 0:未通过 1:通过
93
	 */
94
	private Integer isCheck;
100
	/**
95
	/**
101
	 * 创建时间
96
	 * 创建时间
102
	 */
97
	 */
105
	 * 修改时间
100
	 * 修改时间
106
	 */
101
	 */
107
	private Date modifyTime;
102
	private Date modifyTime;
108
	/**
109
	 * 是否通过审核 0:未通过 1:通过
110
	 */
111
	private Integer isCheck;
112
	/**
113
	 * 是否被删除 状态  0:正常   1:删除
114
	 */
115
	private Integer isDel;
116
	/**
103
	/**
117
	 * 修改人
104
	 * 修改人
118
	 */
105
	 */
121
	 * 修改人
108
	 * 修改人
122
	 */
109
	 */
123
	private Long createId;
110
	private Long createId;
111
	/**
112
	 * 是否被删除 状态  0:正常   1:删除
113
	 */
114
	private Integer isDel;
124
}
115
}

+ 7 - 1
src/main/java/io/renren/modules/admin/service/MemberService.java

19
 */
19
 */
20
public interface MemberService extends IService<MemberEntity> {
20
public interface MemberService extends IService<MemberEntity> {
21
21
22
    PageUtils queryPage(Map<String, Object> params);
22
	PageUtils queryPage(Map<String, Object> params);
23
	
24
   /**
25
     * 根据会员id, 查询获取最近参加的会议
26
	 * @param id
27
     */
28
	List<Map<String, Object>> getMeetingListById(Long id);
23
29
24
    /**
30
    /**
25
	 * 保存用户
31
	 * 保存用户

+ 5 - 18
src/main/java/io/renren/modules/admin/service/impl/MemberServiceImpl.java

22
import io.renren.modules.admin.dao.MemberDao;
22
import io.renren.modules.admin.dao.MemberDao;
23
import io.renren.modules.admin.entity.MemberEntity;
23
import io.renren.modules.admin.entity.MemberEntity;
24
import io.renren.modules.admin.service.MemberService;
24
import io.renren.modules.admin.service.MemberService;
25
import io.renren.modules.admin.entity.EmployeeEntity;
26
import io.renren.modules.admin.service.AttendersService;
25
import io.renren.modules.admin.service.AttendersService;
27
import io.renren.modules.admin.service.EmployeeService;
28
26
29
@Service("memberService")
27
@Service("memberService")
30
public class MemberServiceImpl extends ServiceImpl<MemberDao, MemberEntity> implements MemberService {
28
public class MemberServiceImpl extends ServiceImpl<MemberDao, MemberEntity> implements MemberService {
31
29
32
    @Autowired
33
    private EmployeeService employeeService;
34
    @Autowired
30
    @Autowired
35
    private AttendersService attendersService;
31
    private AttendersService attendersService;
36
32
61
            mMap.put("email", member.getEmail());
57
            mMap.put("email", member.getEmail());
62
            mMap.put("createTime", member.getCreateTime());
58
            mMap.put("createTime", member.getCreateTime());
63
            mMap.put("isCheck", member.getIsCheck());
59
            mMap.put("isCheck", member.getIsCheck());
64
            Long servicerId = member.getServicerId();
65
            if (servicerId != 0) {
66
                Map<String, Object> employeeMap = employeeService.getMap(
67
                    new QueryWrapper<EmployeeEntity>().eq("id", servicerId));
68
                    System.out.println(employeeMap);
69
                    if (employeeMap != null && employeeMap.containsKey("truename")) {
70
                        mMap.put("servicerName", employeeMap.get("truename"));
71
                    } else {
72
                        mMap.put("servicerName", "");
73
                    }
74
            } else {
75
                mMap.put("servicerName", "");
76
            }
77
            List<Map<String, Object>> meetingList = attendersService.getMeetingListByMemberId(memberId);
60
            List<Map<String, Object>> meetingList = attendersService.getMeetingListByMemberId(memberId);
78
            int meetingCounts = meetingList.size();
61
            int meetingCounts = meetingList.size();
79
            if (meetingCounts > 0) {
62
            if (meetingCounts > 0) {
118
    public int updateStatus(Long id, Integer isCheck) {
101
    public int updateStatus(Long id, Integer isCheck) {
119
        int itemp = baseMapper.updateStatus(id, isCheck);
102
        int itemp = baseMapper.updateStatus(id, isCheck);
120
        return itemp;
103
        return itemp;
121
        // @Update("update member set is_check=#{is_check}  where id = #{id}")
122
    }
104
    }
123
105
124
    @Override
106
    @Override
145
    public List<Map<String, Object>> getList() {
127
    public List<Map<String, Object>> getList() {
146
        return baseMapper.selectList();
128
        return baseMapper.selectList();
147
    }
129
    }
130
131
    @Override
132
    public List<Map<String, Object>> getMeetingListById(Long id) {
133
        return baseMapper.getMeetingListById(id);
134
    }
148
}
135
}