提交 1a50fcb6 作者: zhenjie

加盟bug修复

上级 b8e8e7ae
......@@ -32,6 +32,7 @@ public enum ResultEnum implements BaseErrorInfoInterface {
TRANFER_COMPANY_MEMBER_LEADER_ERROR("5015", "转交人不是管理员!"),
COMPANY_EXIST_ERROR("5015", "该企业已认证!"),
COOPERATION_CHECK_NOT_PASS_ERROR("5016", "审核失败,请联系管理人员!"),
REBINDING_COMPANY_ERROR("5017", "该用户已被企业绑定,请尝试让该用户解绑后再重试!"),
//微信相关
PASSWORD_INCONSISTENT("5026", "新密码与确认密码不一致,请确认一致"),
......
......@@ -191,4 +191,6 @@ public interface CompanyDao {
* @return
*/
List<UserAccountDO> listCompanyMembersPage(Integer id, Integer pageNo, Integer pageSize);
int countBingingCompanyInfoByUID(Integer userAccountId);
}
......@@ -139,6 +139,11 @@ public class CompanyServiceImpl implements CompanyService {
@Override
public ResultBody bindingCompanyMember(LoginSuccessDTO loginSuccessDTO, Integer userAccountId, Integer companyInfoId) {
// 查看该成员是否已被绑定
int count = companyDao.countBingingCompanyInfoByUID(userAccountId);
if (count > 0) {
return ResultBody.error(ResultEnum.REBINDING_COMPANY_ERROR);
}
CompanyMemberDO companyMemberDO = new CompanyMemberDO();
companyMemberDO.setUserAccountId(userAccountId);
companyMemberDO.setCompanyInfoId(companyInfoId);
......
......@@ -207,4 +207,8 @@
order by cm.is_leader desc, cm.create_time desc
limit #{pageNo}, #{pageSize}
</select>
<select id="countBingingCompanyInfoByUID" resultType="java.lang.Integer">
select count(*) from company_member where user_account_id = #{userAccountId}
</select>
</mapper>
\ No newline at end of file
......@@ -285,21 +285,22 @@
where type = #{type}
</select>
<select id="listServiceBitmapData" resultType="com.mmc.iuav.user.entity.WebsiteInfoDO">
SELECT wi.id,
wi.`name`,
wi.address,
wi.lat,
wi.lon,
wi.type,
wi.user_apply_tag,
st_distance_sphere(
point(wi.lon, wi.lat),
point(${lon}, ${lat})) AS distance,
ua.content,
ua.score
FROM website_info wi
INNER JOIN user_apply_tag ua ON wi.user_apply_tag = ua.id
WHERE wi.type = #{type}
SELECT
uat.id,
ci.company_name AS `name`,
ci.address,
ci.lon,
ci.lat,
ct.id AS type,
uat.content,
uat.score,
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 = #{type}
ORDER BY distance ASC
LIMIT #{pageNo}, #{pageSize}
</select>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论