This commit is contained in:
Paidax
2025-03-21 12:02:54 +08:00
parent fde57f1630
commit 7410b3a181
8 changed files with 396 additions and 256 deletions
@@ -240,9 +240,9 @@ public class SourceChangeManageServiceImpl extends BaseServiceImpl<SourceChangeM
sysRoleService.clearCache();
// 如果有单位异动,发送消息提醒分工会
// if (middleTable.getChangeTypes().contains(MemberChangeType.UNIT_CHANGE.name())){
// sendUnitChangeTeacher(middleTable, history);
// }
if (middleTable.getChangeTypes().contains(MemberChangeType.UNIT_CHANGE.name())){
sendUnitChangeTeacher(middleTable, history);
}
}
}
@@ -267,7 +267,7 @@ public class SourceChangeManageServiceImpl extends BaseServiceImpl<SourceChangeM
@Override
public void sendUnitChangeTeacher(SourceChangeMiddleTable middleTable, UserHistory history) {
// 查询出异动前的工会
Sql beforeUnionSql = Sqls.create("select un.id,un.unionname from sys_union un left join sys_unit unit on unit.unionid where unit.id = @unitId")
Sql beforeUnionSql = Sqls.create("select un.id,un.unionname from sys_unit unit left join sys_union un on unit.unionid = un.id where unit.id = @unitId")
.setParam("unitId", history.getUnitid());
beforeUnionSql.setCallback(Sqls.callback.map());
dao().execute(beforeUnionSql);
@@ -275,7 +275,7 @@ public class SourceChangeManageServiceImpl extends BaseServiceImpl<SourceChangeM
// 查询出异动后的工会
Sql afterUnionSql = Sqls.create("select un.id,un.unionname from sys_union un left join sys_unit unit on unit.unionid where unit.id = @unitId")
Sql afterUnionSql = Sqls.create("select un.id,un.unionname from sys_unit unit left join sys_union un on unit.unionid = un.id where unit.id = @unitId")
.setParam("unitId", middleTable.getUnitid());
afterUnionSql.setCallback(Sqls.callback.map());
dao().execute(afterUnionSql);
@@ -301,7 +301,9 @@ public class SourceChangeManageServiceImpl extends BaseServiceImpl<SourceChangeM
for (NutMap map : beforeMapList) {
String beforeContent = "尊敬的%s老师,根据学校最新人员信息调整,%s老师的工会关系已从您处调整至%s。特此告知,烦请知悉。祝您生活愉快!"
.formatted(map.getString("username"), middleTable.getUsername(), afterUnionMap.getString("unionname"));
// msgApi.sendMsg(List.of("DingTalk"), map.getString("loginname"), 1, "工会关系转出通知", beforeContent, "", "");
System.out.println(beforeContent);
msgApi.sendMsg(List.of("DingTalk"), map.getString("loginname"), 1, "工会关系转出通知", beforeContent, "", "");
}
}
@@ -325,7 +327,9 @@ public class SourceChangeManageServiceImpl extends BaseServiceImpl<SourceChangeM
for (NutMap map : afterMapList) {
String afterContent = "尊敬的%s老师,根据学校最新人员信息调整,%s老师的工会关系已从%s调整至您处。特此告知,烦请知悉。祝您生活愉快!"
.formatted(map.getString("username"), middleTable.getUsername(), beforeUnionMap.getString("unionname"));
// msgApi.sendMsg(List.of("DingTalk"), map.getString("loginname"), 1, "工会关系转入通知", afterContent, "", "");
System.out.println(afterContent);
msgApi.sendMsg(List.of("DingTalk"), map.getString("loginname"), 1, "工会关系转入通知", afterContent, "", "");
}
}
}