运营月报
正在显示
3 个修改的文件
包含
41 行增加
和
1 行删除
1 | package com.skua.modules.report.controller; | 1 | package com.skua.modules.report.controller; |
2 | 2 | ||
3 | 3 | ||
4 | import com.skua.aop.annotation.CustomExceptionAnno; | ||
4 | import com.skua.core.api.vo.Result; | 5 | import com.skua.core.api.vo.Result; |
5 | import com.skua.core.aspect.annotation.AutoLog; | 6 | import com.skua.core.aspect.annotation.AutoLog; |
6 | import com.skua.core.context.BaseContextHandler; | 7 | import com.skua.core.context.BaseContextHandler; |
8 | import com.skua.core.util.ConvertUtils; | ||
9 | import com.skua.modules.biz.IBusinessService; | ||
7 | import com.skua.modules.custom.service.IFCustomReportDatasetService; | 10 | import com.skua.modules.custom.service.IFCustomReportDatasetService; |
8 | import com.skua.modules.report.service.IOperationReportService; | 11 | import com.skua.modules.report.service.IOperationReportService; |
9 | import com.skua.modules.report.vo.JnhbReportData; | 12 | import com.skua.modules.report.vo.JnhbReportData; |
10 | import com.skua.modules.report.vo.ProductDataVO; | 13 | import com.skua.modules.report.vo.ProductDataVO; |
14 | import com.skua.modules.system.service.ISysDepartService; | ||
11 | import io.swagger.annotations.Api; | 15 | import io.swagger.annotations.Api; |
12 | import io.swagger.annotations.ApiOperation; | 16 | import io.swagger.annotations.ApiOperation; |
13 | import lombok.extern.slf4j.Slf4j; | 17 | import lombok.extern.slf4j.Slf4j; |
... | @@ -18,7 +22,10 @@ import org.springframework.web.bind.annotation.RequestParam; | ... | @@ -18,7 +22,10 @@ import org.springframework.web.bind.annotation.RequestParam; |
18 | import org.springframework.web.bind.annotation.RestController; | 22 | import org.springframework.web.bind.annotation.RestController; |
19 | 23 | ||
20 | import javax.servlet.http.HttpServletRequest; | 24 | import javax.servlet.http.HttpServletRequest; |
25 | import java.util.ArrayList; | ||
26 | import java.util.HashMap; | ||
21 | import java.util.List; | 27 | import java.util.List; |
28 | import java.util.Map; | ||
22 | 29 | ||
23 | @Slf4j | 30 | @Slf4j |
24 | @Api(tags = "数据接口") | 31 | @Api(tags = "数据接口") |
... | @@ -28,6 +35,12 @@ public class OperationReportController { | ... | @@ -28,6 +35,12 @@ public class OperationReportController { |
28 | 35 | ||
29 | @Autowired | 36 | @Autowired |
30 | private IOperationReportService operationReportService; | 37 | private IOperationReportService operationReportService; |
38 | |||
39 | @Autowired | ||
40 | private ISysDepartService departService; | ||
41 | @Autowired | ||
42 | private IBusinessService businessService; | ||
43 | |||
31 | /** | 44 | /** |
32 | * 功能描述: 运营日报进出水初始化 | 45 | * 功能描述: 运营日报进出水初始化 |
33 | */ | 46 | */ |
... | @@ -47,4 +60,31 @@ public class OperationReportController { | ... | @@ -47,4 +60,31 @@ public class OperationReportController { |
47 | return result; | 60 | return result; |
48 | } | 61 | } |
49 | 62 | ||
63 | @GetMapping(value = "/operationMonthReport") | ||
64 | @CustomExceptionAnno(description = "报表:运营月报") | ||
65 | public Result<Object> operationMonthReportCtrl(@RequestParam Map<String,Object> paramsMap) { | ||
66 | // 请求参数 | ||
67 | String departId = ConvertUtils.getString(paramsMap.get("departId")); | ||
68 | String startTime = ConvertUtils.getString(paramsMap.get("startTime")); | ||
69 | String endTime = ConvertUtils.getString(paramsMap.get("endTime")); | ||
70 | String[] departIdArray = departId.split(","); | ||
71 | // 翻译 | ||
72 | Map<String, String> sysDepartDictMap = businessService.dictMap("sys_depart", null); | ||
73 | // 封装结果集 | ||
74 | List<Map<String, Object>> resMapList = new ArrayList<>(); | ||
75 | for (String tmpDepartId : departIdArray) { | ||
76 | String childDepartId = departService.getChildDepartId(tmpDepartId); | ||
77 | // 获取机构子集 | ||
78 | Map<String, Object> paramMap = new HashMap<>(); | ||
79 | paramMap.put("startTime", startTime); | ||
80 | paramMap.put("endTime", endTime); | ||
81 | paramMap.put("departId", childDepartId); | ||
82 | Map<String, Object> resMap = operationReportService.dataAnalysisOfMonth(paramMap); | ||
83 | resMap.put("departId", tmpDepartId); | ||
84 | resMap.put("departName", sysDepartDictMap.get(tmpDepartId)); | ||
85 | resMapList.add(resMap); | ||
86 | } | ||
87 | return Result.ok(resMapList); | ||
88 | } | ||
89 | |||
50 | } | 90 | } | ... | ... |
... | @@ -17,5 +17,5 @@ public interface IOperationReportService { | ... | @@ -17,5 +17,5 @@ public interface IOperationReportService { |
17 | */ | 17 | */ |
18 | ProductDataVO handeReportMonthData(String departIds,Integer year, Integer season,String startDate,String endDate); | 18 | ProductDataVO handeReportMonthData(String departIds,Integer year, Integer season,String startDate,String endDate); |
19 | 19 | ||
20 | Map<String, String> dataAnalysisOfMonth(Map<String, Object> paramMap); | 20 | Map<String, Object> dataAnalysisOfMonth(Map<String, Object> paramMap); |
21 | } | 21 | } | ... | ... |
-
请 注册 或 登录 后发表评论