|
|
@@ -92,7 +92,7 @@ public class NewAdminServiceImpl extends BaseMybatisDao<AdminMapper> implements
|
|
|
|
|
|
@SuppressWarnings("unused")
|
|
|
@Override
|
|
|
- public int updateByPrimaryKeySelective(Admin ad, List<String> roleIds) {
|
|
|
+ public int updateByPrimaryKeySelective(Admin ad, List<String> roleIds,boolean updateName) {
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
params.put("uid", ad.getId());
|
|
|
params.put("roles", roleIds);
|
|
|
@@ -108,7 +108,7 @@ public class NewAdminServiceImpl extends BaseMybatisDao<AdminMapper> implements
|
|
|
ad.setType(sumType(roleIds));
|
|
|
int count=adminMapper.updateByPrimaryKey(ad);
|
|
|
pushAmbRole(ad);
|
|
|
- pushAdminRole(ad.getId(),roleIds,useRole);
|
|
|
+ pushAdminRole(ad,roleIds,useRole,updateName);
|
|
|
if (count>0&&ad.getAmbId()!=null){
|
|
|
//进行巴人数计算
|
|
|
// AmbSystem ambSystem = ambSystemMapper.selectByPrimaryKey(Long.valueOf(ad.getAmbId()));
|
|
|
@@ -124,9 +124,12 @@ public class NewAdminServiceImpl extends BaseMybatisDao<AdminMapper> implements
|
|
|
|
|
|
|
|
|
|
|
|
- private void pushAdminRole(String id,List<String>roleIds, Set<String> useRole) {
|
|
|
+ private void pushAdminRole(Admin ad,List<String>roleIds, Set<String> useRole,boolean updateName) {
|
|
|
Integer flag=0;
|
|
|
String roleType="";
|
|
|
+ //新的计算
|
|
|
+ List<Role> roleList = roleMapper.selectByIdList(roleIds);
|
|
|
+
|
|
|
//加入以前有也要重新计算
|
|
|
if (useRole!=null){
|
|
|
for (String s : useRole) {
|
|
|
@@ -157,7 +160,7 @@ public class NewAdminServiceImpl extends BaseMybatisDao<AdminMapper> implements
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- List<Role> roleList = roleMapper.selectByIdList(roleIds);
|
|
|
+
|
|
|
if (roleList!=null){
|
|
|
for (Role role : roleList) {
|
|
|
if (AFTConstants.SALESMAN_ADMIN.equals(role.getRoleType().toString())){
|
|
|
@@ -189,7 +192,7 @@ public class NewAdminServiceImpl extends BaseMybatisDao<AdminMapper> implements
|
|
|
}
|
|
|
if (flag!=0){
|
|
|
|
|
|
- asyncUtils.updateListExamineName(flag,id,roleType);
|
|
|
+ asyncUtils.updateListExamineName(flag,ad.getId(),roleType);
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -327,11 +330,21 @@ public class NewAdminServiceImpl extends BaseMybatisDao<AdminMapper> implements
|
|
|
}
|
|
|
if(ad.getAmbId()!=null)pushAmbRole(ad);
|
|
|
adminMapper.insert(ad);
|
|
|
- pushAdminRole(ad.getId(),roleIds,null);
|
|
|
+ pushAdminRole(ad,roleIds);
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 新增无需判断权限与名称
|
|
|
+ * @param ad
|
|
|
+ * @param roleIds
|
|
|
+ */
|
|
|
+ private void pushAdminRole(Admin ad,List<String>roleIds){
|
|
|
+ pushAdminRole(ad,roleIds,null,false);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
* 计算巴权限
|
|
|
* @param ad
|
|
|
*/
|