广播订阅 + 福利

This commit is contained in:
Paidax
2025-08-15 10:07:12 +08:00
parent 8f563d361e
commit d2506c3985
10 changed files with 153 additions and 11 deletions
@@ -204,7 +204,7 @@ public class ProposalCaseConfirmServiceImpl extends ViServiceImpl implements Pro
// ProposalToDoHandler.CREATE_UNDERTAKE_TASK.exec(id, null);
// }
//推送承办单位答复待办
ProposalToDoHandler.CREATE_CASE_UNIT_TASK.exec(id, null);
ProposalToDoHandler.CREATE_UNDERTAKE_TASK.exec(id, null);
}
}
@@ -6,6 +6,8 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HtmlUtil;
import io.v.nutz.base.event.user.UserChangeMsg;
import io.v.nutz.base.event.user.UserChangePublisher;
import io.v.nutz.base.service.impl.BaseServiceImpl;
import io.v.nutz.base.utils.MsgApi;
import io.v.nutz.base.utils.Roles;
@@ -262,6 +264,9 @@ public class SourceChangeManageServiceImpl extends BaseServiceImpl<SourceChangeM
// 如果有单位异动,发送消息提醒分工会
if (middleTable.getChangeTypes().contains(MemberChangeType.UNIT_CHANGE.name())){
sendUnitChangeTeacher(middleTable, history);
// 单位变更发送广播消息
UserChangePublisher.broadcast(new UserChangeMsg(List.of(info.getId()),
UserChangeMsg.UNIT_CHANGE_OPERATION, history.getUnitid(), middleTable.getUnitid()));
}
}
}
@@ -244,8 +244,8 @@ public class WelfareEvaluateActivityController {
System.out.println(loginNames);
String link = Globals.AppDomain + "/platform/h5/welfare/evaluate?activityId=%s".formatted(activityId);
// msgApi.sendMsg(List.of("DingTalk"), loginNames, 2, title, sendMsgValue, "", link);
String link = Globals.AppDomain + "/platform/h5/welfare/evaluate?activityId=%s&type=welfare".formatted(activityId);
msgApi.sendMsg(List.of("DingTalk"), loginNames, 2, title, sendMsgValue, "", link);
return Result.success();
} catch (Exception e) {
e.printStackTrace();
@@ -69,6 +69,10 @@ public class H5WelfareEvaluateController {
return Result.error("您无需参加此次投票,感谢您的关注!");
}
// 查询这个人选择的福利
String selectWelfareName = welfareEvaluateActivityService.getSelectWelfareName(activity.getWelfareId());
activity.setSelectWelfareName(selectWelfareName);
String answerRecordId = null;
WelfareEvaluateUserAnswerRecord answerRecord = dao.fetch(WelfareEvaluateUserAnswerRecord.class, Cnd.where("activityId", "=", activityId)
@@ -76,4 +76,9 @@ public class WelfareEvaluateActivity extends BaseModel {
@Comment("最大答题次数(0表示不限制)")
@ColDefine(type = ColType.INT, width = 1)
private Integer maxAttempts;
/**
* 所选的福利名称
*/
private String selectWelfareName;
}
@@ -58,4 +58,7 @@ public interface WelfareEvaluateActivityService extends BaseService<WelfareEvalu
* @param response
*/
void exportReportXlsx(String activityId, HttpServletResponse response);
String getSelectWelfareName(String welfareId);
}
@@ -253,6 +253,53 @@ public class WelfareEvaluateActivityServiceImpl extends BaseServiceImpl<WelfareE
}
@Override
public String getSelectWelfareName(String welfareId) {
Sql sql = Sqls.create("""
SELECT
wpso.optionName,
wpus.selectSpecs,
wpso.simpleDesc,
wpso.supplier
FROM
`welfare_project_user_selection` wpus
LEFT JOIN welfare_project_subject_option wpso ON wpso.id = wpus.selectOptionId
WHERE
welfareId = @projectId
AND selectUserId = @userId
""");
sql.setParam("projectId", welfareId);
sql.setParam("userId", ShiroUtil.getUserId());
List<NutMap> list = listMap(sql);
String collect = list.stream().map(item -> {
String optionName = StrUtil.nullToEmpty(item.getString("optionName"));
String supplier = StrUtil.nullToEmpty(item.getString("supplier"));
String selectSpecs = StrUtil.nullToEmpty(item.getString("selectSpecs"));
StringBuilder sb = new StringBuilder();
if (StrUtil.isNotEmpty(optionName)) {
sb.append(optionName);
}
if (StrUtil.isNotEmpty(supplier)) {
if (!sb.isEmpty()) {
sb.append(":");
}
sb.append(supplier);
}
if (StrUtil.isNotEmpty(selectSpecs)) {
if (!sb.isEmpty()) {
sb.append("(").append(selectSpecs).append(")");
}
}
return sb.toString();
}).filter(StrUtil::isNotBlank)
.collect(Collectors.joining(";"));
return collect;
}
private List<NutMap> querySubjects(String activityId) {
Sql sql = Sqls.create("""
SELECT