Przeglądaj źródła

Merge branch 'master' of http://116.63.33.55/git/read_opc

FinalYu 2 lat temu
rodzic
commit
31b6231dde
34 zmienionych plików z 81 dodań i 5 usunięć
  1. 1 1
      chaunyi_opc/opc_da/src/main/java/com/example/opc_da/controller/ReportTableController.java
  2. 13 0
      chaunyi_opc/opc_da/src/main/java/com/example/opc_da/controller/UserController.java
  3. 2 0
      chaunyi_opc/opc_da/src/main/java/com/example/opc_da/dao/ItemGroupDao.java
  4. 2 0
      chaunyi_opc/opc_da/src/main/java/com/example/opc_da/dao/UserDao.java
  5. 2 0
      chaunyi_opc/opc_da/src/main/java/com/example/opc_da/service/UserService.java
  6. 12 0
      chaunyi_opc/opc_da/src/main/java/com/example/opc_da/service/impl/ReportTableServiceImpl.java
  7. 20 0
      chaunyi_opc/opc_da/src/main/java/com/example/opc_da/service/impl/UserServiceImpl.java
  8. 1 1
      chaunyi_opc/opc_da/src/main/resources/application.yml
  9. 17 1
      chaunyi_opc/opc_da/src/main/resources/mapper/ItemGroupDao.xml
  10. 6 0
      chaunyi_opc/opc_da/src/main/resources/mapper/UserDao.xml
  11. 1 1
      chaunyi_opc/opc_da/src/main/resources/static/app/index.html
  12. 0 0
      chaunyi_opc/opc_da/src/main/resources/static/app/static/js/chunk-vendors.35954aaa.js
  13. 0 0
      chaunyi_opc/opc_da/src/main/resources/static/app/static/js/chunk-vendors.7d651a70.js
  14. 0 0
      chaunyi_opc/opc_da/src/main/resources/static/app/static/js/index.47e87224.js
  15. 0 0
      chaunyi_opc/opc_da/src/main/resources/static/app/static/js/index.8b6b38d7.js
  16. 0 0
      chaunyi_opc/opc_da/src/main/resources/static/app/static/js/pages-login-index.2a159b3a.js
  17. 0 0
      chaunyi_opc/opc_da/src/main/resources/static/app/static/js/pages-login-index.c7063e47.js
  18. 0 0
      chaunyi_opc/opc_da/src/main/resources/static/app/static/js/pages-login-index~pages-user-index.44d1c315.js
  19. 0 0
      chaunyi_opc/opc_da/src/main/resources/static/app/static/js/pages-login-index~pages-user-index.be72c672.js
  20. 0 0
      chaunyi_opc/opc_da/src/main/resources/static/app/static/js/pages-message-index.dd1a599d.js
  21. 0 0
      chaunyi_opc/opc_da/src/main/resources/static/app/static/js/pages-message-index.ecc7aa27.js
  22. 0 0
      chaunyi_opc/opc_da/src/main/resources/static/app/static/js/pages-message-index~pages-message-msg-detail-index~pages-reportForm-index~pages-reportForm-report-de~7378e1f1.4b1019b3.js
  23. 0 0
      chaunyi_opc/opc_da/src/main/resources/static/app/static/js/pages-message-index~pages-message-msg-detail-index~pages-reportForm-index~pages-reportForm-report-de~7378e1f1.ef51d87f.js
  24. 0 0
      chaunyi_opc/opc_da/src/main/resources/static/app/static/js/pages-message-index~pages-reportForm-index.c9a4fb74.js
  25. 0 0
      chaunyi_opc/opc_da/src/main/resources/static/app/static/js/pages-message-index~pages-reportForm-index.ec286111.js
  26. 0 0
      chaunyi_opc/opc_da/src/main/resources/static/app/static/js/pages-message-msg-detail-index.62eb5040.js
  27. 0 0
      chaunyi_opc/opc_da/src/main/resources/static/app/static/js/pages-message-msg-detail-index.a393e18c.js
  28. 0 0
      chaunyi_opc/opc_da/src/main/resources/static/app/static/js/pages-reportForm-index.3bb42d0b.js
  29. 0 0
      chaunyi_opc/opc_da/src/main/resources/static/app/static/js/pages-reportForm-index.6dc8493b.js
  30. 0 0
      chaunyi_opc/opc_da/src/main/resources/static/app/static/js/pages-reportForm-report-detail-index.81d1b26f.js
  31. 0 0
      chaunyi_opc/opc_da/src/main/resources/static/app/static/js/pages-reportForm-report-detail-index.9c7dfd89.js
  32. 0 0
      chaunyi_opc/opc_da/src/main/resources/static/app/static/js/pages-user-index.9b09c104.js
  33. 0 0
      chaunyi_opc/opc_da/src/main/resources/static/app/static/js/pages-user-index.a6f66f4d.js
  34. 4 1
      chaunyi_opc/opc_ua/src/main/resources/application.yml

+ 1 - 1
chaunyi_opc/opc_da/src/main/java/com/example/opc_da/controller/ReportTableController.java

@@ -218,7 +218,7 @@ public class ReportTableController {
      * 报表类型转换
      *
      * @param id
-     * @param isAutoReport 0手动,1自动
+     * @param isAutoReport 0手动,1自动,3事件驱动
      * @return
      */
     @PostMapping("/tableExchangeTypeById")

+ 13 - 0
chaunyi_opc/opc_da/src/main/java/com/example/opc_da/controller/UserController.java

@@ -432,4 +432,17 @@ public class UserController {
         return userService.queryManagerUserNum();
     }
 
+    /**
+     * 在线用户人数
+     * @param loginType
+     * @return
+     */
+    @GetMapping("/getOnlineUser")
+    public Result getOnlineUser(String loginType){
+        if (Blank.isEmpty(loginType)){
+            return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), ResultEnum.REQUEST_WRONGPARAMS.getRespMsg());
+        }
+        return userService.getOnlineUser(loginType);
+    }
+
 }

+ 2 - 0
chaunyi_opc/opc_da/src/main/java/com/example/opc_da/dao/ItemGroupDao.java

@@ -48,4 +48,6 @@ public interface ItemGroupDao {
     Item getItemById(Integer id);
 
     String getItemDescribe(Integer itemGroupId, String itemName);
+
+    List<ItemGroup> getItemGroupListByTableId(Integer tableReportId);
 }

+ 2 - 0
chaunyi_opc/opc_da/src/main/java/com/example/opc_da/dao/UserDao.java

@@ -143,4 +143,6 @@ public interface UserDao {
     Integer deleteUserDepartment(String userId, List<Department> departmentList);
 
     List<Department> getNoShareOldDepartmentList(String userId, List<Department> departmentList);
+
+    List<String> getAllUserIdByType(Integer userType);
 }

+ 2 - 0
chaunyi_opc/opc_da/src/main/java/com/example/opc_da/service/UserService.java

@@ -123,4 +123,6 @@ public interface UserService {
 
 
     Result phoneUserLogin(User user);
+
+    Result getOnlineUser(String loginType);
 }

+ 12 - 0
chaunyi_opc/opc_da/src/main/java/com/example/opc_da/service/impl/ReportTableServiceImpl.java

@@ -7,6 +7,7 @@ import com.example.opc_common.util.Blank;
 import com.example.opc_common.util.ConstantStr;
 import com.example.opc_common.util.Result;
 import com.example.opc_da.dao.DictDao;
+import com.example.opc_da.dao.ItemGroupDao;
 import com.example.opc_da.dao.ReportTableDao;
 import com.example.opc_da.dynamicSchedule.CronTaskRegister;
 import com.example.opc_da.dynamicSchedule.SchedulingRunnable;
@@ -28,6 +29,9 @@ public class ReportTableServiceImpl implements ReportTableService {
     @Resource
     private ReportTableDao reportTableDao;
 
+    @Autowired
+    private ItemGroupDao itemGroupDao;
+
     @Resource
     private UserUtil userUtil;
 
@@ -175,6 +179,14 @@ public class ReportTableServiceImpl implements ReportTableService {
             reportTable.setUserGroupList(userGroupList);
         }
         if (isAutoReport == ConstantStr.AUTOMATIC_REPORT) {
+            List<ItemGroup> itemGroupList = itemGroupDao.getItemGroupListByTableId(id);
+            if (Blank.isNotEmpty(itemGroupList)) {
+                for (ItemGroup itemGroup : itemGroupList) {
+                    if (itemGroup.getRunState() == ConstantStr.START_UP) {
+                        return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "此报表作为事件驱动报表,已被配置在运行的数据组上了,请停止运行数据组后再试");
+                    }
+                }
+            }
             if (Blank.isEmpty(cron)) {
                 return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "cron表达式不能为空");
             }

+ 20 - 0
chaunyi_opc/opc_da/src/main/java/com/example/opc_da/service/impl/UserServiceImpl.java

@@ -654,6 +654,26 @@ public class UserServiceImpl implements UserService {
         }
     }
 
+    @Override
+    public Result getOnlineUser(String loginType) {
+        if (loginType.equals(ConstantStr.FRONT_USER_String)) {
+            List<String> userIdList = userDao.getAllUserIdByType(ConstantStr.FRONT_USER);
+            if (Blank.isEmpty(userIdList)) {
+                return Result.ok(0);
+            } else {
+                int count = 0;
+                for (String userId : userIdList) {
+                    if (Blank.isNotEmpty(redisUtil.get(ConstantStr.FRONT_USER_String + userId))) {
+                        count += 1;
+                    }
+                }
+                return Result.ok(count);
+            }
+        } else {
+            throw new CustomException(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "当前只支持查看客户端在线用户人数");
+        }
+    }
+
 
     @Override
     public synchronized Result updateUser(User user) {

+ 1 - 1
chaunyi_opc/opc_da/src/main/resources/application.yml

@@ -1,6 +1,6 @@
 spring:
   profiles:
-    active: dev
+    active: @spring.profiles.active@
   jackson:
     date-format: yyyy-MM-dd HH:mm:ss
     time-zone: GMT+8

+ 17 - 1
chaunyi_opc/opc_da/src/main/resources/mapper/ItemGroupDao.xml

@@ -55,7 +55,8 @@
         set data_model_id=#{dataModelId},
             event_mode=#{eventMode},
             event_value=#{eventValue},
-            table_report_id=#{tableReportId}, `describe`=#{describe}
+            table_report_id=#{tableReportId},
+            `describe`=#{describe}
         where id = #{id}
     </update>
 
@@ -185,4 +186,19 @@
         where item_group_id = #{itemGroupId}
           AND item_name = #{itemName}
     </select>
+
+    <select id="getItemGroupListByTableId" resultType="com.example.opc_common.entity.ItemGroup">
+        SELECT
+        <include refid="itemGroup"/>
+        FROM
+        t_item_group
+        WHERE
+        id IN (
+        SELECT DISTINCT
+        ( item_group_id )
+        FROM
+        t_item
+        WHERE
+        table_report_id = #{tableReportId})
+    </select>
 </mapper>

+ 6 - 0
chaunyi_opc/opc_da/src/main/resources/mapper/UserDao.xml

@@ -444,5 +444,11 @@
         )) sur on sr.id=sur.department_id
     </select>
 
+    <select id="getAllUserIdByType" resultType="java.lang.String">
+        select user_id
+        from sys_user
+        where user_type = #{userType}
+    </select>
+
 
 </mapper>

+ 1 - 1
chaunyi_opc/opc_da/src/main/resources/static/app/index.html

@@ -2,4 +2,4 @@
 				.supports('top: constant(a)'))
 			document.write(
 				'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
-				(coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=./static/index.63b34199.css><link rel=stylesheet href=./static/luckysheet/dist/plugins/plugins.css><link rel=stylesheet href=./static/luckysheet/dist/plugins/css/pluginsCss.css><link rel=stylesheet href=./static/luckysheet/dist/css/luckysheet.css><link rel=stylesheet href=./static/luckysheet/dist/assets/iconfont/iconfont.css><script src=./static/luckysheet/dist/luckysheet.umd.js></script><script src=./static/luckysheet/dist/plugins/js/plugin.js></script></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=./static/js/chunk-vendors.7d651a70.js></script><script src=./static/js/index.8b6b38d7.js></script></body></html>
+				(coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=./static/index.63b34199.css><link rel=stylesheet href=./static/luckysheet/dist/plugins/plugins.css><link rel=stylesheet href=./static/luckysheet/dist/plugins/css/pluginsCss.css><link rel=stylesheet href=./static/luckysheet/dist/css/luckysheet.css><link rel=stylesheet href=./static/luckysheet/dist/assets/iconfont/iconfont.css><script src=./static/luckysheet/dist/luckysheet.umd.js></script><script src=./static/luckysheet/dist/plugins/js/plugin.js></script></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=./static/js/chunk-vendors.35954aaa.js></script><script src=./static/js/index.47e87224.js></script></body></html>

Plik diff jest za duży
+ 0 - 0
chaunyi_opc/opc_da/src/main/resources/static/app/static/js/chunk-vendors.35954aaa.js


Plik diff jest za duży
+ 0 - 0
chaunyi_opc/opc_da/src/main/resources/static/app/static/js/chunk-vendors.7d651a70.js


Plik diff jest za duży
+ 0 - 0
chaunyi_opc/opc_da/src/main/resources/static/app/static/js/index.47e87224.js


Plik diff jest za duży
+ 0 - 0
chaunyi_opc/opc_da/src/main/resources/static/app/static/js/index.8b6b38d7.js


Plik diff jest za duży
+ 0 - 0
chaunyi_opc/opc_da/src/main/resources/static/app/static/js/pages-login-index.2a159b3a.js


Plik diff jest za duży
+ 0 - 0
chaunyi_opc/opc_da/src/main/resources/static/app/static/js/pages-login-index.c7063e47.js


Plik diff jest za duży
+ 0 - 0
chaunyi_opc/opc_da/src/main/resources/static/app/static/js/pages-login-index~pages-user-index.44d1c315.js


Plik diff jest za duży
+ 0 - 0
chaunyi_opc/opc_da/src/main/resources/static/app/static/js/pages-login-index~pages-user-index.be72c672.js


Plik diff jest za duży
+ 0 - 0
chaunyi_opc/opc_da/src/main/resources/static/app/static/js/pages-message-index.dd1a599d.js


Plik diff jest za duży
+ 0 - 0
chaunyi_opc/opc_da/src/main/resources/static/app/static/js/pages-message-index.ecc7aa27.js


Plik diff jest za duży
+ 0 - 0
chaunyi_opc/opc_da/src/main/resources/static/app/static/js/pages-message-index~pages-message-msg-detail-index~pages-reportForm-index~pages-reportForm-report-de~7378e1f1.4b1019b3.js


Plik diff jest za duży
+ 0 - 0
chaunyi_opc/opc_da/src/main/resources/static/app/static/js/pages-message-index~pages-message-msg-detail-index~pages-reportForm-index~pages-reportForm-report-de~7378e1f1.ef51d87f.js


Plik diff jest za duży
+ 0 - 0
chaunyi_opc/opc_da/src/main/resources/static/app/static/js/pages-message-index~pages-reportForm-index.c9a4fb74.js


Plik diff jest za duży
+ 0 - 0
chaunyi_opc/opc_da/src/main/resources/static/app/static/js/pages-message-index~pages-reportForm-index.ec286111.js


Plik diff jest za duży
+ 0 - 0
chaunyi_opc/opc_da/src/main/resources/static/app/static/js/pages-message-msg-detail-index.62eb5040.js


Plik diff jest za duży
+ 0 - 0
chaunyi_opc/opc_da/src/main/resources/static/app/static/js/pages-message-msg-detail-index.a393e18c.js


Plik diff jest za duży
+ 0 - 0
chaunyi_opc/opc_da/src/main/resources/static/app/static/js/pages-reportForm-index.3bb42d0b.js


Plik diff jest za duży
+ 0 - 0
chaunyi_opc/opc_da/src/main/resources/static/app/static/js/pages-reportForm-index.6dc8493b.js


Plik diff jest za duży
+ 0 - 0
chaunyi_opc/opc_da/src/main/resources/static/app/static/js/pages-reportForm-report-detail-index.81d1b26f.js


Plik diff jest za duży
+ 0 - 0
chaunyi_opc/opc_da/src/main/resources/static/app/static/js/pages-reportForm-report-detail-index.9c7dfd89.js


Plik diff jest za duży
+ 0 - 0
chaunyi_opc/opc_da/src/main/resources/static/app/static/js/pages-user-index.9b09c104.js


Plik diff jest za duży
+ 0 - 0
chaunyi_opc/opc_da/src/main/resources/static/app/static/js/pages-user-index.a6f66f4d.js


+ 4 - 1
chaunyi_opc/opc_ua/src/main/resources/application.yml

@@ -1,6 +1,9 @@
 spring:
   profiles:
-    active: dev
+    active: @spring.profiles.active@
+  jackson:
+    date-format: yyyy-MM-dd HH:mm:ss
+    time-zone: GMT+8
 
 mybatis:
   mapper-locations: classpath:mapper/*.xml

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików