Просмотр исходного кода

报销详情提示消息修改

anderx 1 год назад
Родитель
Сommit
97d9cd637b

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

@@ -46,4 +46,6 @@ public interface RestrictProjectMapper {
 
 
 
 
     void deleteByPram(RestrictProject restrictProject);
     void deleteByPram(RestrictProject restrictProject);
+
+    int selectPrivteByAid(String adminId);
 }
 }

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

@@ -207,6 +207,12 @@
             and  pid = #{pid,jdbcType=VARCHAR}
             and  pid = #{pid,jdbcType=VARCHAR}
         </if>
         </if>
     </select>
     </select>
+    <select id="selectPrivteByAid">
+        select count(*)
+        from restrict_project
+        where type=1
+        and aid = #{aid,jdbcType=VARCHAR}
+    </select>
 
 
     <update id="updateRelease">
     <update id="updateRelease">
         update restrict_project set release_time = now(),type=0
         update restrict_project set release_time = now(),type=0

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

@@ -110,12 +110,13 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 	@Autowired
 	@Autowired
 	private AdminUserCountMapper adminUserCountMapper;
 	private AdminUserCountMapper adminUserCountMapper;
 	@Autowired
 	@Autowired
-	private RestrictProjectMapper restProjectMapper;
+	private RestrictProjectMapper restrictProjectMapper;
 	@Autowired
 	@Autowired
 	private	AsyncUtils asyncUtils;
 	private	AsyncUtils asyncUtils;
 
 
 
 
 
 
+
 	@Value(value = "${upload.path}")
 	@Value(value = "${upload.path}")
 	private String uploadPath = null;
 	private String uploadPath = null;
 
 
@@ -869,7 +870,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 				// 更新业务中间表
 				// 更新业务中间表
 				addUserFollowBusiness(userFollowBusiness, ubId, ub, ufbId, followId);
 				addUserFollowBusiness(userFollowBusiness, ubId, ub, ufbId, followId);
 			}
 			}
-			restProjectMapper.updateRefreshLockTime(fbb.getUid(),ub.getBusinessProjectId(),TokenManager.getAdminId());
+			restrictProjectMapper.updateRefreshLockTime(fbb.getUid(),ub.getBusinessProjectId(),TokenManager.getAdminId());
 		}
 		}
 	}
 	}
 
 
@@ -1607,7 +1608,8 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 			if (u.getShareType()!=1)return -1;
 			if (u.getShareType()!=1)return -1;
 			if (u.getNewChannel()==1)return 0;
 			if (u.getNewChannel()==1)return 0;
 		}
 		}
-		if (userMapper.UserReceiveCount(TokenManager.getAdminId()) >= USER_RECEIVE_MAX)return  -2;
+		int privateCount = userMapper.UserReceiveCount(TokenManager.getAdminId());
+		if (privateCount >= USER_RECEIVE_MAX)return  -2;
 		if(checkMax(uid,TokenManager.getAdminId()))return -3;
 		if(checkMax(uid,TokenManager.getAdminId()))return -3;
 		if(checkBeforeChannel(uid)) return -4;
 		if(checkBeforeChannel(uid)) return -4;
 		return 0;
 		return 0;
@@ -2561,25 +2563,26 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 		}
 		}
 		int limitmax = 0;
 		int limitmax = 0;
 		int i = userMapper.checkUserMax(aid);
 		int i = userMapper.checkUserMax(aid);
+		int rpCount =restrictProjectMapper.selectPrivteByAid(TokenManager.getAdminId());
+		i=i+rpCount;
 		if (uid !=null){
 		if (uid !=null){
 			User user =userMapper.selectByPrimaryKey(uid);
 			User user =userMapper.selectByPrimaryKey(uid);
 			if (user.getNewChannel()==1){
 			if (user.getNewChannel()==1){
 				return false;
 				return false;
 			}
 			}
 		}
 		}
-
 		List<String > roles=adminMapper.getAdminRoleListByAid(aid);
 		List<String > roles=adminMapper.getAdminRoleListByAid(aid);
 		for (String role : roles) {
 		for (String role : roles) {
 			if (role.equals(AFTConstants.SALESMAN_DIRECTOR)){
 			if (role.equals(AFTConstants.SALESMAN_DIRECTOR)){
 				if(limitmax<YXZJ_MAX)limitmax = YXZJ_MAX;
 				if(limitmax<YXZJ_MAX)limitmax = YXZJ_MAX;
-				continue;
-			} else if (role.equals(AFTConstants.SALESMAN_MANAGER)){
+				break;
+            } else if (role.equals(AFTConstants.SALESMAN_MANAGER)){
 				if(limitmax<YXJL_MAX)limitmax = YXJL_MAX;
 				if(limitmax<YXJL_MAX)limitmax = YXJL_MAX;
-				continue;
-			} else if (role.equals(AFTConstants.SALESMAN)){
+				break;
+            } else if (role.equals(AFTConstants.SALESMAN)){
 				if(limitmax<YXY_MAX)limitmax = YXY_MAX;
 				if(limitmax<YXY_MAX)limitmax = YXY_MAX;
-				continue;
-			}
+				break;
+            }
 		}
 		}
 		i+=x;
 		i+=x;
 		if (i >= limitmax) {
 		if (i >= limitmax) {