From 9ff52cfe02ce2dccd7465ef381392bfefb5abb9e Mon Sep 17 00:00:00 2001 From: weicw1996 Date: Sun, 11 Oct 2026 17:05:05 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E8=87=AA=E4=B8=BB=E5=A1=AB=E6=8A=A5):=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=A9=B3=E5=9B=9E=E5=90=8E=E9=87=8D=E6=96=B0?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 背景:填报记录被驳回后用户无法修改重提,只能重新走一遍新增流程。 不复用通用 PUT /yxe/yxe-self-report,原因是该接口无归属校验(任何登录 用户可改他人记录),且请求体带 status=1 会触发审核通过分支给用户加余额, 用户端直接复用等于暴露打款开关。因此单独新增 PUT /resubmit: - 校验登录 + 已认证、记录归属当前用户、当前状态必须为已驳回 - status 与 rejectReason 由服务端写死(置 0、清空),忽略请求体传值 - reward 按新销量重算,与新增提交保持一致(最终金额仍由审核端确认) - 不修改 activityTime:前端表单未采集该字段,避免被置空 --- .../controller/YxeSelfReportController.java | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/src/main/java/com/gxwebsoft/yxe/controller/YxeSelfReportController.java b/src/main/java/com/gxwebsoft/yxe/controller/YxeSelfReportController.java index 6cfcbfe..757af1d 100644 --- a/src/main/java/com/gxwebsoft/yxe/controller/YxeSelfReportController.java +++ b/src/main/java/com/gxwebsoft/yxe/controller/YxeSelfReportController.java @@ -156,6 +156,60 @@ public class YxeSelfReportController extends BaseController { return fail("修改失败"); } + @ApiOperation("重新提交自主填报") + @PutMapping("/resubmit") + public ApiResult resubmit(@RequestBody YxeSelfReport yxeSelfReport) { + User loginUser = getLoginUser(); + if (loginUser == null) { + return fail("请先登录"); + } + if (!Integer.valueOf(2).equals(loginUser.getAuthStatus())) { + return fail("请先完成认证"); + } + if (yxeSelfReport == null || yxeSelfReport.getId() == null) { + return fail("缺少填报记录ID"); + } + YxeSelfReport current = yxeSelfReportService.getById(yxeSelfReport.getId()); + if (current == null) { + return fail("填报记录不存在"); + } + // 只能重新提交自己的记录,避免复用通用修改接口改到他人数据 + if (current.getUserId() == null || !current.getUserId().equals(loginUser.getUserId())) { + return fail("只能重新提交自己的填报记录"); + } + // 仅驳回状态可重提,防止绕过审核直接改回待审核/已通过 + if (!Integer.valueOf(2).equals(current.getStatus())) { + return fail("只有已驳回的填报记录可以重新提交"); + } + YxeSelfReport update = new YxeSelfReport(); + update.setId(current.getId()); + update.setMerchantId(yxeSelfReport.getMerchantId()); + update.setMerchantName(yxeSelfReport.getMerchantName()); + update.setChainId(yxeSelfReport.getChainId()); + update.setChainName(yxeSelfReport.getChainName()); + update.setDate(yxeSelfReport.getDate()); + update.setImage(yxeSelfReport.getImage()); + update.setClockPhotos(yxeSelfReport.getClockPhotos()); + update.setBoothPhotos(yxeSelfReport.getBoothPhotos()); + update.setSalesGroups(yxeSelfReport.getSalesGroups()); + update.setReceiptPhoto(yxeSelfReport.getReceiptPhoto()); + update.setSummary(yxeSelfReport.getSummary()); + update.setRating(yxeSelfReport.getRating()); + update.setLat(yxeSelfReport.getLat()); + update.setLng(yxeSelfReport.getLng()); + update.setLocation(yxeSelfReport.getLocation()); + // 奖金金额与新增提交保持一致:由销量小计算出,改动销量后需要同步更新, + // 否则审核端会按上一轮的金额通过(最终金额仍以审核端确认为准) + update.setReward(yxeSelfReport.getReward()); + // 状态与驳回原因由服务端决定:回到待审核,并清掉上一轮的驳回原因 + update.setStatus(0); + update.setRejectReason(""); + if (yxeSelfReportService.updateById(update)) { + return success("重新提交成功"); + } + return fail("重新提交失败"); + } + @ApiOperation("删除自主填报") @DeleteMapping("/{id}") public ApiResult remove(@PathVariable("id") Integer id) {