提交 0d8db8cd 作者: zhenjie

Merge branch 'develop' of ssh://git.mmcuav.cn:8222/iuav/cms into develop

 Conflicts:
	csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/dao/RoleDao.java
	csm-service/cms-service-user/src/main/resources/mapper/RoleDao.xml
...@@ -30,8 +30,16 @@ public class CodeUtil { ...@@ -30,8 +30,16 @@ public class CodeUtil {
return "DELETE" + CodeUtil.getRandomNum(15); return "DELETE" + CodeUtil.getRandomNum(15);
} }
public static String createRoleNo() { public static String createRoleNo(String roleNo) {
String s = "A" + System.currentTimeMillis(); return getNewEquipmentNo("A", roleNo);
return s; }
public static String getNewEquipmentNo(String equipmentType, String equipmentNo) {
String newEquipmentNo = "A" + "0001";
if (equipmentNo != null && !equipmentNo.isEmpty()) {
int newEquipment = Integer.parseInt(equipmentNo.substring(1)) + 1;
newEquipmentNo = String.format(equipmentType + "%04d", newEquipment);
}
return newEquipmentNo;
} }
} }
...@@ -3,7 +3,6 @@ package com.mmc.iuav.user.controller; ...@@ -3,7 +3,6 @@ package com.mmc.iuav.user.controller;
import com.mmc.iuav.group.Page; import com.mmc.iuav.group.Page;
import com.mmc.iuav.group.Update; import com.mmc.iuav.group.Update;
import com.mmc.iuav.response.ResultBody; import com.mmc.iuav.response.ResultBody;
import com.mmc.iuav.user.model.dto.RoleInfoDTO;
import com.mmc.iuav.user.model.dto.UserAccountSimpleDTO; import com.mmc.iuav.user.model.dto.UserAccountSimpleDTO;
import com.mmc.iuav.user.model.qo.UserAccountQO; import com.mmc.iuav.user.model.qo.UserAccountQO;
import com.mmc.iuav.user.model.vo.UserAccountVO; import com.mmc.iuav.user.model.vo.UserAccountVO;
...@@ -113,13 +112,4 @@ public class UserAccountController extends BaseController { ...@@ -113,13 +112,4 @@ public class UserAccountController extends BaseController {
return userAccountService.removeAppAccount(userAccountId); return userAccountService.removeAppAccount(userAccountId);
} }
@ApiOperation(value = "角色管理-当前角色绑定了那些账号")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("roleAccountList")
public ResultBody<RoleInfoDTO> roleAccountList(@ApiParam(value = "角色id", required = true) @RequestParam Integer id) {
return userAccountService.roleAccountList(id);
}
} }
...@@ -35,6 +35,8 @@ public interface RoleDao { ...@@ -35,6 +35,8 @@ public interface RoleDao {
Integer countNotDelUserAccountByRole(Integer id); Integer countNotDelUserAccountByRole(Integer id);
String findList();
List<MenuInfoDO> listRoleMenuInfo(Integer roleId); List<MenuInfoDO> listRoleMenuInfo(Integer roleId);
void batchAddMenuIds(Integer roleId, List<Integer> addMenuIds); void batchAddMenuIds(Integer roleId, List<Integer> addMenuIds);
......
...@@ -169,11 +169,4 @@ public interface UserServiceDao { ...@@ -169,11 +169,4 @@ public interface UserServiceDao {
*/ */
List<UserAccountDO> listAppUser(UserAccountQO param); List<UserAccountDO> listAppUser(UserAccountQO param);
/**
* 角色关联了那些id
*
* @param id
* @return
*/
List<UserAccountDO> roleAccountList(Integer id);
} }
...@@ -188,11 +188,4 @@ public interface UserAccountService { ...@@ -188,11 +188,4 @@ public interface UserAccountService {
ResultBody removeAppAccount(Integer userAccountId); ResultBody removeAppAccount(Integer userAccountId);
/**
* 角色关联了那些账号
*
* @param id
* @return
*/
ResultBody roleAccountList(Integer id);
} }
...@@ -41,7 +41,7 @@ public class RoleServiceImpl implements RoleService { ...@@ -41,7 +41,7 @@ public class RoleServiceImpl implements RoleService {
} }
RoleInfoDO rd = new RoleInfoDO(roleInfo); RoleInfoDO rd = new RoleInfoDO(roleInfo);
rd.setUserAccountId(userLoginInfoFromRedis.getUserAccountId()); rd.setUserAccountId(userLoginInfoFromRedis.getUserAccountId());
rd.setRoleNo(CodeUtil.createRoleNo()); rd.setRoleNo(CodeUtil.createRoleNo(roleDao.findList()));
roleDao.insertRoleInfo(rd); roleDao.insertRoleInfo(rd);
return ResultBody.success(); return ResultBody.success();
} }
......
...@@ -360,11 +360,5 @@ public class UserAccountServiceImpl implements UserAccountService { ...@@ -360,11 +360,5 @@ public class UserAccountServiceImpl implements UserAccountService {
return userAccountDOList; return userAccountDOList;
} }
@Override
public ResultBody roleAccountList(Integer id) {
List<UserAccountDO> roleInfoDOS = userServiceDao.roleAccountList(id);
List<UserAccountSimpleDTO> accountSimpleDTOS = roleInfoDOS.stream().map(UserAccountDO::buildUserAccountSimpleDTO).collect(Collectors.toList());
return ResultBody.success(accountSimpleDTOS);
}
} }
...@@ -183,4 +183,12 @@ ...@@ -183,4 +183,12 @@
order by m.sort ASC order by m.sort ASC
</select> </select>
<select id="findList" resultType="java.lang.String">
SELECT role_no
FROM role_info
where is_deleted = 0
ORDER BY id DESC LIMIT 1;
</select>
</mapper> </mapper>
...@@ -394,16 +394,5 @@ ...@@ -394,16 +394,5 @@
order by ua.create_time desc order by ua.create_time desc
limit #{pageNo}, #{pageSize} limit #{pageNo}, #{pageSize}
</select> </select>
<select id="roleAccountList" resultMap="userAccountResultMap">
SELECT urr.user_account_id,
ua.user_name,
ua.uid,
ua.phone_num,
ua.user_name,
ua.is_deleted
FROM user_role_rel urr
LEFT JOIN user_account ua ON ua.id = urr.user_account_id
WHERE urr.role_id = #{id}
AND ua.is_deleted = 0
</select>
</mapper> </mapper>
...@@ -18,4 +18,4 @@ patches: ...@@ -18,4 +18,4 @@ patches:
images: images:
- name: REGISTRY/NAMESPACE/IMAGE:TAG - name: REGISTRY/NAMESPACE/IMAGE:TAG
newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/cms newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/cms
newTag: 7bfe973709b306a80823229035782926b9eb231a newTag: bd7e73e413430b655bf229d7a908198126654fb5
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论