From e84e71bda390661a98d2f548d11f3721d2ec110c Mon Sep 17 00:00:00 2001 From: jyy <935090232@qq.com> Date: Fri, 12 Mar 2021 17:30:00 +0800 Subject: [PATCH] 新增申请成为分销员接口10 --- zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoUserAction.java | 122 +++++++++++++++++++++++++++++----------- 1 files changed, 87 insertions(+), 35 deletions(-) diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoUserAction.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoUserAction.java index 640f7c0..62a352d 100644 --- a/zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoUserAction.java +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoUserAction.java @@ -1,28 +1,26 @@ package com.matrix.system.fenxiao.action; -import com.matrix.core.anotations.RemoveRequestToken; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.matrix.core.constance.MatrixConstance; import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.tools.StringUtils; import com.matrix.core.tools.WebUtil; -import com.matrix.system.common.bean.BusParameterSettings; import com.matrix.system.common.bean.SysUsers; -import com.matrix.system.hive.bean.ShoppingGoods; -import com.matrix.system.hive.bean.SysShopInfo; - -import cn.hutool.core.collection.CollUtil; -import cn.hutool.core.util.StrUtil; - +import com.matrix.system.fenxiao.dto.AddSaleManApplyDto; +import com.matrix.system.fenxiao.dto.ShopSalesmanAppliingDto; +import com.matrix.system.fenxiao.dto.ShopSalesmanApplyDto; +import com.matrix.system.fenxiao.service.ShopSalesmanApplyService; +import com.matrix.system.fenxiao.vo.ShopSalesmanAppliingVo; +import com.matrix.system.fenxiao.vo.ShopSalesmanApplyVo; +import com.matrix.system.fenxiao.vo.ShopSalesmanGradeVo; +import com.matrix.system.hive.action.util.QueryUtil; +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 com.matrix.system.fenxiao.constant.FenxiaoSettingConstant; -import com.matrix.system.fenxiao.service.FenXiaoSettingService; -import com.matrix.system.fenxiao.service.ShopSalesmanApplyService; -import com.matrix.system.fenxiao.vo.FenXiaoSettingVo; -import com.matrix.system.fenxiao.vo.ShopSalesmanApplyVo; - -import java.util.ArrayList; -import java.util.Arrays; import java.util.List; @RestController @@ -32,29 +30,83 @@ @Autowired private ShopSalesmanApplyService shopSalesmanApplyService; - /** - * 修改公司维度的分销规则 - */ -// @PostMapping(value = "/fxImgUpload") -// public @ResponseBody -// AjaxResult updateFenXiaoSetting(@RequestBody BusParameterSettings busParameterSettings) { -// return fenXiaoSettingService.updateFenXiaoSettingByCompanyId(busParameterSettings); -// } /** - *获取分销员审核记录 + * 查询分销员审核记录 */ - @RequestMapping(value = "/fenXiaoUserApply") - public AjaxResult selectFenXiaoUserApply() { + @ApiOperation(value = "查询分销员审核记录") + @ApiResponses({ + @ApiResponse(code = 200, message = "OK", response = ShopSalesmanApplyVo.class) + }) + @PostMapping(value = "/findShopSalesmanApplyList") + public @ResponseBody + AjaxResult findShopSalesmanApplyList(@RequestBody ShopSalesmanApplyDto shopSalesmanApplyDto) { + //设置用户公司ID + QueryUtil.setQueryLimitCom(shopSalesmanApplyDto); + //排序 + if(StringUtils.isBlank(shopSalesmanApplyDto.getSort())){ + shopSalesmanApplyDto.setSort("create_time"); + shopSalesmanApplyDto.setOrder("desc"); + } + + Page<ShopSalesmanApplyVo> page = new Page(shopSalesmanApplyDto.getPageNum(), shopSalesmanApplyDto.getPageSize()); + IPage<ShopSalesmanApplyVo> rows = shopSalesmanApplyService.findShopSalesmanApplyList(page,shopSalesmanApplyDto); + AjaxResult result = AjaxResult.buildSuccessInstance(rows.getRecords(),rows.getTotal()); - AjaxResult result= AjaxResult.buildSuccessInstance("查询成功"); - SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); - Long companyId = user.getCompanyId(); - - //分销员审核记录 - List<ShopSalesmanApplyVo> shopSalesmanApplyVos = shopSalesmanApplyService.selectFenXiaoUserApplyByCompanyId(companyId); - result.putInMap("fxshjl", shopSalesmanApplyVos); + return result; + } + + /** + *获取分销员待审核记录 + */ + @ApiOperation(value = "查询分销员审核记录") + @ApiResponses({ + @ApiResponse(code = 200, message = "OK", response = ShopSalesmanAppliingVo.class) + }) + @PostMapping(value = "/findShopSalesmanAppliingList") + public @ResponseBody + AjaxResult findShopSalesmanAppliingList(@RequestBody ShopSalesmanAppliingDto shopSalesmanAppliingDto) { + //设置用户公司ID + QueryUtil.setQueryLimitCom(shopSalesmanAppliingDto); + //排序 + if(StringUtils.isBlank(shopSalesmanAppliingDto.getSort())){ + shopSalesmanAppliingDto.setSort("create_time"); + shopSalesmanAppliingDto.setOrder("desc"); + } - return result; + Page<ShopSalesmanAppliingVo> page = new Page(shopSalesmanAppliingDto.getPageNum(), shopSalesmanAppliingDto.getPageSize()); + IPage<ShopSalesmanAppliingVo> rows = shopSalesmanApplyService.selectBizUserApplyList(page,shopSalesmanAppliingDto); + + //IPage<ShopSalesmanAppliingVo> rows = shopSalesmanApplyService.findShopSalesmanAppliingList(page,shopSalesmanAppliingDto); + AjaxResult result = AjaxResult.buildSuccessInstance(rows.getRecords(),rows.getTotal()); + return result; + } + + /** + *获取对应的分销员等级 + */ + @RequestMapping(value = "/getShopSalesmanGrade") + private @ResponseBody AjaxResult getShopSalesmanGradeVo(){ + AjaxResult result= AjaxResult.buildSuccessInstance("查询成功"); + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + + List<ShopSalesmanGradeVo> dataList = shopSalesmanApplyService.getShopSalesmanGradeVo(user.getCompanyId()); + result.putInMap("salesGrade", dataList); + return result; + } + + /** + *新增分销员 + */ + @ApiOperation(value = "新增分销员") + @PostMapping(value = "/addSaleManApply") + public @ResponseBody + AjaxResult findShopSalesmanAppliingList(@RequestBody AddSaleManApplyDto addSaleManApplyDto) { + //设置用户公司ID + QueryUtil.setQueryLimitCom(addSaleManApplyDto); + AjaxResult result= AjaxResult.buildSuccessInstance("设置成功"); + + shopSalesmanApplyService.addSaleManApply(addSaleManApplyDto.getUserId(),addSaleManApplyDto.getGradeId()); + return result; } } -- Gitblit v1.9.1