Pārlūkot izejas kodu

战区数据统计

hu 2 gadi atpakaļ
vecāks
revīzija
ed0155715b

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


BIN
lib/yos.core-2.0.1.jar


+ 4 - 0
src/custom/restcontroller/R.java

@@ -5197,6 +5197,10 @@ public class R {
         public static class v1 {
         }
     }
+    public static class ID20230802093703 {
+        public static class v1 {
+        }
+    }
 
 }
 

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
src/custom/restcontroller/webmanage/sale/databoard/SQL/战区数据_区域.sql


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
src/custom/restcontroller/webmanage/sale/databoard/SQL/战区数据_经销商.sql


+ 71 - 0
src/custom/restcontroller/webmanage/sale/databoard/databoard.java

@@ -447,6 +447,77 @@ public class databoard extends Controller {
         return getSucReturnObject().setData(topItemclassRows).toString();
     }
 
+
+    /**
+     * 战区数据分析
+     *
+     * @return
+     */
+    @API(title = "战区数据分析", apiversion = R.ID20230802093703.v1.class)
+    @CACHEING
+    public String warZoneAnalysis() throws YosException {
+
+        String datetype = content.getStringValue("datetype");
+        String datatype = content.getString("datatype");
+        String begindate = "";
+        String enddate = "";
+        switch (datetype) {
+            case "月":
+                begindate = getMonthFirstDay();
+                enddate = getMonthLastDay();
+                break;
+            case "年":
+                begindate = new SimpleDateFormat("yyyy").format(new Date()) + "-01-01";
+                enddate = new SimpleDateFormat("yyyy").format(new Date()) + "-12-31";
+                break;
+            case "周":
+                begindate = getWeekFirstDay();
+                enddate = getWeekLastDay();
+                break;
+            default:
+                break;
+        }
+        /*
+         * 过滤条件设置
+         */
+        if (content.containsKey("where")) {
+            JSONObject whereObject = content.getJSONObject("where");
+            if (whereObject.containsKey("begindate") && !"".equals(whereObject.getString("begindate"))) {
+                begindate = whereObject.getString("begindate");
+            }
+            if (whereObject.containsKey("enddate") && !"".equals(whereObject.getString("enddate"))) {
+                enddate = whereObject.getString("enddate");
+            }
+        }
+
+        StringBuffer where = new StringBuffer(" 1=1 ");
+        if (begindate != "") {
+            where.append(" and DATE_FORMAT(t1.checkdate, '%Y-%m-%d') >='").append(begindate).append("' ");
+        }
+        if (enddate != "") {
+            where.append(" and DATE_FORMAT(t1.checkdate, '%Y-%m-%d') <='").append(enddate).append("' ");
+        }
+
+
+        SQLFactory factory;
+        if (datatype.equals("经销商")) {
+            factory = new SQLFactory(this, "战区数据_经销商");
+        } else if (datatype.equals("区域")) {
+            factory = new SQLFactory(this, "战区数据_区域");
+        } else {
+            return getErrReturnObject().setErrMsg("datatype类型错误").toString();
+        }
+
+        factory.addParameter("siteid", siteid);
+        factory.addParameter_SQL("where", where);
+        Rows rows = dbConnect.runSqlQuery(factory.getSQL(false));
+
+        return getSucReturnObject().setData(rows).toString();
+    }
+
+
+
+
     /**
      * @Description: 获取季度第一天
      * 1.根据给定日期计算当前季度的第一个月份

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels