提交 fee3d17d 作者: zhenjie

合作标签筛选加盟商列表

上级 0cdf5e7f
......@@ -74,4 +74,6 @@ public class CompanyInfoVO implements Serializable {
private Integer score;
@ApiModelProperty(value = "背景图", example = "http://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/3505c402-cbf9-41a5-9d6f-bdb350625bea.jpg")
private String backImg;
@ApiModelProperty(value = "当前距离")
private Double distance;
}
......@@ -135,4 +135,15 @@ public class CooperationController extends BaseController {
public List<CooperationTagVO> feignListCooperationTag() {
return cooperationService.listTag();
}
@ApiOperation(value = "合作商家列表-根据合作标签id获取")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = CompanyInfoVO.class)})
@GetMapping("listCompanyInfoByCoopId")
public ResultBody<CompanyInfoVO> listCompanyInfoByCoopId(@ApiParam(value = "加盟合作标签id") @RequestParam Integer coopId,
@RequestParam Integer pageNo,
@RequestParam Integer pageSize,
@RequestParam Double lon,
@RequestParam Double lat) {
return ResultBody.success(cooperationService.listCompanyInfoByCoopId(coopId, pageNo, pageSize, lon, lat));
}
}
......@@ -137,4 +137,8 @@ public interface CooperationDao {
int countUserApplyTagByUid(Integer userAccountId);
UserApplyTagDO appBrandMessage(Integer userAccountId);
int countListCompanyInfoByCoopId(Integer coopId);
List<CompanyInfoDO> listCompanyInfoByCoopId(Integer coopId, Double lon, Double lat, Integer pageNo, Integer pageSize);
}
......@@ -50,6 +50,8 @@ public class CompanyInfoDO implements Serializable {
private Integer score;
private Integer leader;
@ApiModelProperty(value = "当前距离")
private Double distance;
public CompanyInfoDO(ApplyTagEditVO applyTagEditVO) {
this.address = applyTagEditVO.getAddress();
......@@ -69,6 +71,7 @@ public class CompanyInfoDO implements Serializable {
.content(this.getContent())
.score(this.getScore())
.backImg(this.backImg)
.distance(this.distance)
.build();
}
......
......@@ -62,4 +62,6 @@ public interface CooperationService {
ResultBody appBrandList();
ResultBody<UserApplyTagVO> appBrandMessage(Integer userAccountId);
PageResult listCompanyInfoByCoopId(Integer coopId, Integer pageNo, Integer pageSize, Double lon, Double lat);
}
......@@ -252,7 +252,7 @@ public class CooperationServiceImpl implements CooperationService {
if (!userApplyTag.getApplyStatus().equals(1)) {
return ResultBody.error("当前服务商暂未通过审核!");
}
//if (StringUtils.isBlank(applyTagEditVO.getRemark())) {
UserApplyTagDO userApplyTagDO = new UserApplyTagDO();
userApplyTagDO.setId(applyTagEditVO.getId());
......@@ -302,4 +302,15 @@ public class CooperationServiceImpl implements CooperationService {
UserApplyTagVO userApplyTagVO = userApplyTagDO.buildUserApplyTagVO();
return ResultBody.success(userApplyTagVO);
}
@Override
public PageResult listCompanyInfoByCoopId(Integer coopId, Integer pageNo, Integer pageSize, Double lon, Double lat) {
int count = cooperationDao.countListCompanyInfoByCoopId(coopId);
if (count == 0) {
return PageResult.buildPage(pageNo, pageSize, count);
}
List<CompanyInfoVO> list = cooperationDao.listCompanyInfoByCoopId(coopId, lon, lat, (pageNo - 1) * pageSize, pageSize)
.stream().map(CompanyInfoDO::buildCompanyInfoVO).collect(Collectors.toList());
return PageResult.buildPage(pageNo, pageSize, count, list);
}
}
......@@ -432,4 +432,35 @@
AND ct.is_deleted = 0
AND ci.is_deleted = 0
</select>
<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
WHERE ct.id = #{coopId}
and uat.is_deleted = 0 and uat.apply_status = 1
</select>
<select id="listCompanyInfoByCoopId" resultType="com.mmc.iuav.user.entity.CompanyInfoDO">
SELECT ci.id,
ci.company_name,
ci.address,
ci.lon,
ci.lat,
ci.content,
ci.score,
ci.brand_name,
ci.brand_logo,
st_distance_sphere(point(ci.lon, ci.lat), point(${lon}, ${lat})) 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
WHERE ct.id = #{coopId}
and uat.is_deleted = 0 and uat.apply_status = 1
ORDER BY distance ASC
LIMIT #{pageNo}, #{pageSize}
</select>
</mapper>
......@@ -22,6 +22,7 @@ data-filter:
- /userapp/company/listCompanyPageBack
- /userapp/company/getCompanyInfoById
- /userapp/cooperation/service/bitmap
- /userapp/cooperation/listCompanyInfoByCoopId
- /userapp/cooperation/appBrandList
- /userapp/cooperation/appBrandMessage
- /userapp/pilot/detailPilot
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论