Browse Source

前端用户更改酒店信息

huwhois 3 years ago
parent
commit
28bbe8a0a7

+ 2 - 2
pom.xml

@ -77,11 +77,11 @@
77 77
			<artifactId>spring-boot-configuration-processor</artifactId>
78 78
			<optional>true</optional>
79 79
		</dependency>
80
		<!-- <dependency>
80
		<dependency>
81 81
			<groupId>org.springframework.boot</groupId>
82 82
			<artifactId>spring-boot-devtools</artifactId>
83 83
			<optional>true</optional>
84
		</dependency> -->
84
		</dependency>
85 85
		<dependency>
86 86
			<groupId>com.baomidou</groupId>
87 87
			<artifactId>mybatis-plus-boot-starter</artifactId>

+ 39 - 1
src/main/java/io/renren/modules/app/controller/AppAttendersController.java

@ -8,6 +8,8 @@ import io.renren.modules.admin.entity.MemberEntity;
8 8
import io.renren.modules.admin.service.AttendersService;
9 9
import io.renren.modules.admin.service.AttendersviewService;
10 10
import io.renren.modules.admin.service.MemberService;
11
import io.renren.modules.app.annotation.Login;
12
import io.renren.modules.app.form.HotalForm;
11 13
12 14
import java.util.Date;
13 15
@ -15,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired;
15 17
import org.springframework.web.bind.annotation.GetMapping;
16 18
import org.springframework.web.bind.annotation.PathVariable;
17 19
import org.springframework.web.bind.annotation.PostMapping;
20
import org.springframework.web.bind.annotation.RequestAttribute;
18 21
import org.springframework.web.bind.annotation.RequestBody;
19 22
import org.springframework.web.bind.annotation.RequestMapping;
20 23
import org.springframework.web.bind.annotation.RestController;
@ -105,6 +108,41 @@ public class AppAttendersController {
105 108
        return null;
106 109
    }
107 110
108
}
111
    @Login
112
    @GetMapping("/hotal/{mid}")
113
    public R getHotal(@RequestAttribute("userId") Integer userId, @PathVariable("mid") Long mid){
114
        Long uid = userId.longValue();
115
        AttendersEntity attenders = attendersService.getByMMId(uid, mid);
116
        if (attenders == null) {
117
            return R.error("未找到您的报名信息, 请先报名参会.");
118
        }
119
        
120
        HotalForm hotal = new HotalForm();
121
        hotal.setId(attenders.getId());
122
        hotal.setMeetingId(mid);
123
        hotal.setHotelType(attenders.getHotelType());
124
        hotal.setIsShare(attenders.getIsShare());
125
        hotal.setRoomType(attenders.getRoomType());
126
        hotal.setCheckInDate(attenders.getCheckInDate());
127
        hotal.setCheckOutDate(attenders.getCheckOutDate());
128
        
129
        return R.ok().put("hotalInfo", hotal);
130
    }
109 131
132
    @Login
133
    @PostMapping("/hotalsave")
134
    public R saveHotal(@RequestBody HotalForm hotalForm){
135
        AttendersEntity attenders = attendersService.getById(hotalForm.getId());
136
        attenders.setHotelType(hotalForm.getHotelType());
137
        attenders.setIsShare(hotalForm.getIsShare());
138
        attenders.setRoomType(hotalForm.getRoomType());
139
        attenders.setCheckInDate(hotalForm.getCheckInDate());
140
        attenders.setCheckOutDate(hotalForm.getCheckOutDate());
110 141
142
        attendersService.updateById(attenders);
143
144
        return R.ok();
145
    }
146
147
148
}

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

@ -52,7 +52,7 @@ public class AppLoginController {
52 52
        smsCodeService.validate(form.getUuid(), form.getCode(), form.getPhone());
53 53
54 54
        //用户登录
55
        String symbol = MyUtils.md5(form.getTurename() + form.getPhone());
55
        String symbol = MyUtils.md5(form.getTruename() + form.getPhone());
56 56
        UserEntity user =  userService.queryBySymbol(symbol);
57 57
        Assert.isNull(user, "手机号错误");
58 58
        long userId = user.getUserId();

+ 39 - 0
src/main/java/io/renren/modules/app/form/HotalForm.java

@ -0,0 +1,39 @@
1
package io.renren.modules.app.form;
2
3
import lombok.Data;
4
import java.util.Date;
5
6
/**
7
 * 酒店信息表单
8
 */
9
@Data
10
public class HotalForm {
11
    /**
12
     *  会议名单id
13
     */
14
    private Long id;
15
    /**
16
     * 酒店会议id
17
     */
18
    private Long meetingId;
19
    /**
20
     * 酒店 1,会议合作; 2,其他
21
     */
22
    private Integer hotelType;
23
    /**
24
     * 房 型
25
     */
26
    private Integer roomType;
27
    /**
28
     * 房 型
29
     */
30
    private Integer isShare;
31
    /**
32
     * 酒店入住信息
33
     */
34
    private Date checkInDate;
35
    /**
36
     * 酒店离店信息
37
     */
38
    private Date checkOutDate;
39
}

+ 1 - 1
src/main/java/io/renren/modules/app/form/LoginForm.java

@ -29,7 +29,7 @@ public class LoginForm {
29 29
    @NotBlank(message="手机号不能为空")
30 30
    private String phone;
31 31
    @NotBlank(message="姓名不能为空")
32
    private String turename;
32
    private String truename;
33 33
    @NotBlank(message="短信验证码不能为空")
34 34
    private String code;
35 35
    private String uuid;

+ 3 - 3
src/main/java/io/renren/modules/app/service/impl/SmsCodeServiceImpl.java

@ -46,9 +46,9 @@ public class SmsCodeServiceImpl extends ServiceImpl<SmsCodeDao, SmsCodeEntity> i
46 46
47 47
    @Override
48 48
    public void validate(String uuid, String code, String phone)  throws RRException{
49
        SmsCodeEntity smsCodeEntity = this.getOne(new QueryWrapper<SmsCodeEntity>().eq("uuid", uuid));
49
        SmsCodeEntity smsCodeEntity = this.getById(uuid);
50 50
        if (smsCodeEntity == null) {
51
            throw new RRException("验证码不正确");
51
            throw new RRException("验证码不正确1");
52 52
        }
53 53
54 54
        if (smsCodeEntity.getCode().equalsIgnoreCase(code) && smsCodeEntity.getPhone().equalsIgnoreCase(phone)
@ -56,7 +56,7 @@ public class SmsCodeServiceImpl extends ServiceImpl<SmsCodeDao, SmsCodeEntity> i
56 56
            // 删除验证码
57 57
            this.removeById(uuid);
58 58
        } else {
59
            throw new RRException("验证码不正确");
59
            throw new RRException("验证码不正确2");
60 60
        }
61 61
    }
62 62
}