当前位置:网站首页>Project practice - smart health

Project practice - smart health

2022-07-23 05:42:00 Hash..

Smart health project

2022.3.2-2022.3.16 --BDY


Project introduction and technical framework

 Please add a picture description

Chuanzhi health management system is a business system applied to health management institutions , Realize the visualization of the work content of the health management organization 、 Member management specialization 、 Digital health assessment 、 Health intervention process 、 Knowledge base integration , So as to improve the work efficiency of health managers , Strengthen interaction with members , Enhance managers' understanding of the operation of health management institutions .

 Please add a picture description

Main back-end technology stack :

Spring,SpringMVC,Mybatis (SSM frame ) zookeeper,dubbo,SpringSecrity
( Distribution and permissions ) Git,Apache POI,Echarts ( Version control and report )
Tencent cloud SMS service , Qiniu cloud storage service , Wechat development platform ( Third party service )


One 、 Project process

1. Background management system preparation

Booking Management

 Insert picture description here


  1. CheckItem

 Insert picture description here


  1. CheckGroup

 Insert picture description here


  1. SetMeal

 Insert picture description here
Package management is not complete , Edit and delete methods are not written


  1. OrderSetting

 Insert picture description here


Main learning content :

1. Mainly about CRUD operation , And basic SSM Project preparation
2. Learning with paging query
3. About calendar controls and EXCEL File upload download
4. Upload pictures about qiniu cloud service


2. Preparation of wechat reservation system

  1. Setmeal Show all and details

 Insert picture description here

 Insert picture description here


  1. Login And verification code

 Insert picture description here
 Insert picture description here


Main learning content :

1.CRUD And Tencent cloud SMS service
2. Login and SMS authentication services
3. Wechat development platform operation
4. Page static technology


3. Graphic display and permission control

 Insert picture description here


  1. Report_setmeal

 Insert picture description here


  1. Report_member

 Insert picture description here


  1. Report_business

 Insert picture description here


4.Security

validate logon , To give permission
 Insert picture description here
In the background code xiaoming No permission to delete check items
 Insert picture description here Permission management is just a preliminary study , Simply use it in the system to understand the process


Main learning content :

1.Echarts Query and upload data about graphic reports
2. About Spring Security Learning to use


4. Database design

 Insert picture description here

## Table Association and description are not displayed


5. General framework and configuration of the project

1. health_

1. General framework

  • health_parent

Parent , Unified management
 Insert picture description here

  • health_backend

Background system
 Insert picture description here
 Insert picture description here
 Insert picture description here

  • health_common Store tools and entity classes
     Insert picture description here
  • health_interface

Service interface
 Insert picture description here

  • health_jobs

About timing components
 Insert picture description here

  • health_M

Wechat end
 Insert picture description here

health_servide_provider Deposit dubbo Medium service service
 Insert picture description here
 Insert picture description here

2. project pom rely on

The main pom Depending on common,interface Depend on commom, The rest depends on interface,parent Realization pom Document version control .

3. To configure

Primary profile
1.log4j.properties: Log files
2.springmvc.xml: About SpringMVC To configure , Annotation driven , Package scanning
3.spring-redis.xml:redis cache ,jedis Connection pool
4.spring-security.xml:SpringSecurity Access control
5.web.xml:web Container configuration , Interact with the front end
6.redis.properties:redis A launch configuration
7.freemarker.properties: Web page static technology
8.spring-service.xml: Service registration , Package scanning
9.spring-dao.xml:mybatis Use JDBC To configure
10.spring-tx.xml: Used to enable transaction support


Two 、 Project code harvest

1. Interact with the front page (springmvc)

 Insert picture description here
 Insert picture description here

The project is mainly through ajax Request to visit , commonly get A request is a request for data , Put the data to be transferred to the background in url in , Data is generally the basic type ,post The request is usually to transmit data to the background , The data is mainly placed in the form or request body . By observing the front page, you can know how the background needs to operate
Controller layer , adopt @RequestMapping To map requests , adopt @RequestBody To get the returned json Data and encapsulation , Or by @RequestParam To get general data , And then through @Reference( call dubbo) call service Layer to get services .
In the returned data , Generally, in entity classes entity Add the return entity class Result, Then return Result object .

2. Service layer (spring)

Project Controller Layer by calling dubbo Services to access service layer , stay service Business code is mainly written in the layer , And then call Dao Layer access database , Get data
Main notes @Service(interfaceClass = OrderService.class),@Transactional

3. Data access layer (mybatis)

mybatis in Dao After the interface is called, it will pass dao.xml Medium sql Statement to query the database . Main design CRUD Associated query with multiple tables and condition query
//mapper A dynamic proxy

4. Other entity classes and operations

When writing entity classes, you need to pay attention to the tables in the corresponding database , And paging queries PageQuery, Return results Result The entity class
@PreAuthorize(“hasAuthority(‘CHECKITEM_DELETE’)”)// Permission to check , Permission verification annotation use
How to use paging query , How to use dates


3、 ... and 、 Project questions

1. Initial project discussion

  • // Go to zookepper Service registry to find services , The role of annotations
    @Reference

  • // the reason being that int So no parsing, no requestBody
    public Result delete( Integer id){

  • // because RestController ,java The data goes to json data

  • // Specify which service interface is implemented @Service(interfaceClass = CheckItemService.class)

  • Mysql Version of the problem driverClassName=com.mysql.cj.jdbc.Driver url=jdbc:mysql://localhost:3306/health?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Hongkong"

  • //checkgroupIds The name should be the same as the one worn back from the front
    public Result add(@RequestBody Setmeal setmeal,Integer[] checkgroupIds){

2. About setmeal Medium add The problem with the method

stay setmealService Can call to get id stay Controller Problems that cannot be found in , There is no id, To call Dao
After the new method of id value

3. About ordersetting Date format problem in

// The data in the database here is 2022-03-01;
// The data transmitted is 2022-3-1;
// Yes ordersetting.html Add 0
// No addition 0 It can also be successful ,?mybatis Will judge automatically ?==》 sql sentence SELECT * FROM t_ordersetting WHERE orderDate BETWEEN ‘2022-3-4’ AND ‘2022-3-24’; You can also query successfully
// Note that zero is not required , Add 0 No addition 0 All can succeed

4. About ordersetting in mysql Time zone problem

// there date There will be problems after importing , Because the database time is UTC Eight hours earlier than China , So the time passed by will become the time of the previous day
Time zone details //https://blog.csdn.net/qq631431929/article/details/51731834
// Method , Change time zone hongkong
// One more question ,select error ,insert Able to operate ???

5. About static page display

The static page in the original video will not overwrite the original page after adding new data , You need to delete the original file first , Add static pages .
// Static web pages will not overwrite the original static web pages
// terms of settlement , Delete the original file ,new File(outputPath + “\” + htmlname).delete();

6. About List<map> The problem of

 Insert picture description here

// here list The value of will overwrite the original value ?????
//https://blog.csdn.net/ChaoticNg/article/details/121669316LIst<map>
// stay for Inside the loop Map map = new HashMap(); that will do , Create a new one in the heap at a time map, To prevent from covering .
// because list Pointing to map The address of , So whenever you check list, stay map There is only one data in

7. About array null pointer exception The problem of

 Insert picture description here

// An array null pointer exception occurred , The solution is to check the quantity first and then assign a value

8. About business Report problems

 Insert picture description here
// What you can find in the database here is the data from the first day to all days after , Not the data from the first day of this month to this day , There is a problem
// modify , In the database query statement, the limit is less than this day


Four 、 summary

This project lasts a total of 16 God , Generally speaking, the efficiency is very low , Normally, it should be within ten days . This project is mainly based on SSM Of CRUD, To study the SpringSecurity and Redis Cache issues , Reviewed a lot of things , I also learned the development process and development specifications of the whole project .
Including Tencent cloud , Qiniuyun , Development of wechat end , It also makes simple use of zookeeper and dubbo Building distributed systems , Also learned paging Inquire about , Calendar operation , Report and graphic operations .
The project was successfully uploaded to gitee url:https://gitee.com/bian-deyong/project-practice.git

原网站

版权声明
本文为[Hash..]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/204/202207221755086136.html