From 861efe8a7ddc3d52dddbcce83d3a43f476a7418c Mon Sep 17 00:00:00 2001
From: LSH
Date: 星期二, 26 三月 2024 14:34:29 +0800
Subject: [PATCH] #完善工具类

---
 src/main/java/com/zy/crm/manager/controller/PlanTypeController.java |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/zy/crm/manager/controller/PlanTypeController.java b/src/main/java/com/zy/crm/manager/controller/PlanTypeController.java
index 38cd89c..647d6a6 100644
--- a/src/main/java/com/zy/crm/manager/controller/PlanTypeController.java
+++ b/src/main/java/com/zy/crm/manager/controller/PlanTypeController.java
@@ -11,7 +11,9 @@
 import com.core.common.R;
 import com.core.domain.KeyValueVo;
 import com.zy.crm.common.web.BaseController;
+import com.zy.crm.manager.entity.OrderProductType;
 import com.zy.crm.manager.entity.PlanType;
+import com.zy.crm.manager.service.OrderProductTypeService;
 import com.zy.crm.manager.service.PlanTypeService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -23,6 +25,8 @@
 
     @Autowired
     private PlanTypeService planTypeService;
+    @Autowired
+    private OrderProductTypeService orderProductTypeService;
 
     @GetMapping(value = "/planType/{id}/auth")
     @ManagerAuth
@@ -37,6 +41,7 @@
                 .add("planType", planTypeService.selectById(String.valueOf(id)))
                 .add("userId", getUserId())
                 .add("nickName", getUser().getNickname())
+                .add("mobile",getUser().getMobile())
         );
     }
 
@@ -90,6 +95,12 @@
     @RequestMapping(value = "/planType/add/auth")
     @ManagerAuth(memo = "娣诲姞瑙勫垝鍗曠被鍨�")
     public R add(PlanType planType) {
+        int OPTCOUNT = planTypeService.selectCount(new EntityWrapper<PlanType>().eq("order_product_type_id", planType.getOrderProductTypeId()));
+        if (OPTCOUNT!=0) return R.error("閲嶅娣诲姞");
+        OrderProductType orderProductType = orderProductTypeService.selectById(planType.getOrderProductTypeId());
+        planType.setName(orderProductType.getName());
+        planType.setType(orderProductType.getType());
+        planType.setOrderProductTypeId(planType.getOrderProductTypeId());
         planType.setHostId(getHostId());
         planType.setCreateBy(getUserId());
         planType.setCreateTime(new Date());

--
Gitblit v1.9.1