基于javaweb的SpringBoot个人健康管理系统小程序微信小程序(java+springboot+maven+vue+wechat+mysql)

运行环境

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

开发工具

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

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

适用

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

功能说明

002224322204

012224322204

022224322204

032224322204

042224322204

052224322204

062224322204

072224322204

522224312204

532224312204

542224312204

552224312204

562224312204

582224312204

592224312204

基于javaweb的SpringBoot个人健康管理系统小程序微信小程序(java+springboot+maven+vue+wechat+mysql)

推荐使用:谷歌浏览器

后端启动类:StartApplication
前端启动命令:npm run serve

管理员(web端):
admin 123456

用户(小程序端):
a1 123456
a2 123456
a3 123456

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
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永不会进入");
else if("用户".equals(role))
params.put("yonghuId",request.getSession().getAttribute("userId"));
CommonUtil.checkMap(params);
PageUtils page = newsService.queryPage(params);

//字典表数据转换
List<NewsView> list =(List<NewsView>)page.getList();
for(NewsView c:list){
//修改对应字典表字段
dictionaryService.dictionaryConvert(c, request);
}
return R.ok().put("data", page);
}

/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id, HttpServletRequest request){
logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
NewsEntity news = newsService.selectById(id);
if(news !=null){
//entity转view
NewsView view = new NewsView();
BeanUtils.copyProperties( news , view );//把实体数据重构到view中
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}

}
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
    YonghuEntity yonghu = yonghuService.selectById(id);
if(yonghu !=null){
//entity转view
YonghuView view = new YonghuView();
BeanUtils.copyProperties( yonghu , view );//把实体数据重构到view中

//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}


/**
* 退出
*/
@GetMapping(value = "logout")
public R logout(HttpServletRequest request) {
request.getSession().invalidate();
return R.ok("退出成功");
}



/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("list方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));

CommonUtil.checkMap(params);
PageUtils page = yonghuService.queryPage(params);

//字典表数据转换
List<YonghuView> list =(List<YonghuView>)page.getList();
for(YonghuView c:list)
dictionaryService.dictionaryConvert(c, request); //修改对应字典表字段

return R.ok().put("data", page);
}

/**
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
        return R.ok();
}

/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody UsersEntity user){
// ValidatorUtils.validateEntity(user);
usersService.updateById(user);//全部更新
return R.ok();
}

/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
List<UsersEntity> user = usersService.selectList(null);
if(user.size() > 1){
usersService.deleteBatchIds(Arrays.asList(ids));
}else{
return R.error("管理员最少保留一个");
}
return R.ok();
}
}


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
            yundongCollection.setInsertTime(new Date());
yundongCollection.setCreateTime(new Date());
yundongCollectionService.insert(yundongCollection);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}

/**
* 后端修改
*/
@RequestMapping("/update")
public R update(@RequestBody YundongCollectionEntity yundongCollection, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
logger.debug("update方法:,,Controller:{},,yundongCollection:{}",this.getClass().getName(),yundongCollection.toString());
YundongCollectionEntity oldYundongCollectionEntity = yundongCollectionService.selectById(yundongCollection.getId());//查询原先数据

String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
// else if("用户".equals(role))
// yundongCollection.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));

yundongCollectionService.updateById(yundongCollection);//根据id更新
return R.ok();
}



/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids, HttpServletRequest request){
logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
List<YundongCollectionEntity> oldYundongCollectionList =yundongCollectionService.selectBatchIds(Arrays.asList(ids));//要删除的数据
yundongCollectionService.deleteBatchIds(Arrays.asList(ids));

return R.ok();
}


/**
* 批量上传
*/
@RequestMapping("/batchInsert")
public R save( String fileName, HttpServletRequest request){
logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);
Integer yonghuId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")));
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
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
    @RequestMapping("/save")
public R save(@RequestBody GerentizhengEntity gerentizheng, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,gerentizheng:{}",this.getClass().getName(),gerentizheng.toString());

String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永远不会进入");
else if("用户".equals(role))
gerentizheng.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));

if(gerentizheng.getTizhongNum() != null && gerentizheng.getGerentizhengNum() != null){
double v = gerentizheng.getTizhongNum() / (gerentizheng.getGerentizhengNum() * gerentizheng.getGerentizhengNum());
if(v <= 18.4){//消瘦
gerentizheng.setShentiTypes(1);
}else if(v>=18.5 && v<=23.9){
gerentizheng.setShentiTypes(2);
}else if(v>=24 && v<=27.9){
gerentizheng.setShentiTypes(3);
}else{
gerentizheng.setShentiTypes(4);
}
}
gerentizheng.setGerentizhengDelete(1);
gerentizheng.setInsertTime(new Date());
gerentizheng.setCreateTime(new Date());
gerentizhengService.insert(gerentizheng);
return R.ok();
}

/**
* 后端修改
*/
@RequestMapping("/update")
public R update(@RequestBody GerentizhengEntity gerentizheng, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
logger.debug("update方法:,,Controller:{},,gerentizheng:{}",this.getClass().getName(),gerentizheng.toString());
GerentizhengEntity oldGerentizhengEntity = gerentizhengService.selectById(gerentizheng.getId());//查询原先数据

String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
// else if("用户".equals(role))
// gerentizheng.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
if("".equals(gerentizheng.getMeishiPhoto()) || "null".equals(gerentizheng.getMeishiPhoto())){
gerentizheng.setMeishiPhoto(null);
}

gerentizhengService.updateById(gerentizheng);//根据id更新
return R.ok();
}



/**
* 删除


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