提交 fd6e04e1 作者: xiaowang

代码优化

上级 e95177a6
......@@ -16,6 +16,8 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
@Builder
public class ProductReportDTO {
@ApiModelProperty(value = "企业认证总数")
private Integer companyAuthCount;
@ApiModelProperty(value = "入驻商家总数")
private Integer joinStoreCount;
@ApiModelProperty(value = "品牌商")
......
......@@ -33,7 +33,17 @@ public class ProductReportServiceImpl implements ProductReportService {
@Override
public ResultBody<ProductReportDTO> getProductReportData() {
// 获取入驻商家总数
ProductReportDTO joinStoreNumber = userAppApi.getJoinStoreNumber();
ProductReportDTO productReportDTO = userAppApi.getJoinStoreNumber();
if (productReportDTO == null) {
productReportDTO = new ProductReportDTO();
productReportDTO.setCompanyAuthCount(0);
productReportDTO.setJoinStoreCount(0);
productReportDTO.setBrandStore(0);
productReportDTO.setRepairStore(0);
productReportDTO.setTrainingInstitution(0);
productReportDTO.setLeaseStore(0);
productReportDTO.setServiceStore(0);
}
// 获取销售商品个数
int saleProduct = mallGoodsDao.getMallGoodsCount();
// 获取出租商品个数
......@@ -42,24 +52,12 @@ public class ProductReportServiceImpl implements ProductReportService {
int serviceProduct = companyInspectionDao.getServiceProduct();
// 获取在线课程个数
int onlineCourse = imsAppApi.getCurriculumCount();
if (joinStoreNumber == null) {
ProductReportDTO productReportDTO = new ProductReportDTO();
productReportDTO.setJoinStoreCount(0);
productReportDTO.setBrandStore(0);
productReportDTO.setRepairStore(0);
productReportDTO.setTrainingInstitution(0);
productReportDTO.setLeaseStore(0);
productReportDTO.setServiceStore(0);
productReportDTO.setSaleProduct(saleProduct);
productReportDTO.setLeaseProduct(leaseProduct);
productReportDTO.setServiceProduct(serviceProduct);
productReportDTO.setOnlineCourse(onlineCourse);
return ResultBody.success(productReportDTO);
}
joinStoreNumber.setSaleProduct(saleProduct);
joinStoreNumber.setLeaseProduct(leaseProduct);
joinStoreNumber.setServiceProduct(serviceProduct);
joinStoreNumber.setOnlineCourse(onlineCourse);
return ResultBody.success(joinStoreNumber);
productReportDTO.setSaleProduct(saleProduct);
productReportDTO.setLeaseProduct(leaseProduct);
productReportDTO.setServiceProduct(serviceProduct);
productReportDTO.setOnlineCourse(onlineCourse);
return ResultBody.success(productReportDTO);
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论