From 3fc3fcf19503465facc2631d495bd497e4266128 Mon Sep 17 00:00:00 2001 From: xiaoyong931011 <15274802129@163.com> Date: Thu, 11 Mar 2021 21:46:36 +0800 Subject: [PATCH] 分销员后台3 --- zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoUserAction.java | 89 +++++++++++++++++++++++--------------------- 1 files changed, 47 insertions(+), 42 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 1caaee3..5538f6c 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,36 +1,20 @@ package com.matrix.system.fenxiao.action; -import com.matrix.core.anotations.RemoveRequestToken; -import com.matrix.core.constance.MatrixConstance; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 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.common.tools.DataAuthUtil; +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.hive.action.util.QueryUtil; -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 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.dto.ShopSalesmanApplyDto; -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 @RequestMapping(value = "/fenXiao/fenXiaoUser") @@ -42,7 +26,6 @@ /** * 查询分销员审核记录 */ - @ApiOperation(value = "查询分销员审核记录") @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = ShopSalesmanApplyVo.class) @@ -52,32 +35,54 @@ AjaxResult findShopSalesmanApplyList(@RequestBody ShopSalesmanApplyDto shopSalesmanApplyDto) { //设置用户公司ID QueryUtil.setQueryLimitCom(shopSalesmanApplyDto); - + //排序 if(StringUtils.isBlank(shopSalesmanApplyDto.getSort())){ - shopSalesmanApplyDto.setSort("createTime"); + shopSalesmanApplyDto.setSort("create_time"); shopSalesmanApplyDto.setOrder("desc"); } - List<ShopSalesmanApplyVo> rows = shopSalesmanApplyService.findShopSalesmanApplyList(shopSalesmanApplyDto); - Integer total = shopSalesmanApplyService.findShopSalesmanApplyListTotal(shopSalesmanApplyDto); - AjaxResult result = AjaxResult.buildSuccessInstance(rows, total); + + Page<ShopSalesmanApplyVo> page = new Page(shopSalesmanApplyDto.getPageNum(), shopSalesmanApplyDto.getPageSize()); + + IPage<ShopSalesmanApplyVo> rows = shopSalesmanApplyService.findShopSalesmanApplyList(page,shopSalesmanApplyDto); + AjaxResult result = AjaxResult.buildSuccessInstance(rows.getRecords(),rows.getTotal()); + return result; } - /** - *获取分销员审核记录 + + /** + * 跳转 分销员待审核记录页面 + * + @RequestMapping(value = "/shopSalesmanAppliing") + public String shopSalesmanAppliing() { + return "admin/fenxiao/fenxiao-apply"; + } */ - @RequestMapping(value = "/fenXiaoUserApply") - public AjaxResult selectFenXiaoUserApply() { + + /** + *获取分销员待审核记录 + */ + @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); + //查询条件待审核状态 + shopSalesmanAppliingDto.setApplyStatus(1); + //排序 + if(StringUtils.isBlank(shopSalesmanAppliingDto.getSort())){ + shopSalesmanAppliingDto.setSort("create_time"); + shopSalesmanAppliingDto.setOrder("desc"); + } - 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; + Page<ShopSalesmanAppliingVo> page = new Page(shopSalesmanAppliingDto.getPageNum(), shopSalesmanAppliingDto.getPageSize()); + IPage<ShopSalesmanAppliingVo> rows = shopSalesmanApplyService.findShopSalesmanAppliingList(page,shopSalesmanAppliingDto); + AjaxResult result = AjaxResult.buildSuccessInstance(rows.getRecords(),rows.getTotal()); + return result; } } -- Gitblit v1.9.1