Administrator
2024-08-01 64bc7fee39c31a9bff9a79485ae48efa7ac70b2a
pipIrr-platform/pipIrr-web/pipIrr-web-operation/src/main/java/com/dy/pipIrrOperation/feedback/FeedbackCtrl.java
@@ -5,6 +5,7 @@
import com.dy.common.webUtil.BaseResponseUtils;
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pipIrrGlobal.pojoOp.OpeFeedback;
import com.dy.pipIrrGlobal.pojoOp.OpeFeedbackReply;
import com.dy.pipIrrGlobal.voOp.Vofeedback;
import io.swagger.v3.oas.annotations.Parameter;
import jakarta.validation.Valid;
@@ -132,4 +133,28 @@
            return BaseResponseUtils.buildException(e.getMessage());
        }
    }
    /**
     * 添加问题反馈回复
     * @param reply
     * @param bindingResult
     * @return
     */
    @PostMapping(path = "addReply", consumes = MediaType.APPLICATION_JSON_VALUE)
    @Transactional(rollbackFor = Exception.class)
    @SsoAop
    public BaseResponse<Boolean> addReply(@RequestBody @Valid OpeFeedbackReply reply, @Parameter(hidden = true) BindingResult bindingResult){
        if (bindingResult != null && bindingResult.hasErrors()) {
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
        }
        if (reply.getFeedbackId() == null){
            return BaseResponseUtils.buildFail("请传入反馈编号id");
        }
        Integer rec = Optional.ofNullable(feedbackSv.addReply(reply)).orElse(0);
        if (rec == 0) {
            return BaseResponseUtils.buildFail("添加回复失败");
        }
        return BaseResponseUtils.buildSuccess(true);
    }
}