提交 1a3da0e4 作者: xiaowang

bug修复

上级 462af5e7
package com.mmc.iuav.user.model.dto.data;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @Author LW
* @date 2023/9/16 14:15
* 概要:
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class ProductReportDTO {
@ApiModelProperty(value = "入驻商家总数")
private Integer joinStoreCount;
@ApiModelProperty(value = "品牌商")
private Integer brandStore;
@ApiModelProperty(value = "维修商")
private Integer repairStore;
@ApiModelProperty(value = "培训机构")
private Integer trainingInstitution;
@ApiModelProperty(value = "租赁商")
private Integer leaseStore;
@ApiModelProperty(value = "服务商")
private Integer serviceStore;
@ApiModelProperty(value = "销售商品")
private Integer saleProduct;
@ApiModelProperty(value = "出租商品")
private Integer leaseProduct;
@ApiModelProperty(value = "服务商品")
private Integer serviceProduct;
@ApiModelProperty(value = "在线课程")
private Integer onlineCourse;
}
package com.mmc.iuav.user.controller.data;
import com.mmc.iuav.response.ResultBody;
import com.mmc.iuav.user.model.dto.data.ProductReportDTO;
import com.mmc.iuav.user.model.dto.data.UserReportDTO;
import com.mmc.iuav.user.service.data.UserReportService;
import io.swagger.annotations.*;
......@@ -9,6 +10,7 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
/**
* @Author LW
......@@ -29,4 +31,12 @@ public class UserReportController {
public ResultBody<UserReportDTO> getUserReportData(@ApiParam(value = "(预留字段暂时不传值)根据时间查询(暂未实现)") @RequestParam(required = false) String date) {
return userReportService.getUserReportData(date);
}
@ApiOperation(value = "获取入驻商家数量")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ProductReportDTO.class)})
@GetMapping("/getJoinStoreNumber")
@ApiIgnore
public ProductReportDTO getJoinStoreNumber() {
return userReportService.getJoinStoreNumber();
}
}
......@@ -141,4 +141,8 @@ public interface CooperationDao {
int countListCompanyInfoByCoopId(Integer coopId);
List<CompanyInfoDO> listCompanyInfoByCoopId(Integer coopId, Double lon, Double lat, Integer pageNo, Integer pageSize);
int getJoinStoreCount();
int getStoreCountByType(int type);
}
package com.mmc.iuav.user.service.data;
import com.mmc.iuav.response.ResultBody;
import com.mmc.iuav.user.model.dto.data.ProductReportDTO;
import com.mmc.iuav.user.model.dto.data.UserReportDTO;
import com.mmc.iuav.user.model.vo.data.ActiveUserCountVO;
......@@ -16,4 +17,7 @@ public interface UserReportService {
Integer getUserActiveCount();
void insertActiveUserCount(ActiveUserCountVO param);
ProductReportDTO getJoinStoreNumber();
}
......@@ -3,10 +3,12 @@ package com.mmc.iuav.user.service.data.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.mmc.iuav.response.ResultBody;
import com.mmc.iuav.user.dao.CooperationDao;
import com.mmc.iuav.user.dao.RealNameAuthDao;
import com.mmc.iuav.user.dao.UserServiceDao;
import com.mmc.iuav.user.dao.dronepilot.PilotCertificationDao;
import com.mmc.iuav.user.entity.data.ActiveUserCountDO;
import com.mmc.iuav.user.model.dto.data.ProductReportDTO;
import com.mmc.iuav.user.model.dto.data.UserReportDTO;
import com.mmc.iuav.user.model.vo.data.ActiveUserCountVO;
import com.mmc.iuav.user.service.WxService;
......@@ -29,7 +31,9 @@ public class UserReportServiceImpl implements UserReportService {
@Resource
private PilotCertificationDao pilotCertificationDao;
@Resource
WxService wxService;
private WxService wxService;
@Resource
private CooperationDao cooperationDao;
@Override
public ResultBody<UserReportDTO> getUserReportData(String date) {
......@@ -69,4 +73,23 @@ public class UserReportServiceImpl implements UserReportService {
ActiveUserCountDO activeUserCountDO = new ActiveUserCountDO(param);
userServiceDao.insertActiveUserCount(activeUserCountDO);
}
@Override
public ProductReportDTO getJoinStoreNumber() {
ProductReportDTO productReportDTO = new ProductReportDTO();
// 获取入驻商家数量
int joinStoreCount = cooperationDao.getJoinStoreCount();
productReportDTO.setJoinStoreCount(joinStoreCount);
// 获取品牌商入驻数量
productReportDTO.setBrandStore(cooperationDao.getStoreCountByType(1));
// 获取维修商数量
productReportDTO.setRepairStore(cooperationDao.getStoreCountByType(10));
// 获取培训机构数量
productReportDTO.setTrainingInstitution(cooperationDao.getStoreCountByType(4));
// 获取租赁商数量
productReportDTO.setLeaseStore(cooperationDao.getStoreCountByType(3));
// 获取服务商数量
productReportDTO.setServiceStore(cooperationDao.getStoreCountByType(5));
return productReportDTO;
}
}
......@@ -436,11 +436,13 @@
<select id="countListCompanyInfoByCoopId" resultType="java.lang.Integer">
SELECT count(*)
FROM user_apply_tag uat
INNER JOIN cooperation_tag ct ON uat.cooperation_tag_id = ct.id
INNER JOIN company_member cm ON cm.user_account_id = uat.user_account_id
INNER JOIN company_info ci ON cm.company_info_id = ci.id
INNER JOIN cooperation_tag ct ON uat.cooperation_tag_id = ct.id
INNER JOIN company_member cm ON cm.user_account_id = uat.user_account_id
INNER JOIN company_info ci ON cm.company_info_id = ci.id
WHERE ct.id = #{coopId}
and uat.is_deleted = 0 and uat.apply_status = 1 and ci.is_deleted = 0
and uat.is_deleted = 0
and uat.apply_status = 1
and ci.is_deleted = 0
</select>
<select id="listCompanyInfoByCoopId" resultType="com.mmc.iuav.user.entity.CompanyInfoDO">
......@@ -454,15 +456,30 @@
ci.brand_name,
ci.brand_logo,
cbu.back_user_account_id,
round(st_distance_sphere(point(ci.lon, ci.lat),point(#{lon}, #{lat}))/1000, 2) AS distance
round(st_distance_sphere(point(ci.lon, ci.lat), point(#{lon}, #{lat})) / 1000, 2) AS distance
FROM user_apply_tag uat
INNER JOIN cooperation_tag ct ON uat.cooperation_tag_id = ct.id
INNER JOIN company_member cm ON cm.user_account_id = uat.user_account_id
INNER JOIN company_info ci ON cm.company_info_id = ci.id
INNER JOIN company_back_user cbu ON cbu.company_info_id = ci.id
WHERE ct.id = #{coopId}
and uat.is_deleted = 0 and uat.apply_status = 1 and ci.is_deleted = 0
ORDER BY distance ASC
and uat.is_deleted = 0
and uat.apply_status = 1
and ci.is_deleted = 0
ORDER BY distance ASC
LIMIT #{pageNo}, #{pageSize}
</select>
<select id="getJoinStoreCount" resultType="java.lang.Integer">
select count(*)
from user_apply_tag
where is_deleted = 0
and apply_status = 1
</select>
<select id="getStoreCountByType" resultType="java.lang.Integer">
select count(*)
from user_apply_tag
where is_deleted = 0
and apply_status = 1
and cooperation_tag_id = #{type}
</select>
</mapper>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论