|
|
@@ -4,9 +4,12 @@ import java.util.List;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.fs.common.core.domain.R;
|
|
|
+import com.fs.common.core.domain.entity.SysRole;
|
|
|
+import com.fs.common.core.domain.entity.SysUser;
|
|
|
import com.fs.common.utils.ParseUtils;
|
|
|
import com.fs.common.utils.SecurityUtils;
|
|
|
import com.fs.his.dto.AddressInfoDTO;
|
|
|
+import com.fs.system.service.ISysRoleService;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
@@ -50,13 +53,41 @@ public class FsUserAddressController extends BaseController
|
|
|
{
|
|
|
startPage();
|
|
|
List<FsUserAddress> list = fsUserAddressService.selectFsUserAddressList(fsUserAddress);
|
|
|
+ SysRole sysRole = null;
|
|
|
+ try {
|
|
|
+ sysRole = isCheckPermission();
|
|
|
+ } catch (Exception e) {
|
|
|
+ }
|
|
|
for (FsUserAddress userAddress : list) {
|
|
|
- userAddress.setPhone(decryptAutoPhoneMk(userAddress.getPhone()));
|
|
|
- userAddress.setDetail(ParseUtils.parseAddress(userAddress.getDetail()));
|
|
|
+ if (sysRole == null || sysRole.getIsCheckPhone() != 1 ) {
|
|
|
+ userAddress.setPhone(decryptAutoPhoneMk(userAddress.getPhone()));
|
|
|
+ }
|
|
|
+ if (sysRole == null || sysRole.getIsCheckAddress() != 1 ) {
|
|
|
+ userAddress.setDetail(ParseUtils.parseAddress(userAddress.getDetail()));
|
|
|
+ }
|
|
|
}
|
|
|
return getDataTable(list);
|
|
|
}
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ISysRoleService sysRoleService;
|
|
|
+ private SysRole isCheckPermission() {
|
|
|
+ SysRole sysRole = new SysRole();
|
|
|
+ SysUser user = getLoginUser().getUser();
|
|
|
+ boolean flag = user.isAdmin();
|
|
|
+ if (flag) {
|
|
|
+ sysRole.setIsCheckPhone(1);
|
|
|
+ sysRole.setIsCheckAddress(1);
|
|
|
+ } else {
|
|
|
+ List<SysRole> roles = user.getRoles();
|
|
|
+ if (roles != null && !roles.isEmpty()) {
|
|
|
+ Long[] roleIds = roles.stream().map(SysRole::getRoleId).toArray(Long[]::new);
|
|
|
+ return sysRoleService.getIsCheckPermission(roleIds);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return sysRole;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 导出用户地址列表
|
|
|
*/
|