Commit 88bc5a91 by zhiwj

添加创建时间返回

parent 1f25a703
......@@ -35,7 +35,20 @@ public class PlatformBrandRefDTO implements Serializable {
private Date createTime;
private Date updateTime;
/**
* 商户名称
*/
private String enterpriseName;
/**
* 公司名称
*/
private String companyName;
/**
*
*/
private String logo;
public Integer getPlatformBrandRefId() {
return platformBrandRefId;
}
......@@ -99,4 +112,28 @@ public class PlatformBrandRefDTO implements Serializable {
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public String getEnterpriseName() {
return enterpriseName;
}
public void setEnterpriseName(String enterpriseName) {
this.enterpriseName = enterpriseName;
}
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
public String getLogo() {
return logo;
}
public void setLogo(String logo) {
this.logo = logo;
}
}
......@@ -10,13 +10,11 @@ import com.gic.enterprise.constant.Constants;
import com.gic.enterprise.dto.DictDTO;
import com.gic.enterprise.dto.PlatformBrandDTO;
import com.gic.enterprise.dto.PlatformBrandRefDTO;
import com.gic.enterprise.entity.TabEnterprise;
import com.gic.enterprise.entity.TabPlatformBrand;
import com.gic.enterprise.entity.TabPlatformBrandRef;
import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.service.DictApiService;
import com.gic.enterprise.service.PlatformBrandApiService;
import com.gic.enterprise.service.PlatformBrandRefService;
import com.gic.enterprise.service.PlatformBrandService;
import com.gic.enterprise.service.*;
import com.github.pagehelper.PageHelper;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
......@@ -40,6 +38,8 @@ public class PlatformBrandApiServiceImpl implements PlatformBrandApiService {
private PlatformBrandRefService platformBrandRefService;
@Autowired
private DictApiService dictApiService;
@Autowired
private EnterpriseService enterpriseService;
@Override
public ServiceResponse<Integer> saveBrandFromGic(String categoryCode, String platformBrandName) {
......@@ -188,6 +188,14 @@ public class PlatformBrandApiServiceImpl implements PlatformBrandApiService {
TabPlatformBrand brand = this.platformBrandService.getByBrandName(brandName);
com.github.pagehelper.Page<TabPlatformBrandRef> brandRefPage = this.platformBrandRefService.listByPlatformBrandRef(brand == null ? null : brand.getPlatformBrandId());
Page<PlatformBrandRefDTO> page = PageHelperUtils.changePageHelperToCurrentPage(brandRefPage, PlatformBrandRefDTO.class);
if(CollectionUtils.isNotEmpty(page.getResult())) {
for (PlatformBrandRefDTO ref : page.getResult()) {
TabEnterprise enterprise = enterpriseService.getEnterpriseById(ref.getEnterpriseId());
ref.setEnterpriseName(enterprise.getEnterpriseName());
ref.setCompanyName(enterprise.getCompanyName());
ref.setLogo(enterprise.getLogo());
}
}
return ServiceResponse.success(page);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment