BS架構(gòu)的母乳數(shù)據(jù)管理系統(tǒng)_第1頁
BS架構(gòu)的母乳數(shù)據(jù)管理系統(tǒng)_第2頁
BS架構(gòu)的母乳數(shù)據(jù)管理系統(tǒng)_第3頁
BS架構(gòu)的母乳數(shù)據(jù)管理系統(tǒng)_第4頁
BS架構(gòu)的母乳數(shù)據(jù)管理系統(tǒng)_第5頁
已閱讀5頁,還剩33頁未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡介

摘要錯誤!文檔中沒有指定樣式的文字。PAGE8系統(tǒng)詳細(xì)設(shè)計本章主要介紹母乳數(shù)據(jù)管理系統(tǒng)的詳細(xì)設(shè)計,主要介紹重點功能模塊的實現(xiàn)情況和運(yùn)行截圖。4.1用戶登錄用戶登錄界面如圖4-1所示:圖4-1用戶登錄運(yùn)行界面在進(jìn)入登錄界面以后輸入正確的用戶名、密碼、驗證碼,點擊【登錄】按鈕。系統(tǒng)會根據(jù)用戶所輸入的信息,通過功能代碼實現(xiàn)與數(shù)據(jù)庫中存儲數(shù)據(jù)的對比,從而判別該登錄用戶是否合法,如果不合法將提示輸入正確的登錄信息,輸入正確則登錄系統(tǒng),進(jìn)入系統(tǒng)的主界面。以下是部分代碼:UsernamePasswordTokentoken=newUsernamePasswordToken(username,password,rememberMe);

Subjectsubject=SecurityUtils.getSubject();

try{

subject.login(token);

returnsuccess();

}catch(AuthenticationExceptione){

Stringmsg="用戶或密碼錯誤";

if(StringUtils.isNotEmpty(e.getMessage())){

msg=e.getMessage();

}

returnerror(msg);

}4.2系統(tǒng)主界面正確登錄系統(tǒng)之后會跳轉(zhuǎn)到系統(tǒng)主界面,如圖4-2所示:圖4-2系統(tǒng)主界面主界面左側(cè)為菜單欄,顯示用戶被授權(quán)訪問的菜單,右側(cè)為歡迎頁面。4.3母乳背景信息查詢背景信息查詢功能如4-3所示:圖4-3母乳背景信息查詢查詢:點擊菜單【背景信息與營養(yǎng)組成】后,會顯示如4-3所示界面,可通過母乳編號,省份,泌乳期等條件查詢符合條件的母乳樣本。以下是部分實現(xiàn)代碼:Stringprovs=bakInfo.getProv();

if(!"".equals(provs)&&provs!=null){

bakInfo.setProvs_arr(Convert.toStrArray(provs));

}

Stringlactations=bakInfo.getLactation();

if(!"".equals(lactations)&&lactations!=null){

bakInfo.setLactations_arr(Convert.toStrArray(lactations));

}

returnbakInfoMapper.selectBakInfoList(bakInfo);4.4母乳背景信息管理新增:點擊圖4-3中的【新增】按鈕,會顯示圖4-4所示界面,填寫相應(yīng)信息后,點擊右下角【確定】按鈕保存背景信息。圖4-4母乳背景信息錄入修改:點擊圖4-3中【修改】或【背景信息】按鈕,會顯示如圖4-5所示界面,填寫相應(yīng)信息后,點擊右下角【確定】按鈕保存背景信息。圖4-5母乳背景信息修改刪除: 點擊圖4-3中【刪除】按鈕,提示是否確認(rèn)刪除,如圖4-6,點擊按鈕【是】,刪除背景信息及營養(yǎng)組成信息。圖4-6確認(rèn)對話框以下是功能部分實現(xiàn)代碼:保存:if(bakInfo.getLactation()!=null){

switch(bakInfo.getLactation()){

case"0-7d":

bakInfo.setLactation_month("1");

break;

case"8-14d":

bakInfo.setLactation_month("1");

break;

case"15-30d":

bakInfo.setLactation_month("1");

break;

case"31-90d":

bakInfo.setLactation_month("2");

break;

case"91-180d":

bakInfo.setLactation_month("3");

break;

case"180d以上":

bakInfo.setLactation_month("4");

break;

}

}

bakInfo.setBakinfo_num(GetMilkNum.getMilkNumByTime());

bakInfo.setStatus(0);

bakInfo.setCreate_user_id(ShiroUtils.getUserId());

bakInfo.setCreate_user_name(ShiroUtils.getLoginName());

returntoAjax(bakinfoService.addBakInfo(bakInfo));修改:BakInfobakInfoResult=bakinfoService.selectBakInfoByNum(bakinfo_num);

mmap.put("bakinfo",bakInfoResult);

mmap.put("bakinfo_num",bakinfo_num);

//孕期是否有如下情況checkbox處理開始

Stringpc=bakInfoResult.getPregnancy_condition();

List<MilkDict>pregnancy_conditions=milkDictService.selectByKey("pregnancy_condition");

if(pc!=null&&!"".equals(pc)){

String[]pcs=StringUtils.split(pc,',');

for(MilkDictpregnancy_condition:pregnancy_conditions){

for(Stringpc_1:pcs){

if(pc_1.equals(pregnancy_condition.getType())){

pregnancy_condition.setSelected(true);

break;

}

}

}

}

mmap.put("pregnancy_conditions",pregnancy_conditions);

//孕期是否有如下情況checkbox處理結(jié)束

//營養(yǎng)補(bǔ)充劑dietary_supplementcheckbox處理開始

Stringds=bakInfoResult.getDietary_supplement();

List<MilkDict>dietary_supplements=milkDictService.selectByKey("dietary_supplement");

if(ds!=null&&!"".equals(ds)){

String[]dss=StringUtils.split(ds,',');

for(MilkDictdietary_supplement:dietary_supplements){

for(Stringds_1:dss){

if(ds_1.equals(dietary_supplement.getType())){

dietary_supplement.setSelected(true);

break;

}

}

}

}

mmap.put("dietary_supplements",dietary_supplements);

//營養(yǎng)補(bǔ)充劑dietary_supplementcheckbox處理結(jié)束

returnprefix+"/edit";刪除:intsuccess=0;

success=bakinfoService.deleteBakInfoByNum(bakinfo_num);

nutInfoService.deleteByNum(bakinfo_num);

returntoAjax(success);4.5母乳營養(yǎng)組成管理母乳營養(yǎng)組成已母乳樣本背景信息為基礎(chǔ)維護(hù),即先有母乳樣本背景信息,再維護(hù)其對應(yīng)的營養(yǎng)組成信息。點擊圖4-3中【營養(yǎng)組成】按鈕,顯示圖4-7所示界面,填寫各類營養(yǎng)成分含量后,點擊右下角【確定】按鈕保存。圖4-7維護(hù)營養(yǎng)組成以下是部分實現(xiàn)代碼://獲取

intsuccess=0;//是否更新或插入成功,默認(rèn)為0不成功

ArrayList<String>keyList=newArrayList<String>();

Stringkey_before_;

Stringbakinfo_num=map.get("bakinfo_num");

map.remove("bakinfo_num");

Iterator<Map.Entry<String,String>>it=map.entrySet().iterator();

//遍歷獲取key_before_

while(it.hasNext()){

Map.Entry<String,String>entry=it.next();

Stringkey=entry.getKey();

Stringvalue=entry.getValue();

key_before_=StringUtils.substringBefore(key,"_");

if(keyList.toArray().length==0){

keyList.add(key_before_);

continue;

}

if(!keyList.contains(key_before_)){

keyList.add(key_before_);

}

}

//營養(yǎng)元素記錄是否存在,>0則存在,執(zhí)行更新,否則執(zhí)行插入

intnutFlag=0;

//循環(huán)

for(intj=0;j<keyList.toArray().length;j++){

Stringkey_code=keyList.toArray()[j].toString();

DetailDictdetailDict=detailDictService.selectByKey(key_code);

Stringweight=map.get(keyList.toArray()[j]+"_weight");

Stringwet_weight=map.get(keyList.toArray()[j]+"_wet_weight");

Stringdry_weight=map.get(keyList.toArray()[j]+"_dry_weight");

Stringpercent=map.get(keyList.toArray()[j]+"_percent");

Doubleweight2=null;

Doubledry_weight2=null;

Doublewet_weight2=null;

Doublepercent2=null;

//傳入4個參數(shù)是否都為空

intisEmpty=1;//默認(rèn)為空

try{

if(weight!=null&&!"".equals(weight)){

weight2=Double.valueOf(weight);

isEmpty=0;//不為空

}

if(dry_weight!=null&&!"".equals(dry_weight)){

dry_weight2=Double.valueOf(dry_weight);

isEmpty=0;//不為空

}

if(wet_weight!=null&&!"".equals(wet_weight)){

wet_weight2=Double.valueOf(wet_weight);

isEmpty=0;//不為空

}

if(percent!=null&&!"".equals(percent)){

percent2=Double.valueOf(percent);

isEmpty=0;//不為空

}

}catch(Exceptione){

e.printStackTrace();

returnerror("只能輸入整數(shù)或小數(shù)!");

}

NutInfonutInfo=newNutInfo();

nutInfo.setBakinfo_num(bakinfo_num);//編號

nutInfo.setKey_code(detailDict.getKey());//營養(yǎng)元素項目碼

nutInfo.setKey_name(detailDict.getKey_name());//營養(yǎng)元素項目名稱

nutInfo.setWeight(weight2);//重量

nutInfo.setWeight_unit(detailDict.getWeight_unit());//重量單位

nutInfo.setDry_weight(dry_weight2);//干重

nutInfo.setDry_weight_unit(detailDict.getDry_weight_unit());//干重單位

nutInfo.setWet_weight(wet_weight2);//濕重

nutInfo.setWet_weight_unit(detailDict.getWet_weight_unit());//濕重單位

nutInfo.setPercent(percent2);//百分比

nutInfo.setPercent_who(detailDict.getPercent_who());//百分比who

nutInfo.setType_code(detailDict.getType_code());//營養(yǎng)元素類型碼

nutInfo.setType_name(detailDict.getType_name());//營養(yǎng)元素類型名稱

nutInfo.setCreate_user_id(ShiroUtils.getUserId());//創(chuàng)建人user_id

nutInfo.setCreate_user_name(ShiroUtils.getLoginName());//登錄名

nutInfo.setLast_update_user_id(ShiroUtils.getUserId());//更新人user_id

nutInfo.setLast_update_user_name(ShiroUtils.getLoginName());//更新人user_name

//查詢該條營養(yǎng)元素是否存在,存在則更新,否則插入

nutFlag=nutInfoService.selectByNumAndKeycode(bakinfo_num,key_code);

BakInfobakInfo=bakInfoService.selectBakInfoByNum(bakinfo_num);

intstatus_flag=bakInfo.getStatus();

bakInfo.setLast_update_user_id(ShiroUtils.getUserId());

bakInfo.setLast_update_user_name(ShiroUtils.getLoginName());

if(nutFlag==0&&isEmpty==1){//3.記錄不存在,傳入為空,不插入,不更新nutFlag==0&&isEmpty==1

continue;

}

if(nutFlag>0&&isEmpty==1){//1.記錄存在,傳入為空,則刪除nutFlag>0&&isEmpty==1

success=nutInfoService.deleteByNumAndKeycode(bakinfo_num,key_code);

continue;

}

if(nutFlag==0&&isEmpty==0){//4.記錄不存在,傳入不全為空,則插入nutFlag=0&&isEmpty==0

//不存在,則插入

success=nutInfoService.insertNutInfo(nutInfo);

if(status_flag==0){

bakInfoService.updateStatus(bakInfo);

}

continue;

}

if(nutFlag>0&&isEmpty==0){//2.記錄存在,傳入不為空,則更新nutFlag>0&&isEmpty==1

//存在,則更新

success=nutInfoService.update(nutInfo);

System.out.println("記錄已存在,更新");

continue;

}

}

returnsuccess==0?error("您未輸入任何內(nèi)容,無需提交!"):toAjax(success);4.6營養(yǎng)組成統(tǒng)計分析選擇【篩選條件】中相應(yīng)的條件,及【統(tǒng)計選項】中相應(yīng)的選項,如果不選則默認(rèn)全選,點擊【搜索】按鈕,統(tǒng)計出符合條件的樣本的營養(yǎng)元素最大值,最小值,中位數(shù),平均值,四分位數(shù)等結(jié)果,如圖4-8所示。再次搜索時將統(tǒng)計第二次的統(tǒng)計結(jié)果,第1次的統(tǒng)計結(jié)果不會變化,如圖4-9所示。圖4-8統(tǒng)計結(jié)果1圖4-9統(tǒng)計結(jié)果24.7用戶管理用于新增,修改,刪除,重置密碼等功能,如圖4-10所示:圖4-10用戶管理用戶新增界面,如圖4-11所示:圖4-11新增用戶以下是部分實現(xiàn)代碼:查詢:startPage();

List<SysUser>list=userService.selectUserList(user);

returngetDataTable(list);新增:if(StringUtils.isNotNull(user.getUserId())&&SysUser.isAdmin(user.getUserId()))

{

returnerror("不允許修改超級管理員用戶");

}

user.setSalt(ShiroUtils.randomSalt());

user.setPassword(passwordService.encryptPassword(user.getLoginName(),user.getPassword(),user.getSalt()));

user.setCreateBy(ShiroUtils.getLoginName());

returntoAjax(userService.insertUser(user));修改: if(StringUtils.isNotNull(user.getUserId())&&SysUser.isAdmin(user.getUserId())){

returnerror("不允許修改超級管理員用戶");

}

user.setUpdateBy(ShiroUtils.getLoginName());

returntoAjax(userService.updateUser(user));重置密碼:user.setSalt(ShiroUtils.randomSalt());

user.setPassword(passwordService.encryptPassword(user.getLoginName(),user.getPassword(),user.getSalt()));

returntoAjax(userService.resetUserPwd(user));刪除用戶:try{

returntoAjax(userService.deleteUserByIds(ids));

}catch(Exceptione){

returnerror(e.getMessage());

}4.8角色管理用于新增,修改,刪除角色,數(shù)據(jù)權(quán)限分配等功能,如圖4-12所示:圖4-12角色管理以下是部分實現(xiàn)代碼:查詢:startPage();

List<SysRole>list=roleService.selectRoleList(role);

returngetDataTable(list);新增: role.setCreateBy(ShiroUtils.getLoginName());

ShiroUtils.clearCachedAuthorizationInfo();

returntoAjax(roleService.insertRole(role));刪除:try{

returntoAjax(roleService.deleteRoleByIds(ids));

}catch(Exceptione){

returnerror(e.getMessage());

}4.9日志管理用于日志管理,如圖4-13所示:圖4-13日志管理日志詳情,如圖4-14所示:圖4-14日志詳情以下是查詢功能部分后臺和前臺代碼:后臺:startPage();

List<SysOperLog>list=operLogService.selectOperLogList(operLog);

returngetDataTable(list);前臺:<!DOCTYPEhtml>

<htmllang="zh"xmlns:th=""

xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">

<metacharset="utf-8">

<headth:include="include::header"></head>

<linkth:href="@{/ajax/libs/jsonview/jquery.jsonview.css}"rel="stylesheet"/>

<bodyclass="white-bg">

<divclass="wrapperwrapper-contentanimatedfadeInRightibox-content">

<formclass="form-horizontalm-t"id="signupForm">

<divclass="form-group">

<labelclass="col-sm-2control-label">操作模塊:</label>

<divclass="form-control-static"th:text="${operLog.title}+'/'+${@dict.getLabel('sys_oper_type',operLog.businessType)}">

</div>

</div>

<divclass="form-group">

<labelclass="col-sm-2control-label">登錄信息:</label>

<divclass="form-control-static"th:text="${operLog.operName}+'/'+${operLog.deptName}+'/'+${operLog.operIp}+'/'+${operLog.operLocation}">

</div>

</div>

<divclass="form-group">

<labelclass="col-sm-2control-label">請求地址:</label>

<divclass="form-control-static"th:text="${operLog.operUrl}">

</div>

</div>

<divclass="form-group">

<labelclass="col-sm-2control-label">操作方法:</label>

<divclass="form-control-static"th:text="${operLog.method}">

</div>

</div>

<divclass="form-group">

<labelclass="col-sm-2control-label">請求參數(shù):</label>

<divclass="form-control-static"><preid="operParam"></pre></div>

</div>

<divclass="form-group">

<labelclass="col-sm-2control-label">狀態(tài):</label>

<divclass="form-control-static"th:class="${operLog.status==0?'labellabel-primary':'labellabel-danger'}"th:text="${operLog.status==0?'正常':'異常'}">

</div>

</div>

<divclass="form-group"th:style="'display:'+${operLog.status==0?'none':'block'}">

<labelclass="col-sm-2control-label">異常信息:</label>

<divclass="form-control-static"th:text="${operLog.errorMsg}">

</div>

</div>

</form>

</div>

<divth:include="include::footer"></div>

<scriptth:src="@{/ajax/libs/jsonview/jquery.jsonview.js}"></script>

<scriptth:inline="javascript">

$(function(){

varjson=[[${operLog.operParam}]];

if($.common.isNotEmpty(json)&&json.length<2000){

$("#operParam").JSONView(json);

}else{

$("#operParam").text(json);

}

});

</script>

</body>

</html>結(jié)束語這篇論文主要講述了一個母乳數(shù)據(jù)管理系統(tǒng),在實現(xiàn)母乳數(shù)據(jù)管理系統(tǒng)的時候,我重點完成了以下幾點內(nèi)容:(1)深入思考該系統(tǒng)的工作流程;(2)按照工作流程設(shè)計該系統(tǒng)的總體結(jié)構(gòu),繪制結(jié)構(gòu)圖;(3)設(shè)計系統(tǒng)的功能模塊,如:后臺系統(tǒng)維護(hù)模塊,其中包含背景信息錄入、查詢、刪除等功能;(4)熟練地運(yùn)用和掌握J(rèn)avaWeb技術(shù)和MySql數(shù)據(jù)庫編程,進(jìn)行系統(tǒng)的程序代碼編寫、調(diào)試運(yùn)行以及功能測試;(5)了解服務(wù)器的部署問題,數(shù)據(jù)庫的存儲問題,以及數(shù)據(jù)

溫馨提示

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

最新文檔

評論

0/150

提交評論