| | |
| | | |
| | | } |
| | | |
| | | WebService static String checkDealerId(String dealerId) { |
| | | String rtn = '0'; |
| | | // 获取系统管理员Id |
| | | String getUserId = System.label.SystemAdmin1_2_GPI; |
| | | // 获取当前用户Id |
| | | String userId = UserInfo.getUserId().subString(0,15); |
| | | dealerId.subString(0,15); |
| | | |
| | | String userDealerId; |
| | | List<User> userList = new List<User>(); |
| | | User user = new User(); |
| | | |
| | | if (String.isNotBlank(getUserId)) { |
| | | if (!getUserId.contains(userId)) { |
| | | userList = [select mu_Dealer__c |
| | | from User |
| | | where id =: userId]; |
| | | |
| | | user = userList[0]; |
| | | userDealerId = user.mu_Dealer__c; |
| | | if (String.isNotBlank(userDealerId)) { |
| | | userDealerId.substring(0,15); |
| | | } |
| | | if (userDealerId == dealerId) { |
| | | rtn = '1'; |
| | | } |
| | | }else { |
| | | rtn = '0'; |
| | | } |
| | | }else { |
| | | rtn = '0'; |
| | | } |
| | | System.debug('rtn='+rtn); |
| | | return rtn; |
| | | } |
| | | |
| | | |
| | | |