|
@@ -19,6 +19,9 @@ public class report extends Controller {
|
|
|
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));
|
|
@@ -27,18 +30,37 @@ public class report extends Controller {
|
|
|
}
|
|
|
|
|
|
@API(title = "应用报表、打印请求预览页面", apiversion = R.ID20221213094501.v1.class)
|
|
|
- @CACHEING_CLEAN(apiversions = R.ID20221114135403.v1.class)
|
|
|
public String viewReport() throws YosException {
|
|
|
long sys_reportid = content.getLongValue("sys_reportid");
|
|
|
long dataid = content.getLongValue("dataid");
|
|
|
- Rows rows = dbConnect.runSqlQuery("select t1.*,t2.systemapp from sys_report t1 left join sys_systemapp t2 on t1.systemappid=t2.systemappid where sys_reportid=" + sys_reportid);
|
|
|
+ Rows rows = dbConnect.runSqlQuery("select * from sys_report where sys_reportid=" + sys_reportid);
|
|
|
if (rows.isEmpty()) {
|
|
|
return getErrReturnObject().setErrMsg("找不到报表信息").toString();
|
|
|
}
|
|
|
- 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);
|
|
|
+ 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();
|
|
|
}
|
|
|
- return getSucReturnObject().setData("/yosreport/jmreport/view/" + jimu_report_id + "?token=" + getReportToken(sys_reportid, dataid)).toString();
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
}
|