feat(config): 修改九公司配置支持多公司ID
parent
2cd65662fc
commit
1eb129d61d
|
|
@ -65,4 +65,4 @@ dahua:
|
|||
clientSecret: 5ef82f7c-9926-46a3-8d07-136fd054849c
|
||||
nine:
|
||||
config:
|
||||
companyId: 2008712261453131776
|
||||
companyId: 2008712261453131776,2046785341004177408
|
||||
|
|
|
|||
|
|
@ -66,4 +66,4 @@ dahua:
|
|||
clientSecret: 5ef82f7c-9926-46a3-8d07-136fd054849c
|
||||
nine:
|
||||
config:
|
||||
companyId: 2590800828822460065
|
||||
companyId: 2590800828822460065,2044322367672422400
|
||||
|
|
@ -241,8 +241,14 @@ public class UserQueryExe {
|
|||
UserCO userCO = new UserCO();
|
||||
BeanUtils.copyProperties(userDO, userCO);
|
||||
try{
|
||||
Long nineCompanyId = nineCompanyConfig.getCompanyId();
|
||||
userCO.setNineCompanyFlag(nineCompanyId != null && nineCompanyId.equals(userCO.getCorpinfoId()));
|
||||
String companyId = nineCompanyConfig.getCompanyId();
|
||||
boolean nineCompanyFlag = companyId != null
|
||||
&& userCO.getCorpinfoId() != null
|
||||
&& Arrays.stream(companyId.split(","))
|
||||
.map(String::trim)
|
||||
.filter(item -> !item.isEmpty())
|
||||
.anyMatch(item -> item.equals(String.valueOf(userCO.getCorpinfoId())));
|
||||
userCO.setNineCompanyFlag(nineCompanyFlag);
|
||||
}catch (Exception e){
|
||||
log.error("获取九公司ID异常", e);
|
||||
e.printStackTrace();
|
||||
|
|
|
|||
|
|
@ -8,5 +8,5 @@ import org.springframework.stereotype.Component;
|
|||
@ConfigurationProperties(prefix = "nine.config")
|
||||
@Data
|
||||
public class NineCompanyConfig {
|
||||
private Long companyId;
|
||||
private String companyId;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue