資源簡介
僅此作為一個參考,希望下載者更多的自己實踐和進行思考。
代碼片段和文件信息
package?cn.smbms.controller.bill;
import?java.util.Date;
import?java.util.HashMap;
import?java.util.List;
import?javax.servlet.http.HttpServletRequest;
import?org.springframework.beans.factory.annotation.Autowired;
import?org.springframework.stereotype.Controller;
import?org.springframework.ui.Model;
import?org.springframework.web.bind.annotation.RequestMapping;
import?org.springframework.web.bind.annotation.RequestParam;
import?org.springframework.web.bind.annotation.ResponseBody;
import?org.springframework.web.servlet.ModelAndView;
import?com.mysql.jdbc.StringUtils;
import?cn.smbms.pojo.Bill;
import?cn.smbms.pojo.PageVo;
import?cn.smbms.pojo.Provider;
import?cn.smbms.pojo.User;
import?cn.smbms.service.bill.BillService;
import?cn.smbms.service.provider.ProviderService;
import?cn.smbms.tools.Constants;
@Controller
@RequestMapping(“bill“)
public?class?BillController?{
@Autowired
private?BillService?billService;
@Autowired
private?ProviderService?providerService;
@RequestMapping(“/bill.do“)
public?ModelAndView?getBillList(Bill?bill@RequestParam(required?=?false?defaultValue?=?“1“)?Integer?pageIndex){
ModelAndView?modelAndView?=?new?ModelAndView();
PageVo?pageVo?=?new?PageVo();
List?providerList?=?providerService.getProviderList(““““);
pageVo?=?billService.getBillList(billpageIndex);
modelAndView.addobject(“providerList“?providerList);
modelAndView.addobject(“pageVo“?pageVo);
modelAndView.addobject(“bill“?bill);
modelAndView.setViewName(“billlist“);
return?modelAndView;
}
@RequestMapping(“/getProviderList.do“)
@ResponseBody
public?List?getProviderList(String?proNameString?proCode){
return?providerService.getProviderList(proNameproCode);
}
@RequestMapping(“/view.do“)
public?ModelAndView?getUserView(String?billid)?{
ModelAndView?modelAndView?=?new?ModelAndView();
Bill?bill?=?billService.getBillById(billid);
modelAndView.addobject(“bill“?bill);
modelAndView.setViewName(“billview“);
return?modelAndView;
}
@RequestMapping(“/modify.do“)
public?String?getUserViewById(String?billid?Model?model)?{
Bill?bill?=?billService.getBillById(billid);
model.addAttribute(“bill“?bill);
return?“billmodify“;
}
@RequestMapping(“/modifyBill.do“)
public?String?modify(HttpServletRequest?requestBill?bill)?{
bill.setModifyBy(((User)request.getSession().getAttribute(Constants.USER_SESSION)).getId());
bill.setModifyDate(new?Date());
if(billService.modify(bill)){
return?“redirect:bill.do“;
}else?{
return?“billmodify“;
}
}
@RequestMapping(“/add.do“)
public?String?add(HttpServletRequest?requestBill?bill){
bill.setCreatedBy(((User)request.getSession().getAttribute(Constants.USER_SESSION)).getId());
bill.setCreationDate(new?Date());
if(billService.add(bill)){
return?“redirect:bill.do“;
}else?{
return?“billadd“;
}
}
@RequestMapping(“/delbill.do“)
@Res
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-11-16?15:28??SMBMS_SSM_08\
?????文件????????1232??2018-11-08?14:28??SMBMS_SSM_08\.classpath
?????文件????????1062??2018-11-08?14:28??SMBMS_SSM_08\.project
?????目錄???????????0??2018-11-16?15:28??SMBMS_SSM_08\.settings\
?????文件?????????564??2018-11-08?14:28??SMBMS_SSM_08\.settings\.jsdtscope
?????文件?????????102??2018-11-09?17:14??SMBMS_SSM_08\.settings\org.eclipse.core.resources.prefs
?????文件?????????364??2018-11-08?14:28??SMBMS_SSM_08\.settings\org.eclipse.jdt.core.prefs
?????文件?????????649??2018-11-08?14:28??SMBMS_SSM_08\.settings\org.eclipse.wst.common.component
?????文件?????????398??2018-11-08?14:28??SMBMS_SSM_08\.settings\org.eclipse.wst.common.project.facet.core.xm
?????文件??????????49??2018-11-08?14:28??SMBMS_SSM_08\.settings\org.eclipse.wst.jsdt.ui.superType.container
?????文件???????????6??2018-11-08?14:28??SMBMS_SSM_08\.settings\org.eclipse.wst.jsdt.ui.superType.name
?????目錄???????????0??2018-11-16?15:28??SMBMS_SSM_08\WebRoot\
?????目錄???????????0??2018-11-16?15:28??SMBMS_SSM_08\WebRoot\me
?????文件??????????39??2018-11-08?14:28??SMBMS_SSM_08\WebRoot\me
?????目錄???????????0??2018-11-16?15:28??SMBMS_SSM_08\WebRoot\WEB-INF\
?????目錄???????????0??2018-11-16?15:28??SMBMS_SSM_08\WebRoot\WEB-INF\classes\
?????目錄???????????0??2018-11-16?15:28??SMBMS_SSM_08\WebRoot\WEB-INF\classes\cn\
?????目錄???????????0??2018-11-16?15:28??SMBMS_SSM_08\WebRoot\WEB-INF\classes\cn\smbms\
?????目錄???????????0??2018-11-16?15:28??SMBMS_SSM_08\WebRoot\WEB-INF\classes\cn\smbms\controller\
?????目錄???????????0??2018-11-16?15:28??SMBMS_SSM_08\WebRoot\WEB-INF\classes\cn\smbms\controller\bill\
?????文件????????5005??2018-11-12?10:22??SMBMS_SSM_08\WebRoot\WEB-INF\classes\cn\smbms\controller\bill\BillController.class
?????目錄???????????0??2018-11-16?15:28??SMBMS_SSM_08\WebRoot\WEB-INF\classes\cn\smbms\controller\provider\
?????文件????????4480??2018-11-12?16:37??SMBMS_SSM_08\WebRoot\WEB-INF\classes\cn\smbms\controller\provider\ProviderController.class
?????目錄???????????0??2018-11-16?15:28??SMBMS_SSM_08\WebRoot\WEB-INF\classes\cn\smbms\controller\user\
?????文件????????2733??2018-11-13?14:23??SMBMS_SSM_08\WebRoot\WEB-INF\classes\cn\smbms\controller\user\LoginController.class
?????文件????????1477??2018-11-10?14:43??SMBMS_SSM_08\WebRoot\WEB-INF\classes\cn\smbms\controller\user\LogoutController.class
?????文件????????8510??2018-11-13?14:13??SMBMS_SSM_08\WebRoot\WEB-INF\classes\cn\smbms\controller\user\UserController.class
?????目錄???????????0??2018-11-16?15:28??SMBMS_SSM_08\WebRoot\WEB-INF\classes\cn\smbms\converter\
?????文件????????1115??2018-11-10?14:43??SMBMS_SSM_08\WebRoot\WEB-INF\classes\cn\smbms\converter\DateConverter.class
?????目錄???????????0??2018-11-16?15:28??SMBMS_SSM_08\WebRoot\WEB-INF\classes\cn\smbms\exception\
?????文件?????????708??2018-11-10?14:43??SMBMS_SSM_08\WebRoot\WEB-INF\classes\cn\smbms\exception\SsmException.class
............此處省略308個文件信息
評論
共有 條評論