Browse Source

投稿要求,对公账户等接口修改

huwhois 5 years ago
parent
commit
9d87076003

+ 1 - 3
src/main/java/io/renren/modules/admin/controller/LectureController.java

@ -86,9 +86,7 @@ public class LectureController {
86 86
    @PostMapping("/delete")
87 87
    @RequiresPermissions("admin:lecture:delete")
88 88
    public R delete(@RequestBody Long[] ids) {
89
        // lectureService.removeByIds(Arrays.asList(ids));
90
        BaseMapper<LectureEntity> lectureBaseMapper = lectureService.getBaseMapper();
91
        lectureBaseMapper.deleteBatchIds(Arrays.asList(ids));
89
        lectureService.removeByIds(Arrays.asList(ids));
92 90
        return R.ok();
93 91
    }
94 92

+ 31 - 0
src/main/java/io/renren/modules/admin/controller/MoneyAccountController.java

@ -7,6 +7,7 @@ import java.util.Date;
7 7
import org.apache.shiro.authz.annotation.RequiresPermissions;
8 8
import org.springframework.beans.factory.annotation.Autowired;
9 9
import org.springframework.web.bind.annotation.PathVariable;
10
import org.springframework.web.bind.annotation.PostMapping;
10 11
import org.springframework.web.bind.annotation.RequestBody;
11 12
import org.springframework.web.bind.annotation.RequestMapping;
12 13
import org.springframework.web.bind.annotation.RequestParam;
@ -55,6 +56,36 @@ public class MoneyAccountController {
55 56
        return R.ok().put("moneyAccount", moneyAccount);
56 57
    }
57 58
59
    /**
60
     * 根据meetingId信息
61
     */
62
    @RequestMapping("/infobymid/{mid}")
63
    @RequiresPermissions("admin:moneyaccount:info")
64
    public R infoByMid(@PathVariable("mid") Long mid){
65
		MoneyAccountEntity moneyAccount = moneyAccountService.getOneByMeetingId(mid);
66
        
67
        return R.ok().put("moneyAccount", moneyAccount);
68
    }
69
70
    /**
71
     * 添加or修改 moneyAccount
72
     * @param moneyAccount
73
     * @return
74
     */
75
    @PostMapping("addorupdate")
76
    @RequiresPermissions("admin:moneyaccount:save")
77
    public R addOrUpdate(@RequestBody MoneyAccountEntity moneyAccount){
78
        Long meetingId = moneyAccount.getMeetingId();
79
        String name = moneyAccount.getName();
80
        String bank = moneyAccount.getBank();
81
        String accout = moneyAccount.getAccount();
82
        Date createTime = new Date();
83
        System.out.println(meetingId);
84
         Integer rows = moneyAccountService.addOrUpdate(meetingId, name, bank, accout, createTime);
85
86
        return R.ok().put("rows", rows);
87
    }
88
58 89
    /**
59 90
     * 保存
60 91
     */

+ 94 - 0
src/main/java/io/renren/modules/admin/controller/PaperRequireController.java

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

+ 13 - 5
src/main/java/io/renren/modules/admin/controller/TypesOfFeeController.java

@ -1,5 +1,6 @@
1 1
package io.renren.modules.admin.controller;
2 2
3
import java.math.BigDecimal;
3 4
import java.util.Arrays;
4 5
import java.util.Map;
5 6
import java.util.Date;
@ -9,6 +10,8 @@ import org.springframework.beans.factory.annotation.Autowired;
9 10
import org.springframework.web.bind.annotation.PathVariable;
10 11
import org.springframework.web.bind.annotation.RequestBody;
11 12
import org.springframework.web.bind.annotation.RequestMapping;
13
import org.springframework.web.bind.annotation.GetMapping;
14
import org.springframework.web.bind.annotation.PostMapping;
12 15
import org.springframework.web.bind.annotation.RequestParam;
13 16
import org.springframework.web.bind.annotation.RestController;
14 17
@ -35,7 +38,7 @@ public class TypesOfFeeController {
35 38
    /**
36 39
     * 列表
37 40
     */
38
    @RequestMapping("/list")
41
    @GetMapping("/list")
39 42
    @RequiresPermissions("admin:typesoffee:list")
40 43
    public R list(@RequestParam Map<String, Object> params){
41 44
        PageUtils page = typesOfFeeService.queryPage(params);
@ -47,7 +50,7 @@ public class TypesOfFeeController {
47 50
    /**
48 51
     * 信息
49 52
     */
50
    @RequestMapping("/info/{id}")
53
    @GetMapping("/info/{id}")
51 54
    @RequiresPermissions("admin:typesoffee:info")
52 55
    public R info(@PathVariable("id") Long id){
53 56
		TypesOfFeeEntity typesOfFee = typesOfFeeService.getById(id);
@ -58,9 +61,14 @@ public class TypesOfFeeController {
58 61
    /**
59 62
     * 保存
60 63
     */
61
    @RequestMapping("/save")
64
    @PostMapping("/save")
62 65
    @RequiresPermissions("admin:typesoffee:save")
63 66
    public R save(@RequestBody TypesOfFeeEntity typesOfFee){
67
        BigDecimal maxMoney = BigDecimal.valueOf(999999.99);
68
        if (typesOfFee.getMoney().compareTo(maxMoney) == 1) {
69
            return R.error("金额超出可使用范围");
70
        }
71
64 72
        typesOfFee.setCreateTime(new Date());
65 73
		typesOfFeeService.save(typesOfFee);
66 74
@ -70,7 +78,7 @@ public class TypesOfFeeController {
70 78
    /**
71 79
     * 修改
72 80
     */
73
    @RequestMapping("/update")
81
    @PostMapping("/update")
74 82
    @RequiresPermissions("admin:typesoffee:update")
75 83
    public R update(@RequestBody TypesOfFeeEntity typesOfFee){
76 84
		typesOfFeeService.updateById(typesOfFee);
@ -81,7 +89,7 @@ public class TypesOfFeeController {
81 89
    /**
82 90
     * 删除
83 91
     */
84
    @RequestMapping("/delete")
92
    @PostMapping("/delete")
85 93
    @RequiresPermissions("admin:typesoffee:delete")
86 94
    public R delete(@RequestBody Long[] ids){
87 95
		typesOfFeeService.removeByIds(Arrays.asList(ids));

+ 6 - 1
src/main/java/io/renren/modules/admin/dao/MoneyAccountDao.java

@ -1,8 +1,12 @@
1 1
package io.renren.modules.admin.dao;
2 2
3 3
import io.renren.modules.admin.entity.MoneyAccountEntity;
4
5
import java.util.Date;
6
4 7
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5 8
import org.apache.ibatis.annotations.Mapper;
9
import org.apache.ibatis.annotations.Update;
6 10
7 11
/**
8 12
 * 
@ -13,5 +17,6 @@ import org.apache.ibatis.annotations.Mapper;
13 17
 */
14 18
@Mapper
15 19
public interface MoneyAccountDao extends BaseMapper<MoneyAccountEntity> {
16
	
20
    @Update("REPLACE INTO money_account(`meeting_id`, `name`, `bank`, `account`, `create_time`) VALUES(#{meeting_id}, #{name}, #{bank}, #{account}, #{create_time});")
21
    Integer addOrUpdate(Long meeting_id, String name, String bank, String account, Date create_time);
17 22
}

+ 17 - 0
src/main/java/io/renren/modules/admin/dao/PaperRequireDao.java

@ -0,0 +1,17 @@
1
package io.renren.modules.admin.dao;
2
3
import io.renren.modules.admin.entity.PaperRequireEntity;
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-03-16 11:02:40
13
 */
14
@Mapper
15
public interface PaperRequireDao extends BaseMapper<PaperRequireEntity> {
16
	
17
}

+ 1 - 1
src/main/java/io/renren/modules/admin/dao/TypesOfAttendersDao.java

@ -17,7 +17,7 @@ import java.util.List;
17 17
@Mapper
18 18
public interface TypesOfAttendersDao extends BaseMapper<TypesOfAttendersEntity> {
19 19

20
    @Select("select * from types_of_attenders where type like '%${name}%' ")
20
    @Select("select * from types_of_attenders where name like '%${name}%' ")
21 21
    List<TypesOfAttendersEntity> findAllByType (String name);
22 22

23 23


+ 4 - 8
src/main/java/io/renren/modules/admin/entity/MeetingEntity.java

@ -81,18 +81,14 @@ public class MeetingEntity implements Serializable {
81 81
	 * 现场报名截止时间
82 82
	 */
83 83
	private Date onsiteRegDeadline;
84
	/**
85
	 * 投稿截止时间
86
	 */
87
	private Date subDeadline;
88
	/**
89
	 * 投稿范围及要求
90
	 */
91
	private String subRequirement;
92 84
	/**
93 85
	 * 会议介绍
94 86
	 */
95 87
	private String introduction;
88
	/**
89
	 * 举办单位id
90
	 */
91
	private Long paperRequireId;
96 92
	/**
97 93
	 * 创建时间
98 94
	 */

+ 44 - 0
src/main/java/io/renren/modules/admin/entity/PaperRequireEntity.java

@ -0,0 +1,44 @@
1
package io.renren.modules.admin.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-03-16 11:02:40
16
 */
17
@Data
18
@TableName("paper_require")
19
public class PaperRequireEntity implements Serializable {
20
	private static final long serialVersionUID = 1L;
21
22
	/**
23
	 * 
24
	 */
25
	@TableId
26
	private Long id;
27
	/**
28
	 * 截止时间
29
	 */
30
	private Date deadline;
31
	/**
32
	 * 要求
33
	 */
34
	private String content;
35
	/**
36
	 * 创建时间
37
	 */
38
	private Date createTime;
39
	/**
40
	 * 是否被删除 状态  0:正常   1:删除
41
	 */
42
	private Integer isDel;
43
44
}

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

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
4 4
import io.renren.common.utils.PageUtils;
5 5
import io.renren.modules.admin.entity.MoneyAccountEntity;
6 6
7
import java.util.Date;
7 8
import java.util.Map;
8 9
9 10
/**
@ -16,5 +17,9 @@ import java.util.Map;
16 17
public interface MoneyAccountService extends IService<MoneyAccountEntity> {
17 18
18 19
    PageUtils queryPage(Map<String, Object> params);
20
21
    MoneyAccountEntity getOneByMeetingId(Long meetingId);
22
23
    Integer addOrUpdate(Long meeting_id, String name, String bank, String account, Date create_time);
19 24
}
20 25

+ 20 - 0
src/main/java/io/renren/modules/admin/service/PaperRequireService.java

@ -0,0 +1,20 @@
1
package io.renren.modules.admin.service;
2
3
import com.baomidou.mybatisplus.extension.service.IService;
4
import io.renren.common.utils.PageUtils;
5
import io.renren.modules.admin.entity.PaperRequireEntity;
6
7
import java.util.Map;
8
9
/**
10
 * 投稿要求表
11
 *
12
 * @author chenshun
13
 * @email sunlightcs@gmail.com
14
 * @date 2020-03-16 11:02:40
15
 */
16
public interface PaperRequireService extends IService<PaperRequireEntity> {
17
18
    PageUtils queryPage(Map<String, Object> params);
19
}
20

+ 0 - 1
src/main/java/io/renren/modules/admin/service/impl/LectureServiceImpl.java

@ -1,6 +1,5 @@
1 1
package io.renren.modules.admin.service.impl;
2 2
3
import java.util.Arrays;
4 3
import java.util.Map;
5 4
import org.apache.commons.lang.StringUtils;
6 5
import org.springframework.stereotype.Service;

+ 13 - 1
src/main/java/io/renren/modules/admin/service/impl/MoneyAccountServiceImpl.java

@ -1,6 +1,8 @@
1 1
package io.renren.modules.admin.service.impl;
2 2
3 3
import org.springframework.stereotype.Service;
4
5
import java.util.Date;
4 6
import java.util.Map;
5 7
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
6 8
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -26,4 +28,14 @@ public class MoneyAccountServiceImpl extends ServiceImpl<MoneyAccountDao, MoneyA
26 28
        return new PageUtils(page);
27 29
    }
28 30
29
}
31
    @Override
32
    public MoneyAccountEntity getOneByMeetingId(Long meetingId) {
33
        MoneyAccountEntity moneyAccount = this.getOne(new QueryWrapper<MoneyAccountEntity>().eq("meeting_id", meetingId));
34
        return moneyAccount;
35
    }
36
37
    @Override
38
    public Integer addOrUpdate(Long meeting_id, String name, String bank, String account, Date create_time){
39
        return baseMapper.addOrUpdate(meeting_id, name, bank, account, create_time);
40
    }
41
}

+ 29 - 0
src/main/java/io/renren/modules/admin/service/impl/PaperRequireServiceImpl.java

@ -0,0 +1,29 @@
1
package io.renren.modules.admin.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.dao.PaperRequireDao;
12
import io.renren.modules.admin.entity.PaperRequireEntity;
13
import io.renren.modules.admin.service.PaperRequireService;
14
15
16
@Service("paperRequireService")
17
public class PaperRequireServiceImpl extends ServiceImpl<PaperRequireDao, PaperRequireEntity> implements PaperRequireService {
18
19
    @Override
20
    public PageUtils queryPage(Map<String, Object> params) {
21
        IPage<PaperRequireEntity> page = this.page(
22
                new Query<PaperRequireEntity>().getPage(params),
23
                new QueryWrapper<PaperRequireEntity>()
24
        );
25
26
        return new PageUtils(page);
27
    }
28
29
}

+ 5 - 4
src/main/java/io/renren/modules/admin/service/impl/TypesOfFeeServiceImpl.java

@ -1,7 +1,8 @@
1 1
package io.renren.modules.admin.service.impl;
2 2
3
import org.springframework.stereotype.Service;
4 3
import java.util.Map;
4
import org.apache.commons.lang.StringUtils;
5
import org.springframework.stereotype.Service;
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;
@ -12,18 +13,18 @@ import io.renren.modules.admin.dao.TypesOfFeeDao;
12 13
import io.renren.modules.admin.entity.TypesOfFeeEntity;
13 14
import io.renren.modules.admin.service.TypesOfFeeService;
14 15
15
16 16
@Service("typesOfFeeService")
17 17
public class TypesOfFeeServiceImpl extends ServiceImpl<TypesOfFeeDao, TypesOfFeeEntity> implements TypesOfFeeService {
18 18
19 19
    @Override
20 20
    public PageUtils queryPage(Map<String, Object> params) {
21
22
        String meetingId = (String)params.get("meetingId");
21 23
        IPage<TypesOfFeeEntity> page = this.page(
22 24
                new Query<TypesOfFeeEntity>().getPage(params),
23
                new QueryWrapper<TypesOfFeeEntity>()
25
                new QueryWrapper<TypesOfFeeEntity>().eq(StringUtils.isNotBlank(meetingId),"meeting_id", meetingId)
24 26
        );
25 27
26 28
        return new PageUtils(page);
27 29
    }
28
29 30
}