基于javaweb+mysql的ssm失物招领信息管理系统(java+ssm+jsp+javascript+h-ui+mysql)
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb+mysql的SSM失物招领信息管理系统(java+ssm+jsp+javascript+h-ui+mysql)
项目介绍
本项目为后台管理系统,分为管理员与用户两种角色; 管理员角色包含以下功能: 管理员登录,修改个人信息,用户管理,公告管理,物品类型管理,感谢信类型管理,失物发布管理,寻找发布管理,感谢信发布管理,发布互助信息等功能。
用户角色包含以下功能: 用户登录,修改个人资料,查看公告,查看失物发布,寻找发布查看,查看感谢信,添加互助信息等功能。
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可 4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 5.数据库:MySql 5.7版本; 6.是否Maven项目:否;
技术栈
- 后端:Spring+SpringMVC+Mybatis 2. 前端:JSP+CSS+JavaScript+H-UI
使用说明
- 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven; 若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中config/spring-mvc.xml配置文件中的数据库配置改为自己的配置; 4. 运行项目,输入http://localhost:8080/ssm_swzl_sys/ 登录
if (list.size() > 1) {
model.addAttribute("util", util);
model.addAttribute("errMsg", "该信息已存在!");
return "GxxType/saveOrUpdate";
}
gxxTypeMapper.updateObject(util);
}
return this.getAllUtil(request, model);
}
}
@Controller
@RequestMapping(value = "Gongao")
public class GongaoController {
@Autowired
private GongaoMapper gongaoMapper;
@RequestMapping(value = "/initUtil.do")
public String initUtil(HttpServletRequest request, Model model) {
return "Gongao/saveOrUpdate";
}
@RequestMapping(value = "/selectUtil.do")
public String selectUtil(HttpServletRequest request, Gongao util, Model model) {
util = gongaoMapper.selectObject(util.getId());
model.addAttribute("util", util);
return "Gongao/saveOrUpdate";
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@RequestMapping(value = "/getAllUtil.do")
public String getAllUtil(HttpServletRequest request, Model model) {
String field = request.getParameter("field");
String fieldValue = request.getParameter("fieldValue");
try {
}
return this.getAllUtil(request, model);
}
@RequestMapping(value = "/saveOrUpdateObject.do")
public String saveOrUpdateObject(HttpServletRequest request, Ymdjb util, Model model) {
List<Ymdjb> list = ymdjbMapper.getObjectList("s_0", util.getS_0());
List<User> listUser = userMapper.getObjectList(null, null);
model.addAttribute("listUser", listUser);
if (0 == util.getId()) {
if (list.size() > 0) {
model.addAttribute("util", util);
model.addAttribute("errMsg", "该信息已存在!");
return "Ymdjb/saveOrUpdate";
}
ymdjbMapper.insertObject(util);
} else {
if (list.size() > 1) {
model.addAttribute("util", util);
model.addAttribute("errMsg", "该信息已存在!");
return "Ymdjb/saveOrUpdate";
}
ymdjbMapper.updateObject(util);
}
return this.getAllUtil(request, model);
}
}
@Controller
@RequestMapping(value = "WupinType")
public class WupinTypeController {
@Autowired
currentPageNo = Integer.parseInt(pageNo);
}catch(Exception e){
}
List<GxxType> list = gxxTypeMapper.getObjectList(field, fieldValue);
PageModel pageModel = new PageModel();
pageModel = pageModel.getUtilByController(list, currentPageNo);
model.addAttribute("pageModel", pageModel);
model.addAttribute("fieldValue", fieldValue);
model.addAttribute("field", field);
return "GxxType/find";
}
@RequestMapping(value = "/deleteUtil.do")
public String deleteUtil(HttpServletRequest request, GxxType util, Model model) {
try{
gxxTypeMapper.deleteObject(util.getId());
}catch(Exception e){
}
return this.getAllUtil(request, model);
}
@RequestMapping(value = "/deleteManyUtil.do")
public String deleteManyUtil(HttpServletRequest request, User util,
Model model) {
String ids[] = request.getParameterValues("id");
for (String id : ids) {
util = new User();
util.setId(Integer.parseInt(id));
try{
gxxTypeMapper.deleteObject(util.getId());
}catch(Exception e){}
}
return this.getAllUtil(request, model);
}
@RequestMapping(value = "/saveOrUpdateObject.do")
public String saveOrUpdateObject(HttpServletRequest request, GxxType util, Model model) {
List<GxxType> list = gxxTypeMapper.getObjectList("s_0", util.getS_0());
if (0 == util.getId()) {
if (list.size() > 0) {
model.addAttribute("util", util);
model.addAttribute("errMsg", "该信息已存在!");
return "GxxType/saveOrUpdate";
}
gxxTypeMapper.insertObject(util);
} else {
@SuppressWarnings("serial")
public class ImageServlet extends HttpServlet {
protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
response.setContentType("image/jpeg");
int w = 85;
int h = 20;
java.util.Random random = new java.util.Random();
BufferedImage img = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
Graphics pen = img.getGraphics();
pen.setColor(Color.WHITE);
pen.fillRect(0, 0, w, h);
for (int i = 0; i < 50; i++) {
pen.setColor(new Color(random.nextInt(255), random.nextInt(255),
random.nextInt(255)));
int x1 = random.nextInt(w);
int y1 = random.nextInt(h);
int x2 = random.nextInt(10) + x1;
int y2 = random.nextInt(10) + y1;
pen.drawLine(x1, y1, x2, y2);
}
StringBuffer sb = new StringBuffer();
pen.setFont(new Font("黑体", Font.BOLD, 16));
for (int i = 0; i < 4; i++) {
pen.setColor(new Color(random.nextInt(100), random.nextInt(100),
random.nextInt(100)));
String num = String.valueOf(random.nextInt(10));
pen.drawString(num, i * 20 + 10, 15);
sb.append(num);
}
request.getSession().setAttribute("code", sb.toString());
response.setHeader("Pragma", "no-store");
response.setDateHeader("Expires", 0);
response.setHeader("Pragma", "no-cache");
ImageIO.write(img, "jpeg", response.getOutputStream());
}
if (0 == util.getId()) {
userMapper.insertObject(util);
} else {
userMapper.updateObject(util);
}
return this.getAllUtil(request, util, model);
}
return this.getAllUtil(request, util, model);
}
}
@Controller
@RequestMapping(value = "XunwufbglFile")
public class XunwufbglFileController {
@Autowired
private XunwufbglFileMapper xunwufbglFileMapper;
@Autowired
private WupinTypeMapper wupinTypeMapper;
@Autowired
private UserMapper userMapper;
int start = this.getStartIndex();
state = new FileManager( conf ).listFile( start );
break;
}
return state.toJSONString();
}
public int getStartIndex () {
String start = this.request.getParameter( "start" );
try {
return Integer.parseInt( start );
} catch ( Exception e ) {
return 0;
}
}
/**
* callback参数验证
*/
public boolean validCallbackName ( String name ) {
if ( name.matches( "^[a-zA-Z_]+[\\w0-9_]*$" ) ) {
return true;
}
return false;
}
}
if (!"admin".equals(user_type)) {
//list = listShiwufbglFile;
}
PageModel pageModel = new PageModel();
pageModel = pageModel.getUtilByController(list, currentPageNo);
model.addAttribute("pageModel", pageModel);
model.addAttribute("fieldValue", fieldValue);
model.addAttribute("field", field);
return "ShiwufbglFile/find";
}
@RequestMapping(value = "/deleteUtil.do")
public String deleteUtil(HttpServletRequest request, ShiwufbglFile util, Model model) {
try{
shiwufbglFileMapper.deleteObject(util.getId());
}catch(Exception e){
}
return this.getAllUtil(request, model);
}
@RequestMapping(value = "/deleteManyUtil.do")
public String deleteManyUtil(HttpServletRequest request, User util,
Model model) {
String ids[] = request.getParameterValues("id");
for (String id : ids) {
util = new User();
util.setId(Integer.parseInt(id));
try{
shiwufbglFileMapper.deleteObject(util.getId());
}catch(Exception e){}
}
return this.getAllUtil(request, model);
}
@RequestMapping(value = "/saveOrUpdateObject.do")
public String saveOrUpdateObject(HttpServletRequest request, ShiwufbglFile util, Model model) {
List<ShiwufbglFile> list = shiwufbglFileMapper.getObjectList("s_0", util.getS_0());
List<WupinType> listWupinType = wupinTypeMapper.getObjectList(null, null);
model.addAttribute("listWupinType", listWupinType);
shiwufbglFileMapper.insertObject(util);
} else {
if (list.size() > 1) {
model.addAttribute("util", util);
model.addAttribute("errMsg", "该信息已存在!");
return "ShiwufbglFile/saveOrUpdate";
}
shiwufbglFileMapper.updateObject(util);
}
return this.getAllUtil(request, model);
}
@RequestMapping(value = "/upload.do")
public String upload(@RequestParam MultipartFile[] myfiles, HttpServletRequest request, ShiwufbglFile util, Model model) throws IOException{
for (MultipartFile file : myfiles) {
if (!file.isEmpty()) {
String fileName = file.getOriginalFilename();
String path = request.getSession().getServletContext()
.getRealPath("upload")
+ File.separator;
String uploadName = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date())
+ fileName;
File localFile = new File(path + uploadName);
file.transferTo(localFile);
util.setS_0(uploadName);
util.setS_1(fileName);
util.setS_2(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
}else{
List<ShiwufbglFile> list = shiwufbglFileMapper.getObjectList("s_3", util.getS_3());
List<WupinType> listWupinType = wupinTypeMapper.getObjectList(null, null);
model.addAttribute("listWupinType", listWupinType);
List<User> listUser = userMapper.getObjectList(null, null);
model.addAttribute("listUser", listUser);
if (0 == util.getId()) {
if (list.size() > 0) {
model.addAttribute("util", util);
model.addAttribute("errMsg", "该信息已存在!");
return "ShiwufbglFile/saveOrUpdate";
}
util.setS_0("None");
util.setS_1("None");
model.addAttribute("errMsg", "该信息已存在!");
return "WupinType/saveOrUpdate";
}
wupinTypeMapper.updateObject(util);
}
return this.getAllUtil(request, model);
}
}
@Controller
@RequestMapping(value = "GxxType")
public class GxxTypeController {
@Autowired
private GxxTypeMapper gxxTypeMapper;
@RequestMapping(value = "/initUtil.do")
public String initUtil(HttpServletRequest request, Model model) {
return "GxxType/saveOrUpdate";
}
@RequestMapping(value = "/selectUtil.do")
public String selectUtil(HttpServletRequest request, GxxType util, Model model) {
util = gxxTypeMapper.selectObject(util.getId());
model.addAttribute("util", util);
return "GxxType/saveOrUpdate";
}
@SuppressWarnings({ "rawtypes", "unchecked" })
xunwufbglFileMapper.deleteObject(util.getId());
}catch(Exception e){}
}
return this.getAllUtil(request, model);
}
@RequestMapping(value = "/saveOrUpdateObject.do")
public String saveOrUpdateObject(HttpServletRequest request, XunwufbglFile util, Model model) {
List<XunwufbglFile> list = xunwufbglFileMapper.getObjectList("s_0", util.getS_0());
List<WupinType> listWupinType = wupinTypeMapper.getObjectList(null, null);
model.addAttribute("listWupinType", listWupinType);
List<User> listUser = userMapper.getObjectList(null, null);
model.addAttribute("listUser", listUser);
if (0 == util.getId()) {
if (list.size() > 0) {
model.addAttribute("util", util);
model.addAttribute("errMsg", "该信息已存在!");
return "XunwufbglFile/saveOrUpdate";
}
xunwufbglFileMapper.insertObject(util);
} else {
if (list.size() > 1) {
model.addAttribute("util", util);
model.addAttribute("errMsg", "该信息已存在!");
return "XunwufbglFile/saveOrUpdate";
}
xunwufbglFileMapper.updateObject(util);
}
return this.getAllUtil(request, model);
}
@RequestMapping(value = "/upload.do")
public String upload(@RequestParam MultipartFile[] myfiles, HttpServletRequest request, XunwufbglFile util, Model model) throws IOException{
for (MultipartFile file : myfiles) {
if (!file.isEmpty()) {
String fileName = file.getOriginalFilename();
String path = request.getSession().getServletContext()
.getRealPath("upload")
+ File.separator;
String uploadName = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date())
+ fileName;
File localFile = new File(path + uploadName);
file.transferTo(localFile);
util.setS_0(uploadName);
util.setS_1(fileName);
util.setS_2(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
}else{
List<XunwufbglFile> list = xunwufbglFileMapper.getObjectList("s_3", util.getS_3());
List<WupinType> listWupinType = wupinTypeMapper.getObjectList(null, null);
model.addAttribute("listWupinType", listWupinType);
List<User> listUser = userMapper.getObjectList(null, null);
model.addAttribute("listUser", listUser);
if (0 == util.getId()) {
if (list.size() > 0) {
return "XunwufbglFile/saveOrUpdate";
}
@RequestMapping(value = "/selectUtil.do")
public String selectUtil(HttpServletRequest request, XunwufbglFile util, Model model) {
util = xunwufbglFileMapper.selectObject(util.getId());
model.addAttribute("util", util);
List<WupinType> listWupinType = wupinTypeMapper.getObjectList(null, null);
model.addAttribute("listWupinType", listWupinType);
List<User> listUser = userMapper.getObjectList(null, null);
model.addAttribute("listUser", listUser);
return "XunwufbglFile/saveOrUpdate";
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@RequestMapping(value = "/getAllUtil.do")
public String getAllUtil(HttpServletRequest request, Model model) {
String field = request.getParameter("field");
String fieldValue = request.getParameter("fieldValue");
try {
fieldValue = new String(fieldValue.getBytes("UTF-8"), "UTF-8");
} catch (Exception e) {}
String pageNo = request.getParameter("pageModel.currentPageNo");
int currentPageNo = 1;
try{
currentPageNo = Integer.parseInt(pageNo);
}catch(Exception e){
}
List<XunwufbglFile> list = xunwufbglFileMapper.getObjectList(field, fieldValue);
List<XunwufbglFile> listXunwufbglFile = new ArrayList<XunwufbglFile>();
HttpSession session = request.getSession();
int user_id = (Integer) session.getAttribute("user_id");
String user_type = (String) session.getAttribute("user_type");
for (XunwufbglFile temp : list) {
if (user_id == temp.getUser().getId()) {
listXunwufbglFile.add(temp);
}
}
if (!"admin".equals(user_type)) {
//list = listXunwufbglFile;
}
PageModel pageModel = new PageModel();
pageModel = pageModel.getUtilByController(list, currentPageNo);
model.addAttribute("pageModel", pageModel);
model.addAttribute("fieldValue", fieldValue);
model.addAttribute("field", field);
return "XunwufbglFile/find";
}
@RequestMapping(value = "/deleteUtil.do")
public String deleteUtil(HttpServletRequest request, XunwufbglFile util, Model model) {
try{
}
@RequestMapping(value = "/saveOrUpdateObject.do")
public String saveOrUpdateObject(HttpServletRequest request, WupinType util, Model model) {
List<WupinType> list = wupinTypeMapper.getObjectList("s_0", util.getS_0());
if (0 == util.getId()) {
if (list.size() > 0) {
model.addAttribute("util", util);
model.addAttribute("errMsg", "该信息已存在!");
return "WupinType/saveOrUpdate";
}
wupinTypeMapper.insertObject(util);
} else {
if (list.size() > 1) {
model.addAttribute("util", util);
model.addAttribute("errMsg", "该信息已存在!");
return "WupinType/saveOrUpdate";
}
wupinTypeMapper.updateObject(util);
}
return this.getAllUtil(request, model);
}
}
@Controller
@RequestMapping(value = "GxxType")
public class GxxTypeController {
@Autowired
private GxxTypeMapper gxxTypeMapper;
@RequestMapping(value = "/initUtil.do")
public String initUtil(HttpServletRequest request, Model model) {
return "GxxType/saveOrUpdate";
}
@RequestMapping(value = "/selectUtil.do")
public String selectUtil(HttpServletRequest request, GxxType util, Model model) {
util = gxxTypeMapper.selectObject(util.getId());
}
List<Gongao> list = gongaoMapper.getObjectList(field, fieldValue);
PageModel pageModel = new PageModel();
pageModel = pageModel.getUtilByController(list, currentPageNo);
model.addAttribute("pageModel", pageModel);
model.addAttribute("fieldValue", fieldValue);
model.addAttribute("field", field);
return "Gongao/find";
}
@RequestMapping(value = "/deleteUtil.do")
public String deleteUtil(HttpServletRequest request, Gongao util, Model model) {
try{
gongaoMapper.deleteObject(util.getId());
}catch(Exception e){
}
return this.getAllUtil(request, model);
}
@RequestMapping(value = "/deleteManyUtil.do")
public String deleteManyUtil(HttpServletRequest request, User util,
Model model) {
String ids[] = request.getParameterValues("id");
for (String id : ids) {
util = new User();
util.setId(Integer.parseInt(id));
try{
gongaoMapper.deleteObject(util.getId());
}catch(Exception e){}
}
return this.getAllUtil(request, model);
}
@RequestMapping(value = "/saveOrUpdateObject.do")
public String saveOrUpdateObject(HttpServletRequest request, Gongao util, Model model) {
List<Gongao> list = gongaoMapper.getObjectList("s_0", util.getS_0());
if (0 == util.getId()) {
if (list.size() > 0) {
model.addAttribute("util", util);
model.addAttribute("errMsg", "该信息已存在!");
return "Gongao/saveOrUpdate";
}
gongaoMapper.insertObject(util);
} else {
if (list.size() > 1) {
return this.getAllUtil(request, model);
}
@RequestMapping(value = "/upload.do")
public String upload(@RequestParam MultipartFile[] myfiles, HttpServletRequest request, ShiwufbglFile util, Model model) throws IOException{
for (MultipartFile file : myfiles) {
if (!file.isEmpty()) {
String fileName = file.getOriginalFilename();
String path = request.getSession().getServletContext()
.getRealPath("upload")
+ File.separator;
String uploadName = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date())
+ fileName;
File localFile = new File(path + uploadName);
file.transferTo(localFile);
util.setS_0(uploadName);
util.setS_1(fileName);
util.setS_2(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
}else{
List<ShiwufbglFile> list = shiwufbglFileMapper.getObjectList("s_3", util.getS_3());
List<WupinType> listWupinType = wupinTypeMapper.getObjectList(null, null);
model.addAttribute("listWupinType", listWupinType);
List<User> listUser = userMapper.getObjectList(null, null);
model.addAttribute("listUser", listUser);
if (0 == util.getId()) {
if (list.size() > 0) {
model.addAttribute("util", util);
model.addAttribute("errMsg", "该信息已存在!");
return "ShiwufbglFile/saveOrUpdate";
}
util.setS_0("None");
util.setS_1("None");
util.setS_2(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
} else {
if (list.size() > 1) {
model.addAttribute("util", util);
model.addAttribute("errMsg", "该信息已存在!");
return "ShiwufbglFile/saveOrUpdate";
}
ShiwufbglFile utilTmp = shiwufbglFileMapper.selectObject(util
.getId());
case ActionMap.UPLOAD_IMAGE:
case ActionMap.UPLOAD_SCRAWL:
case ActionMap.UPLOAD_VIDEO:
case ActionMap.UPLOAD_FILE:
conf = this.configManager.getConfig( actionCode );
state = new Uploader( request, conf ).doExec();
break;
case ActionMap.CATCH_IMAGE:
conf = configManager.getConfig( actionCode );
String[] list = this.request.getParameterValues( (String)conf.get( "fieldName" ) );
state = new ImageHunter( conf ).capture( list );
break;
case ActionMap.LIST_IMAGE:
case ActionMap.LIST_FILE:
conf = configManager.getConfig( actionCode );
int start = this.getStartIndex();
state = new FileManager( conf ).listFile( start );
break;
}
return state.toJSONString();
}
public int getStartIndex () {
String start = this.request.getParameter( "start" );
try {
return Integer.parseInt( start );
} catch ( Exception e ) {
return 0;
}
}
/**
* callback参数验证
*/
public boolean validCallbackName ( String name ) {
wupinTypeMapper.updateObject(util);
}
return this.getAllUtil(request, model);
}
}
@Controller
@RequestMapping(value = "GxxType")
public class GxxTypeController {
@Autowired
private GxxTypeMapper gxxTypeMapper;
@RequestMapping(value = "/initUtil.do")
public String initUtil(HttpServletRequest request, Model model) {
return "GxxType/saveOrUpdate";
}
@RequestMapping(value = "/selectUtil.do")
public String selectUtil(HttpServletRequest request, GxxType util, Model model) {
util = gxxTypeMapper.selectObject(util.getId());
model.addAttribute("util", util);
return "GxxType/saveOrUpdate";
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@RequestMapping(value = "/getAllUtil.do")
public String getAllUtil(HttpServletRequest request, Model model) {
String field = request.getParameter("field");
String fieldValue = request.getParameter("fieldValue");
try {
return "ShiwufbglFile/saveOrUpdate";
}
ShiwufbglFile utilTmp = shiwufbglFileMapper.selectObject(util
.getId());
util.setS_0(utilTmp.getS_0());
util.setS_1(utilTmp.getS_1());
util.setS_2(utilTmp.getS_2());
}
}
if (0 == util.getId()) {
shiwufbglFileMapper.insertObject(util);
} else {
shiwufbglFileMapper.updateObject(util);
}
return "ShiwufbglFile/ok";
}
return "ShiwufbglFile/ok";
}
}
@Controller
@RequestMapping(value = "Gxxfb")
public class GxxfbController {
@Autowired
private GxxfbMapper gxxfbMapper;
@Autowired
private GxxTypeMapper gxxTypeMapper;
@Autowired
private UserMapper userMapper;
@RequestMapping(value = "/initUtil.do")
public String initUtil(HttpServletRequest request, Model model) {
List<GxxType> listGxxType = gxxTypeMapper.getObjectList(null, null);
model.addAttribute("listGxxType", listGxxType);
List<User> listUser = userMapper.getObjectList(null, null);
@RequestMapping(value = "/initUtil.do")
public String initUtil(HttpServletRequest request, Model model) {
List<GxxType> listGxxType = gxxTypeMapper.getObjectList(null, null);
model.addAttribute("listGxxType", listGxxType);
List<User> listUser = userMapper.getObjectList(null, null);
model.addAttribute("listUser", listUser);
return "Gxxfb/saveOrUpdate";
}
@RequestMapping(value = "/selectUtil.do")
public String selectUtil(HttpServletRequest request, Gxxfb util, Model model) {
util = gxxfbMapper.selectObject(util.getId());
model.addAttribute("util", util);
List<GxxType> listGxxType = gxxTypeMapper.getObjectList(null, null);
model.addAttribute("listGxxType", listGxxType);
List<User> listUser = userMapper.getObjectList(null, null);
model.addAttribute("listUser", listUser);
return "Gxxfb/saveOrUpdate";
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@RequestMapping(value = "/getAllUtil.do")
public String getAllUtil(HttpServletRequest request, Model model) {
String field = request.getParameter("field");
String fieldValue = request.getParameter("fieldValue");
try {
fieldValue = new String(fieldValue.getBytes("UTF-8"), "UTF-8");
} catch (Exception e) {}
String pageNo = request.getParameter("pageModel.currentPageNo");
int currentPageNo = 1;
try{
currentPageNo = Integer.parseInt(pageNo);
}catch(Exception e){
}
List<Gxxfb> list = gxxfbMapper.getObjectList(field, fieldValue);
List<Gxxfb> listGxxfb = new ArrayList<Gxxfb>();
HttpSession session = request.getSession();
int user_id = (Integer) session.getAttribute("user_id");
String user_type = (String) session.getAttribute("user_type");
for (Gxxfb temp : list) {
if (user_id == temp.getUser().getId()) {
listGxxfb.add(temp);
}
}
if (!"admin".equals(user_type)) {
//list = listGxxfb;
}
PageModel pageModel = new PageModel();