From bbe0a2fd03063316e50cf141986bda984599bbda Mon Sep 17 00:00:00 2001 From: 935090232@qq.com <ak473600000> Date: Tue, 22 Feb 2022 23:41:42 +0800 Subject: [PATCH] Merge branch 'developer' --- zq-erp/src/main/java/com/matrix/system/app/action/ApiVipLabelAction.java | 35 ++++++++++++++++++++++++++++++----- 1 files changed, 30 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 22d3e15..3399e91 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 @@ -7,8 +7,12 @@ import com.matrix.system.hive.dao.SysVipLabelDao; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; + +import java.util.List; /** * @author wzy @@ -22,10 +26,26 @@ @Autowired private SysVipLabelDao sysVipLabelDao; - @ApiOperation(value = "获取客户标签列表", notes = "获取客户标签列表") - @GetMapping(value = "/findLabelByVipId/{vipId}") - public AjaxResult findLabelByVipId(@PathVariable("vipId") Long vipId) { - return null; + @ApiOperation(value = "获取标签列表", notes = "获取标签列表") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = SysVipLabel.class) + }) + @PostMapping(value = "/findLabelList") + public AjaxResult findLabelByVipId(@RequestBody LabelDto labelDto) { + SysVipLabel sysVipLabel = new SysVipLabel(); + sysVipLabel.setCompanyId(getMe().getCompanyId()); + sysVipLabel.setIsAll(1); + sysVipLabel.setLabel(labelDto.getLabel()); + List<SysVipLabel> zbLabel = sysVipLabelDao.selectByModel(sysVipLabel); + + sysVipLabel = new SysVipLabel(); + sysVipLabel.setUserId(getMe().getSuId()); + sysVipLabel.setLabel(labelDto.getLabel()); + List<SysVipLabel> userLabel = sysVipLabelDao.selectByModel(sysVipLabel); + AjaxResult ajaxResult = AjaxResult.buildSuccessInstance("获取成功"); + ajaxResult.putInMap("allLabel", zbLabel); + ajaxResult.putInMap("myLabel", userLabel); + return ajaxResult; } @@ -33,6 +53,7 @@ @PostMapping(value = "/addLabel") public AjaxResult addLabel(@RequestBody LabelDto labelDto) { SysVipLabel sysVipLabel = new SysVipLabel(); + sysVipLabel.setCreateBy(getMe().getSuName()); sysVipLabel.setLabel(labelDto.getLabel()); sysVipLabel.setColor(labelDto.getColor()); sysVipLabel.setShopId(getMe().getShopId()); @@ -50,7 +71,11 @@ @ApiOperation(value = "删除标签", notes = "删除标签") @GetMapping(value = "/delById/{id}") public AjaxResult delById(@PathVariable("id") Long id) { - return null; + int i = sysVipLabelDao.deleteById(id); + if (i > 0) { + return AjaxResult.buildSuccessInstance("删除成功"); + } + return AjaxResult.buildFailInstance("删除失败"); } -- Gitblit v1.9.1