package com.basic.x01.location;
|
|
import java.util.Date;
|
import java.util.HashMap;
|
import java.util.List;
|
import java.util.Map;
|
|
import javax.annotation.Resource;
|
|
import org.apache.ibatis.annotations.Param;
|
import org.springframework.stereotype.Controller;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import com.basic.x01.base.BaseController;
|
import com.basic.x01.helper.UserHelper;
|
import com.basic.x01.location.mapper.LocationMapper;
|
import com.basic.x01.system.model.TSysUser;
|
|
import framework.util.TimeUtil;
|
|
/**
|
*
|
*
|
* @company 北京贝思科技术有限公司
|
* @author liuyajun, 8384503@qq.com
|
* @date 2016年2月15日
|
* @time 下午1:52:02
|
*/
|
|
@Controller
|
public class LocationReport extends BaseController {
|
public final static String ACTION_ID = "locationReport";
|
|
@Resource
|
LocationMapper locMapper;
|
|
@RequestMapping(value=ACTION_ID)
|
public String report(@Param("searchName") String searchName,
|
@Param("searchDate") String searchDate) throws Throwable {
|
|
TSysUser user = this.getLoingedUser();
|
if(user==null || ! UserHelper.isSchoolUser(user)){
|
throw this.exception("当前不是学校用户");
|
}
|
|
if(this.isEmpty(searchDate)){
|
searchDate = TimeUtil.getDate10(new Date());
|
}
|
|
Map<String, Object> param = new HashMap<String, Object>();
|
param.put("schoolId", user.getOrgId());
|
|
if(! this.isEmpty(searchName)){
|
param.put("searchName", "%"+searchName+"%");
|
}
|
if(! this.isEmpty(searchDate)){
|
param.put("searchDate", searchDate);
|
}
|
|
this.getRequest().setAttribute("searchName", searchName);
|
this.getRequest().setAttribute("searchDate", searchDate);
|
|
List<Map<String,Object>> list = locMapper.getLocLogList(this.wrapPageSearchParam(param));
|
|
this.getRequest().setAttribute("list", list);
|
this.getRequest().setAttribute("hasData", list.size()>0?"y":"n");
|
|
return "location/loc-list";
|
}
|
|
}
|