最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

基于Java SSM的健康管理小程序的實(shí)現(xiàn)

 更新時間:2021年11月18日 16:42:58   作者:我是springmeng  
本篇文章主要為大家分享了基于SSM健康管理小程序的設(shè)計(jì)與實(shí)現(xiàn)。感興趣的小伙伴可以了解一下

一、系統(tǒng)的簡介

開發(fā)語言:Java

框架:ssm

JDK版本:JDK1.8

服務(wù)器:tomcat7

數(shù)據(jù)庫:mysql 5.7(一定要5.7版本)

數(shù)據(jù)庫工具:Navicat11

開發(fā)軟件:eclipse/myeclipse/idea

Maven包:Maven3.3.9

瀏覽器:谷歌瀏覽器

二、系統(tǒng)實(shí)現(xiàn)的主要功能

(1)用戶管理。主要實(shí)現(xiàn)了健康管理小程序的用戶管理功能。

(2)登錄注冊。小程序端可以登錄注冊。

(3)健康目標(biāo)。完成健康目標(biāo)的設(shè)定

(4)商城。在線購買健康相關(guān)的商品。

(5)個人信息查看。查看各種信息。

(6)后臺管理。管理小程序端的各種信息。

三、系統(tǒng)的界面演示

 

 

 

 

 

 

 

 

四、核心代碼展示

@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();
    }
    
    /**
     * 獲取默認(rèn)地址
     */
    @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();
    }
/**
 * 登錄相關(guān)
 */
@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);
    }
    
    /**
     * 根據(jù)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();
    }
    

以上就是基于Java SSM的健康管理小程序的實(shí)現(xiàn)的詳細(xì)內(nèi)容,更多關(guān)于Java 的資料請關(guān)注腳本之家其它相關(guān)文章!

相關(guān)文章

  • Spring中的SpringApplicationRunListener詳細(xì)解析

    Spring中的SpringApplicationRunListener詳細(xì)解析

    這篇文章主要介紹了Spring中的SpringApplicationRunListener詳細(xì)解析,SpringApplicationRunListener是一個監(jiān)聽SpringApplication中run方法的接口,在項(xiàng)目啟動過程的各個階段進(jìn)行事件的發(fā)布,需要的朋友可以參考下
    2023-11-11
  • SpringBoot配置連接兩個或多個數(shù)據(jù)庫的常用方法

    SpringBoot配置連接兩個或多個數(shù)據(jù)庫的常用方法

    在Spring Boot應(yīng)用中連接多個數(shù)據(jù)庫或數(shù)據(jù)源可以使用多種方式,本文講給大家介紹兩種常用的方法:使用Spring Boot官方支持的多數(shù)據(jù)源配置和使用第三方庫實(shí)現(xiàn)多數(shù)據(jù)源,文章通過代碼介紹的非常詳細(xì),需要的朋友可以參考下
    2023-08-08
  • Spring?Boot中的max-http-header-size配置方式

    Spring?Boot中的max-http-header-size配置方式

    這篇文章主要介紹了Spring?Boot中的max-http-header-size配置方式,具有很好的參考價(jià)值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教
    2022-09-09
  • 單點(diǎn)登錄的三種方式和JWT的介紹與使用

    單點(diǎn)登錄的三種方式和JWT的介紹與使用

    這篇文章主要說明了單點(diǎn)登錄的三種方式和JWT的介紹與使用,加深自己的印象以及幫助的諸位小伙伴兒們,需要的朋友可以參考下
    2023-03-03
  • Java使用Collections.sort()排序的方法

    Java使用Collections.sort()排序的方法

    這篇文章介紹了Java使用Collections.sort()排序的方法,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2021-12-12
  • MyBatis中的resultMap簡要概述

    MyBatis中的resultMap簡要概述

    這篇文章主要介紹了MyBatis中的resultMap簡要概述的相關(guān)資料,需要的朋友可以參考下
    2016-07-07
  • Spring?Cloud?Gateway服務(wù)網(wǎng)關(guān)限流問題及解決

    Spring?Cloud?Gateway服務(wù)網(wǎng)關(guān)限流問題及解決

    這篇文章主要介紹了Spring?Cloud?Gateway服務(wù)網(wǎng)關(guān)限流問題及解決,具有很好的參考價(jià)值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教
    2025-04-04
  • 在SpringBoot 中從application.yml中獲取自定義常量方式

    在SpringBoot 中從application.yml中獲取自定義常量方式

    這篇文章主要介紹了在SpringBoot 中從application.yml中獲取自定義常量方式,具有很好的參考價(jià)值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2020-04-04
  • java使用mybatis調(diào)用存儲過程返回一個游標(biāo)結(jié)果集方式

    java使用mybatis調(diào)用存儲過程返回一個游標(biāo)結(jié)果集方式

    這篇文章主要介紹了java使用mybatis調(diào)用存儲過程返回一個游標(biāo)結(jié)果集方式,具有很好的參考價(jià)值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教
    2024-01-01
  • 如何集成swagger2構(gòu)建Restful API

    如何集成swagger2構(gòu)建Restful API

    這篇文章主要介紹了如何集成swagger2構(gòu)建Restful API,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下
    2019-11-11

最新評論

饶河县| 浙江省| 诸暨市| 曲麻莱县| 囊谦县| 科尔| 射洪县| 南康市| 大厂| 佛坪县| 乐山市| 平潭县| 三门峡市| 中山市| 城步| 文昌市| 临潭县| 湖南省| 甘德县| 台州市| 宜州市| 南丰县| 元氏县| 峨眉山市| 崇仁县| 通化县| 兰西县| 新泰市| 云南省| 靖边县| 连平县| 嘉禾县| 和平县| 尚志市| 顺平县| 尼勒克县| 隆化县| 庆城县| 五寨县| 潞西市| 奎屯市|