From f81300462deff06ab6c90b24ecb9f0ba5031a766 Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Fri, 22 Jan 2021 11:23:52 +0800
Subject: [PATCH] modify

---
 zq-erp/src/main/java/com/matrix/system/app/action/ApiVipLabelAction.java |   29 ++++++++++++++++++++++++-----
 1 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/zq-erp/src/main/java/com/matrix/system/app/action/ApiVipLabelAction.java b/zq-erp/src/main/java/com/matrix/system/app/action/ApiVipLabelAction.java
index 1d518c6..22d3e15 100644
--- a/zq-erp/src/main/java/com/matrix/system/app/action/ApiVipLabelAction.java
+++ b/zq-erp/src/main/java/com/matrix/system/app/action/ApiVipLabelAction.java
@@ -1,19 +1,26 @@
 package com.matrix.system.app.action;
 
 import com.matrix.core.pojo.AjaxResult;
+import com.matrix.system.app.dto.LabelDto;
+import com.matrix.system.hive.action.BaseController;
+import com.matrix.system.hive.bean.SysVipLabel;
+import com.matrix.system.hive.dao.SysVipLabelDao;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 /**
  * @author wzy
  * @date 2020-12-22
  **/
-//@Api(value = "ApiVipLabelAction", tags = "客户标签接口类")
+@Api(value = "ApiVipLabelAction", tags = "客户标签接口类")
 @RestController
 @RequestMapping(value = "/api/label")
-public class ApiVipLabelAction {
+public class ApiVipLabelAction extends BaseController {
 
+    @Autowired
+    private SysVipLabelDao sysVipLabelDao;
 
     @ApiOperation(value = "获取客户标签列表", notes = "获取客户标签列表")
     @GetMapping(value = "/findLabelByVipId/{vipId}")
@@ -22,10 +29,22 @@
     }
 
 
-    @ApiOperation(value = "添加客户标签", notes = "添加客户标签")
+    @ApiOperation(value = "添加标签", notes = "添加标签")
     @PostMapping(value = "/addLabel")
-    public AjaxResult addLabel() {
-        return null;
+    public AjaxResult addLabel(@RequestBody LabelDto labelDto) {
+        SysVipLabel sysVipLabel = new SysVipLabel();
+        sysVipLabel.setLabel(labelDto.getLabel());
+        sysVipLabel.setColor(labelDto.getColor());
+        sysVipLabel.setShopId(getMe().getShopId());
+        sysVipLabel.setCompanyId(getMe().getCompanyId());
+        sysVipLabel.setUserId(getMe().getSuId());
+        sysVipLabel.setIsAll(2);
+        int i = sysVipLabelDao.insert(sysVipLabel);
+        if (i > 0) {
+            return AjaxResult.buildSuccessInstance("添加成功");
+        } else {
+            return AjaxResult.buildFailInstance("添加失败");
+        }
     }
 
     @ApiOperation(value = "删除标签", notes = "删除标签")

--
Gitblit v1.9.1