|
|
@@ -8,10 +8,7 @@ import com.github.kevinsawicki.http.HttpRequest;
|
|
|
import com.izouma.imt.converter.LongArrayConverter;
|
|
|
import com.izouma.imt.converter.StringArrayConverter;
|
|
|
import com.izouma.imt.domain.*;
|
|
|
-import com.izouma.imt.domain.vendor.BranchInformation;
|
|
|
-import com.izouma.imt.domain.vendor.Product;
|
|
|
-import com.izouma.imt.domain.vendor.ProductTag;
|
|
|
-import com.izouma.imt.domain.vendor.VendorInfo;
|
|
|
+import com.izouma.imt.domain.vendor.*;
|
|
|
import com.izouma.imt.dto.*;
|
|
|
import com.izouma.imt.dto.excel.VendorInfoVO;
|
|
|
import com.izouma.imt.enums.*;
|
|
|
@@ -63,6 +60,7 @@ public class VendorInfoService {
|
|
|
private final BuyersInfoService buyersInfoService;
|
|
|
private final SysConfigRepo sysConfigRepo;
|
|
|
private final SearchRecordRepo searchRecordRepo;
|
|
|
+ private final DecorationRepo decorationRepo;
|
|
|
|
|
|
public Page<VendorInfo> all(PageQuery pageQuery) {
|
|
|
return vendorInfoRepo.findAll(JpaUtils.toSpecification(pageQuery, VendorInfo.class), JpaUtils.toPageRequest(pageQuery));
|
|
|
@@ -508,6 +506,11 @@ public class VendorInfoService {
|
|
|
.stream()
|
|
|
.collect(Collectors.groupingBy(BranchInformation::getUserId));
|
|
|
|
|
|
+ // 自定义
|
|
|
+ Map<Long, String> decorationMap = decorationRepo.findAllByVendorInfoIdIsNotNullAndAndCustomAreaIsNotNull()
|
|
|
+ .stream()
|
|
|
+ .collect(Collectors.toMap(Decoration::getVendorInfoId, Decoration::getCustomArea));
|
|
|
+
|
|
|
// 所有标签
|
|
|
List<ProductTag> tagList = productTagRepo.findAll();
|
|
|
Map<Long, String> tagMap = tagList
|
|
|
@@ -608,11 +611,46 @@ public class VendorInfoService {
|
|
|
}
|
|
|
if (StrUtil.isNotBlank(vendorInfo.getLogo1())) {
|
|
|
HttpRequest.get(vendorInfo.getLogo1())
|
|
|
- .receive(new File(dirfile + "/logo1" + this.getSuffix(vendorInfo.getLogo())));
|
|
|
+ .receive(new File(dirfile + "/logo1" + this.getSuffix(vendorInfo.getLogo1())));
|
|
|
}
|
|
|
if (StrUtil.isNotBlank(vendorInfo.getBusinessLicenseImg())) {
|
|
|
HttpRequest.get(vendorInfo.getBusinessLicenseImg())
|
|
|
- .receive(new File(dirfile + "/BusinessLicense" + this.getSuffix(vendorInfo.getLogo())));
|
|
|
+ .receive(new File(dirfile + "/BusinessLicense" + this.getSuffix(vendorInfo.getBusinessLicenseImg())));
|
|
|
+ }
|
|
|
+ if (StrUtil.isNotBlank(vendorInfo.getIDImg())) {
|
|
|
+ HttpRequest.get(vendorInfo.getIDImg())
|
|
|
+ .receive(new File(dirfile + "/id" + this.getSuffix(vendorInfo.getIDImg())));
|
|
|
+ }
|
|
|
+ if (StrUtil.isNotBlank(user.getCard())) {
|
|
|
+ HttpRequest.get(user.getCard())
|
|
|
+ .receive(new File(dirfile + "/card" + this.getSuffix(user.getCard())));
|
|
|
+ }
|
|
|
+ if (StrUtil.isNotBlank(vendorInfo.getOtherFiles())) {
|
|
|
+ String[] split = vendorInfo.getOtherFiles().split(",");
|
|
|
+ for (int i = 1; i <= split.length; i++) {
|
|
|
+ HttpRequest.get(split[i - 1])
|
|
|
+ .receive(new File(dirfile + "/other" + i + this.getSuffix(split[i - 1])));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (StrUtil.isNotBlank(vendorInfo.getImg())) {
|
|
|
+ String[] split = vendorInfo.getImg().split(",");
|
|
|
+ for (int i = 1; i <= split.length; i++) {
|
|
|
+ String suffix = this.getSuffix(split[i - 1]);
|
|
|
+// if (suffix.equals(".mp4")){
|
|
|
+// continue;
|
|
|
+// }
|
|
|
+
|
|
|
+ HttpRequest.get(split[i - 1])
|
|
|
+ .receive(new File(dirfile + "/banner" + i + suffix));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ String decoration = decorationMap.get(vendorInfo.getId());
|
|
|
+ if (StrUtil.isNotBlank(decoration)) {
|
|
|
+ String[] split = decoration.split(",");
|
|
|
+ for (int i = 1; i <= split.length; i++) {
|
|
|
+ HttpRequest.get(split[i - 1])
|
|
|
+ .receive(new File(dirfile + "/custom" + i + this.getSuffix(split[i - 1])));
|
|
|
+ }
|
|
|
}
|
|
|
vos.add(vo);
|
|
|
});
|