ソースを参照

authourity to DB

master
MSI\2Fi 2週間前
コミット
23c69d3478
6個のファイルの変更62行の追加3行の削除
  1. +34
    -2
      src/main/java/com/ffii/tsms/modules/common/mail/service/MailReminderService.kt
  2. +6
    -1
      src/main/java/com/ffii/tsms/modules/common/mail/web/MailController.kt
  3. +6
    -0
      src/main/resources/db/changelog/changes/20250807_01_jasonT/01_add_authority_maintain_all_projects.sql
  4. +6
    -0
      src/main/resources/db/changelog/changes/20250807_01_jasonT/02_add_authority_generate_project_manhour.sql
  5. +5
    -0
      src/main/resources/db/changelog/changes/20250807_01_jasonT/03_add_authority_generate_project_manhour_daily.sql
  6. +5
    -0
      src/main/resources/db/changelog/changes/20250807_01_jasonT/04_add_authority_generate_last_modify_report.sql

+ 34
- 2
src/main/java/com/ffii/tsms/modules/common/mail/service/MailReminderService.kt ファイルの表示

@@ -115,7 +115,29 @@ open class MailReminderService(
mailService.send(mailRequestList)
}

// @Scheduled(cron = "0 0 6 7 * ?") // (SS/MM/HH/DD/MM/YY)
private fun createEmailRequestWithAdditionalInfo(content: String, emailTo: List<String>, info: String) {
val subject = settingsService.findByName(SettingNames.TIMESHEET_MAIL_SUBJECT).orElseThrow().value
val template = settingsService.findByName(SettingNames.TIMESHEET_MAIL_TEMPLATE).orElseThrow().value
val cc = settingsService.findByName(SettingNames.TIMESHEET_MAIL_CC).orElseThrow().value.split(",")
val bcc = settingsService.findByName(SettingNames.TIMESHEET_MAIL_BCC).orElseThrow().value.split(",")
val mailRequest = MailRequest.Builder()
.subject("<$info> $subject")
.templateContent(template)
.args(
mapOf(
Pair("date", content),
)
)
.addTo(emailTo)
.addCc(cc)
.addBcc(bcc)
.build()
val mailRequestList = mutableListOf<MailRequest>()
mailRequestList += mailRequest
mailService.send(mailRequestList)
}

@Scheduled(cron = "0 0 6 7 * ?") // (SS/MM/HH/DD/MM/YY)
open fun sendTimesheetToTeamLead7TH() {
logger.info("-----------------------")
logger.info("Scheduled Start: 7th email reminder")
@@ -244,7 +266,8 @@ open class MailReminderService(
.filter { it.missingDates.isNotEmpty() }
}

@Scheduled(cron = "0 0 6 7 * ?") // (SS/MM/HH/DD/MM/YY)
// This function will send email to team lead with cumulative record, fallback to v1
// @Scheduled(cron = "0 0 6 7 * ?") // (SS/MM/HH/DD/MM/YY)
open fun sendMissingTimesheetDateToTeamLead7th(){
logger.info("-----------------------")
logger.info("Scheduled Start: 7th email reminder V2")
@@ -733,6 +756,15 @@ open class MailReminderService(
}
println(fullLog)
}
}
open fun testEmail() {
logger.info("-----------------------")
logger.info("Test Email Reminder: Email name and cc")

val intro = StringBuilder("Jason, Staffs Missing Timesheet in the Table Below: \n")
val emailContent = intro
val receiver = listOf("[email protected]")
createEmailRequestWithAdditionalInfo(emailContent.toString(), receiver, "Group")
}

}

+ 6
- 1
src/main/java/com/ffii/tsms/modules/common/mail/web/MailController.kt ファイルの表示

@@ -37,7 +37,7 @@ class MailController(
}
@GetMapping("/test7th")
fun test7th() {
mailReminderService.sendMissingTimesheetDateToTeamLead7th()
mailReminderService.sendTimesheetToTeamLead7TH()
}
@GetMapping("/test15th")
fun test15th() {
@@ -53,4 +53,9 @@ class MailController(
fun test15thStaffList(){
mailReminderService.test15thStaffList()
}

@GetMapping("/test-email")
fun testEmail(){
mailReminderService.testEmail()
}
}

+ 6
- 0
src/main/resources/db/changelog/changes/20250807_01_jasonT/01_add_authority_maintain_all_projects.sql ファイルの表示

@@ -0,0 +1,6 @@
-- liquibase formatted sql
-- changeset jasonT:add_authories_records_maintain_all_projects

INSERT INTO `authority` (`authority`, `name`) VALUES
('MAINTAIN_ALL_PROJECTS', 'maintain all projects');


+ 6
- 0
src/main/resources/db/changelog/changes/20250807_01_jasonT/02_add_authority_generate_project_manhour.sql ファイルの表示

@@ -0,0 +1,6 @@
-- liquibase formatted sql
-- changeset jasonT:add_authories_records_maintain_all_projects

INSERT INTO `authority` (`authority`, `name`) VALUES
('G_PROJ_MANHOUR_SUMMARY_MONTHLY_R', 'generate project manhour summary monthly report');


+ 5
- 0
src/main/resources/db/changelog/changes/20250807_01_jasonT/03_add_authority_generate_project_manhour_daily.sql ファイルの表示

@@ -0,0 +1,5 @@
-- liquibase formatted sql
-- changeset jasonT:add_authories_records_daily_report

INSERT INTO `authority` (`authority`, `name`) VALUES
('G_PROJ_MANHOUR_SUMMARY_DAILY_R', 'generate project manhour summary daily report');

+ 5
- 0
src/main/resources/db/changelog/changes/20250807_01_jasonT/04_add_authority_generate_last_modify_report.sql ファイルの表示

@@ -0,0 +1,5 @@
-- liquibase formatted sql
-- changeset jasonT:add_authories_records_last_modified

INSERT INTO `authority` (`authority`, `name`) VALUES
('G_LAST_MODIFIED_REPORT', 'generate last modified report');

読み込み中…
キャンセル
保存