[精讚] [會員登入]
24

學習帳號不在籍處理

雲端校務系統中學生異動可能是因轉學造成短期空檔不在籍 所以在判斷停用後, 時間註記在 syncAccount.getDa

分享此文連結 //n.sfs.tw/16260

分享連結 學習帳號不在籍處理@igogo
(文章歡迎轉載,務必尊重版權註明連結來源)
2024-09-24 14:25:11 最後編修
2023-10-04 15:00:54 By igogo
 

 

 

雲端校務系統中學生異動可能是因轉學造成短期空檔不在籍

所以在判斷停用後, 時間註記在 syncAccount.getDataTimestamp()

超過30天未更新且又是停用者, 先寄mail通知

超過90天後,

找出 account 為停用 且 syncAccount.getDataTimestamp() 超過90天者及syncAccount.getOutOfStudyTimestamp() == 0

執行停權並將syncAccount.setOutOfStudyTimestamp() 設為執行時間

 

學生回復學籍時, syncAccount.getOutOfStudyTimestamp() 再標記為0

 

部份程式


  List<SyncAccount> syncAccounts = syncAccountService.findByOutofStudyConditionBefore(100);

        syncAccounts.forEach(syncAccount -> {
            Instant instant = Instant.ofEpochSecond(syncAccount.getDataTimestamp());
            ZonedDateTime present = instant.atZone(ZoneId.of("Asia/Taipei"));  //taipei時區
            Account account = accountDAO.findAccountByPID(syncAccount.getPid());
            UserName userName = accountUtilsService.getUserName(account);

            User user = null;
            try {
                user = userService.getUser(syncAccount.getGoogle_account());


                logger.info(account.getGoogle_account() + ",is suspended? " + user.getSuspended());

                if (user.getSuspended() == false) {
                    logger.info("set user suspensed: " + account.getGoogle_account());
                    user.setOrgUnitPath("/停用");
                    user.setSuspended(true);
                }

                userName.setFamilyName("停用");
                user.setName(userName);
                user = userService.update(user);



                //學習帳號列表
                StUser stUser = syncStUserService.findStUserByEmail(syncAccount.getGoogle_account());
                stUser.setFullname(userName.getFamilyName() + userName.getFullName());
                stUser.setUpdateTimestamp(Instant.now().getEpochSecond());
                stUser.setOrgUnitPath("/停用");
                stUser.setSuspended(true);
                syncStUserService.save(stUser);


                //資料庫帳號更新參照
                syncAccount.setName(userName.getFamilyName() + userName.getFullName());
                syncAccount.setOutOfStudyTimestamp(Instant.now().getEpochSecond());
                syncAccountService.save(syncAccount);


            } catch (Exception e) {
                throw new RuntimeException(e);
            }


        });

 

 

 

END

你可能感興趣的文章

學習帳號不在籍處理 雲端校務系統中學生異動可能是因轉學造成短期空檔不在籍 所以在判斷停用後, 時間註記在 syncAccount.getDa

我有話要說

>>

限制:留言最高字數1000字。 限制:未登入訪客,每則留言間隔需超過10分鐘,每日最多5則留言。

訪客留言

[無留言]

隨機好文

[vue.js] 設定 content type 今天在wickt 端怎麼就是收不到vue.js 以post 傳過來的資料 找了好久才發現 application/jso

axios vuejs application/x-www-form-urlencoded 送資料 VUE.JS 以 application/x-www-form-urlencoded 送資料

2018 hoc 頒獎 校慶到了,啦啦隊比賽如火如荼展開,學務主任將頒發獎狀給表現優異的班級。請完成以下程式碼,讓程式將啦啦隊表演成績由高至低依序輸出。

找尋多個文件夾中最新檔案(jpg,png,txt)並複製到nexus資料夾 找尋多個文件夾中最新檔案(jpg,png,txt)並複製到集中資料夾

題庫批次匯入google表單 請先建一新試算表, 將題目轉成格式如下 並將網址列記下來, 後續的題目就是從此試算表讀出 題目 答案 選項一 選項二 選