liuxiaolong
2019-05-09 0d1d88cdb668e75ea8609417ac18ae19947e9525
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
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";
    }
 
}