资源简介
myeclipse+Tomcat9.0+ssm框架,基于web的家庭理财系统
代码片段和文件信息
package com.jtlc.controller;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.request;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
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.servlet.ModelAndView;
import tk.mybatis.mapper.entity.Example;
import com.jtlc.entity.Admin;
import com.jtlc.entity.User;
import com.jtlc.entity.UserReg;
import com.jtlc.service.AdminService;
import com.jtlc.dao.AdminDao;
import com.jtlc.dao.UserDao;
import com.jtlc.dao.UserRegDao;
/**
* 管理员登陆 增加 修改 删除 删除登陆日志
*/
@Controller
public class AmindController {
@Autowired
private AdminDao adminDao;
@Autowired
private UserDao userDao;
@Autowired
private AdminService as;
@Autowired
private UserRegDao userRegDao;
//获得各个管理员的信息
@RequestMapping(“admin/system/admin“)
public ModelAndView lookUserReg(HttpSession s) {
ModelAndView modelAndView=new ModelAndView();
String adminName=(String) s.getAttribute(“adminname“);
// 创建Example
Example example = new Example(Admin.class);
// 创建Criteria
Example.Criteria criteria = example.createCriteria();
// 添加查询条件
criteria.andEqualTo(“adminName“adminName );
List list1=adminDao.selectByExample(example);
if(!list1.isEmpty()){
modelAndView.addobject(“admin“ list1.get(0));
}
List list=adminDao.selectAll();
modelAndView.addobject(“list“ list);
modelAndView.setViewName(“admin“);
if(!list.isEmpty()){
return modelAndView;
}
else{
modelAndView.addobject(“message“ “查询的记录不存在!“);
return modelAndView;
}
}
//新增和修改管理员信息
@RequestMapping(“manager“)
public ModelAndView managerAdmin(int idString timeString passwordint numberAdmin admin@RequestParam(“ra“) String raHttpSession s){
ModelAndView modelAndView = new ModelAndView(“forward:admin/system/admin.jsp“);
System.out.println(“操作类型:“+ra);
if(ra.equals(“add“)){
int flag = as.addAdmin(admin);
if(flag == 1){
modelAndView.addobject(“message“ “增加管理员成功!“);
return modelAndView;
}
else if(flag == 2){
modelAndView.addobject(“message“ “该用户名已经存在!“);
return modelAndView;
}
else{
modelAndView.addobject(“message“ “系统维护中,请稍后再试!“);
return modelAndView;
}
}
else if(ra.equals(“update“)){
int flag=as.updateAdmin(id time passwordnumber admin);
if(flag==1){
s.setAttribute(“adminname“
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-04-08 12:05 jtlc Maven Webapp\
文件 6148 2018-12-15 20:09 jtlc Maven Webapp\.DS_Store
目录 0 2018-12-15 20:11 __MACOSX\
目录 0 2018-12-15 20:11 __MACOSX\jtlc Maven Webapp\
文件 120 2018-12-15 20:09 __MACOSX\jtlc Maven Webapp\._.DS_Store
目录 0 2018-04-08 12:06 jtlc Maven Webapp\target\
目录 0 2018-03-27 15:51 jtlc Maven Webapp\target\test-classes\
文件 6148 2018-04-08 12:07 jtlc Maven Webapp\target\.DS_Store
目录 0 2018-12-15 20:11 __MACOSX\jtlc Maven Webapp\target\
文件 120 2018-04-08 12:07 __MACOSX\jtlc Maven Webapp\target\._.DS_Store
目录 0 2018-12-15 11:10 jtlc Maven Webapp\target\classes\
文件 650 2018-12-15 11:10 jtlc Maven Webapp\target\classes\mybatis-config.xm
文件 485 2018-12-15 11:10 jtlc Maven Webapp\target\classes\logback.xm
文件 6148 2018-04-08 12:12 jtlc Maven Webapp\target\classes\.DS_Store
目录 0 2018-12-15 11:10 jtlc Maven Webapp\target\classes\mapper\
文件 328 2018-12-15 11:10 jtlc Maven Webapp\target\classes\mapper\AdminDao.xm
文件 2057 2018-12-15 11:10 jtlc Maven Webapp\target\classes\mapper\FamilyIncomeDao.xm
文件 473 2018-12-15 11:10 jtlc Maven Webapp\target\classes\mapper\remindInformationDao.xm
文件 775 2018-12-15 11:10 jtlc Maven Webapp\target\classes\mapper\securutyAccountDao.xm
文件 2093 2018-12-15 11:10 jtlc Maven Webapp\target\classes\mapper\FamilyExpenseDao.xm
文件 1102 2018-12-15 11:10 jtlc Maven Webapp\target\classes\mapper\debtInformationDao.xm
文件 767 2018-12-15 11:10 jtlc Maven Webapp\target\classes\mapper\investInformationDao.xm
文件 449 2018-12-15 11:10 jtlc Maven Webapp\target\classes\mapper\bankAccountDao.xm
文件 151 2018-12-15 11:10 jtlc Maven Webapp\target\classes\jdbc.properties
目录 0 2018-12-15 11:10 jtlc Maven Webapp\target\classes\com\
文件 6148 2018-04-08 12:12 jtlc Maven Webapp\target\classes\com\.DS_Store
目录 0 2018-12-15 11:10 jtlc Maven Webapp\target\classes\com\jtlc\
目录 0 2018-12-15 11:10 jtlc Maven Webapp\target\classes\com\jtlc\entity\
文件 2072 2018-12-15 11:10 jtlc Maven Webapp\target\classes\com\jtlc\entity\SecurityAccount.class
文件 2475 2018-12-15 11:10 jtlc Maven Webapp\target\classes\com\jtlc\entity\RemindInformation.class
文件 2436 2018-12-15 11:10 jtlc Maven Webapp\target\classes\com\jtlc\entity\BankAccount.class
............此处省略371个文件信息
- 上一篇:微信开发所需jar包
- 下一篇:Android计算器混合运算源码
评论
共有 条评论