藥品信息管理系統(tǒng) 課程設(shè)計(jì).doc_第1頁
藥品信息管理系統(tǒng) 課程設(shè)計(jì).doc_第2頁
藥品信息管理系統(tǒng) 課程設(shè)計(jì).doc_第3頁
藥品信息管理系統(tǒng) 課程設(shè)計(jì).doc_第4頁
藥品信息管理系統(tǒng) 課程設(shè)計(jì).doc_第5頁
已閱讀5頁,還剩47頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

精品文檔遼 寧 科 技 大 學(xué)課程設(shè)計(jì)報(bào)告設(shè)計(jì)題目: 藥品信息管理系統(tǒng) 學(xué)院、系: 電信 專業(yè)班級(jí): 計(jì)算機(jī)141班 學(xué)生姓名: 梁君瑋 指導(dǎo)教師: 劉揚(yáng) 王莉 成 績: 2017年 12月 1日目錄1.概述41.1實(shí)驗(yàn)?zāi)繕?biāo)41.2運(yùn)行環(huán)境、工具及框架42需求分析42.1頂層流程42.2中層流程52.3底層流程52.3.1登錄系統(tǒng)52.3.2進(jìn)藥操作62.3.3售藥操作62.3.4庫存管理72.3.5單據(jù)管理72.3.6外鍵:供應(yīng)商管理(擴(kuò)展功能)82.3.7外鍵:客戶管理(擴(kuò)展功能)83概要設(shè)計(jì)93.1 E-R圖94總體設(shè)計(jì)94.1數(shù)據(jù)庫設(shè)計(jì)94.1.1使用PowerDesigner設(shè)計(jì)數(shù)據(jù)庫模型94.1.2生成建表語句104.2系統(tǒng)功能設(shè)計(jì)134.2.1使用Rational Rose設(shè)計(jì)系統(tǒng)用例圖134.2.2系統(tǒng)功能描述135應(yīng)用程序的編程實(shí)現(xiàn)145.1建庫145.2設(shè)計(jì)網(wǎng)頁165.2.1前端目錄結(jié)構(gòu)165.2.2舉例(進(jìn)藥頁):175.3添加配置225.3.1邏輯架構(gòu)225.3.2Hibernate配置事務(wù)及實(shí)體類235.4代碼目錄結(jié)構(gòu)(MVC)245.5編寫后臺(tái)代碼(java)245.5.1實(shí)體類245.5.2數(shù)據(jù)持久層(hibernate)265.5.3服務(wù)層(使用Spring的Service注解)285.5.4控制層(SpringMVC)296測試和運(yùn)行311. 概述1.1實(shí)驗(yàn)?zāi)繕?biāo)為了檢驗(yàn)自己從大一到現(xiàn)在為止的學(xué)習(xí)收獲,運(yùn)用所學(xué)軟件工程課程及數(shù)據(jù)庫課程所學(xué)習(xí)的理論知識(shí)同實(shí)踐相結(jié)合,建立工程化思想,使用面向?qū)ο笳Z言(java)開發(fā)一個(gè)小型MIS系統(tǒng),鍛煉自己解決實(shí)際問題的能力,為畢業(yè)設(shè)計(jì)打下良好的基礎(chǔ)。本次實(shí)驗(yàn)從前端到后臺(tái)、從設(shè)計(jì)分析到實(shí)現(xiàn)并完成都是通過自己的慢慢積累并查閱相關(guān)框架資料(包括使用建模工具)完成,也算是一個(gè)微型的web全棧設(shè)計(jì)了。1.2運(yùn)行環(huán)境、工具及框架本次設(shè)計(jì)的是基于jdk1.8的web項(xiàng)目,使用工具及運(yùn)行環(huán)境如下:編程語言:java、HTML、css、js等后端框架:Spring+SpringMVC+Hibernate前端腳本:jQuery、jstl、el、jsp等日志記錄:log4j、logging設(shè)計(jì)工具:Rational Rose、Microsoft Visio數(shù)據(jù)庫:MySQL5.7數(shù)據(jù)庫工具:PowerDesigner、navicatformysql編譯工具:eclipse、WebStorm服務(wù)器:tomcat測試系統(tǒng)環(huán)境:wind7、wind10、Linux(centOS7)2需求分析使用visio工具建立數(shù)據(jù)流圖(使用三層數(shù)據(jù)流圖):2.1頂層流程2.2中層流程2.3底層流程2.3.1登錄系統(tǒng)2.3.2進(jìn)藥操作2.3.3售藥操作2.3.4庫存管理 2.3.5單據(jù)管理2.3.6外鍵:供應(yīng)商管理(擴(kuò)展功能)2.3.7外鍵:客戶管理(擴(kuò)展功能)3概要設(shè)計(jì)3.1 E-R圖4總體設(shè)計(jì)4.1數(shù)據(jù)庫設(shè)計(jì)4.1.1使用PowerDesigner設(shè)計(jì)數(shù)據(jù)庫模型4.1.2生成建表語句/*=*/* DBMS name: MySQL 5.0 */* Created on: 2017/12/7 20:19:35 */*=*/drop table if exists t_customer;drop table if exists t_enter;drop table if exists t_inventory;drop table if exists t_manufacturers;drop table if exists t_sell;drop table if exists t_supplier;drop table if exists t_user;/*=*/* Table: t_customer */*=*/create table t_customer( c_id varchar(255) not null, c_name varchar(255), c_address varchar(255), c_postal varchar(255), c_phone varchar(255), c_poxy varchar(255), primary key (c_id);/*=*/* Table: t_enter */*=*/create table t_enter( document_number varchar(255) not null, medicine_id varchar(255), procurement_price double(10,2), procurement_number int(10), procurement_date varchar(255), specification varchar(255), m_id varchar(255), s_id varchar(255), primary key (document_number);/*=*/* Table: t_inventory */*=*/create table t_inventory( medicine_id varchar(255) not null, medicine_name varchar(255), inventory_number int(10), specification varchar(255), retail_price double(10,2), m_id varchar(255), primary key (medicine_id);/*=*/* Table: t_manufacturers */*=*/create table t_manufacturers( m_id varchar(255) not null, m_name varchar(255) not null, m_address varchar(255), m_postal varchar(255), m_phone varchar(255), m_fax varchar(255), primary key (m_id);/*=*/* Table: t_sell */*=*/create table t_sell( document_number int(10) not null, medicine_id varchar(255), c_id varchar(255), sell_number int(10), sell_date date, unit_price double(10,2), primary key (document_number);/*=*/* Table: t_supplier */*=*/create table t_supplier( s_id varchar(255) not null, s_name varchar(255) not null, s_address varchar(255), s_postal varchar(255), s_fax varchar(255), s_phone varchar(255), primary key (s_id);/*=*/* Table: t_user */*=*/create table t_user( login_id varchar(255) not null, password varchar(255) not null, username varchar(255), primary key (login_id);alter table t_enter add constraint FK_Reference_1 foreign key (medicine_id) references t_inventory (medicine_id) on delete restrict on update restrict;alter table t_enter add constraint FK_Reference_3 foreign key (m_id) references t_manufacturers (m_id) on delete restrict on update restrict;alter table t_enter add constraint FK_Reference_4 foreign key (s_id) references t_supplier (s_id) on delete restrict on update restrict;alter table t_inventory add constraint FK_Reference_5 foreign key (m_id) references t_manufacturers (m_id) on delete restrict on update restrict;alter table t_sell add constraint FK_Reference_2 foreign key (medicine_id) references t_inventory (medicine_id) on delete restrict on update restrict;alter table t_sell add constraint FK_Reference_7 foreign key (c_id) references t_customer (c_id) on delete restrict on update restrict;4.2系統(tǒng)功能設(shè)計(jì)4.2.1使用Rational Rose設(shè)計(jì)系統(tǒng)用例圖4.2.2系統(tǒng)功能描述實(shí)現(xiàn)基本功能:藥品數(shù)據(jù)庫進(jìn)藥表(單據(jù)號(hào),藥品編碼,采購價(jià),采購數(shù)量,采購日期,供應(yīng)商)售藥表(顧客號(hào),藥品編碼,銷售數(shù)量,銷售日期,單價(jià))庫存表(藥品編碼,藥品名稱,庫存量,生產(chǎn)廠家,規(guī)格,零售價(jià))單據(jù)號(hào):編程自動(dòng)生成(從1開始,每次加1)。顧客號(hào):編程自動(dòng)生成(從1開始,每次加1)。進(jìn)藥:當(dāng)進(jìn)新藥(第一次進(jìn)此藥)時(shí),用戶需要輸入(藥品編碼,藥品名稱,采購價(jià),采購數(shù)量,采購日期,供應(yīng)商,生產(chǎn)廠家,規(guī)格,零售價(jià))當(dāng)進(jìn)的藥品是已經(jīng)進(jìn)過的藥品時(shí),用戶輸入完藥品代碼時(shí),窗體的文本框中將自動(dòng)顯示藥品名稱,生產(chǎn)廠家,規(guī)格,零售價(jià),用戶只需要輸入采購價(jià),采購數(shù)量,采購日期,供應(yīng)商。售藥:只需要用戶輸入藥品編碼,銷售數(shù)量;單價(jià),藥品名稱將自動(dòng)顯示,日期調(diào)用系統(tǒng)當(dāng)前日期。一次售藥可以銷售多種藥品,最后一起結(jié)帳。顯示應(yīng)收藥款,實(shí)收金額,找零。庫存查詢:按藥品代碼,藥品名稱查詢。進(jìn)藥查詢:按藥品代碼,藥品名稱,采購日期查詢。售藥查詢:按藥品代碼,藥品名稱、銷售日期查詢。5應(yīng)用程序的編程實(shí)現(xiàn)5.1建庫在navicatformysql中運(yùn)行sql腳本:生成數(shù)據(jù)庫如下:庫存表:售藥表(其他表不一一列舉出來了):5.2設(shè)計(jì)網(wǎng)頁編碼采用utf-8、使用css文件保持頁面風(fēng)格統(tǒng)一。5.2.1前端目錄結(jié)構(gòu)5.2.2舉例(進(jìn)藥頁):主菜單和頂部代碼:base href=藥品信息管理系統(tǒng)body margin-top: 0;margin-left: 0;ul li list-style: none;acolor:black;$(function() window.open(main/enter/index.jsp, workFrame););function show(where) window.open(main/+where + /index.jsp, workFrame);藥品信息管理系統(tǒng)一一梁君瑋用戶:$username未登錄 注銷進(jìn)藥售藥庫存查詢進(jìn)藥查詢售藥查詢供應(yīng)商客戶進(jìn)藥頁面代碼:base href=進(jìn)藥function selectMedicine(index) window.open(main/enter/choose_medicine.jsp, 請(qǐng)選擇藥品,width=800, height=410, scrollbars=no);var rowIndex = 0;function addOneLineOnClick() var row = tblFlowCardDetail.insertRow(tblFlowCardDetail.rows.length);var col = row.insertCell(0);col.innerHTML = ;col = row.insertCell(1);col.innerHTML = ;col = row.insertCell(2);col.innerHTML = ;col = row.insertCell(3);col.innerHTML = ;col = row.insertCell(4);col.innerHTML = ;col = row.insertCell(5);col.innerHTML = ;col = row.insertCell(6);col.innerHTML = ;col = row.insertCell(7);col.innerHTML = ;col = row.insertCell(8);col.innerHTML = ;row.setAttribute(id, row + rowIndex);row.setAttribute(name, row + rowIndex);rowIndex+;function DeleteRow(rowTag) var i = tblFlowCardDetail.rowsrowTag.rowIndex;var j;for (j = i; j = rowIndex; j+) tblFlowCardDetail.rowsj.cells0.childNodes1.index-; tblFlowCardDetail.deleteRow(i);rowIndex-;   分銷商庫存管理>>盤點(diǎn)結(jié)果維護(hù)>>添加*供應(yīng)商代碼:  供應(yīng)商名稱: *藥品編碼藥品名稱采購價(jià)采購數(shù)量采購日期生產(chǎn)廠家規(guī)格零售價(jià)刪除    頁面如下:5.3添加配置5.3.1邏輯架構(gòu)分層MVC(view-controller-service-dao-VO-db)框架使用的是SSH(Spring+SpringMVC+Hibernate)使用Spring集成SpringMVC和Hibernate,使用配置文件的方式:5.3.2Hibernate配置事務(wù)及實(shí)體類數(shù)據(jù)源連接池使用c3p0:5.4代碼目錄結(jié)構(gòu)(MVC)5.5編寫后臺(tái)代碼(java)5.5.1實(shí)體類使用hibernate和jdk自帶的注解建立實(shí)體類例(進(jìn)藥實(shí)體類):package com.ljw.medicine.beans;import javax.persistence.CascadeType;import javax.persistence.Entity;import javax.persistence.GeneratedValue;import javax.persistence.Id;import javax.persistence.ManyToOne;import javax.persistence.Table;import org.hibernate.annotations.GenericGenerator;/* * ClassName:Enter * company: * Description:進(jìn)藥實(shí)體類 * date 2017年11月30日 下午7:12:28 * author 梁君瑋 */EntityTablepublic class Enter IdGeneratedValue(generator=xxx)GenericGenerator(name=xxx,strategy=native)private Integer document_id;/單據(jù)號(hào)ManyToOne(targetEntity=Inventory.class,cascade=CascadeType.ALL)private Inventory inventory;/藥品private double procurement_price;/采購價(jià)private int procurement_number;/采購數(shù)量private String procurement_date;/采購日期ManyToOne(targetEntity=Supplier.class,cascade=CascadeType.ALL)private Supplier supplier;/供應(yīng)商public Integer getDocument_number() return document_id;public void setDocument_number(Integer document_id) this.document_id = document_id;public Inventory getInventory() return inventory;public void setInventory(Inventory inventory) this.inventory = inventory;public double getProcurement_price() return procurement_price;public void setProcurement_price(double procurement_price) curement_price = procurement_price;public int getProcurement_number() return procurement_number;public void setProcurement_number(int procurement_number) curement_number = procurement_number;public String getProcurement_date() return procurement_date;public void setProcurement_date(String procurement_date) curement_date = procurement_date;public Supplier getSupplier() return supplier;public void setSupplier(Supplier supplier) this.supplier = supplier;5.5.2數(shù)據(jù)持久層(hibernate)例(進(jìn)藥):package com.ljw.medicine.dao.impl;import java.util.List;import java.util.Map;import org.hibernate.SessionFactory;import org.hibernate.query.Query;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.stereotype.Repository;import com.ljw.medicine.beans.Enter;import com.ljw.medicine.dao.EnterDao;/* * ClassName:EnterDaoImpl * company: * Description:進(jìn)藥信息持久層實(shí)現(xiàn)類 * date 2017年11月30日 下午7:22:32 * author 梁君瑋 */Repositorypublic class EnterDaoImpl implements EnterDao Autowiredpublic final void setSessionFactory(SessionFactory sessionFactory) this.sessionFactory = sessionFactory; private SessionFactory sessionFactory;/* * 批量保存創(chuàng)建的進(jìn)藥信息 */Overridepublic void saveCreateEnter(List enterList) sessionFactory.getCurrentSession().save(enterList);/* * 根據(jù)條件分頁查詢進(jìn)藥信息列表 */Overridepublic List queryEnterForPageByCondition(Map map) Enter enter = (Enter) map.get(enter);Integer skipNumber = (Integer) map.get(skipNumber);Integer pageSize = (Integer) map.get(pageSize);String hql = from Enter where inventory.m_id like :m_id and inventory.m_name like :m_name and procurement_date like :procurement_date and supplier like :supplier order by procurement_date desc ;SuppressWarnings(unchecked)Query query = sessionFactory.getCurrentSession().createQuery(hql).setParameter(m_id, %+enter.getInventory().getM_id()+%) .setParameter(m_name,%+ enter.getInventory().getM_name()+%).setParameter(procurement_date,%+ enter.getProcurement_date()+%).setParameter(supplier,%+ enter.getSupplier().getS_id()+%).setFirstResult(skipNumber).setMaxResults(pageSize);return query.list();/* * 根據(jù)條件查詢進(jìn)藥信息的總條數(shù) */Overridepublic Long queryCountOfEnterByCondition(Map map) Enter enter = (Enter) map.get(enter);String hql = select count(s_id) from Enter where inventory.m_id like :m_id and inventory.m_name like :m_name and procurement_date like :procurement_date and supplier like :supplier order by procurement_date desc;SuppressWarnings(unchecked)Query query = sessionFactory.getCurrentSession().createQuery(hql).setParameter(m_id, %+enter.getInventory().getM_id()+%) .setParameter(m_name,%+ enter.getInventory().getM_

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論