package jnpf.dmsController; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import jnpf.base.ActionResult; import jnpf.dmsService.DmsDanganXiaohuiShenqingTongguoService; import jnpf.exception.DataException; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; 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.RestController; import java.util.Map; @Slf4j @Tag(name = "DMS档案销毁申请接口", description = "档案销毁申请业务操作") @RestController @RequiredArgsConstructor @RequestMapping("/biz/dangan/xiaohui") public class DmsDanganXiaohuiShenqingController { private final DmsDanganXiaohuiShenqingTongguoService tongguoService; @Operation(summary = "档案销毁申请通过") @PostMapping("/tongguo") public ActionResult tongguo(@RequestBody(required = false) Map formData) { String flowId = resolveParam(formData, "flow_id", "flowId"); String taskId = resolveParam(formData, "task_id", "taskId"); try { tongguoService.tongguo(flowId, taskId); return ActionResult.success("档案销毁申请通过处理成功", "档案销毁申请通过处理成功"); } catch (DataException e) { log.warn("档案销毁申请通过处理失败:flowId={}, taskId={}, msg={}", flowId, taskId, e.getMessage()); return ActionResult.fail(e.getMessage()); } } private String resolveParam(Map formData, String snakeCaseKey, String camelCaseKey) { if (formData == null) { return ""; } Object raw = formData.get(snakeCaseKey); if (raw == null) { raw = formData.get(camelCaseKey); } return raw == null ? "" : String.valueOf(raw).trim(); } }