首页>代码>ssm开发e律通律师事务所管理系统>/src/com/sxl/controller/admin/AdminController.java
package com.sxl.controller.admin;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.sxl.controller.MyController;

@Controller("adminController")
@RequestMapping(value = "/admin")
public class AdminController extends MyController {
	

	@RequestMapping(value = "/index")
	public String frame(Model model, HttpServletRequest request)throws Exception {
		return "/admin/index";
	}
	
	@RequestMapping(value = "/main")
	public String main(Model model, HttpServletRequest request)throws Exception {
		return "/admin/main";
	}
	
	@RequestMapping(value = "/tj1")
	public String tj1(Model model, HttpServletRequest request)throws Exception {
		String sql="select DATE_FORMAT(insertDate,'%Y-%m-%d') dates,sum(allPrice) price from t_order order by DATE_FORMAT(insertDate,'%Y-%m-%d')  desc";
		List<Map> list = db.queryForList(sql);
		model.addAttribute("list", list);
		System.out.println(list);
		return "/admin/tj/tj1";
	}
	
	
	@RequestMapping(value = "/password")
	public String password(Model model, HttpServletRequest request)throws Exception {
		return "/admin/password";
	}
	
	
	@RequestMapping(value = "/changePassword")
	public ResponseEntity<String> loginSave(Model model,HttpServletRequest request,String oldPassword,String newPassword) throws Exception {
		Map admin = getAdmin(request);
		if(oldPassword.equals(admin.get("password").toString())){
			String sql="update t_admin set password=? where id=?";
			db.update(sql, new Object[]{newPassword,admin.get("id")});
			return renderData(true,"1",null);
		}else{
			return renderData(false,"1",null);
		}
	}
}
最近下载更多
peureux  LV1 2024年3月15日
咩咩咩咩咩  LV2 2024年2月22日
lilong007  LV23 2023年12月30日
zhuizi0000  LV1 2023年2月11日
testuser1234567  LV24 2022年5月23日
houliukou  LV38 2022年5月11日
109683670  LV9 2022年4月18日
一起来看火星雨  LV2 2022年3月25日
恒久乐  LV4 2022年3月3日
rodert  LV14 2022年2月16日
最近浏览更多
yu823749  LV1 6月10日
TY0165  LV20 2024年6月21日
李俊雄  LV3 2024年5月8日
WaZiN7  LV6 2024年4月25日
peureux  LV1 2024年3月15日
咩咩咩咩咩  LV2 2024年2月14日
orville 2024年2月11日
暂无贡献等级
shuangfu  LV25 2023年12月2日
limenghaoqwer  LV2 2023年11月27日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友