feat(msgcenter): 卡片直批——MsgApprovalProxyService 定位待办办 approve/reject(B3 §2):身份全取会话防代批、bizId=办件 id 匹配 instanceId、0/>1 匹配明确文案、业务拒绝原文透出、不可达降级不阻塞
This commit is contained in:
@@ -2,10 +2,13 @@ package com.yunhai.userhome.controller.api;
|
||||
|
||||
import com.yunhai.platform.utils.model.BoaUser;
|
||||
import com.yunhai.userhome.config.Config;
|
||||
import com.yunhai.userhome.model.MsgHandleRequest;
|
||||
import com.yunhai.userhome.service.MsgApprovalProxyService;
|
||||
import com.yunhai.userhome.service.MsgCenterProxyService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
@@ -24,6 +27,7 @@ import java.util.Map;
|
||||
public class MessageCenterController {
|
||||
|
||||
private final MsgCenterProxyService proxy;
|
||||
private final MsgApprovalProxyService approvalProxy;
|
||||
|
||||
/** schId=0 时推断:主学校 → 主归属组(bureau)→ 0(对齐 MessageController 旧口径) */
|
||||
private Integer resolveSchId(BoaUser user) {
|
||||
@@ -73,4 +77,16 @@ public class MessageCenterController {
|
||||
public void readAll(BoaUser authUserWithDept) {
|
||||
proxy.readAll(authUserWithDept.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 卡片直批(B3 §2):同意/拒绝消息对应的审批待办。
|
||||
* 红线:operatorId/schId/operatorName 一律取当前会话,绝不接受前端传参(防越权代批)。
|
||||
*
|
||||
* @return {ok, message}——ok=false 时 message 为可直接展示的文案(已处理/多节点/业务拒绝/不可达降级)
|
||||
*/
|
||||
@PostMapping("msgCenter/handle")
|
||||
public Map<String, Object> handle(BoaUser authUserWithDept, @RequestBody MsgHandleRequest request) {
|
||||
return approvalProxy.handle(authUserWithDept.getId(), resolveSchId(authUserWithDept),
|
||||
authUserWithDept.getName(), request.getMsgId(), request.getAction(), request.getOpinion());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user