소스 검색

发货单打印次数

郭齐峰 1 년 전
부모
커밋
287d4abd45

BIN
lib/yos.core-2.3.0-sources.jar


BIN
lib/yos.core-2.3.0.jar


+ 0 - 12
src/custom/restcontroller/system/report/SQL/应用报表查询.sql

@@ -1,12 +0,0 @@
-select t1.sys_reportid,
-       t1.siteid,
-       if(t1.reporttype = '积木报表', t2.type, 'datainfo') type,
-       if(t1.reporttype = '积木报表', t2.name, t1.name)    name
-from sys_report t1
-         left join jimureport.jimu_report t2 on t1.jimu_report_id = t2.id
-where (ifnull(t1.siteid, '') = '' or t1.siteid = $siteid$)
-  and t1.systemappid = $systemappid$
-  and t1.isused = 1
-  and ((t1.reporttype = '积木报表' and t2.id is not null)
-    or (t1.reporttype != '积木报表'))
-  and exists(select * from sys_rolereportauth t3 where t1.sys_reportid = t3.sys_reportid and t3.roleid in $roleids$)

+ 0 - 11
src/custom/restcontroller/system/report/SQL/应用报表查询2.sql

@@ -1,11 +0,0 @@
-select t1.sys_reportid,
-       t1.siteid,
-       if(t1.reporttype = '积木报表', t2.type, 'datainfo') type,
-       if(t1.reporttype = '积木报表', t2.name, t1.name)    name
-from sys_report t1
-         left join jimureport.jimu_report t2 on t1.jimu_report_id = t2.id
-where (ifnull(t1.siteid, '') = '' or t1.siteid = $siteid$)
-  and t1.systemappid = $systemappid$
-  and t1.isused = 1
-  and ((t1.reporttype = '积木报表' and t2.id is not null)
-    or (t1.reporttype != '积木报表'))

+ 0 - 66
src/custom/restcontroller/system/report/report.java

@@ -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();
-        }
-
-
-    }
-}

+ 16 - 1
src/custom/restcontroller/webmanage/sale/dispatch/dispatch.java

@@ -5,6 +5,7 @@ import beans.datacontrllog.DataContrlLog;
 import beans.dispatch.Dispatch;
 import beans.parameter.Parameter;
 import beans.remind.Remind;
+import beans.report.Report;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import common.Controller;
@@ -269,7 +270,14 @@ public class dispatch extends Controller {
         ArrayList<Long> ids = rows.toArrayList("sa_dispatchid", new ArrayList<>());
         //查询数量金额
         RowsMap dispatchAmountRowsMap = Dispatch.getDispatchAmountAndQty(this, ids);
-
+        Rows reportRows = dbConnect.runSqlQuery("select sys_reportid from sys_report where (siteid is null or siteid='' or siteid='" + siteid + "') and systemappid=209");
+        ArrayList<HashMap<Long, Integer>> viewCountList = new ArrayList<>();
+        for (Row reportRow : reportRows) {
+            long sys_reportid = reportRow.getLong("sys_reportid");
+            HashMap<Long, Integer> viewCount = Report.getViewCount(this, sys_reportid, ids);
+            viewCountList.add(viewCount);
+        }
+//        HashMap<Long, Integer> viewCount = Report.getViewCount(this, 82, ids);
         for (Row row : rows) {
             Long id = row.getLong("sa_dispatchid");
             if (dispatchAmountRowsMap.get(id.toString()).isNotEmpty()) {
@@ -279,6 +287,13 @@ public class dispatch extends Controller {
                 row.put("sumamount", 0);
                 row.put("sumqty", 0);
             }
+            Integer isreport = 0;
+            for (HashMap<Long, Integer> viewCount : viewCountList) {
+                if (viewCount.containsKey(id)) {
+                    isreport += viewCount.get(id);
+                }
+            }
+            row.put("isreport", isreport);
         }
         return getSucReturnObject().setData(rows).toString();
     }