欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

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

 更新時間:2021年11月18日 16:42:58   作者:我是springmeng  
本篇文章主要為大家分享了基于SSM健康管理小程序的設(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)實現(xiàn)的主要功能

(1)用戶管理。主要實現(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的健康管理小程序的實現(xiàn)的詳細(xì)內(nèi)容,更多關(guān)于Java 的資料請關(guān)注腳本之家其它相關(guān)文章!

相關(guān)文章

  • SpringBoot加載啟動的源碼解析

    SpringBoot加載啟動的源碼解析

    這篇文章主要介紹了SpringBoot加載啟動的源碼解析,@SpringBootApplication注解是Spring Boot的核心注解,它其實是一個組合注解,本身其實也是一個IoC容器的配置類,需要的朋友可以參考下
    2023-12-12
  • java LRU(Least Recently Used )詳解及實例代碼

    java LRU(Least Recently Used )詳解及實例代碼

    這篇文章主要介紹了java LRU(Least Recently Used )詳解及實例代碼的相關(guān)資料,Java里面實現(xiàn)LRU緩存通常有兩種選擇,一種是使用LinkedHashMap,一種是自己設(shè)計數(shù)據(jù)結(jié)構(gòu),使用鏈表+HashMap,需要的朋友可以參考下
    2016-11-11
  • Springboot實現(xiàn)動態(tài)定時任務(wù)流程詳解

    Springboot實現(xiàn)動態(tài)定時任務(wù)流程詳解

    通過重寫SchedulingConfigurer方法實現(xiàn)對定時任務(wù)的操作,單次執(zhí)行、停止、啟動三個主要的基本功能,動態(tài)的從數(shù)據(jù)庫中獲取配置的定時任務(wù)cron信息,通過反射的方式靈活定位到具體的類與方法中
    2022-09-09
  • Spring動態(tài)多數(shù)據(jù)源配置實例Demo

    Spring動態(tài)多數(shù)據(jù)源配置實例Demo

    本篇文章主要介紹了Spring動態(tài)多數(shù)據(jù)源配置實例Demo,具有一定的參考價值,有興趣的可以了解一下。
    2017-01-01
  • Java實現(xiàn)簡單的掃雷小程序

    Java實現(xiàn)簡單的掃雷小程序

    這篇文章主要為大家詳細(xì)介紹了Java實現(xiàn)簡單的掃雷小程序,文中示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2020-04-04
  • Java對Excel表格的上傳和下載處理方法

    Java對Excel表格的上傳和下載處理方法

    這篇文章主要介紹了Java對Excel表格的上傳和下載處理方法,需要的朋友可以參考下
    2017-08-08
  • 詳解JAVA 強引用

    詳解JAVA 強引用

    這篇文章主要介紹了JAVA 強引用的相關(guān)資料,幫助大家更好的理解和學(xué)習(xí),感興趣的朋友可以了解下
    2020-08-08
  • Mybatis新手教程之簡單入門

    Mybatis新手教程之簡單入門

    這篇文章主要給大家介紹了關(guān)于Mybatis新手教程之簡單入門的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面來一起學(xué)習(xí)學(xué)習(xí)吧
    2019-02-02
  • 教你Spring如何使用三級緩存解決循環(huán)依賴

    教你Spring如何使用三級緩存解決循環(huán)依賴

    這篇文章主要介紹了Spring使用三級緩存解決循環(huán)依賴的過程,本文給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考下
    2022-03-03
  • SpringBoot中使用SpringSecurity進行權(quán)限控制的示例代碼

    SpringBoot中使用SpringSecurity進行權(quán)限控制的示例代碼

    本文將詳細(xì)介紹如何在Spring Boot應(yīng)用程序中使用Spring Security進行權(quán)限控制,我們將探討Spring Security的基本概念,以及如何使用Spring Security實現(xiàn)認(rèn)證和授權(quán),需要的朋友可以參考下
    2024-02-02

最新評論