From d6f909527f6bb3ad3e642b8bf93980832c3b50e8 Mon Sep 17 00:00:00 2001 From: "kuang.yife" Date: Tue, 18 Apr 2023 22:47:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=94=AE=E5=90=8E=E8=AE=B0=E5=BD=95=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E4=B8=8D=E8=83=BD=E5=9C=A8=E5=88=86=E8=B4=A6=E5=90=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../order/AfterServiceRecordController.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ghy-admin/src/main/java/com/ghy/web/controller/order/AfterServiceRecordController.java b/ghy-admin/src/main/java/com/ghy/web/controller/order/AfterServiceRecordController.java index c89c0c11..aa044098 100644 --- a/ghy-admin/src/main/java/com/ghy/web/controller/order/AfterServiceRecordController.java +++ b/ghy-admin/src/main/java/com/ghy/web/controller/order/AfterServiceRecordController.java @@ -7,7 +7,9 @@ import com.ghy.common.core.page.TableDataInfo; import com.ghy.common.enums.BusinessType; import com.ghy.common.utils.poi.ExcelUtil; import com.ghy.order.domain.AfterServiceRecord; +import com.ghy.order.domain.OrderDetail; import com.ghy.order.service.IAfterServiceRecordService; +import com.ghy.order.service.OrderDetailService; import org.apache.commons.lang3.exception.ExceptionUtils; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; @@ -32,6 +34,9 @@ public class AfterServiceRecordController extends BaseController { @Autowired private IAfterServiceRecordService afterServiceRecordService; + @Autowired + private OrderDetailService orderDetailService; + @RequiresPermissions("worker:record:view") @GetMapping() public String record() { @@ -102,6 +107,10 @@ public class AfterServiceRecordController extends BaseController { @ResponseBody public AjaxResult addSave(@RequestBody AfterServiceRecord afterServiceRecord) { logger.info("新增售后记录:{}", afterServiceRecord); + OrderDetail orderDetail = orderDetailService.selectById(afterServiceRecord.getOrderDetailId()); + if(orderDetail.getDrawCashTime() != null){ + return AjaxResult.error("已发起分账子单,请联系师傅处理线下售后!"); + } return toAjax(afterServiceRecordService.insertAfterServiceRecord(afterServiceRecord)); } @@ -125,6 +134,10 @@ public class AfterServiceRecordController extends BaseController { public AjaxResult editSave(@RequestBody AfterServiceRecord afterServiceRecord) { logger.info("修改售后记录:{}", afterServiceRecord); try { + OrderDetail orderDetail = orderDetailService.selectById(afterServiceRecord.getOrderDetailId()); + if(orderDetail.getDrawCashTime() != null){ + return AjaxResult.error("已发起分账子单,请联系师傅处理线下售后!"); + } return toAjax(afterServiceRecordService.updateAfterServiceRecord(afterServiceRecord)); } catch (Exception exception) { logger.error(ExceptionUtils.getStackTrace(exception));