Browse Source

限制限定项目数量开发

anderx 1 year ago
parent
commit
3ed9e412e5

+ 1 - 1
src/main/java/com/goafanti/common/dao/RestrictProjectMapper.java

@@ -47,5 +47,5 @@ public interface RestrictProjectMapper {
 
     void deleteByPram(RestrictProject restrictProject);
 
-    int selectPrivteByAid(String adminId);
+    int selectPrivateByAid(String aid);
 }

+ 6 - 5
src/main/java/com/goafanti/common/mapper/RestrictProjectMapper.xml

@@ -207,13 +207,14 @@
             and  pid = #{pid,jdbcType=VARCHAR}
         </if>
     </select>
-    <select id="selectPrivteByAid">
-        select count(*)
-        from restrict_project
-        where type=1
-        and aid = #{aid,jdbcType=VARCHAR}
+    <select id="selectPrivateByAid" resultType="java.lang.Integer">
+            select count(*)
+            from restrict_project
+            where type=1
+              and aid = #{aid,jdbcType=VARCHAR}
     </select>
 
+
     <update id="updateRelease">
         update restrict_project set release_time = now(),type=0
         where id  in

+ 1 - 1
src/main/java/com/goafanti/customer/controller/AdminCustomerApiController.java

@@ -663,7 +663,7 @@ public class AdminCustomerApiController extends BaseApiController{
 			}else if (check==-3){
 				//客服营销员不限制上线
 				if (!TokenManager.hasRole(AFTConstants.CUSTOMER_SERVICE_SALESMAN)){
-					res.getError().add(buildError("", "私有客户已达最大限制"));
+					res.getError().add(buildError("", "领取失败!您的“私有客户/私有限定项目”总计已超出最大限制,请移出相关数据后,再来领取!"));
 					return res;
 				}
 			}else if (check==-4){

+ 1 - 1
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -2564,7 +2564,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 		int limitmax = 0;
 		int i = userMapper.checkUserMax(aid);
 		//加入限定项目的数量
-		int rpCount =restrictProjectMapper.selectPrivteByAid(TokenManager.getAdminId());
+		int rpCount =restrictProjectMapper.selectPrivateByAid(TokenManager.getAdminId());
 		i=i+rpCount;
 		if (uid !=null){
 			User user =userMapper.selectByPrimaryKey(uid);