Browse Source

后端代码提交

mashengyi 3 years ago
parent
commit
fa8f5f47f2

+ 1 - 1
src/main/java/com/jkcredit/invoice/model/entity/customer/CustomerRec.java

@@ -54,7 +54,7 @@ public class CustomerRec {
     private String companyPhone;
 
     /**
-     * 2-自营平台 3-合作商户
+     * 1-行业用户 2-自营平台 3-合作商户
      */
     private Integer companyType;
     /**

+ 14 - 4
src/main/java/com/jkcredit/invoice/service/lowerService/impl/CustomerLowerServiceImpl.java

@@ -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());
                }
             }
             //客户备案信息入表