huwhois 5 ans auparavant
Parent
commit
263521f511

+ 109 - 0
src/main/java/io/renren/modules/admin/meeting/controller/MeetingController.java

@ -0,0 +1,109 @@
1
package io.renren.modules.admin.meeting.controller;
2
3
import java.util.Arrays;
4
import java.util.Map;
5
6
import org.apache.shiro.authz.annotation.RequiresPermissions;
7
import org.springframework.beans.factory.annotation.Autowired;
8
import org.springframework.web.bind.annotation.PathVariable;
9
import org.springframework.web.bind.annotation.RequestBody;
10
import org.springframework.web.bind.annotation.RequestMapping;
11
import org.springframework.web.bind.annotation.RequestParam;
12
import org.springframework.web.bind.annotation.RestController;
13
14
import io.renren.modules.admin.meeting.entity.MeetingEntity;
15
import io.renren.modules.admin.meeting.service.MeetingService;
16
import io.renren.common.utils.PageUtils;
17
import io.renren.common.utils.R;
18
19
20
21
/**
22
 * 会议表
23
 *
24
 * @author chenshun
25
 * @email sunlightcs@gmail.com
26
 * @date 2020-02-20 14:59:39
27
 */
28
@RestController
29
@RequestMapping("admin/meeting")
30
public class MeetingController {
31
    @Autowired
32
    private MeetingService meetingService;
33
34
    /**
35
     * 列表
36
     */
37
    @RequestMapping("/list")
38
    @RequiresPermissions("admin:meeting:list")
39
    public R list(@RequestParam Map<String, Object> params){
40
        PageUtils page = meetingService.queryPage(params);
41
42
        return R.ok().put("page", page);
43
    }
44
45
46
    /**
47
     * 信息
48
     */
49
    @RequestMapping("/info/{id}")
50
    @RequiresPermissions("admin:meeting:info")
51
    public R info(@PathVariable("id") Long id){
52
		MeetingEntity meeting = meetingService.getById(id);
53
54
        return R.ok().put("meeting", meeting);
55
    }
56
57
    /**
58
     * 保存
59
     */
60
    @RequestMapping("/save")
61
    @RequiresPermissions("admin:meeting:save")
62
    public R save(@RequestBody MeetingEntity meeting){
63
        meeting.setCreateTime(new Date());
64
		meetingService.save(meeting);
65
66
        return R.ok();
67
    }
68
69
    /**
70
     * 修改
71
     */
72
    @RequestMapping("/update")
73
    @RequiresPermissions("admin:meeting:update")
74
    public R update(@RequestBody MeetingEntity meeting){
75
        meeting.setModifyTime(new Date());
76
		meetingService.updateById(meeting);
77
78
        return R.ok();
79
    }
80
81
    /**
82
     * 删除
83
     */
84
    // @RequestMapping("/delete")
85
    // @RequiresPermissions("admin:meeting:delete")
86
    // public R delete(@RequestBody Long[] ids){
87
	// 	meetingService.removeByIds(Arrays.asList(ids));
88
89
    //     return R.ok();
90
    // }
91
    @PostMapping("/delete")
92
    @RequiresPermissions("admin:meeting:delete")
93
    @ApiOperation("删除")
94
    public R delete(@RequestBody Long[] ids){
95
        meetingService.delete(ids);
96
        return R.ok();
97
    }
98
99
    @PostMapping("/status")
100
    @RequiresPermissions("admin:meeting:status")
101
    @ApiOperation("改变审核状态")
102
    public R status(@RequestBody Map<String, Object> param){
103
        Long id = Long.valueOf(param.get("id").toString());
104
        Integer status = Integer.valueOf(param.get("status").toString());
105
106
        meetingService.updateStatus(id, status);
107
        return R.ok();
108
    }
109
}

+ 18 - 0
src/main/java/io/renren/modules/admin/meeting/dao/MeetingDao.java

@ -0,0 +1,18 @@
1
package io.renren.modules.admin.meeting.dao;
2
3
import io.renren.modules.admin.meeting.entity.MeetingEntity;
4
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
import org.apache.ibatis.annotations.Mapper;
6
7
/**
8
 * 会议表
9
 * 
10
 * @author chenshun
11
 * @email sunlightcs@gmail.com
12
 * @date 2020-02-20 14:59:39
13
 */
14
@Mapper
15
public interface MeetingDao extends BaseMapper<MeetingEntity> {
16
	@Update("update meeting set is_check=#{isCheck} where id=#{id}")
17
    int updateStatus(Long id, Integer isCheck);
18
}

+ 108 - 0
src/main/java/io/renren/modules/admin/meeting/entity/MeetingEntity.java

@ -0,0 +1,108 @@
1
package io.renren.modules.admin.meeting.entity;
2
3
import com.baomidou.mybatisplus.annotation.TableId;
4
import com.baomidou.mybatisplus.annotation.TableName;
5
6
import java.io.Serializable;
7
import java.util.Date;
8
import lombok.Data;
9
10
/**
11
 * 会议表
12
 * 
13
 * @author chenshun
14
 * @email sunlightcs@gmail.com
15
 * @date 2020-02-20 14:59:39
16
 */
17
@Data
18
@TableName("meeting")
19
public class MeetingEntity implements Serializable {
20
	private static final long serialVersionUID = 1L;
21
22
	/**
23
	 * 会议id (会议表)
24
	 */
25
	@TableId
26
	private Long id;
27
	/**
28
	 * 举办单位id
29
	 */
30
	private Long companyId;
31
	/**
32
	 * 会议名称(中文)
33
	 */
34
	private String nameCn;
35
	/**
36
	 * 会议名称(英文)
37
	 */
38
	private String nameEn;
39
	/**
40
	 * 举办地点
41
	 */
42
	private String address;
43
	/**
44
	 * 开始时间
45
	 */
46
	private Date startTime;
47
	/**
48
	 * 结束时间
49
	 */
50
	private Date endTime;
51
	/**
52
	 * 官方网址
53
	 */
54
	private String officeWebsite;
55
	/**
56
	 * 会议封面图片地址
57
	 */
58
	private String titlePicture;
59
	/**
60
	 * 涉及学科
61
	 */
62
	private String subjects;
63
	/**
64
	 * 涉及行业
65
	 */
66
	private String industries;
67
	/**
68
	 * 会议负责人
69
	 */
70
	private String serviceEmp;
71
	/**
72
	 * 线上报名截止时间
73
	 */
74
	private Date onlineRegDeadline;
75
	/**
76
	 * 现场报名截止时间
77
	 */
78
	private Date onsiteRegDeadline;
79
	/**
80
	 * 投稿截止时间
81
	 */
82
	private Date subDeadline;
83
	/**
84
	 * 投稿范围及要求
85
	 */
86
	private String subRequirement;
87
	/**
88
	 * 会议介绍
89
	 */
90
	private String introduction;
91
	/**
92
	 * 创建时间
93
	 */
94
	private Date createTime;
95
	/**
96
	 * 修改时间
97
	 */
98
	private Date modifyTime;
99
	/**
100
	 * 是否通过审核 0:未通过 1:通过
101
	 */
102
	private Integer isCheck;
103
	/**
104
	 * 是否被删除 状态  0:正常   1:删除
105
	 */
106
	private Integer isDel;
107
108
}

+ 32 - 0
src/main/java/io/renren/modules/admin/meeting/service/MeetingService.java

@ -0,0 +1,32 @@
1
package io.renren.modules.admin.meeting.service;
2
3
import com.baomidou.mybatisplus.extension.service.IService;
4
import io.renren.common.utils.PageUtils;
5
import io.renren.modules.admin.meeting.entity.MeetingEntity;
6
7
import java.util.Map;
8
9
/**
10
 * 会议表
11
 *
12
 * @author chenshun
13
 * @email sunlightcs@gmail.com
14
 * @date 2020-02-20 14:59:39
15
 */
16
public interface MeetingService extends IService<MeetingEntity> {
17
18
    PageUtils queryPage(Map<String, Object> params);
19
20
    /**
21
	 * 删除用户(逻辑删除)
22
	 */
23
	void delete(Long[] ids);
24
25
	/**
26
	 * 更新审核状态
27
	 * @param id
28
	 * @param isCheck
29
	 */
30
    int updateStatus(Long id, Integer isCheck);
31
}
32

+ 40 - 0
src/main/java/io/renren/modules/admin/meeting/service/impl/MeetingServiceImpl.java

@ -0,0 +1,40 @@
1
package io.renren.modules.admin.meeting.service.impl;
2
3
import org.springframework.stereotype.Service;
4
import java.util.Map;
5
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
6
import com.baomidou.mybatisplus.core.metadata.IPage;
7
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
8
import io.renren.common.utils.PageUtils;
9
import io.renren.common.utils.Query;
10
11
import io.renren.modules.admin.meeting.dao.MeetingDao;
12
import io.renren.modules.admin.meeting.entity.MeetingEntity;
13
import io.renren.modules.admin.meeting.service.MeetingService;
14
15
16
@Service("meetingService")
17
public class MeetingServiceImpl extends ServiceImpl<MeetingDao, MeetingEntity> implements MeetingService {
18
19
    @Override
20
    public PageUtils queryPage(Map<String, Object> params) {
21
        IPage<MeetingEntity> page = this.page(
22
                new Query<MeetingEntity>().getPage(params),
23
                new QueryWrapper<MeetingEntity>()
24
        );
25
26
        return new PageUtils(page);
27
    }
28
29
    @Override
30
    public void delete(Long[] ids) {
31
        baseMapper.deleteBatchIds(Arrays.asList(ids));
32
    }
33
34
    @Override
35
    public int updateStatus(Long id, Integer isCheck) {
36
        int itemp = baseMapper.updateStatus(id, isCheck);
37
        return itemp;
38
        // @Update("update member set is_check=#{is_check}  where id = #{id}")
39
    }
40
}