jiazx0107@163.com
2023-05-17 620eab6cca2bc9ef9ea6d3067a0a5ba1deadbd1c
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
72
73
74
75
76
77
78
package com.ld.igds.quantity.view;
 
import com.bstek.bdf2.core.model.DefaultDept;
import com.bstek.dorado.annotation.DataProvider;
import com.bstek.dorado.data.provider.Page;
import com.ld.igds.quantity.dto.QuantityData;
import com.ld.igds.quantity.service.HQuantityDataService;
import com.ld.igds.sys.service.SysDeptService;
import com.ld.igds.util.ContextUtil;
import com.ld.igds.util.DateUtil;
 
import org.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
 
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
 
/**
 * 
 * @author: andy.jia
 * @description: 
 * @version: 
 * @data:2020年1月16日
 *
 */
@Component
public class QuantityDataPR {
    
    @Autowired
    private HQuantityDataService quantityDataSetvice;
    
    @Autowired
    private SysDeptService sysDeptService;
    
    /**
     * quantityDataPR#getQuery 根据报表类型,获取默认查询信息,比如表头信息等
     * 
     * @param type
     * @return
     */
    @DataProvider
    public Map<String, Object> getQuery(String type) {
        Map<String, Object> result = new HashMap<String, Object>();
 
        DefaultDept subDept = sysDeptService.getSubDept(null,null);
        result.put("title", "数量检测数据");
        if (null != subDept) {
            result.put("title", subDept.getName() + "数量检测数据");
            result.put("deptId", subDept.getId());
        }
 
        result.put("end", new Date());
        Date start = DateUtil.getNewByDay(new Date(), -90);
        result.put("start", start);
 
        result.put("timeDesc",
                DateFormatUtils.format(start, "yyyy-MM-dd") + "   截至:"
                        + DateFormatUtils.format(new Date(), "yyyy-MM-dd"));
        
        result.put("createUser", ContextUtil.getLoginUserCName());
        return result;
    }
    
    /**
     * quantityDataPR#getData
     * 根据条件分页获取数据信息
     * @param page
     * @param parameter
     * @throws Exception
     */
    @DataProvider
    public void getData(Page<QuantityData> page, Map<String,Object> parameter)throws Exception{
        quantityDataSetvice.getData(page,parameter);
    }
 
}