jinpengyong
2022-03-09 8228b06f808840d95d58e4ad457e072800af33e6
screen-manage/src/main/java/com/moral/api/controller/OrganizationLayoutController.java
@@ -52,9 +52,22 @@
        Map<String, Integer> map = new HashMap<>();
        map.put("organization_id",organization_id);
        map.put("version_id",version_id);
        organizationLayoutService.delete(map);
        List<OrganizationLayout> organizationLayouts = organizationLayoutSetUp.getOrganizationLayouts();
        organizationLayoutService.insertList(organizationLayouts);
        organizationLayoutService.setUp(map,organizationLayouts);
        return ResultMessage.ok();
    }
    @RequestMapping(value = "getLayoutByMac", method = RequestMethod.GET)
    @ResponseBody
    public ResultMessage getLayoutByMac(HttpServletRequest request){
        Map<String,Object> parameters = WebUtils.getParametersStartingWith(request,null);
        if (ObjectUtils.isEmpty(parameters.get("mac"))){
            return ResultMessage.fail(ResponseCodeEnum.PARAMETERS_IS_MISSING.getCode(),ResponseCodeEnum.PARAMETERS_IS_MISSING.getMsg());
        }
        Map<String,Object> resultMap = organizationLayoutService.getLayoutByMac(parameters.get("mac").toString());
        if (ObjectUtils.isEmpty(resultMap)){
            return null;
        }
        return ResultMessage.ok(resultMap);
    }
}