12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- package com.caimei.www.service.page.impl;
- import com.caimei.www.mapper.SupplierDao;
- import com.caimei.www.pojo.page.SupplierDetail;
- import com.caimei.www.service.page.SupplierService;
- import lombok.extern.slf4j.Slf4j;
- import org.springframework.beans.factory.annotation.Value;
- import org.springframework.stereotype.Service;
- import org.springframework.util.StringUtils;
- import javax.annotation.Resource;
- import java.util.List;
- /**
- * Description
- *
- * @author : Charles
- * @date : 2020/7/22
- */
- @Slf4j
- @Service
- public class SupplierServiceImpl implements SupplierService {
- @Value("${caimei.wwwDomain}")
- private String domain;
- @Resource
- private SupplierDao supplierDao;
- /**
- * 供应商详情
- *
- * @param supplierId
- * @return
- */
- @Override
- public SupplierDetail getSupplierById(Integer supplierId) {
- SupplierDetail supplier = supplierDao.getSupplierById(supplierId);
- if (!StringUtils.isEmpty(supplier.getBusinessScope())) {
- String[] businessScope = supplier.getBusinessScope().split("/");
- supplier.setBusinessScopeArr(businessScope);
- supplier.setMedicalPracticeLicense(supplierDao.medicalPracticeLicense(supplierId));
- }
- //公司资质照片
- List<String> productionLicence = supplierDao.getShopCertById(supplierId, 2);
- if (null != productionLicence && productionLicence.size() > 0) {
- supplier.setMedicalPracticeLicenseImg1(productionLicence.get(0));
- }
- List<String> hygienicLicense = supplierDao.getShopCertById(supplierId, 5);
- if (null != hygienicLicense && hygienicLicense.size() > 0) {
- supplier.setMedicalPracticeLicenseImg2(hygienicLicense.get(0));
- }
- List<String> taxLicense = supplierDao.getShopCertById(supplierId, 6);
- if (null != taxLicense && taxLicense.size() > 0) {
- supplier.setMedicalPracticeLicenseImg3(taxLicense.get(0));
- }
- return supplier;
- }
- }
|