Browse Source

Merge branch 'huangyuan-user' of lift-manager/lift-server into develop

huangyuan 5 years ago
parent
commit
d9093b5463

+ 1 - 2
lift-batch-service/src/main/java/cn/com/ty/lift/batch/config/AppletDataSchedulingConfig.java

@@ -3,7 +3,6 @@ package cn.com.ty.lift.batch.config;
 import cn.com.ty.lift.batch.applet.util.DataInitUtil;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.scheduling.annotation.EnableScheduling;
-import org.springframework.scheduling.annotation.Scheduled;
 
 import javax.annotation.Resource;
 
@@ -20,7 +19,7 @@ public class AppletDataSchedulingConfig {
     private DataInitUtil dataInitUtil;
 
     //定时刷新redis中的数据,每天凌晨两点执行
-    @Scheduled(cron = "0 0 2 * * ?")
+    //@Scheduled(cron = "0 0 2 * * ?")
     public void flushRedisCacheData(){
         dataInitUtil.initAppletData();
     }

+ 10 - 0
lift-business-service/src/main/java/cn/com/ty/lift/business/common/CommonController.java

@@ -175,4 +175,14 @@ public class CommonController {
         common.setMaintain(maintain);
         return RestResponse.success(common);
     }
+
+    @PostMapping("propertyCount")
+    public RestResponse propertyCount(@RequestBody CommonRequest request) {
+        long repair = emergencyRepairService.countDoingByUser(request);
+        long maintain = maintenancePlanService.countWaitingMaintenanceByUser(request);
+        CommonResponse common = new CommonResponse();
+        common.setRepair(repair);
+        common.setMaintain(maintain);
+        return RestResponse.success(common);
+    }
 }

+ 3 - 1
lift-push/src/main/resources/application.yml

@@ -1,11 +1,13 @@
 server:
   port: 20233
+  tomcat:
+    basedir: /Users/huangyuan/application/tomcat/data/tomcat_temp
 
 spring:
   application:
     name: lift-push-service
   profiles:
-    active: prod
+    active: test
   datasource:
     hikari:
       max-lifetime: 1200000 # default: 1800000

+ 2 - 1
lift-system-service/src/main/java/cn/com/ty/lift/system/user/service/impl/LoginService.java

@@ -464,7 +464,8 @@ public class LoginService implements ILoginService {
         //设置用户公司id
         userInfoMap.put(ApiConstants.CURRENT_COMPANY_ID, userResponse.getMaintenanceCompany().getId());
         //设置用户菜单信息
-        userInfoMap.put(ApiConstants.CURRENT_PERMISSION_URL, menuService.menuToUrl(userResponse.getMenus()));
+        userInfoMap.put(ApiConstants.CURRENT_PERMISSION_URL, menuService.menuToUrl(ProjectUtils
+                .deepCopy(userResponse.getMenus())));
         putUserInfoToRedis(userRequest, userResponse, userInfoMap, mobileUserInfo);
     }
 

+ 10 - 7
lift-system-service/src/main/java/cn/com/ty/lift/system/user/service/impl/RoleMenuService.java

@@ -13,6 +13,7 @@ import org.springframework.stereotype.Service;
 import javax.annotation.Resource;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * @author huangyuan
@@ -54,15 +55,17 @@ public class RoleMenuService extends ServiceImpl<RoleMenuMapper, RoleMenu> imple
     @Override
     public List<Menu> getMenuTree(Long roleId) {
         List<RoleMenu> roleMenuList = this.list(new QueryWrapper<RoleMenu>()
-            .eq("role_id", roleId)
+                .eq("role_id", roleId)
         );
-        List<Long> menuIds = ProjectUtils.getAttrList(roleMenuList, "menuId", null);
-        if(menuIds != null && menuIds.size() > 0){
-            //获取所有菜单
-            List<Menu> menuList = (List<Menu>) menuService.listByIds(menuIds);
-            return menuService.getMenuTree(menuList);
+        if (roleMenuList != null && roleMenuList.size() > 0) {
+            List<Long> menuIds = roleMenuList.stream().map(RoleMenu::getMenuId).collect(Collectors.toList());
+            if (menuIds.size() > 0) {
+                //获取所有菜单
+                List<Menu> menuList = (List<Menu>) menuService.listByIds(menuIds);
+                //将菜单转化为树
+                return menuService.getMenuTree(menuList);
+            }
         }
-        //将菜单转化为树
         return null;
     }
 }