diff --git a/src/main/java/com/glxp/api/entity/basic/UdiProductEntity.java b/src/main/java/com/glxp/api/entity/basic/UdiProductEntity.java index 94940e66..d17caf90 100644 --- a/src/main/java/com/glxp/api/entity/basic/UdiProductEntity.java +++ b/src/main/java/com/glxp/api/entity/basic/UdiProductEntity.java @@ -347,6 +347,7 @@ public class UdiProductEntity { */ @TableField(value = "detailSort") private Integer detailSort; + public Integer getMyBhxjsl() { if (bhxjsl == null || bhxjsl == 0) return 1; diff --git a/src/main/java/com/glxp/api/service/collect/RelCodeBatchService.java b/src/main/java/com/glxp/api/service/collect/RelCodeBatchService.java index 7a520182..ae2616e1 100644 --- a/src/main/java/com/glxp/api/service/collect/RelCodeBatchService.java +++ b/src/main/java/com/glxp/api/service/collect/RelCodeBatchService.java @@ -32,6 +32,7 @@ import com.glxp.api.service.auth.CustomerService; import com.glxp.api.service.basic.ProductInfoService; import com.glxp.api.service.basic.UdiProductService; import com.glxp.api.util.HttpClient; +import com.glxp.api.util.alihealth.AlihealthUtils; import com.glxp.api.util.udi.FilterUdiUtils; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; @@ -59,7 +60,8 @@ public class RelCodeBatchService extends ServiceImpl ioCodeTempEntities = ioCodeTempDao.selectList(new LambdaQueryWrapper().eq(IoCodeTempEntity::getCode, parentCode)); if (CollUtil.isNotEmpty(ioCodeTempEntities)) { - + IoCodeTempEntity codeTempEntity = ioCodeTempEntities.get(0); //1、排除掉层级是1的 UdiEntity udi = FilterUdiUtils.getUdi(parentCode); if (udi == null) @@ -374,6 +376,19 @@ public class RelCodeBatchService extends ServiceImpl navList = this.list(new LambdaQueryWrapper() .eq(RelCodeBatch::getParentCode, parentCode)); +// codeTempEntity.getSupId() + //todo if(navList)是空的 1.查供应商key;2:根据parentCode查阿里接口;3:根据返回结果,再次查询 + if(navList == null || navList.size() == 0 ){ + BaseResponse baseResponse = alihealthUtils.relCodeInsert(codeTempEntity.getSupId(),parentCode); + if(baseResponse.getCode() == 20000){ + // 插入成功就重新查询一下 + navList = this.list(new LambdaQueryWrapper() + .eq(RelCodeBatch::getParentCode, parentCode)); + }else { + log.error(baseResponse.getMessage()); + } + } + if ((udiProductEntity != null && "1".equals(udiProductEntity.getPackLevel())) || (CollUtil.isNotEmpty(navList)) ) {