wangli пре 4 година
родитељ
комит
42bb656dbf

+ 5 - 1
operation_manager/src/main/resources/application-sit.properties

@@ -86,6 +86,10 @@ UMIS.sys_excel_path=/UMIS_USER_EXCEL/
 UMIS.sys_video_path=/UMIS_USER_VIDEOS/
 wf.svg.file.path=D:/test/
 
-
+# 设置 feign 客户端超时时间(OpenFeign 默认支持 ribbon)
+# 值的是建立连接所用的时间,使用与网络状态正常的情况,两端连接所用的时间
+ribbon.ReadTimeout=5000
+# 指的是建立连接后从服务器读取到可用资源所用的时间
+ribbon.ConnectionTimeout=5000
 
 

+ 5 - 3
sms_water/src/main/java/com/huaxu/service/impl/MonitorDataReportServiceImpl.java

@@ -631,7 +631,8 @@ public class MonitorDataReportServiceImpl implements MonitorDataReportService {
         //水厂获取实时流量并计算出当天流量
         for (DeviceWaterDetail deviceWaterDetail : deviceSupplyWaterDetailsForDay) {
             MonitorDataEntity monitorDataEntity = MonitorDataMap.get(deviceWaterDetail.getDeviceId());
-            if (monitorDataEntity != null && monitorDataEntity.getDataValues() != null && monitorDataEntity.getDataValues().size() > 0) {
+            if (monitorDataEntity != null && monitorDataEntity.getDataValues() != null && monitorDataEntity.getDataValues().size() > 0
+                && deviceWaterDetail != null && deviceWaterDetail.getLatestValue() != null) {
                 for (MonitorDataValueEntity monitorDataValueEntity : monitorDataEntity.getDataValues()) {
                     if (monitorDataValueEntity.getAttributeId().equals(deviceWaterDetail.getAttributeId())) {
                         //累计当天流量
@@ -644,7 +645,8 @@ public class MonitorDataReportServiceImpl implements MonitorDataReportService {
         //水源获取实时流量并计算出当天流量
         for (DeviceWaterDetail deviceWaterDetail : deviceIntakeWaterDetailsForDay) {
             MonitorDataEntity monitorDataEntity = MonitorDataMap.get(deviceWaterDetail.getDeviceId());
-            if (monitorDataEntity != null && monitorDataEntity.getDataValues() != null && monitorDataEntity.getDataValues().size() > 0) {
+            if (monitorDataEntity != null && monitorDataEntity.getDataValues() != null && monitorDataEntity.getDataValues().size() > 0
+                    && deviceWaterDetail != null && deviceWaterDetail.getLatestValue() != null) {
                 for (MonitorDataValueEntity monitorDataValueEntity : monitorDataEntity.getDataValues()) {
                     if (monitorDataValueEntity.getAttributeId().equals(deviceWaterDetail.getAttributeId())) {
                         //累计当天流量
@@ -841,7 +843,7 @@ public class MonitorDataReportServiceImpl implements MonitorDataReportService {
 
         List<SceneWaterAmount> sceneWaterAmounts = new ArrayList<>();
         deviceSupplyWaterDetailsForDay.stream()
-                .filter(item -> StringUtils.isNotBlank(item.getSceneName()))
+                .filter(item -> StringUtils.isNotBlank(item.getSceneName()) && item != null && item.getLatestValue() != null )
                 .collect(Collectors.groupingBy(item -> item.getSceneName(), Collectors.toList()))
                 .forEach((key, value) -> {
                     SceneWaterAmount sceneWaterAmount = new SceneWaterAmount();

+ 7 - 7
sms_water/src/main/resources/mapper/MonitorDataReportMapper.xml

@@ -918,7 +918,7 @@
             sum(r.SUM_VALUE) as "amount"
         from sms_scene_type st
         left join sms_scene s on s.SCENE_TYPE_ID =st.id
-        left join sms_device_parm dp on s.id=dp.SCENE_ID
+        left join sms_device_parm dp on s.id=dp.PARENT_SCENE_ID
         left join sms_month_report r on r.DEVICE_ID= dp.DEVICE_ID and r.ATTRIBUTE_ID = dp.ATTRIBUTE_ID
 
         where  dp.`STATUS`=1 and st.SCENE_TYPE_NAME = '水厂' and s.ENABLE_STATE = 1
@@ -963,7 +963,7 @@
             ,dp.PARM_TYPE as "parmType"
         from sms_scene_type st
         left join sms_scene s on s.SCENE_TYPE_ID =st.id
-        left join sms_device_parm dp on s.id=dp.SCENE_ID
+        left join sms_device_parm dp on s.id=dp.PARENT_SCENE_ID
         where  dp.`STATUS`=1 and st.SCENE_TYPE_NAME = #{sceneTypeName} and s.ENABLE_STATE = 1
         and dp.PARM_TYPE =#{parmType}   and dp.TENANT_ID=#{tenantId}
         <if test="userType!=null and userType!=-999 and userType!=-9999 and  programItems != null and programItems.size() > 0">
@@ -1001,7 +1001,7 @@
             ,dp.DEVICE_ID as "deviceId"
             ,dp.ATTRIBUTE_ID as "attributeId"
             ,dp.PARM_TYPE as "parmType"
-            ,ifnull(r.LATEST_VALUE,0)  as "latestValue"
+            ,r.LATEST_VALUE  as "latestValue"
         from sms_scene_type st
         left join sms_scene s on s.SCENE_TYPE_ID =st.id
         left join sms_device_parm dp on s.id=dp.PARENT_SCENE_ID
@@ -1042,7 +1042,7 @@
             sum(ifnull(r.SUM_VALUE,0)) as "amount"
         from sms_scene_type st
         left join sms_scene s on s.SCENE_TYPE_ID =st.id
-        left join sms_device_parm dp on s.id=dp.SCENE_ID
+        left join sms_device_parm dp on s.id=dp.PARENT_SCENE_ID
         left join sms_month_report r on r.DEVICE_ID= dp.DEVICE_ID and r.ATTRIBUTE_ID = dp.ATTRIBUTE_ID and r.year = #{year} and r.month= #{month}
         where  dp.`STATUS`=1 and st.SCENE_TYPE_NAME = #{sceneTypeName} and s.ENABLE_STATE = 1
         and dp.PARM_TYPE =#{parmType}   and dp.TENANT_ID=#{tenantId}
@@ -1080,7 +1080,7 @@
             sum(ifnull(r.SUM_VALUE,0)) as "amount"
         from sms_scene_type st
         left join sms_scene s on s.SCENE_TYPE_ID =st.id
-        left join sms_device_parm dp on s.id=dp.SCENE_ID
+        left join sms_device_parm dp on s.id=dp.PARENT_SCENE_ID
         left join sms_year_report r on r.DEVICE_ID= dp.DEVICE_ID and r.ATTRIBUTE_ID = dp.ATTRIBUTE_ID and r.year = #{year}
         where  dp.`STATUS`=1 and st.SCENE_TYPE_NAME = #{sceneTypeName} and s.ENABLE_STATE = 1
         and dp.PARM_TYPE =#{parmType}   and dp.TENANT_ID=#{tenantId}
@@ -1172,7 +1172,7 @@
         from sms_scene_type st
             left join sms_scene s on s.SCENE_TYPE_ID =st.id and PARENT_SCENE_ID ='0'
             left join sms_device_parm dp on dp.PARENT_SCENE_ID =s.ID
-            left join sms_alarm_details ad on ad.STATE = 1 and ad.SCENE_ID=dp.SCENE_ID and ad.DEVICE_ID =dp.DEVICE_ID and ad.ATTRIBUTE_ID =dp.ATTRIBUTE_ID
+            left join sms_alarm_details ad on ad.STATE = 1 and ad.PARENT_SCENE_ID=dp.PARENT_SCENE_ID and ad.DEVICE_ID =dp.DEVICE_ID and ad.ATTRIBUTE_ID =dp.ATTRIBUTE_ID
 
             where s.`STATUS`=1  and s.ENABLE_STATE = 1 and st.SCENE_TYPE_NAME = '水厂' and s.TENANT_ID =#{tenantId}  and dp.`STATUS` = 1
 
@@ -1218,7 +1218,7 @@
             ,da.UNIT as "unit"
         from sms_scene_type st
         left join sms_scene s on s.SCENE_TYPE_ID =st.id
-        left join sms_device_parm dp on s.id=dp.SCENE_ID
+        left join sms_device_parm dp on s.id=dp.PARENT_SCENE_ID
         left join sms_device_attribute da on dp.ATTRIBUTE_ID =da.ID
         left join sms_month_report r on r.DEVICE_ID =dp.DEVICE_ID and r.ATTRIBUTE_ID = dp.ATTRIBUTE_ID
         where  dp.`STATUS`=1 and st.SCENE_TYPE_NAME = #{sceneTypeName} and s.ENABLE_STATE = 1

+ 2 - 2
user_center/src/main/java/com/huaxu/controller/OrgController.java

@@ -140,8 +140,8 @@ public class OrgController {
         return new AjaxMessage<>(ResultStatus.OK, orgService.getUserTrees(org));
     }
 
-      @RequestMapping(value = "getAllByTenantId", method = RequestMethod.POST)
-      List<Org>getAllByTenantId(){
+    @RequestMapping(value = "getAllByTenantId", method = RequestMethod.POST)
+    public List<Org> getAllByTenantId(){
         Org org=new Org();
         org.setStatus(1);
         org.setTenantId(UserUtil.getCurrentUser().getTenantId());

+ 0 - 1
user_center/src/main/java/com/huaxu/controller/TenantController.java

@@ -92,7 +92,6 @@ public class TenantController {
      * 新增租户logo
      */
     @RequestMapping(value = "addTenantLogo", method = RequestMethod.POST)
-    @ResponseBody
     @ApiOperation(value = "租户logo")
     public  AjaxMessage<String>  addUserPhoto(@ApiParam(value = "租户logo", required = true)@RequestParam("avatarfile") MultipartFile file) {
         String avatar = "";

+ 0 - 11
user_center/src/main/java/com/huaxu/controller/UserController.java

@@ -135,7 +135,6 @@ public class UserController {
      */
     @ApiOperation(value = "用户头像")
     @RequestMapping(value = "addUserPhoto", method = RequestMethod.POST)
-    @ResponseBody
     public AjaxMessage<String> addUserPhoto(@ApiParam(value = "用户头像", required = true) @RequestParam("avatarfile") MultipartFile file) {
         String avatar = "";
         if (!file.isEmpty()) {
@@ -154,7 +153,6 @@ public class UserController {
     @LogAnnotation(module = "【用户管理】新增")
     @ApiOperation(value = "新增用户信息")
     @RequestMapping(value = "addUser", method = RequestMethod.POST)
-    @ResponseBody
     public AjaxMessage<Integer> addUser(@ApiParam(value = "用户信息", required = true) @RequestBody UserEntity user) {
         if (user.getPhone() != null) {
             boolean isExsit = userService.checkMobileUnique(user.getPhone());
@@ -184,7 +182,6 @@ public class UserController {
     @LogAnnotation(module = "【用户管理】修改")
     @ApiOperation(value = "更新用户信息")
     @RequestMapping(value = "/updateUserById", method = RequestMethod.POST)
-    @ResponseBody
     public AjaxMessage<Integer> editUser(@ApiParam(value = "用户信息", required = true) @RequestBody UserEntity user) {
         if (user.getPhone() != null) {
             boolean isExsit = userService.checkMobileUnique(user);
@@ -208,7 +205,6 @@ public class UserController {
     @LogAnnotation(module = "【用户管理】批量删除")
     @ApiOperation(value = "按ID进行批量删除")
     @RequestMapping(value = "/deleteUserByIds", method = RequestMethod.POST)
-    @ResponseBody
     public AjaxMessage<Integer> deleteUserByIds(@ApiParam(value = "用户ID", required = true) @RequestBody Long[] ids) {
         LoginUser currentUser = UserUtil.getCurrentUser();
         Integer userId = currentUser.getId();
@@ -242,7 +238,6 @@ public class UserController {
     @LogAnnotation(module = "【用户管理】单条删除")
     @ApiOperation(value = "按ID进行单个删除")
     @RequestMapping(value = "/deleteUserById", method = RequestMethod.POST)
-    @ResponseBody
     public AjaxMessage<Integer> deleteUserById(@ApiParam(value = "用户ID", required = true) @RequestParam Long id) {
         LoginUser currentUser = UserUtil.getCurrentUser();
         Integer userId = currentUser.getId();
@@ -259,7 +254,6 @@ public class UserController {
         return new AjaxMessage<>(ResultStatus.OK, result);
     }
     @RequestMapping(value = "/getUserIdsByOrgId", method = RequestMethod.POST)
-    @ResponseBody
     public List<Integer>getUserIdsByOrgId(String ids) {
         List list = JSONObject.parseObject(ids, List.class);
         List<Integer> result = userService.getUserIdsByOrgId(list);
@@ -267,20 +261,17 @@ public class UserController {
     }
 
     @RequestMapping(value = "/findUserIdsByOrgId", method = RequestMethod.GET)
-    @ResponseBody
     public AjaxMessage<List<UserEntity>> findUserIdsByOrgId(String ids) {
         List list = JSONObject.parseObject(ids, List.class);
         List<UserEntity> result = userService.findUserIdsByOrgId(list);
         return new AjaxMessage<>(ResultStatus.OK,result);
     }
     @RequestMapping(value = "/findUserList", method = RequestMethod.GET)
-    @ResponseBody
     public AjaxMessage<List<UserListDto>> findUserList() {
         List<UserListDto> userList = userService.findUserList();
         return new AjaxMessage<>(ResultStatus.OK,userList);
     }
     @RequestMapping(value = "/findUserIdsByUserIds", method = RequestMethod.POST)
-    @ResponseBody
     public List<UserEntity> findUserIdsByUserIds(Long[] ids) {
         List list = Arrays.asList(ids.clone());
         List<UserEntity> result = userService.findUserIdsByUserIds(list);
@@ -288,7 +279,6 @@ public class UserController {
     }
     @ApiOperation(value = "获取登录用户所属机构及其上级机构用户信息")
     @RequestMapping(value = "/findUserIdsForOrg", method = RequestMethod.GET)
-    @ResponseBody
     public List<Long> findUserIdsForOrg() {
         List<Long> ids = new ArrayList<>();
         List<UserEntity> result = userService.findUserIdsForOrg();
@@ -300,7 +290,6 @@ public class UserController {
 
     @ApiOperation(value = "查询拥有此机构权限的用户")
     @RequestMapping(value = "/findUserIdsByPermissonOrg", method = RequestMethod.POST)
-    @ResponseBody
     public List<Integer> findUserIdsByPermissonOrg(
             @RequestParam(value = "tenantId", required = false) String tenantId,
             @RequestParam(value = "companyOrgId", required = false)Integer companyOrgId,

+ 7 - 0
user_center/src/main/resources/application-dev.properties

@@ -82,3 +82,10 @@ receive.exchange.name=messageExchange
 dispath.routing.key=dipathKey
 
 
+# 设置 feign 客户端超时时间(OpenFeign 默认支持 ribbon)
+# 值的是建立连接所用的时间,使用与网络状态正常的情况,两端连接所用的时间
+ribbon.ReadTimeout=5000
+# 指的是建立连接后从服务器读取到可用资源所用的时间
+ribbon.ConnectionTimeout=5000
+
+