纯净、安全、绿色的下载网站

首页|软件分类|下载排行|最新软件|IT学院

当前位置:首页IT学院IT技术

Java SSM健康管理小程序 基于Java SSM的健康管理小程序的实现

我是springmeng   2021-11-18 我要评论
想了解基于Java SSM的健康管理小程序的实现的相关内容吗,我是springmeng在本文为您仔细讲解Java SSM健康管理小程序的相关知识和一些Code实例,欢迎阅读和指正,我们先划重点:Java,健康管理小程序,Java,SSM健康管理小程序,下面大家一起来学习吧。

一、系统的简介

开发语言:Java

框架:ssm

JDK版本:JDK1.8

服务器:tomcat7

数据库:mysql 5.7(一定要5.7版本)

数据库工具:Navicat11

开发软件:eclipse/myeclipse/idea

Maven包:Maven3.3.9

浏览器:谷歌浏览器

二、系统实现的主要功能

(1)用户管理。主要实现了健康管理小程序的用户管理功能。

(2)登录注册。小程序端可以登录注册。

(3)健康目标。完成健康目标的设定

(4)商城。在线购买健康相关的商品。

(5)个人信息查看。查看各种信息。

(6)后台管理。管理小程序端的各种信息。

三、系统的界面演示

 

 

 

 

 

 

 

 

四、核心代码展示

@RestController
@RequestMapping("/address")
public class AddressController {
    @Autowired
    private AddressService addressService;
    /**
     * 后端列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,AddressEntity address, 
  HttpServletRequest request){
     if(!request.getSession().getAttribute("role").toString().equals("管理员")) {
      address.setUserid((Long)request.getSession().getAttribute("userId"));
     }
 
        EntityWrapper<AddressEntity> ew = new EntityWrapper<AddressEntity>();
  PageUtils page = addressService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, address), params), params));
        return R.ok().put("data", page);
    }
    
    /**
     * 前端列表
     */
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params,AddressEntity address, HttpServletRequest request){
     if(!request.getSession().getAttribute("role").toString().equals("管理员")) {
      address.setUserid((Long)request.getSession().getAttribute("userId"));
     }
 
        EntityWrapper<AddressEntity> ew = new EntityWrapper<AddressEntity>();
  PageUtils page = addressService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, address), params), params));
        return R.ok().put("data", page);
    }
 
 /**
     * 列表
     */
    @RequestMapping("/lists")
    public R list( AddressEntity address){
        EntityWrapper<AddressEntity> ew = new EntityWrapper<AddressEntity>();
       ew.allEq(MPUtil.allEQMapPre( address, "address")); 
        return R.ok().put("data", addressService.selectListView(ew));
    }
 
  /**
     * 查询
     */
    @RequestMapping("/query")
    public R query(AddressEntity address){
        EntityWrapper< AddressEntity> ew = new EntityWrapper< AddressEntity>();
   ew.allEq(MPUtil.allEQMapPre( address, "address")); 
  AddressView addressView =  addressService.selectView(ew);
  return R.ok("查询地址成功").put("data", addressView);
    }
 
    /**
     * 后端详情
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        AddressEntity address = addressService.selectById(id);
        return R.ok().put("data", address);
    }
 
    /**
     * 前端详情
     */
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id){
        AddressEntity address = addressService.selectById(id);
        return R.ok().put("data", address);
    }
    
    /**
     * 后端保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody AddressEntity address, HttpServletRequest request){
     address.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
     //ValidatorUtils.validateEntity(address);
     address.setUserid((Long)request.getSession().getAttribute("userId"));
  Long userId = (Long)request.getSession().getAttribute("userId");
     if(address.getIsdefault().equals("是")) {
      addressService.updateForSet("isdefault='否'", new EntityWrapper<AddressEntity>().eq("userid", userId));
     }
     address.setUserid(userId);
 
        addressService.insert(address);
        return R.ok();
    }
    
    /**
     * 前端保存
     */
    @RequestMapping("/add")
    public R add(@RequestBody AddressEntity address, HttpServletRequest request){
     address.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
     //ValidatorUtils.validateEntity(address);
     address.setUserid((Long)request.getSession().getAttribute("userId"));
  Long userId = (Long)request.getSession().getAttribute("userId");
     if(address.getIsdefault().equals("是")) {
      addressService.updateForSet("isdefault='否'", new EntityWrapper<AddressEntity>().eq("userid", userId));
     }
     address.setUserid(userId);
 
        addressService.insert(address);
        return R.ok();
    }
 
    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody AddressEntity address, HttpServletRequest request){
        //ValidatorUtils.validateEntity(address);
        if(address.getIsdefault().equals("是")) {
      addressService.updateForSet("isdefault='否'", new EntityWrapper<AddressEntity>().eq("userid", request.getSession().getAttribute("userId")));
     }
        addressService.updateById(address);//全部更新
        return R.ok();
    }
    
    /**
     * 获取默认地址
     */
    @RequestMapping("/default")
    public R defaultAddress(HttpServletRequest request){
     Wrapper<AddressEntity> wrapper = new EntityWrapper<AddressEntity>().eq("isdefault", "是").eq("userid", request.getSession().getAttribute("userId"));
        AddressEntity address = addressService.selectOne(wrapper);
        return R.ok().put("data", address);
    }
 
    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        addressService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }
/**
 * 登录相关
 */
@RequestMapping("config")
@RestController
public class ConfigController{
 
 @Autowired
 private ConfigService configService;
 
 /**
     * 列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,ConfigEntity config){
        EntityWrapper<ConfigEntity> ew = new EntityWrapper<ConfigEntity>();
     PageUtils page = configService.queryPage(params);
        return R.ok().put("data", page);
    }
    
 /**
     * 列表
     */
    @IgnoreAuth
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params,ConfigEntity config){
        EntityWrapper<ConfigEntity> ew = new EntityWrapper<ConfigEntity>();
     PageUtils page = configService.queryPage(params);
        return R.ok().put("data", page);
    }
 
    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") String id){
        ConfigEntity config = configService.selectById(id);
        return R.ok().put("data", config);
    }
    
    /**
     * 详情
     */
    @IgnoreAuth
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") String id){
        ConfigEntity config = configService.selectById(id);
        return R.ok().put("data", config);
    }
    
    /**
     * 根据name获取信息
     */
    @RequestMapping("/info")
    public R infoByName(@RequestParam String name){
        ConfigEntity config = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));
        return R.ok().put("data", config);
    }
    
    /**
     * 保存
     */
    @PostMapping("/save")
    public R save(@RequestBody ConfigEntity config){
//     ValidatorUtils.validateEntity(config);
     configService.insert(config);
        return R.ok();
    }
 
    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody ConfigEntity config){
//        ValidatorUtils.validateEntity(config);
        configService.updateById(config);//全部更新
        return R.ok();
    }
 
    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
     configService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }
}
@RestController
@RequestMapping("/orders")
public class OrdersController {
    @Autowired
    private OrdersService ordersService;
 
    /**
     * 后端列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,OrdersEntity orders, 
  HttpServletRequest request){
     if(!request.getSession().getAttribute("role").toString().equals("管理员")) {
      orders.setUserid((Long)request.getSession().getAttribute("userId"));
     }
 
        EntityWrapper<OrdersEntity> ew = new EntityWrapper<OrdersEntity>();
  PageUtils page = ordersService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, orders), params), params));
        return R.ok().put("data", page);
    }
    
    /**
     * 前端列表
     */
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params,OrdersEntity orders, HttpServletRequest request){
        EntityWrapper<OrdersEntity> ew = new EntityWrapper<OrdersEntity>();
  PageUtils page = ordersService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, orders), params), params));
        return R.ok().put("data", page);
    }
 
 /**
     * 列表
     */
    @RequestMapping("/lists")
    public R list( OrdersEntity orders){
        EntityWrapper<OrdersEntity> ew = new EntityWrapper<OrdersEntity>();
       ew.allEq(MPUtil.allEQMapPre( orders, "orders")); 
        return R.ok().put("data", ordersService.selectListView(ew));
    }
 
  /**
     * 查询
     */
    @RequestMapping("/query")
    public R query(OrdersEntity orders){
        EntityWrapper< OrdersEntity> ew = new EntityWrapper< OrdersEntity>();
   ew.allEq(MPUtil.allEQMapPre( orders, "orders")); 
  OrdersView ordersView =  ordersService.selectView(ew);
  return R.ok("查询订单成功").put("data", ordersView);
    }
 
    /**
     * 后端详情
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        OrdersEntity orders = ordersService.selectById(id);
        return R.ok().put("data", orders);
    }
 
    /**
     * 前端详情
     */
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id){
        OrdersEntity orders = ordersService.selectById(id);
        return R.ok().put("data", orders);
    }
   
    /**
     * 后端保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody OrdersEntity orders, HttpServletRequest request){
     orders.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
     //ValidatorUtils.validateEntity(orders);
     orders.setUserid((Long)request.getSession().getAttribute("userId"));
 
        ordersService.insert(orders);
        return R.ok();
    }
    

相关文章

猜您喜欢

  • C# Bitmap图像处理 C# Bitmap图像处理(含增强对比度的三种方法)

    想了解C# Bitmap图像处理(含增强对比度的三种方法)的相关内容吗,莫干在本文为您仔细讲解C# Bitmap图像处理的相关知识和一些Code实例,欢迎阅读和指正,我们先划重点:C#,Bitmap图像处理,C#,图像处理,下面大家一起来学习吧。..
  • C++入门之内存处理 C++入门之内存处理详解

    想了解C++入门之内存处理详解的相关内容吗,捕获一只小肚皮在本文为您仔细讲解C++入门之内存处理的相关知识和一些Code实例,欢迎阅读和指正,我们先划重点:C++入门,C++内存处理,下面大家一起来学习吧。..

网友评论

Copyright 2020 www.moon-script.com 【月光下载】 版权所有 软件发布

声明:所有软件和文章来自软件开发商或者作者 如有异议 请与本站联系 点此查看联系方式