Commit f2c499fa by fudahua

根据userId 伪登录

parent 1180182a
......@@ -36,10 +36,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.*;
import java.util.stream.Collectors;
@RestController
......@@ -129,21 +126,23 @@ public class InfoController extends WebBaseController{
staffDTOS.addAll(userDtos);
}
if (CollectionUtils.isNotEmpty(staffDTOS)) {
loginStaff = staffDTOS.get(0);
if (staffDTOS.size() > 1) {
String dictName = loginUserId.getDictName();
String[] split = dictName.split("-");
if (split.length > 1) {
Integer pos = Integer.valueOf(split[1]);
if (pos != null && staffDTOS.size() > pos) {
loginStaff = staffDTOS.get(pos);
} else {
loginStaff = staffDTOS.get(0);
String weiCorpId = split[1];
WxEnterpriseDTO weiWxEnterpriseDTO = wxEnterpriseApiService.getEnterpriseBycorpId(weiCorpId);
if (null != weiWxEnterpriseDTO) {
loginStaff = staffDTOS.stream().filter(staffDTO -> {
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);
......
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