SupplierServiceImpl.java 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. package com.caimei.www.service.page.impl;
  2. import com.caimei.www.mapper.SupplierDao;
  3. import com.caimei.www.pojo.page.SupplierDetail;
  4. import com.caimei.www.service.page.SupplierService;
  5. import lombok.extern.slf4j.Slf4j;
  6. import org.springframework.beans.factory.annotation.Value;
  7. import org.springframework.stereotype.Service;
  8. import org.springframework.util.StringUtils;
  9. import javax.annotation.Resource;
  10. import java.util.List;
  11. /**
  12. * Description
  13. *
  14. * @author : Charles
  15. * @date : 2020/7/22
  16. */
  17. @Slf4j
  18. @Service
  19. public class SupplierServiceImpl implements SupplierService {
  20. @Value("${caimei.wwwDomain}")
  21. private String domain;
  22. @Resource
  23. private SupplierDao supplierDao;
  24. /**
  25. * 供应商详情
  26. *
  27. * @param supplierId
  28. * @return
  29. */
  30. @Override
  31. public SupplierDetail getSupplierById(Integer supplierId) {
  32. SupplierDetail supplier = supplierDao.getSupplierById(supplierId);
  33. if (!StringUtils.isEmpty(supplier.getBusinessScope())) {
  34. String[] businessScope = supplier.getBusinessScope().split("/");
  35. supplier.setBusinessScopeArr(businessScope);
  36. supplier.setMedicalPracticeLicense(supplierDao.medicalPracticeLicense(supplierId));
  37. }
  38. //公司资质照片
  39. List<String> productionLicence = supplierDao.getShopCertById(supplierId, 2);
  40. if (null != productionLicence && productionLicence.size() > 0) {
  41. supplier.setMedicalPracticeLicenseImg1(productionLicence.get(0));
  42. }
  43. List<String> hygienicLicense = supplierDao.getShopCertById(supplierId, 5);
  44. if (null != hygienicLicense && hygienicLicense.size() > 0) {
  45. supplier.setMedicalPracticeLicenseImg2(hygienicLicense.get(0));
  46. }
  47. List<String> taxLicense = supplierDao.getShopCertById(supplierId, 6);
  48. if (null != taxLicense && taxLicense.size() > 0) {
  49. supplier.setMedicalPracticeLicenseImg3(taxLicense.get(0));
  50. }
  51. return supplier;
  52. }
  53. }