Commit f2c499fa by fudahua

根据userId 伪登录

parent 1180182a
...@@ -36,10 +36,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -36,10 +36,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList; import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@RestController @RestController
...@@ -129,21 +126,23 @@ public class InfoController extends WebBaseController{ ...@@ -129,21 +126,23 @@ public class InfoController extends WebBaseController{
staffDTOS.addAll(userDtos); staffDTOS.addAll(userDtos);
} }
if (CollectionUtils.isNotEmpty(staffDTOS)) { if (CollectionUtils.isNotEmpty(staffDTOS)) {
loginStaff = staffDTOS.get(0);
if (staffDTOS.size() > 1) { if (staffDTOS.size() > 1) {
String dictName = loginUserId.getDictName(); String dictName = loginUserId.getDictName();
String[] split = dictName.split("-"); String[] split = dictName.split("-");
if (split.length > 1) { if (split.length > 1) {
Integer pos = Integer.valueOf(split[1]); String weiCorpId = split[1];
if (pos != null && staffDTOS.size() > pos) { WxEnterpriseDTO weiWxEnterpriseDTO = wxEnterpriseApiService.getEnterpriseBycorpId(weiCorpId);
loginStaff = staffDTOS.get(pos); if (null != weiWxEnterpriseDTO) {
} else { loginStaff = staffDTOS.stream().filter(staffDTO -> {
loginStaff = staffDTOS.get(0); if (weiWxEnterpriseDTO.getWxEnterpriseId().equals(staffDTO.getWxEnterpriseId())) {
return true;
} else {
return false;
}
}).findFirst().orElse(staffDTOS.get(0));
} }
} else {
loginStaff = staffDTOS.get(0);
} }
} else {
loginStaff = staffDTOS.get(0);
} }
} }
// StaffDTO staffDTO = staffApiService.selectByNationcodeAndPhoneNumber(enterprise.getWxEnterpriseId(), "86", midPhone); // StaffDTO staffDTO = staffApiService.selectByNationcodeAndPhoneNumber(enterprise.getWxEnterpriseId(), "86", midPhone);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment