首页>代码>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 3月15日
咩咩咩咩咩  LV2 2月22日
lilong007  LV20 2023年12月30日
zhuizi0000  LV1 2023年2月11日
testuser1234567  LV24 2022年5月23日
houliukou  LV37 2022年5月11日
109683670  LV9 2022年4月18日
一起来看火星雨  LV2 2022年3月25日
恒久乐  LV4 2022年3月3日
rodert  LV14 2022年2月16日
最近浏览更多
peureux  LV1 3月15日
咩咩咩咩咩  LV2 2月14日
orville 2月11日
暂无贡献等级
shuangfu  LV24 2023年12月2日
limenghaoqwer  LV2 2023年11月27日
Noah_aaa 2023年11月8日
暂无贡献等级
ha8018 2023年10月17日
暂无贡献等级
yichang123  LV1 2023年10月12日
zhaozhiqi  LV5 2023年10月2日
903201717 2023年9月12日
暂无贡献等级
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友