|
@ -2,8 +2,6 @@ package com.yihu.jw.basic.agadmin.controller.resource;
|
|
|
|
|
|
|
|
|
|
import com.fasterxml.jackson.core.type.TypeReference;
|
|
import com.fasterxml.jackson.core.type.TypeReference;
|
|
import com.yihu.ehr.constants.ErrorCode;
|
|
|
|
import com.yihu.ehr.constants.ServiceApi;
|
|
|
|
|
|
|
|
import com.yihu.fastdfs.FastDFSUtil;
|
|
import com.yihu.fastdfs.FastDFSUtil;
|
|
import com.yihu.jw.basic.agadmin.service.ReportService;
|
|
import com.yihu.jw.basic.agadmin.service.ReportService;
|
|
@ -14,9 +12,8 @@ import com.yihu.jw.basic.quota.service.TjDimensionMainService;
|
|
import com.yihu.jw.basic.quota.service.TjDimensionSlaveService;
|
|
import com.yihu.jw.basic.quota.service.TjDimensionSlaveService;
|
|
import com.yihu.jw.basic.quota.service.TjQuotaDimensionMainService;
|
|
import com.yihu.jw.basic.quota.service.TjQuotaDimensionMainService;
|
|
import com.yihu.jw.basic.quota.service.TjQuotaDimensionSlaveService;
|
|
import com.yihu.jw.basic.quota.service.TjQuotaDimensionSlaveService;
|
|
import com.yihu.jw.basic.resource.controller.RsReportEndPoint;
|
|
|
|
|
|
import com.yihu.jw.basic.resource.dao.RsReportDao;
|
|
import com.yihu.jw.basic.resource.model.RsCategoryTypeTreeModel;
|
|
import com.yihu.jw.basic.resource.model.RsCategoryTypeTreeModel;
|
|
import com.yihu.jw.basic.resource.model.RsResourcesModel;
|
|
|
|
import com.yihu.jw.basic.resource.service.*;
|
|
import com.yihu.jw.basic.resource.service.*;
|
|
import com.yihu.jw.basic.util.FileUploadUtil;
|
|
import com.yihu.jw.basic.util.FileUploadUtil;
|
|
import com.yihu.jw.entity.ehr.id.BizObject;
|
|
import com.yihu.jw.entity.ehr.id.BizObject;
|
|
@ -25,11 +22,8 @@ import com.yihu.jw.entity.ehr.quota.TjDimensionSlave;
|
|
import com.yihu.jw.entity.ehr.quota.TjQuotaDimensionMain;
|
|
import com.yihu.jw.entity.ehr.quota.TjQuotaDimensionMain;
|
|
import com.yihu.jw.entity.ehr.quota.TjQuotaDimensionSlave;
|
|
import com.yihu.jw.entity.ehr.quota.TjQuotaDimensionSlave;
|
|
import com.yihu.jw.entity.ehr.resource.*;
|
|
import com.yihu.jw.entity.ehr.resource.*;
|
|
import com.yihu.jw.exception.ApiException;
|
|
|
|
import com.yihu.jw.restmodel.ehr.resource.MChartInfoModel;
|
|
import com.yihu.jw.restmodel.ehr.resource.MChartInfoModel;
|
|
import com.yihu.jw.restmodel.ehr.resource.MRsColumnsModel;
|
|
import com.yihu.jw.restmodel.ehr.resource.MRsColumnsModel;
|
|
import com.yihu.jw.restmodel.ehr.resource.MRsReport;
|
|
|
|
import com.yihu.jw.restmodel.ehr.resource.MRsResources;
|
|
|
|
import com.yihu.jw.restmodel.web.Envelop;
|
|
import com.yihu.jw.restmodel.web.Envelop;
|
|
import com.yihu.jw.restmodel.web.ListEnvelop;
|
|
import com.yihu.jw.restmodel.web.ListEnvelop;
|
|
import com.yihu.jw.restmodel.web.ObjEnvelop;
|
|
import com.yihu.jw.restmodel.web.ObjEnvelop;
|
|
@ -37,14 +31,11 @@ import com.yihu.jw.restmodel.web.PageEnvelop;
|
|
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
|
|
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
|
|
import com.yihu.jw.util.common.LogService;
|
|
import com.yihu.jw.util.common.LogService;
|
|
import com.yihu.jw.util.date.DateTimeUtil;
|
|
import com.yihu.jw.util.date.DateTimeUtil;
|
|
import com.yihu.jw.util.http.HttpClientUtil;
|
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import java.io.FileInputStream;
|
|
import java.io.FileInputStream;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
@ -60,41 +51,46 @@ import java.util.*;
|
|
*/
|
|
*/
|
|
@RestController("RsReportController")
|
|
@RestController("RsReportController")
|
|
@RequestMapping("/resource/report")
|
|
@RequestMapping("/resource/report")
|
|
|
|
@Api(tags = {"网关-资源报表"})
|
|
public class ReportController extends EnvelopRestEndpoint {
|
|
public class ReportController extends EnvelopRestEndpoint {
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
@Resource
|
|
|
|
private FileResourceManager fileResourceManager;
|
|
|
|
@Resource
|
|
private RsResourceService rsResourceService;
|
|
private RsResourceService rsResourceService;
|
|
@Autowired
|
|
|
|
|
|
@Resource
|
|
private RsReportService rsReportService;
|
|
private RsReportService rsReportService;
|
|
@Autowired
|
|
|
|
|
|
@Resource
|
|
|
|
private RsReportDao rsReportDao;
|
|
|
|
@Resource
|
|
private RsResourceCategoryService rsCategoryService;
|
|
private RsResourceCategoryService rsCategoryService;
|
|
@Autowired
|
|
|
|
|
|
@Resource
|
|
private RsReportViewService rsReportViewService;
|
|
private RsReportViewService rsReportViewService;
|
|
@Autowired
|
|
|
|
|
|
@Resource
|
|
private FastDFSUtil fastDFSUtil;
|
|
private FastDFSUtil fastDFSUtil;
|
|
@Autowired
|
|
|
|
|
|
@Resource
|
|
private RsResourceDefaultParamService resourceDefaultParamService;
|
|
private RsResourceDefaultParamService resourceDefaultParamService;
|
|
@Autowired
|
|
|
|
|
|
@Resource
|
|
private ResourceBrowseService resourceBrowseService;
|
|
private ResourceBrowseService resourceBrowseService;
|
|
@Autowired
|
|
|
|
|
|
@Resource
|
|
private RsResourceQuotaService resourceQuotaService;
|
|
private RsResourceQuotaService resourceQuotaService;
|
|
@Autowired
|
|
|
|
|
|
@Resource
|
|
private TjQuotaDimensionMainService tjQuotaDimensionMainService;
|
|
private TjQuotaDimensionMainService tjQuotaDimensionMainService;
|
|
@Autowired
|
|
|
|
|
|
@Resource
|
|
private TjQuotaDimensionSlaveService tjQuotaDimensionSlaveService;
|
|
private TjQuotaDimensionSlaveService tjQuotaDimensionSlaveService;
|
|
@Autowired
|
|
|
|
|
|
@Resource
|
|
private TjDimensionMainService tjDimensionMainService;
|
|
private TjDimensionMainService tjDimensionMainService;
|
|
@Autowired
|
|
|
|
|
|
@Resource
|
|
private TjDimensionSlaveService tjDimensionSlaveService;
|
|
private TjDimensionSlaveService tjDimensionSlaveService;
|
|
@Autowired
|
|
|
|
|
|
@Resource
|
|
private ResourceBrowseControllerService resourceBrowseControllerService;
|
|
private ResourceBrowseControllerService resourceBrowseControllerService;
|
|
@Autowired
|
|
|
|
|
|
@Resource
|
|
private ReportService reportService;
|
|
private ReportService reportService;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 展示明细
|
|
* 展示明细
|
|
*/
|
|
*/
|
|
@RequestMapping(value = "detail")
|
|
|
|
|
|
@GetMapping(value = "detail")
|
|
public Envelop detail(Integer id) {
|
|
public Envelop detail(Integer id) {
|
|
try {
|
|
try {
|
|
if (id != null) {
|
|
if (id != null) {
|
|
@ -111,7 +107,7 @@ public class ReportController extends EnvelopRestEndpoint {
|
|
/**
|
|
/**
|
|
* 分页查询
|
|
* 分页查询
|
|
*/
|
|
*/
|
|
@RequestMapping("/search")
|
|
|
|
|
|
@GetMapping("/search")
|
|
public Envelop search(String codeName, String reportCategoryId, int page, int rows) {
|
|
public Envelop search(String codeName, String reportCategoryId, int page, int rows) {
|
|
Map<String, Object> params = new HashMap<>();
|
|
Map<String, Object> params = new HashMap<>();
|
|
StringBuffer filters = new StringBuffer();
|
|
StringBuffer filters = new StringBuffer();
|
|
@ -137,7 +133,7 @@ public class ReportController extends EnvelopRestEndpoint {
|
|
/**
|
|
/**
|
|
* 根据条件,获取视图树形数据(视图类别树下展示视图)
|
|
* 根据条件,获取视图树形数据(视图类别树下展示视图)
|
|
*/
|
|
*/
|
|
@RequestMapping("/getViewsTreeData")
|
|
|
|
|
|
@GetMapping("/getViewsTreeData")
|
|
public Envelop getViewsTreeData(String codeName, Integer reportId, HttpServletRequest request) {
|
|
public Envelop getViewsTreeData(String codeName, Integer reportId, HttpServletRequest request) {
|
|
try {
|
|
try {
|
|
ListEnvelop envelop = new ListEnvelop();
|
|
ListEnvelop envelop = new ListEnvelop();
|
|
@ -221,7 +217,7 @@ public class ReportController extends EnvelopRestEndpoint {
|
|
/**
|
|
/**
|
|
* 保存
|
|
* 保存
|
|
*/
|
|
*/
|
|
@RequestMapping("/save")
|
|
|
|
|
|
@PostMapping("/save")
|
|
public Envelop save(String data) {
|
|
public Envelop save(String data) {
|
|
try {
|
|
try {
|
|
RsReport newRsReport = toEntity(data, RsReport.class);
|
|
RsReport newRsReport = toEntity(data, RsReport.class);
|
|
@ -258,10 +254,10 @@ public class ReportController extends EnvelopRestEndpoint {
|
|
/**
|
|
/**
|
|
* 删除
|
|
* 删除
|
|
*/
|
|
*/
|
|
@RequestMapping("/delete")
|
|
|
|
public Envelop delete(String id) {
|
|
|
|
|
|
@PostMapping("/delete")
|
|
|
|
public Envelop delete(Integer id) {
|
|
try {
|
|
try {
|
|
rsReportService.delete(id);
|
|
|
|
|
|
rsReportDao.deleteById(id);
|
|
return success("删除成功");
|
|
return success("删除成功");
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
@ -272,7 +268,7 @@ public class ReportController extends EnvelopRestEndpoint {
|
|
/**
|
|
/**
|
|
* 验证资源报表编码是否唯一
|
|
* 验证资源报表编码是否唯一
|
|
*/
|
|
*/
|
|
@RequestMapping("/isUniqueCode")
|
|
|
|
|
|
@GetMapping("/isUniqueCode")
|
|
public Envelop isUniqueCode(@RequestParam Integer id, @RequestParam String code) {
|
|
public Envelop isUniqueCode(@RequestParam Integer id, @RequestParam String code) {
|
|
try {
|
|
try {
|
|
return ObjEnvelop.getSuccess("查询成功",rsReportService.isUniqueCode(id, code));
|
|
return ObjEnvelop.getSuccess("查询成功",rsReportService.isUniqueCode(id, code));
|
|
@ -285,7 +281,7 @@ public class ReportController extends EnvelopRestEndpoint {
|
|
/**
|
|
/**
|
|
* 验证资源报表名称是否唯一
|
|
* 验证资源报表名称是否唯一
|
|
*/
|
|
*/
|
|
@RequestMapping("/isUniqueName")
|
|
|
|
|
|
@GetMapping("/isUniqueName")
|
|
public Envelop isUniqueName(@RequestParam Integer id, @RequestParam String name) {
|
|
public Envelop isUniqueName(@RequestParam Integer id, @RequestParam String name) {
|
|
try {
|
|
try {
|
|
return ObjEnvelop.getSuccess("查询成功",rsReportService.isUniqueName(id, name));
|
|
return ObjEnvelop.getSuccess("查询成功",rsReportService.isUniqueName(id, name));
|
|
@ -334,7 +330,7 @@ public class ReportController extends EnvelopRestEndpoint {
|
|
/**
|
|
/**
|
|
* 保存资源配置
|
|
* 保存资源配置
|
|
*/
|
|
*/
|
|
@RequestMapping("saveSetting")
|
|
|
|
|
|
@PostMapping("saveSetting")
|
|
public Envelop saveSetting(@RequestParam Integer reportId, @RequestParam String data) {
|
|
public Envelop saveSetting(@RequestParam Integer reportId, @RequestParam String data) {
|
|
try {
|
|
try {
|
|
List<RsReportView> rsReportViewList = objectMapper.readValue(data, new TypeReference<List<RsReportView>>(){});
|
|
List<RsReportView> rsReportViewList = objectMapper.readValue(data, new TypeReference<List<RsReportView>>(){});
|
|
@ -346,14 +342,10 @@ public class ReportController extends EnvelopRestEndpoint {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
private RsReportEndPoint rsReportEndPoint;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* 获取报表模版内容及其各个图形数据
|
|
* 获取报表模版内容及其各个图形数据
|
|
*/
|
|
*/
|
|
@RequestMapping("getTemplateData")
|
|
|
|
|
|
@GetMapping("getTemplateData")
|
|
public Object getTemplateData(@RequestParam String reportCode, HttpServletRequest request) {
|
|
public Object getTemplateData(@RequestParam String reportCode, HttpServletRequest request) {
|
|
Envelop envelop = new Envelop();
|
|
Envelop envelop = new Envelop();
|
|
Map<String, Object> params = new HashMap<>();
|
|
Map<String, Object> params = new HashMap<>();
|
|
@ -524,7 +516,7 @@ public class ReportController extends EnvelopRestEndpoint {
|
|
return resultList;
|
|
return resultList;
|
|
}
|
|
}
|
|
|
|
|
|
@RequestMapping("getRsQuotaPreview")
|
|
|
|
|
|
@GetMapping("getRsQuotaPreview")
|
|
public Envelop getRsQuotaPreview(@RequestParam String resourceId) {
|
|
public Envelop getRsQuotaPreview(@RequestParam String resourceId) {
|
|
List<Map<String, Object>> options = new ArrayList<>();
|
|
List<Map<String, Object>> options = new ArrayList<>();
|
|
try {
|
|
try {
|
|
@ -549,7 +541,7 @@ public class ReportController extends EnvelopRestEndpoint {
|
|
* @param linkageFilter 联动视图条件,多个用;拼接 town=361102;quotaDate >= '2018-03-01' and quotaDate <= '2018-03-31'
|
|
* @param linkageFilter 联动视图条件,多个用;拼接 town=361102;quotaDate >= '2018-03-01' and quotaDate <= '2018-03-31'
|
|
* @param linkageDimension 联动维度
|
|
* @param linkageDimension 联动维度
|
|
*/
|
|
*/
|
|
@RequestMapping("/getLinkageTemplateData")
|
|
|
|
|
|
@GetMapping("/getLinkageTemplateData")
|
|
public Envelop getLinkageTemplateData(@RequestParam(name="reportCode",required=false) String reportCode,
|
|
public Envelop getLinkageTemplateData(@RequestParam(name="reportCode",required=false) String reportCode,
|
|
@RequestParam(name="linkageResourceIdStr",required=true) String linkageResourceIdStr,
|
|
@RequestParam(name="linkageResourceIdStr",required=true) String linkageResourceIdStr,
|
|
@RequestParam(name="linkageFilter",required=false) String linkageFilter,
|
|
@RequestParam(name="linkageFilter",required=false) String linkageFilter,
|
|
@ -629,8 +621,6 @@ public class ReportController extends EnvelopRestEndpoint {
|
|
return conditions;
|
|
return conditions;
|
|
}
|
|
}
|
|
|
|
|
|
@Autowired
|
|
|
|
private FileResourceManager fileResourceManager;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* 生成模板
|
|
* 生成模板
|
|
@ -671,7 +661,7 @@ public class ReportController extends EnvelopRestEndpoint {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@RequestMapping("/getPositionMapByCode")
|
|
|
|
|
|
@GetMapping("/getPositionMapByCode")
|
|
public Envelop getPositionByCode(String code) throws Exception {
|
|
public Envelop getPositionByCode(String code) throws Exception {
|
|
Map<String, Object> params = new HashMap<>();
|
|
Map<String, Object> params = new HashMap<>();
|
|
params.put("code", code);
|
|
params.put("code", code);
|
|
@ -682,7 +672,7 @@ public class ReportController extends EnvelopRestEndpoint {
|
|
return envelop;
|
|
return envelop;
|
|
}
|
|
}
|
|
|
|
|
|
@RequestMapping("/getTemplateContent")
|
|
|
|
|
|
@GetMapping("/getTemplateContent")
|
|
public Envelop getTemplateContent(String reportCode) {
|
|
public Envelop getTemplateContent(String reportCode) {
|
|
Map<String, Object> params = new HashMap<>();
|
|
Map<String, Object> params = new HashMap<>();
|
|
try {
|
|
try {
|