Browse Source

Merge branch 'feature-refactor' of ssh://10.10.100.21/source/platform-bi-server into feature-refactor

zhuth 6 years ago
parent
commit
cf8f1e007f

+ 1 - 1
bi-server/src/main/java/com/usoftchina/bi/server/dao/chart/ChartsConfigMapper.java

@@ -257,7 +257,7 @@ public interface ChartsConfigMapper {
      * @param groupInfoList
      */
     @Update("<script>"
-            + "UPDATE BI_CHARTS_GROUP SET BC_CHARTS_GROUP = -1 WHERE BC_CHARTS_GROUP IN "
+            + "UPDATE BI_CHARTS_GROUP SET BC_FATHER_ID = -1 WHERE BC_FATHER_ID IN "
             + "<foreach collection=\"list\" item=\"item\" index=\"index\" open=\"(\" close=\")\" separator=\",\">"
             +   "#{item.id, jdbcType=INTEGER}"
             + "</foreach>"

+ 3 - 3
bi-server/src/main/java/com/usoftchina/bi/server/dao/chart/ShowChartsMapper.java

@@ -223,15 +223,15 @@ public interface ShowChartsMapper {
     /*
     总体分组的值
      */
-    @Select("select ${groupBy},${operation} from ${tableName} ${screen} group by ${groupBy} order by ${groupByOne}")
+    @Select("select ${groupBy},${operation} from ${tableName} group by ${groupBy} order by ${groupByOne}")
     List<LinkedHashMap<String, Object>> getGroupByValue(@Param("groupBy") String groupBy, @Param("operation") String operation, @Param("tableName") String tableName,
                                                         @Param("groupByOne") String groupByOne, @Param("screen") String screen);
 
     /*
     总体TH值
      */
-    @Select("select median(${columnName}) from sale where ${columnName} between " +
-            " (select ${fOperation}(${columnName}) from sale) and (select ${aOperation}(${columnName}) from ${tableName})" +
+    @Select("select median(${columnName}) from ${tableName} where ${columnName} between " +
+            " (select ${fOperation}(${columnName}) from ${tableName}) and (select ${aOperation}(${columnName}) from ${tableName})" +
             " group by " +
             " ${groupBy} order by ${groupByOne}")
     List<LinkedHashMap<String, Object>> getGroupByValueTh(@Param("groupBy") String groupBy, @Param("columnName") String columnName, @Param("tableName") String tableName,

+ 2 - 2
bi-server/src/main/java/com/usoftchina/bi/server/dao/dashboard/DashBoardMenuMapper.java

@@ -23,9 +23,9 @@ public interface DashBoardMenuMapper {
             + " UNION "
             + " SELECT ID id,BD_NAME name,'dashboard' type,BD_MENUID parentId FROM BI_DASHBOARDS WHERE BD_MENUID = #{id, jdbcType=INTEGER} AND CREATE_ID = #{userId,jdbcType=INTEGER} "
             + " UNION "
-            + " SELECT ID id,BD_NAME name,'dashboard' type,BD_MENUID parentId FROM BI_POWER_USERS INNER JOIN BI_DASHBOARDS ON ID = BPU_DASHBOARDID WHERE BPU_USERID = #{userId,jdbcType=INTEGER} "
+            + " SELECT ID id,BD_NAME name,'dashboard' type,BD_MENUID parentId FROM BI_POWER_USERS INNER JOIN BI_DASHBOARDS ON ID = BPU_DASHBOARDID WHERE BPU_USERID = #{userId,jdbcType=INTEGER} AND BD_MENUID = #{id, jdbcType=INTEGER} "
             + " UNION "
-            + " SELECT ID id,BD_NAME name,'dashboard' type,BD_MENUID parentId FROM BI_POWER_USERS INNER JOIN BI_DASHBOARDS ON ID = BPU_DASHBOARDID WHERE BPU_USERGROUPID IN (SELECT BR_USER_GROUP FROM BI_USER_REL_GROUPS WHERE BR_USER_ID = #{userId,jdbcType=INTEGER}) ")
+            + " SELECT ID id,BD_NAME name,'dashboard' type,BD_MENUID parentId FROM BI_POWER_USERS INNER JOIN BI_DASHBOARDS ON ID = BPU_DASHBOARDID WHERE BPU_USERGROUPID IN (SELECT BR_USER_GROUP FROM BI_USER_REL_GROUPS WHERE BR_USER_ID = #{userId,jdbcType=INTEGER}) AND BD_MENUID = #{id, jdbcType=INTEGER}")
     List<DashboardMenuRespDTO> getMenuById(@Param("userId") int userId, @Param("id") int id);
 
     /**

+ 2 - 1
bi-server/src/main/java/com/usoftchina/bi/server/dao/dashboard/DashboardsMapper.java

@@ -109,7 +109,8 @@ public interface DashboardsMapper {
             " from BI_DASHBOARDS where (id in " +
             " (select bo_da_id from bi_DASHBOARDS_object " +
             " where (bo_type = '0' and bo_ob_id in (select br_user_group from bi_user_rel_groups where br_user_id= #{userId}))" +
-            " or (BO_TYPE='1' and bo_ob_id = #{userId} )) or create_id = #{userId}) and id = #{id}")
+            " or (BO_TYPE='1' and bo_ob_id = #{userId} )) or create_id = #{userId} " +
+            "or id in (select bpu_dashboardid from bi_power_users where bpu_userid = #{userId} or bpu_usergroupid in (select br_user_group from bi_user_rel_groups where br_user_id = #{userId})) ) and id = #{id}")
     @Results(id = "DashBoardsResultMap", value = {
             @Result(column = "id", property = "id", jdbcType = JdbcType.INTEGER),
             @Result(column = "bdName", property = "bdName", jdbcType = JdbcType.VARCHAR),

+ 0 - 15
bi-server/src/main/java/com/usoftchina/bi/server/service/chart/ShowPopulationService.java

@@ -147,23 +147,8 @@ public class ShowPopulationService {
             List<LinkedHashMap<String, Object>> valueListTh = new ArrayList<>();
 
             Iterator thList = operatorOther.iterator();
-            while (thList.hasNext()){
-                String oprTh = (String) thList.next();
-                String fOpertion = "";
-                String aOpertion = "";
-                if ("25th".equals(oprTh)){
-                    fOpertion = "min";
-                    aOpertion = "median";
-                }else if ("75th".equals(oprTh)) {
-                    fOpertion = "median";
-                    aOpertion = "max";
-                }
-                valueListTh = showChartsMapper.getGroupByValueTh(groupBy, columnName, tableName, listOne, screen, fOpertion, aOpertion);
-
-            }
 
             valueList = showChartsMapper.getGroupByValue(groupBy, opr, tableName, listOne, screenStr);
-            valueList.addAll(valueListTh);
             popAndIndDataInfo.setValueList(valueList);
             return new RepEntity(RepCode.success, popAndIndDataInfo);
         }

+ 2 - 2
bi-server/src/main/java/com/usoftchina/bi/server/utils/ScreenUtil.java

@@ -212,11 +212,11 @@ public class ScreenUtil {
                 break;
             case "year" :
                 formatValue = localDate.plusYears(0).with(TemporalAdjusters.firstDayOfYear()).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) + ","
-                        + localDate.plusWeeks(0).with(TemporalAdjusters.firstDayOfYear()).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
+                        + localDate.plusYears(0).with(TemporalAdjusters.lastDayOfYear()).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
                 break;
             case "lastyear" :
                 formatValue = localDate.plusYears(-1).with(TemporalAdjusters.firstDayOfYear()).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) + ","
-                        + localDate.plusWeeks(-1).with(TemporalAdjusters.firstDayOfYear()).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
+                        + localDate.plusWeeks(-1).with(TemporalAdjusters.lastDayOfYear()).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
                 break;
             default:
                 formatValue = value;