資源簡介
北大青鳥 SSM 和maven總結(jié)的超市訂單管理項目
代碼片段和文件信息
package?com.liaojie.controller;
import?com.alibaba.fastjson.JSONArray;
import?com.liaojie.entity.Bill;
import?com.liaojie.entity.Provider;
import?com.liaojie.entity.Role;
import?com.liaojie.entity.User;
import?com.liaojie.service.bill.BillService;
import?com.liaojie.service.provider.ProviderService;
import?com.liaojie.tools.Constants;
import?com.liaojie.tools.PageSupport;
import?org.springframework.stereotype.Controller;
import?org.springframework.ui.Model;
import?org.springframework.web.bind.annotation.RequestMapping;
import?org.springframework.web.bind.annotation.RequestMethod;
import?org.springframework.web.bind.annotation.RequestParam;
import?org.springframework.web.bind.annotation.ResponseBody;
import?javax.annotation.Resource;
import?javax.servlet.http.HttpSession;
import?java.util.Date;
import?java.util.HashMap;
import?java.util.List;
@Controller
@RequestMapping(“/bill“)
public?class?BillController?{
????//定義這兩個表的service好調(diào)用方法
????@Resource
????private?BillService?billService;
????@Resource
????private?ProviderService?providerService;
????/**
?????*?顯示所有訂單表
?????*?@param?model
?????*?@param?queryProductName
?????*?@param?queryProviderId
?????*?@param?pageIndex
?????*?@return
?????*/
????@RequestMapping(value?=?“/list.html“)
????public?String?getUserList(Model?model
??????????????????????????????@RequestParam(value?=?“queryProductName“?required?=?false)?String?queryProductName
??????????????????????????????@RequestParam(value?=?“queryProviderId“?required?=?false)?String?queryProviderId
??????????????????????????????@RequestParam(value?=?“pageIndex“?required?=?false)?String?pageIndex)?{
????????int?_queryProviderId?=?0;
????????ListbillList=null;
????????//設(shè)置頁面容量
????????int?pageSize?=?Constants.pageSize;
????????//當(dāng)前頁碼
????????int?currentPageNo?=?1;
????????//判斷傳入進(jìn)入來的值是否為空
????????if?(queryProductName==null){
?????????queryProductName=““;
????????}
????????//如果傳進(jìn)來的兩個參數(shù)都為空則賦值并為queryProviderId轉(zhuǎn)入int類型
????????if?(queryProviderId!=null?&&?!queryProviderId.equals(““)){
????????????_queryProviderId=Integer.parseInt(queryProviderId);
????????}
????????if?(pageIndex?!=?null)?{
????????????currentPageNo?=?Integer.valueOf(pageIndex);
????????}
????????//總數(shù)量(表)
????????int?totalCount?=billService.getBIllCount(queryProductName_queryProviderId);
????????//總頁數(shù)
????????PageSupport?pages?=?new?PageSupport();
????????pages.setCurrentPageNo(currentPageNo);
????????pages.setPageSize(pageSize);
????????pages.setTotalCount(totalCount);
????????int?totalPageCount?=?pages.getTotalPageCount();
????????//控制首頁和尾頁
????????if?(currentPageNo?1)?{
????????????currentPageNo?=?1;
????????}?else?if?(currentPageNo?>?totalPageCount)?{
????????????currentPageNo?=?totalPageCount;
????????}
????????billList=billService.getBillList(queryProductName_queryProviderIdcurrentPageNopageSize);
????????model.addAttribute(“billList“?billList);
????????List?prov
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????????42??2019-11-01?14:32??chaoshimavcen\.git\COMMIT_EDITMSG
?????文件????????305??2019-11-01?14:33??chaoshimavcen\.git\config
?????文件?????????73??2019-11-01?14:31??chaoshimavcen\.git\desc
?????文件?????????23??2019-11-01?14:31??chaoshimavcen\.git\HEAD
?????文件????????478??2019-11-01?14:31??chaoshimavcen\.git\hooks\applypatch-msg.sample
?????文件????????896??2019-11-01?14:31??chaoshimavcen\.git\hooks\commit-msg.sample
?????文件???????3327??2019-11-01?14:31??chaoshimavcen\.git\hooks\fsmonitor-watchman.sample
?????文件????????189??2019-11-01?14:31??chaoshimavcen\.git\hooks\post-update.sample
?????文件????????424??2019-11-01?14:31??chaoshimavcen\.git\hooks\pre-applypatch.sample
?????文件???????1638??2019-11-01?14:31??chaoshimavcen\.git\hooks\pre-commit.sample
?????文件???????1348??2019-11-01?14:31??chaoshimavcen\.git\hooks\pre-push.sample
?????文件???????4898??2019-11-01?14:31??chaoshimavcen\.git\hooks\pre-reba
?????文件????????544??2019-11-01?14:31??chaoshimavcen\.git\hooks\pre-receive.sample
?????文件???????1492??2019-11-01?14:31??chaoshimavcen\.git\hooks\prepare-commit-msg.sample
?????文件???????3610??2019-11-01?14:31??chaoshimavcen\.git\hooks\update.sample
?????文件??????36859??2019-11-02?08:34??chaoshimavcen\.git\index
?????文件????????240??2019-11-01?14:31??chaoshimavcen\.git\info\exclude
?????文件????????187??2019-11-01?14:32??chaoshimavcen\.git\logs\HEAD
?????文件????????187??2019-11-01?14:32??chaoshimavcen\.git\logs\refs\heads\master
?????文件????????142??2019-11-01?14:33??chaoshimavcen\.git\logs\refs\remotes\origin\master
?????文件????????632??2019-11-01?14:31??chaoshimavcen\.git\ob
?????文件???????1366??2019-11-01?14:31??chaoshimavcen\.git\ob
?????文件???????2813??2019-11-01?14:31??chaoshimavcen\.git\ob
?????文件????????549??2019-11-01?14:31??chaoshimavcen\.git\ob
?????文件????????498??2019-11-01?14:31??chaoshimavcen\.git\ob
?????文件????????149??2019-11-01?14:32??chaoshimavcen\.git\ob
?????文件????????330??2019-11-01?14:31??chaoshimavcen\.git\ob
?????文件?????369712??2019-11-01?14:31??chaoshimavcen\.git\ob
?????文件?????177959??2019-11-01?14:31??chaoshimavcen\.git\ob
?????文件??????51680??2019-11-01?14:31??chaoshimavcen\.git\ob
............此處省略759個文件信息
評論
共有 條評論