宅急送項目第六天筆記!_宅急送項目

來源:互聯網
上載者:User
宅急送項目第六天 
一、 回顧前5天
1、 項目前端 easyui  (為什麼使用。 收費。 ) 、伺服器SSH三大架構 
2、 資料層 GenericDAO 抽取 
3、 業務層 分頁查詢 製作為萬用群組件 
4、 AJAX互動 flexjson (網路上 flexjson外掛程式 ,從google下載) ---------- 現在每次寫json返回 
JSONSerializer 
include/exclude
JSONSerializer  提供 serialize / deepSerialize 序列化對象為json 
response.getWriter.print(...)

將返回json內容 定義為 struts2 結果集 (自訂結果集)
5、 easyui 提供豐富的CSS 、layout布局 、tab菜單 (內嵌iframe, 每個tab可以單獨重新整理)、datagrid 資料表格(工具列按鈕,將json資料與表格捆綁自動顯示資料,提供分頁工具條)、form校正提示(validatebox numberbox datebox datetimebox ccmbobox )、訊息提示(alert 中間快顯視窗、show 右下角)、快顯視窗 window (遮罩效果)

6、 菜單樹形菜單 ztree 
7、 POI Excel解析(匯入匯出)、Hibernate二級緩衝(查詢快取)、Lucene全文檢索索引 

8、 JBPM工作流程 (馬上講到)
====================================================================================
9、 業務 使用者管理 、 宅急送(三大模組 基礎設定、取派業務、中轉業務 )
** 基礎設定 標準、取派員、地區、分區、定區排班 
** 取派業務 業務受理、工單產生、工作單錄入、大量匯入、人工調度  (封裝、返貨、簽收 ....)

二、 業務受理
客戶通過網路和電話 聯絡客服,客服記錄客戶送貨請求,產生業務通知單 
在產生業務通知單過程中,自動匹配定區,匹配相關取派員, 如果能夠匹配,產生工單,通知取派員進行取貨 ,如果不能匹配,轉入人工調度 

使用到達城市簡碼 去匹配region地區表,得知貨物送往哪個城市 

工單查詢 ----- 進行追單或者銷單
*** 因為取派員 很久 沒有取貨。客戶 發出追單請求
*** 客戶不想進行送貨,發出銷單請求 

查詢工單 
1、 根據客戶電話 ----- 通知單 ---- 工單
2、 根據客戶名 ---- 通知單 ----- 工單 
3、 根據日期  -----  取貨時間(受理時間+2小時) 業務通知單 ----- 工單

使用 datagrid 內建查詢,傳入queryParams 需要是一個js對象,如何將表單資訊轉換為js對象 
** 通過jquery 提供fn 對函數進行擴充
$.fn.serializeJson=function(){  
            var serializeObj={};  
            var array=this.serializeArray();  
            var str=this.serialize();  
            $(array).each(function(){  
                if(serializeObj[this.name]){  
                    if($.isArray(serializeObj[this.name])){  
                        serializeObj[this.name].push(this.value);  
                    }else{  
                        serializeObj[this.name]=[serializeObj[this.name],this.value];  
                    }  
                }else{  
                    serializeObj[this.name]=this.value;   
                }  
            });  
            return serializeObj;  
        }; 

追單,將工單類型 改為追單,追單次數+1
銷單,將工單類型 改為銷單  

三、工作單快速錄入
業務受理: 客戶業務被記錄下來
工單: 通知取派員 去取貨了
工作單 : 物流配送業務正式開始 

工作單錄入: 是系統中人機互動最多 (收貨人資訊、發貨人資訊、貨物資訊、保險、封裝 、貨物計費、返貨、簽單、出港 )

工作單快速錄入: 貨物、送貨資訊 
* 操作人員在貨量大單子多時簡潔快速錄入工作單的途徑,快速錄入中的資訊主要是為了滿足配載而設定的功能介面
* 工作單還需要完善其他資訊

使用技術 : table的行編輯 
* 點擊td時,嵌入一個input  (使用js可以做到)

很多前端UI控制項,都提供表格的行編輯(easyui 也提供行編輯、 extjs 同樣提供)
快速錄入: 新增一行 ,輸入後儲存操作、 輸入過程中取消輸入 、 雙擊修改操作

var columns = [ [ {
field : 'id',
title : '工作單號',
width : 120,
align : 'center',
editor :{
type : 'validatebox',
options : {
required: true
}
}
}, {
field : 'arrivecity',
title : '到達地',
width : 120,
align : 'center',
editor :{
type : 'validatebox',
options : {
required: true
}
}
},{
field : 'product',
title : '產品',
width : 120,
align : 'center',
editor :{
type : 'validatebox',
options : {
required: true
}
}
}, {
field : 'num',
title : '件數',
width : 120,
align : 'center',
editor :{
type : 'numberbox',
options : {
required: true
}
}
}, {
field : 'weight',
title : '重量',
width : 120,
align : 'center',
editor :{
type : 'validatebox',
options : {
required: true
}
}
}, {
field : 'floadreqr',
title : '配載要求',
width : 220,
align : 'center',
editor :{
type : 'validatebox',
options : {
required: true
}
}
}] ];

1、 新增一行 
appendRow 、insertRow  ---- 為了業務員選擇insert ,每次編輯第一行 
為可以編輯的列指定 editor  ----- 代表該列可以編輯 
開啟編輯 beginEdit 傳入index 索引 (確保只能編輯一行 )
編輯完成 結束編輯 endEdit 
取消編輯 cancelEdit 
function isEmptyObject(obj) {
for ( var name in obj ) {
return false;
}
return true;
}
判斷當前對象為空白,就刪除 

將伺服器程式碼完成  設計domain 實體類 

在onAfterEdit 添加或者修改結束 ----- 使用ajax請求,將資料發送給伺服器,完成資料添加 
*** 增加 、修改、刪除 $.post
*** 查詢 $("#grid").datagrid(...)

產生json中不想有updatetime 
第一種 jsonSerializer.include("id","arrivecity","product","num","weight","loadreqr").exclude("*"); // 唯寫include沒有效果 (推薦)
第二種 jsonSerializer.exclude("*.updatetime","*.class"); 

2、 刪除 
只能選中一行 datagrid 有 singleSelect
刪除時 獲得選中行 $("#grid").datagrid('getSelected'); 

四、工作單錄入
在業務人員有充分時間情況下,不需要使用快速錄入,可以將之前快速錄入工作單補全 ------- 很像業務受理
提供大form, 輸入工作單資訊,提交到伺服器 ,判斷如果工作單號,之前存在,修改完善資訊, 如果之前不存在,新增一個工作單 

工作單匯入 : 
大量匯入 
工作單錄匯入是提供固定的格式,集中在表外錄入工作單資訊,通過匯入的方式批量產生系統的工作單資訊。系統提供匯出空白表格錄入,和按照固定格式匯入的功能,匯入資料的校正方式同工作單錄入。主要是應用在項目客戶集中匯入工作單中應用

每次新加一個功能。建立頁面jsp,修改menu.json中菜單連結

1、 空白excel 模板下載
WEB-INF外 通過連結下載
WEB-INF裡 編寫struts2 的Action完成下載

****** 下載檔案時,最好不要用中文檔案名稱 
if(filename==null){
return null;
}
System.out.println(filename);
//真實檔案名稱 可能中文
String agent = ServletActionContext.getRequest().getHeader("user-agent");// 瀏覽器
if(agent.contains("Firefox")){
return "=?UTF-8?B?"+new BASE64Encoder().encode(filename.getBytes("utf-8"))+"?=";
}else{
// IE
return URLEncoder.encode(filename, "utf-8");
}

2、 編寫資料,完成資料上傳 
struts2 上傳  ------------- jquery ocupload 
POI解析 

業務層 兩個方法互相調用 (事務傳播問題) , 每個業務層方法都具有管理事務的能力  

  

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.