Commit 67282a11 by kangxiaoshan

校验客户主账号

parent f18451ec
package common.model;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import java.util.Date;
@Entity
public class QcloudAccount {
private Long id;
private String email;
private String company;
private Long accountId;// 账号id
private Date updateTime;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public Long getAccountId() {
return accountId;
}
public void setAccountId(Long accountId) {
this.accountId = accountId;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public String getCompany() {
return company;
}
public void setCompany(String company) {
this.company = company;
}
}
package common.repository;
import common.model.QcloudAccount;
import org.springframework.data.jpa.repository.JpaRepository;
public interface QcloudAccountRepository extends JpaRepository<QcloudAccount, Long> {
QcloudAccount findByEmail(String email);
}
...@@ -200,9 +200,6 @@ public class ContractServiceImpl implements ContractService { ...@@ -200,9 +200,6 @@ public class ContractServiceImpl implements ContractService {
@Autowired @Autowired
JdbcTemplate jdbcTemplate; JdbcTemplate jdbcTemplate;
@Autowired
@Qualifier("jdbcTemplateQcloud")
JdbcTemplate jdbcTemplateqCloud;
@Autowired @Autowired
TransactionUtils transactionUtils; TransactionUtils transactionUtils;
...@@ -210,6 +207,9 @@ public class ContractServiceImpl implements ContractService { ...@@ -210,6 +207,9 @@ public class ContractServiceImpl implements ContractService {
@Autowired @Autowired
ShareIncomeService shareIncomeService; ShareIncomeService shareIncomeService;
@Autowired
QcloudAccountRepository qcloudAccountRepository;
@Override @Override
public Map<String, Object> checkAccount(String email, String platfrom) { public Map<String, Object> checkAccount(String email, String platfrom) {
...@@ -223,6 +223,18 @@ public class ContractServiceImpl implements ContractService { ...@@ -223,6 +223,18 @@ public class ContractServiceImpl implements ContractService {
if ("tkio".equals(platfrom)) { if ("tkio".equals(platfrom)) {
//account4Web = account4WebRepository.findByEmail(email); //account4Web = account4WebRepository.findByEmail(email);
account = accountRepository.findByEmail(email); account = accountRepository.findByEmail(email);
if (account == null) {
QcloudAccount qcloudAccount = qcloudAccountRepository.findByEmail(email);
if (qcloudAccount != null) {
account = new Account();
account.setId(qcloudAccount.getId());
account.setCompany(qcloudAccount.getCompany());
account.setEmail(qcloudAccount.getEmail());
}
}
} else if ("io".equals(platfrom)) { } else if ("io".equals(platfrom)) {
ioAccount4Web = ioAccount4WebRepository.findByEmail(email); ioAccount4Web = ioAccount4WebRepository.findByEmail(email);
} else if ("adi".equals(platfrom)) { } else if ("adi".equals(platfrom)) {
...@@ -2389,6 +2401,12 @@ public class ContractServiceImpl implements ContractService { ...@@ -2389,6 +2401,12 @@ public class ContractServiceImpl implements ContractService {
} }
});*/ });*/
List<QcloudAccount> qcloudAccounts = qcloudAccountRepository.findAll();
qcloudAccounts.stream().map(v -> {
emailDic.put(v.getEmail(), "");
return null;
});
for (int i = 0; i < accountsEmail.size(); i++) { for (int i = 0; i < accountsEmail.size(); i++) {
String e = accountsEmail.get(i); String e = accountsEmail.get(i);
if (!emailDic.containsKey(e)) { if (!emailDic.containsKey(e)) {
......
...@@ -344,12 +344,12 @@ ...@@ -344,12 +344,12 @@
<property name="dataSource" ref="dataSource"/> <property name="dataSource" ref="dataSource"/>
</bean> </bean>
<bean id="qClouDataSource" parent="parentDataSource"> <!--<bean id="qClouDataSource" parent="parentDataSource">
<property name="url" value="${qcloudatasource.url}"/> <property name="url" value="${qcloudatasource.url}"/>
<property name="username" value="${qcloudatasource.username}"/> <property name="username" value="${qcloudatasource.username}"/>
<property name="password" value="${qcloudatasource.password}"/> <property name="password" value="${qcloudatasource.password}"/>
</bean> </bean>
<bean id="jdbcTemplateQcloud" class="org.springframework.jdbc.core.JdbcTemplate"> <bean id="jdbcTemplateQcloud" class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource" ref="qClouDataSource"></property> <property name="dataSource" ref="qClouDataSource"></property>
</bean> </bean>-->
</beans> </beans>
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