huwhois 5 ans auparavant
Parent
commit
8f4909a6c6

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

124
    @RequiresPermissions("admin:member:status")
124
    @RequiresPermissions("admin:member:status")
125
    @ApiOperation("改变审核状态")
125
    @ApiOperation("改变审核状态")
126
    public R status(@RequestBody Map<String, Object> params){
126
    public R status(@RequestBody Map<String, Object> params){
127
       System.out.println(params);      
127
    //    System.out.println(params);      
128
        Long id = Long.valueOf(params.get("id").toString());
128
        Long id = Long.valueOf(params.get("id").toString());
129
        Integer status = Integer.valueOf(params.get("status").toString());
129
        Integer status = Integer.valueOf(params.get("status").toString());
130
        // System.out.println(id);
130
        // System.out.println(id);
135
135
136
    @PostMapping("/repassword/{id}")
136
    @PostMapping("/repassword/{id}")
137
    @RequiresPermissions("admin:member:repassword")
137
    @RequiresPermissions("admin:member:repassword")
138
    @ApiOperation("改变审核状态")
138
    @ApiOperation("重置默认密码")
139
    public R repassword(@PathVariable("id") Long id){
139
    public R repassword(@PathVariable("id") Long id){
140
        MemberEntity member = memberService.getById(id);
140
        MemberEntity member = memberService.getById(id);
141
        member.setPassword("123456");
141
        member.setPassword("123456");

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

81
        String accout = moneyAccount.getAccount();
81
        String accout = moneyAccount.getAccount();
82
        Date createTime = new Date();
82
        Date createTime = new Date();
83
        System.out.println(meetingId);
83
        System.out.println(meetingId);
84
         Integer rows = moneyAccountService.addOrUpdate(meetingId, name, bank, accout, createTime);
84
        Integer rows = moneyAccountService.addOrUpdate(meetingId, name, bank, accout, createTime);
85
85
86
        return R.ok().put("rows", rows);
86
        return R.ok().put("rows", rows);
87
    }
87
    }

+ 9 - 0
src/main/java/io/renren/modules/admin/controller/PaymentController.java

191
191
192
        ExcelUtils.exportExcel(data, response.getOutputStream());
192
        ExcelUtils.exportExcel(data, response.getOutputStream());
193
    }
193
    }
194
195
    @PostMapping("paystatus")
196
    @RequiresPermissions("admin:payment:update")
197
    public R setPayStatus(@RequestBody Map<String, Object> params) {
198
        Long id = Long.valueOf(params.get("id").toString());
199
        Integer status = Integer.valueOf(params.get("status").toString());
200
        paymentService.updatePayStatus(id, status);
201
        return R.ok();
202
    }
194
}
203
}

+ 37 - 9
src/main/java/io/renren/modules/admin/controller/SignInfoController.java

26
import org.springframework.web.bind.annotation.RestController;
26
import org.springframework.web.bind.annotation.RestController;
27
27
28
import javax.servlet.http.HttpServletResponse;
28
import javax.servlet.http.HttpServletResponse;
29
30
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
31
29
import java.net.URLEncoder;
32
import java.net.URLEncoder;
30
import java.text.SimpleDateFormat;
33
import java.text.SimpleDateFormat;
31
import java.util.ArrayList;
34
import java.util.ArrayList;
268
        return R.ok();
271
        return R.ok();
269
    }
272
    }
270
273
271
    // /**
272
    //  * 修改
273
    //  */
274
    // @RequestMapping("/update")
275
    // @RequiresPermissions("admin:signinfo:update")
276
    // public R update(@RequestBody SignInfoEntity signInfo){
277
	// 	signInfoService.updateById(signInfo);
274
    /**
275
     * 修改
276
     */
277
    @RequestMapping("/update")
278
    @RequiresPermissions("admin:signinfo:update")
279
    public R update(@RequestBody SignInfoEntity signInfo){
280
        SignInfoEntity formerSignInfo = signInfoService.getById(signInfo.getId());
281
        AttendersEntity attenders = attendersService.getById(formerSignInfo.getAId());
282
        MemberEntity member = memberService.getById(attenders.getMemberId());
283
        // MemberEntity member = new MemberEntity();
284
        // AttendersEntity attenders = new AttendersEntity();
285
        PaymentEntity payment = paymentService.getOne(new QueryWrapper<PaymentEntity>().eq("attenders_id", formerSignInfo.getAId()));
278
286
279
    //     return R.ok();
280
    // }
287
        Date nowTime = new Date();
288
        member.setId(attenders.getMemberId());
289
        member.setUsername(signInfo.getPhone());
290
        member.setTruename(signInfo.getTruename());
291
        member.setPhone(signInfo.getPhone());
292
        member.setModifyTime(nowTime);
293
        member.setModifyId(getUserId());
294
        memberService.updateById(member);
295
296
        attenders.setName(signInfo.getTruename());
297
        attenders.setPhone(signInfo.getPhone());
298
        attenders.setOrganization(signInfo.getOrganization());
299
        attenders.setNote(signInfo.getOrganization());
300
        attenders.setServicer(signInfo.getServicer());
301
        attendersService.updateById(attenders);
302
303
        payment.setIsPay(signInfo.getIsPay());
304
        payment.setMoney(signInfo.getMoney());
305
        paymentService.updateById(payment);
306
307
        return R.ok();
308
    }
281
309
282
    // /**
310
    // /**
283
    //  * 删除
311
    //  * 删除

+ 4 - 0
src/main/java/io/renren/modules/admin/dao/PaymentDao.java

4
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
import org.apache.ibatis.annotations.Mapper;
5
import org.apache.ibatis.annotations.Mapper;
6
import org.apache.ibatis.annotations.Select;
6
import org.apache.ibatis.annotations.Select;
7
import org.apache.ibatis.annotations.Update;
7
8
8
import java.math.BigDecimal;
9
import java.math.BigDecimal;
9
import java.util.List;
10
import java.util.List;
35
36
36
    @Select("select sum(p.money) as totalMoney from attenders join payment p on attenders.id=p.attenders_id  where p.meeting_id=#{meetingId} and attenders.is_del=0 and p.is_del=0 ${where};")
37
    @Select("select sum(p.money) as totalMoney from attenders join payment p on attenders.id=p.attenders_id  where p.meeting_id=#{meetingId} and attenders.is_del=0 and p.is_del=0 ${where};")
37
    BigDecimal getTotalMoney(Long meetingId, String where);
38
    BigDecimal getTotalMoney(Long meetingId, String where);
39
40
    @Update("UPDATE payment SET `is_pay`=#{status} where id=#{id}")
41
    int updatePayStatus(Long id, Integer status);
38
}
42
}

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

81
	 */
81
	 */
82
	@Email(message="邮箱格式不正确", groups = {AddGroup.class, UpdateGroup.class})
82
	@Email(message="邮箱格式不正确", groups = {AddGroup.class, UpdateGroup.class})
83
	private String email;
83
	private String email;
84
        /**
85
         * 办公电话
86
         */
87
        private String officephone;
88
        /**
89
         * 其他联系方式
90
         */
91
        private String otherphone;
84
	/**
85
	 * 办公电话
86
	 */
87
	private String officephone;
88
	/**
89
	 * 其他联系方式
90
	 */
91
	private String otherphone;
92
	/**
92
	/**
93
	 * 负责人id
93
	 * 负责人id
94
	 */
94
	 */

+ 2 - 0
src/main/java/io/renren/modules/admin/service/PaymentService.java

39
     * @return
39
     * @return
40
     */
40
     */
41
    BigDecimal getTotalMoney(Long meetingId, String where);
41
    BigDecimal getTotalMoney(Long meetingId, String where);
42
43
	int updatePayStatus(Long id, Integer status);
42
}
44
}
43
45

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

74
    public BigDecimal getTotalMoney(Long meetingId, String where) {
74
    public BigDecimal getTotalMoney(Long meetingId, String where) {
75
        return baseMapper.getTotalMoney(meetingId, where);
75
        return baseMapper.getTotalMoney(meetingId, where);
76
    }
76
    }
77
78
    @Override
79
    public int updatePayStatus(Long id, Integer status) {
80
       return baseMapper.updatePayStatus(id, status);
81
    }
77
}
82
}

+ 14 - 0
src/main/java/io/renren/modules/app/controller/Meeting.java

2
2
3
import io.renren.common.utils.R;
3
import io.renren.common.utils.R;
4
import io.renren.modules.admin.entity.MeetingEntity;
4
import io.renren.modules.admin.entity.MeetingEntity;
5
import io.renren.modules.admin.entity.MoneyAccountEntity;
5
import io.renren.modules.admin.service.MeetingService;
6
import io.renren.modules.admin.service.MeetingService;
7
import io.renren.modules.admin.service.MoneyAccountService;
6
8
7
import org.springframework.beans.factory.annotation.Autowired;
9
import org.springframework.beans.factory.annotation.Autowired;
8
import org.springframework.web.bind.annotation.GetMapping;
10
import org.springframework.web.bind.annotation.GetMapping;
21
    @Autowired
23
    @Autowired
22
    private MeetingService meetingService;
24
    private MeetingService meetingService;
23
25
26
    @Autowired
27
    private MoneyAccountService moneyAccountService;
28
24
    /**
29
    /**
25
     * 获取会议信息
30
     * 获取会议信息
26
     */
31
     */
31
        return R.ok().put("meeting", meeting);
36
        return R.ok().put("meeting", meeting);
32
    }
37
    }
33
38
39
    /**
40
     * 根据meetingId信息获取对公账号
41
     */
42
    @GetMapping("/accountinfo/{mid}")
43
    public R infoByMid(@PathVariable("mid") Long mid){
44
		MoneyAccountEntity moneyAccount = moneyAccountService.getOneByMeetingId(mid);
45
        
46
        return R.ok().put("moneyAccount", moneyAccount);
47
    }
34
}
48
}

+ 23 - 1
src/main/java/io/renren/modules/app/controller/UserController.java

4
import java.util.List;
4
import java.util.List;
5
import java.util.Map;
5
import java.util.Map;
6
6
7
import org.apache.shiro.crypto.hash.Sha256Hash;
8
import org.apache.commons.lang.StringUtils;
7
import org.springframework.beans.factory.annotation.Autowired;
9
import org.springframework.beans.factory.annotation.Autowired;
8
import org.springframework.web.bind.annotation.GetMapping;
10
import org.springframework.web.bind.annotation.GetMapping;
9
import org.springframework.web.bind.annotation.PostMapping;
11
import org.springframework.web.bind.annotation.PostMapping;
61
    @GetMapping("/orderlist")
63
    @GetMapping("/orderlist")
62
    @ApiOperation("获取订单列表")
64
    @ApiOperation("获取订单列表")
63
    public R orderList(@RequestAttribute("userId") Integer userId){
65
    public R orderList(@RequestAttribute("userId") Integer userId){
64
        System.out.println(userId);
66
        // System.out.println(userId);
65
        Long memberId = Long.valueOf(userId);        
67
        Long memberId = Long.valueOf(userId);        
66
68
67
        List<Map<String, Object>> orderList = userService.queryOrderList(memberId);        
69
        List<Map<String, Object>> orderList = userService.queryOrderList(memberId);        
68
70
69
        return R.ok().put("orderList", orderList);
71
        return R.ok().put("orderList", orderList);
70
    }
72
    }
73
    /**
74
     * 重置密码
75
     */
76
    @Login
77
    @PostMapping("newpassword")
78
    @ApiOperation("重置密码")
79
    public R newpassword(@RequestBody Map<String, Object> params, @LoginUser UserEntity user) {
80
        Long id = user.getUserId();
81
        String password = (String) params.get("password");
82
        String newpassword = (String) params.get("newpassword");
83
        if (StringUtils.isBlank(newpassword)) {
84
            return R.error("新密码不能为空");
85
        }
86
        if(!user.getPassword().equals(new Sha256Hash(password, user.getSalt()).toHex())){
87
			return R.error("原密码不正确");
88
		}
89
90
        userService.updatePassWord(id, newpassword);
91
        return R.ok();
92
    }
71
}
93
}

+ 4 - 0
src/main/java/io/renren/modules/app/dao/UserDao.java

15
import io.renren.modules.app.entity.UserEntity;
15
import io.renren.modules.app.entity.UserEntity;
16
import org.apache.ibatis.annotations.Mapper;
16
import org.apache.ibatis.annotations.Mapper;
17
import org.apache.ibatis.annotations.Select;
17
import org.apache.ibatis.annotations.Select;
18
import org.apache.ibatis.annotations.Update;
18
19
19
/**
20
/**
20
 * 用户
21
 * 用户
28
29
29
    @Select("select a.name as attendersName,a.meeting_id as meetingId,a.position_id as position,(select m.name_cn from meeting as m where m.id=a.meeting_id) as meetingName ,(select m.start_time from meeting as m where m.id=a.meeting_id) as startTime,(select m.end_time from meeting as m where m.id=a.meeting_id) as endTime,(select p.is_pay from payment as p where p.attenders_id = a.id) as isCheck from attenders as a where a.id = #{attendersId};")
30
    @Select("select a.name as attendersName,a.meeting_id as meetingId,a.position_id as position,(select m.name_cn from meeting as m where m.id=a.meeting_id) as meetingName ,(select m.start_time from meeting as m where m.id=a.meeting_id) as startTime,(select m.end_time from meeting as m where m.id=a.meeting_id) as endTime,(select p.is_pay from payment as p where p.attenders_id = a.id) as isCheck from attenders as a where a.id = #{attendersId};")
30
    Map<String, Object> queryOrderInfoByAttendersId(Long attendersId);
31
    Map<String, Object> queryOrderInfoByAttendersId(Long attendersId);
32
33
    @Update("UPDATE member SET `password`=#{password}, `salt`=#{salt} WHERE `id`=#{id}")
34
    int updatePassWord(Long id, String password, String salt);
31
}
35
}

+ 8 - 0
src/main/java/io/renren/modules/app/service/UserService.java

47
	 * 
47
	 * 
48
	 */
48
	 */
49
	Map<String, Object> queryOrderInfoByAttendersId(Long attendersId);
49
	Map<String, Object> queryOrderInfoByAttendersId(Long attendersId);
50
51
	/**
52
	 * 重置密码
53
	 * @param id
54
	 * @param password
55
	 * @param repassword
56
	 */
57
	int updatePassWord(Long id, String password);
50
}
58
}

+ 9 - 1
src/main/java/io/renren/modules/app/service/impl/UserServiceImpl.java

42
		//密码错误
42
		//密码错误
43
		// if(!user.getPassword().equals(DigestUtils.sha256Hex(form.getPassword()))){
43
		// if(!user.getPassword().equals(DigestUtils.sha256Hex(form.getPassword()))){
44
		if(!user.getPassword().equals(new Sha256Hash(form.getPassword(), user.getSalt()).toHex())){
44
		if(!user.getPassword().equals(new Sha256Hash(form.getPassword(), user.getSalt()).toHex())){
45
			throw new RRException("账号或密码错误1");
45
			throw new RRException("账号或密码错误");
46
		}
46
		}
47
47
48
		return user.getUserId();
48
		return user.getUserId();
68
	public Map<String, Object> queryOrderInfoByAttendersId(Long attendersId) {
68
	public Map<String, Object> queryOrderInfoByAttendersId(Long attendersId) {
69
		return baseMapper.queryOrderInfoByAttendersId(attendersId);
69
		return baseMapper.queryOrderInfoByAttendersId(attendersId);
70
	}
70
	}
71
72
	@Override
73
	public int updatePassWord(Long id, String password) {
74
		String salt = RandomStringUtils.randomAlphanumeric(20);
75
		password = new Sha256Hash(password, salt).toHex();
76
77
		return baseMapper.updatePassWord(id, password, salt);
78
	}
71
}
79
}