|
@@ -1,66 +0,0 @@
|
|
|
-package restcontroller.system.report;
|
|
|
-
|
|
|
-import beans.user.User;
|
|
|
-import com.alibaba.fastjson.JSONObject;
|
|
|
-import common.Controller;
|
|
|
-import common.YosException;
|
|
|
-import common.annotation.API;
|
|
|
-import common.annotation.CACHEING_CLEAN;
|
|
|
-import common.data.Rows;
|
|
|
-import common.data.SQLFactory;
|
|
|
-import restcontroller.R;
|
|
|
-
|
|
|
-public class report extends Controller {
|
|
|
- public report(JSONObject content) throws YosException {
|
|
|
- super(content);
|
|
|
- }
|
|
|
-
|
|
|
- @API(title = "应用报表、打印列表查询", apiversion = R.ID20221213094401.v1.class)
|
|
|
- public String queryReportList() throws YosException {
|
|
|
- long systemappid = content.getLong("systemappid");
|
|
|
- SQLFactory sqlFactory = new SQLFactory(this, "应用报表查询");
|
|
|
- if (usertype == 0) {
|
|
|
- sqlFactory = new SQLFactory(this, "应用报表查询2");
|
|
|
- }
|
|
|
- sqlFactory.addParameter("systemappid", systemappid);
|
|
|
- sqlFactory.addParameter("siteid", siteid);
|
|
|
- sqlFactory.addParameter_in("roleids", User.getUserRoleIDs(this, userid));
|
|
|
- Rows rows = dbConnect.runSqlQuery(sqlFactory.getSQL());
|
|
|
- return getSucReturnObject().setData(rows).toString();
|
|
|
- }
|
|
|
-
|
|
|
- @API(title = "应用报表、打印请求预览页面", apiversion = R.ID20221213094501.v1.class)
|
|
|
- public String viewReport() throws YosException {
|
|
|
- long sys_reportid = content.getLongValue("sys_reportid");
|
|
|
- long dataid = content.getLongValue("dataid");
|
|
|
- Rows rows = dbConnect.runSqlQuery("select * from sys_report where sys_reportid=" + sys_reportid);
|
|
|
- if (rows.isEmpty()) {
|
|
|
- return getErrReturnObject().setErrMsg("找不到报表信息").toString();
|
|
|
- }
|
|
|
- if ("积木报表".equals(rows.get(0).getString("reporttype"))) {
|
|
|
- String jimu_report_id = rows.get(0).getString("jimu_report_id");
|
|
|
- if (rows.get(0).getString("systemapp").equals("dispatch")) {
|
|
|
- dbConnect.runSqlUpdate("update sa_dispatch set isreport=isreport+1 where siteid='" + siteid + "' and sa_dispatchid=" + dataid);
|
|
|
- }
|
|
|
- return getSucReturnObject().setData("/yosreport/jmreport/view/" + jimu_report_id + "?token=" + getReportToken(sys_reportid, dataid)).toString();
|
|
|
- } else if (rows.get(0).getString("reporttype").equalsIgnoreCase("Birt报表")) {
|
|
|
- String filename = rows.get(0).getString("filename");
|
|
|
- return getSucReturnObject().setData("/birt/frameset?__report=" + filename + ".rptdesign&token=" + getReportToken(sys_reportid, dataid)).toString();
|
|
|
- } else {
|
|
|
-// getReportToken(sys_reportid, dataid);
|
|
|
- String path = rows.get(0).getString("path");
|
|
|
- if (path.contains("${siteid}")) {
|
|
|
- path = path.replace("${siteid}", siteid);
|
|
|
- }
|
|
|
- if (path.contains("${userid}")) {
|
|
|
- path = path.replace("${userid}", String.valueOf(userid));
|
|
|
- }
|
|
|
- if (path.contains("${dataid}")) {
|
|
|
- path = path.replace("${dataid}", String.valueOf(dataid));
|
|
|
- }
|
|
|
- return getSucReturnObject().setData(path).toString();
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
-}
|