|
@@ -71,16 +71,26 @@ public class CustomerLowerServiceImpl implements CustomeLowerService {
|
|
|
res.append("#"+customerRec.getCompanyName()+"业务类型有误;#");
|
|
|
return;
|
|
|
}
|
|
|
+ if(StringUtils.isEmpty(customerRec.getCompanyName()) || StringUtils.isEmpty(customerRec.getCompanyReferencenum())){
|
|
|
+ res.append("企业备案名称或税号为空");
|
|
|
+ return;
|
|
|
+ }
|
|
|
//默认备案状态为备案中 2-失败 1-成功 3-等待协议上传 4-停用 0-备案中
|
|
|
customerRec.setRecStatus(0);
|
|
|
//主动查询上游接口,如果已经备案则更新
|
|
|
RespR respR = customerService.customerRecQuery(customerRec);
|
|
|
if(respR.getCode() == 0){
|
|
|
List<B2bCompanyModel> b2bCompanyModels = (List<B2bCompanyModel>)respR.getData();
|
|
|
- if(b2bCompanyModels.size()==1){
|
|
|
- customerRec.setCompanyNum(b2bCompanyModels.get(0).getCompanyNum());
|
|
|
- customerRec.setCompanyType(b2bCompanyModels.get(0).getCompanyType());
|
|
|
- customerRec.setRecStatus(1);
|
|
|
+ if(b2bCompanyModels.size()>=1){
|
|
|
+ b2bCompanyModels.forEach(b2bCompanyModel->{
|
|
|
+ if(b2bCompanyModel.getCompanyType().equals(customerRec.getCompanyType())){
|
|
|
+ customerRec.setCompanyNum(b2bCompanyModel.getCompanyNum());
|
|
|
+ customerRec.setCompanyType(b2bCompanyModel.getCompanyType());
|
|
|
+ customerRec.setRecStatus(1);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ log.info("AAAAAAAAAAA"+customerRec.getCompanyName()+b2bCompanyModels.size());
|
|
|
}
|
|
|
}
|
|
|
//客户备案信息入表
|