From 08ff3d86f32498d1041d82746a3554563e051301 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Fri, 12 Mar 2021 13:53:16 +0800
Subject: [PATCH] 分销员后台8

---
 zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-user.html            |    3 ++-
 zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanApplyService.java |    4 +---
 zq-erp/pom.xml                                                                       |    4 ++--
 zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoUserAction.java         |    4 +++-
 zq-erp/src/main/java/com/matrix/system/fenxiao/dto/AddSaleManApplyDto.java           |    3 +++
 zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanApplyDao.xml            |    6 +++++-
 6 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/zq-erp/pom.xml b/zq-erp/pom.xml
index f11f7a0..6590214 100644
--- a/zq-erp/pom.xml
+++ b/zq-erp/pom.xml
@@ -394,12 +394,12 @@
                     <exclude>config/test/*</exclude>
                     <exclude>config/xcx/*</exclude>
 
-                    <!---->
+                    <!--
                     <exclude>config/config.json</exclude>
                     <exclude>config/application.properties</exclude>
                     <exclude>config/system.properties</exclude>
 
-
+-->
 
                     <exclude>**/*.woff</exclude>
                     <exclude>**/*.woff2</exclude>
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 dbfae36..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
@@ -101,8 +101,10 @@
     @PostMapping(value = "/addSaleManApply")
     public @ResponseBody
     AjaxResult findShopSalesmanAppliingList(@RequestBody AddSaleManApplyDto addSaleManApplyDto) {
+        //设置用户公司ID
+        QueryUtil.setQueryLimitCom(addSaleManApplyDto);
         AjaxResult result= AjaxResult.buildSuccessInstance("设置成功");
-        SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY);
+
         shopSalesmanApplyService.addSaleManApply(addSaleManApplyDto.getUserId(),addSaleManApplyDto.getGradeId());
 		return result;
     }
diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/AddSaleManApplyDto.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/AddSaleManApplyDto.java
index fefa925..0fcd776 100644
--- a/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/AddSaleManApplyDto.java
+++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/AddSaleManApplyDto.java
@@ -14,4 +14,7 @@
 	@ApiModelProperty(value ="等级ID")
     private String gradeId;
 
+    @ApiModelProperty(hidden = true)
+    private Long companyId;
+
 }
diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanApplyService.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanApplyService.java
index fc38e81..9707da8 100644
--- a/zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanApplyService.java
+++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanApplyService.java
@@ -1,6 +1,5 @@
 package com.matrix.system.fenxiao.service;
 
-import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.core.conditions.Wrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -13,7 +12,6 @@
 import com.matrix.core.tools.StringUtils;
 import com.matrix.system.common.bean.BusParameterSettings;
 import com.matrix.system.common.dao.BusParameterSettingsDao;
-import com.matrix.system.common.interceptor.HostInterceptor;
 import com.matrix.system.fenxiao.constant.FenxiaoSettingConstant;
 import com.matrix.system.fenxiao.dao.ShopSalesmanApplyDao;
 import com.matrix.system.fenxiao.dao.ShopSalesmanGradeDao;
@@ -99,7 +97,7 @@
             	shopSalesmanApply.setGradeId(shopSalesmanGrade.getId());
             }
 
-            BusParameterSettings busParameterSettings = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_AUDIT_METHOD, HostInterceptor.getCompanyId());
+            BusParameterSettings busParameterSettings = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_AUDIT_METHOD, loginUser.getCompanyId());
             if(busParameterSettings!=null
                     &&busParameterSettings.getParamValue().equals("1")){
                 //自动审核
diff --git a/zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanApplyDao.xml b/zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanApplyDao.xml
index 36c4159..e0375f5 100644
--- a/zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanApplyDao.xml
+++ b/zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanApplyDao.xml
@@ -58,7 +58,9 @@
 
 	<select id="findShopSalesmanApplyList" resultType="com.matrix.system.fenxiao.vo.ShopSalesmanApplyVo">
 		SELECT
-		a.user_id userId
+		a.user_id userId,
+		b.nick_name nickname,
+		(SELECT s.nick_name from biz_user s where s.user_id = a.parent_user_id) parentUser,
 		FROM
 		shop_salesman_apply a
 		LEFT JOIN biz_user b ON a.user_id = b.user_id
@@ -99,9 +101,11 @@
 		a.nick_name nickName
 		FROM
 		biz_user a
+		LEFT JOIN shop_salesman_apply b ON a.user_id = b.user_id
 		<where>
 			a.company_id = #{record.companyId}
 			and a.is_sales != 1
+			and b.apply_status != 1
 			<if test="record.nickName != null and record.nickName != ''">
 				and a.nick_name like concat('%',#{record.nickName},'%')
 			</if>
diff --git a/zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-user.html b/zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-user.html
index ba2d9d7..63603ff 100644
--- a/zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-user.html
+++ b/zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-user.html
@@ -74,8 +74,9 @@
                                 <el-table-column
                                         fixed="right"
                                         label="操作"
-                                        width="100">
+                                        width="auto">
                                     <template slot-scope="scope">
+                                        <el-button type="text" size="small" @click="addSaleManApply(scope.row)">审核</el-button>
                                         <el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>
                                         <el-button type="text" size="small">编辑</el-button>
                                     </template>

--
Gitblit v1.9.1