基于javaweb的SSM+Maven旅游景点管理系统旅游资源(java+ssm+elementui+vue+mysql)

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8、Node.js≥14

开发工具

后端:eclipse/idea/myeclipse/sts等均可配置运行
前端:WebStorm/VSCode/HBuilderX等均可

❗没学过node.js的不要搞前后端分离项目

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

261424000701

271424000701

281424000701

291424000701

311424000701

321424000701

基于javaweb的SSM+Maven旅游景点管理系统旅游资源(java+ssm+elementui+vue+mysql)

1
2
3
4
5
6
7
8
9
10
管理员
admin 123456

用户
用户1 123456
用户2 123456
用户3 123456
用户4 123456
用户5 123456
用户6 123456

旅游资源网站的主要使用者分为管理员和用户,实现功能包括:

管理员:首页、个人中心、用户管理、景点信息管理、购票信息管理、酒店信息管理、客房类型管理、客房信息管理、客房预订管理、交流论坛、系统管理

用户:首页、个人中心、购票信息管理、客房预订管理、我的收藏管理,前台首页;首页、景点信息、酒店信息、客房信息、交流论坛、红色文化、个人中心、后台管理、客服咨询

由于本程序规模不大,可供课程设计,毕业设计学习演示之用

后端:SSM(Spring+SpringMVC+Mybatis)
前端:ElementUI+Vue

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
       return R.ok();
}

/**
* 提醒接口
*/
@RequestMapping("/remind/{columnName}/{type}")
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type,@RequestParam Map<String, Object> map) {
map.put("column", columnName);
map.put("type", type);

if(type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
Date remindEndDate = null;
if(map.get("remindstart")!=null) {
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindStart);
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate));
}
if(map.get("remindend")!=null) {
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}

Wrapper<JingdianxinxiEntity> wrapper = new EntityWrapper<JingdianxinxiEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
   public R save(@RequestBody JiudianxinxiEntity jiudianxinxi, HttpServletRequest request){
jiudianxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(jiudianxinxi);

jiudianxinxiService.insert(jiudianxinxi);
return R.ok();
}

/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody JiudianxinxiEntity jiudianxinxi, HttpServletRequest request){
jiudianxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(jiudianxinxi);

jiudianxinxiService.insert(jiudianxinxi);
return R.ok();
}

/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody JiudianxinxiEntity jiudianxinxi, HttpServletRequest request){
//ValidatorUtils.validateEntity(jiudianxinxi);
jiudianxinxiService.updateById(jiudianxinxi);//全部更新
return R.ok();
}


/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
jiudianxinxiService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}

/**
* 提醒接口
*/
@RequestMapping("/remind/{columnName}/{type}")
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type,@RequestParam Map<String, Object> map) {
map.put("column", columnName);
map.put("type", type);

if(type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
Date remindEndDate = null;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
   public R save(@RequestBody ForumEntity forum, HttpServletRequest request){
forum.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(forum);
forum.setUserid((Long)request.getSession().getAttribute("userId"));

forumService.insert(forum);
return R.ok();
}

/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody ForumEntity forum, HttpServletRequest request){
forum.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(forum);
forum.setUserid((Long)request.getSession().getAttribute("userId"));

forumService.insert(forum);
return R.ok();
}

/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody ForumEntity forum, HttpServletRequest request){
//ValidatorUtils.validateEntity(forum);
forumService.updateById(forum);//全部更新
return R.ok();
}


/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
forumService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}

/**
* 提醒接口
*/
@RequestMapping("/remind/{columnName}/{type}")
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type,@RequestParam Map<String, Object> map) {
map.put("column", columnName);
map.put("type", type);
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
		}

Wrapper<KefangyudingEntity> wrapper = new EntityWrapper<KefangyudingEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}

String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("yonghu")) {
wrapper.eq("yonghuming", (String)request.getSession().getAttribute("username"));
}

int count = kefangyudingService.selectCount(wrapper);
return R.ok().put("count", count);
}



}


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
@Component
public class AuthorizationInterceptor implements HandlerInterceptor {

public static final String LOGIN_TOKEN_KEY = "Token";

@Autowired
private TokenService tokenService;

@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {

//支持跨域请求
response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE");
response.setHeader("Access-Control-Max-Age", "3600");
response.setHeader("Access-Control-Allow-Credentials", "true");
response.setHeader("Access-Control-Allow-Headers", "x-requested-with,request-source,Token, Origin,imgType, Content-Type, cache-control,postman-token,Cookie, Accept,authorization");
response.setHeader("Access-Control-Allow-Origin", request.getHeader("Origin"));

IgnoreAuth annotation;
if (handler instanceof HandlerMethod) {
annotation = ((HandlerMethod) handler).getMethodAnnotation(IgnoreAuth.class);
} else {
return true;
}

//从header中获取token
String token = request.getHeader(LOGIN_TOKEN_KEY);

/**
* 不需要验证权限的方法直接放过
*/
if(annotation!=null) {
return true;
}

TokenEntity tokenEntity = null;
if(StringUtils.isNotBlank(token)) {
tokenEntity = tokenService.getTokenEntity(token);
}

if(tokenEntity != null) {
request.getSession().setAttribute("userId", tokenEntity.getUserid());
request.getSession().setAttribute("role", tokenEntity.getRole());
request.getSession().setAttribute("tableName", tokenEntity.getTablename());
request.getSession().setAttribute("username", tokenEntity.getUsername());
return true;
}

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
   */
@RequestMapping("/query")
public R query(KefangleixingEntity kefangleixing){
EntityWrapper< KefangleixingEntity> ew = new EntityWrapper< KefangleixingEntity>();
ew.allEq(MPUtil.allEQMapPre( kefangleixing, "kefangleixing"));
KefangleixingView kefangleixingView = kefangleixingService.selectView(ew);
return R.ok("查询客房类型成功").put("data", kefangleixingView);
}

/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
KefangleixingEntity kefangleixing = kefangleixingService.selectById(id);
return R.ok().put("data", kefangleixing);
}

/**
* 前端详情
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
KefangleixingEntity kefangleixing = kefangleixingService.selectById(id);
return R.ok().put("data", kefangleixing);
}




/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody KefangleixingEntity kefangleixing, HttpServletRequest request){
kefangleixing.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(kefangleixing);

kefangleixingService.insert(kefangleixing);
return R.ok();
}

/**


项目链接:
https://javayms.github.io?id=401524180701201it
https://javayms.pages.dev?id=401524180701201it