供应商列表查询去重、活动查询用户信息去重、查询组织信息错误处理

main
cheney 10 months ago
parent dc9be2704a
commit 9515791a36
  1. 2
      competition/src/main/java/com/huoran/competition/mapper/xml/CompetitionMapper.xml
  2. 2
      nakadai/src/main/java/com/huoran/nakadai/controller/PlatformTeamAccountController.java
  3. 4
      nakadai/src/main/java/com/huoran/nakadai/mapper/xml/EnterpriseCertificationMapper.xml
  4. 5
      nakadai/src/main/java/com/huoran/nakadai/service/impl/PlatformTeamAccountServiceImpl.java
  5. 14
      users/src/main/java/com/huoran/users/controller/HrUserAccountController.java
  6. 6
      users/src/main/java/com/huoran/users/entity/res/OrganizationInfo.java
  7. 2
      users/src/main/java/com/huoran/users/mapper/HrUserAccountMapper.java
  8. 68
      users/src/main/java/com/huoran/users/mapper/xml/HrUserAccountMapper.xml
  9. 2
      users/src/main/java/com/huoran/users/service/IHrUserAccountService.java
  10. 12
      users/src/main/java/com/huoran/users/service/impl/HrUserAccountServiceImpl.java

@ -825,7 +825,7 @@
</select> </select>
<select id="obtainRole" resultType="java.lang.String"> <select id="obtainRole" resultType="java.lang.String">
SELECT SELECT
a.platform_id DISTINCT(a.platform_id)
FROM FROM
nakadai.hr_user_account a nakadai.hr_user_account a
INNER JOIN nakadai.hr_user_info u ON u.user_id = a.user_id INNER JOIN nakadai.hr_user_info u ON u.user_id = a.user_id

@ -235,7 +235,7 @@ public class PlatformTeamAccountController {
return platformTeamAccountService.getUserAccountByPhone(appletCallbackReq); return platformTeamAccountService.getUserAccountByPhone(appletCallbackReq);
} }
@ApiOperation(value = "获取当前平台用户的团队信息", response = PartnerAccountResp.class) @ApiOperation(value = "获取当前平台用户的团队信息(接口弃用,组织信息从用户信息中获取)", response = PartnerAccountResp.class)
@GetMapping("/getTeamsByPlatformId") @GetMapping("/getTeamsByPlatformId")
public R getTeamsByPlatformId(@ApiParam(name = "platformId", value = "平台id") @RequestParam Integer platformId, HttpServletRequest request) { public R getTeamsByPlatformId(@ApiParam(name = "platformId", value = "平台id") @RequestParam Integer platformId, HttpServletRequest request) {
String accountId = platformTeamAccountService.getCurrentPlatformAccount(TokenUtils.getIdByJwtToken(request), platformId); String accountId = platformTeamAccountService.getCurrentPlatformAccount(TokenUtils.getIdByJwtToken(request), platformId);

@ -104,6 +104,8 @@
<if test="req.city!=null and req.city!='' "> <if test="req.city!=null and req.city!='' ">
and t.city=#{req.province,jdbcType=VARCHAR} and t.city=#{req.province,jdbcType=VARCHAR}
</if> </if>
GROUP BY id
ORDER BY t.submit_time DESC
</select> </select>
<select id="enterpriseCertificationDetails" resultType="com.huoran.common.entity.EnterpriseCertification"> <select id="enterpriseCertificationDetails" resultType="com.huoran.common.entity.EnterpriseCertification">
SELECT SELECT
@ -246,6 +248,8 @@
<if test="req.city!=null and req.city!='' "> <if test="req.city!=null and req.city!='' ">
and t.city=#{req.province,jdbcType=VARCHAR} and t.city=#{req.province,jdbcType=VARCHAR}
</if> </if>
GROUP BY id
ORDER BY t.submit_time DESC
</select> </select>

@ -110,6 +110,7 @@ public class PlatformTeamAccountServiceImpl extends ServiceImpl<PlatformTeamAcco
if (platformId == 7) { // 如果个人账号被禁用,抛出异常 if (platformId == 7) { // 如果个人账号被禁用,抛出异常
throw new CustomException(ExceptionEnum.ACCOUNT_DISABLED); throw new CustomException(ExceptionEnum.ACCOUNT_DISABLED);
} }
data.put("tips", "你已被组织禁止登录,现为您切回个人端");
continue; // 如果组织账号被禁用,跳过当前循环 continue; // 如果组织账号被禁用,跳过当前循环
} }
if (platformId == 7) { // 如果是个人账号,保存信息并跳过当前循环 if (platformId == 7) { // 如果是个人账号,保存信息并跳过当前循环
@ -229,7 +230,7 @@ public class PlatformTeamAccountServiceImpl extends ServiceImpl<PlatformTeamAcco
} }
break; break;
case 7: case 7:
userName = "个人" + randomNumber7; userName = "用户" + randomNumber7;
break; break;
} }
if (appletCallbackReq.getName()!=null){ if (appletCallbackReq.getName()!=null){
@ -247,7 +248,7 @@ public class PlatformTeamAccountServiceImpl extends ServiceImpl<PlatformTeamAcco
if (appletCallbackReq.getPlatformId() != 7) { if (appletCallbackReq.getPlatformId() != 7) {
//添加个人端信息,判断是否重复,为空添加 //添加个人端信息,判断是否重复,为空添加
if (account == null){ if (account == null){
String personalUserName = "个人" + randomNumber7; String personalUserName = "用户" + randomNumber7;
addUserInfo(personalUserName, 7, appletCallbackReq.getOpenId(), appletCallbackReq.getPhone()); addUserInfo(personalUserName, 7, appletCallbackReq.getOpenId(), appletCallbackReq.getPhone());
} }

@ -97,6 +97,20 @@ public class HrUserAccountController {
return iHrUserAccountService.delUserAccounts(ids); return iHrUserAccountService.delUserAccounts(ids);
} }
@PostMapping("/deletePrompt")
@ApiOperation(value = "批量删除用户,为企业负责人,则提示:该用户为组织负责人,删除后会同步删除该组织,确定删除?")
public R deletePrompt(@RequestBody List<String> ids) {
String tips = null;
for (String id : ids) {
int team = iHrUserAccountService.selectTeam(id);
if (team > 0){
tips = "该用户为组织负责人,删除后会同步删除该组织,确定删除?";
}
}
return R.ok().put("tips",tips);
}
/** /**
* 查看用户系统绑定详情 * 查看用户系统绑定详情
*/ */

@ -24,6 +24,12 @@ public class OrganizationInfo {
@ApiModelProperty("团队id") @ApiModelProperty("团队id")
private Integer teamId; private Integer teamId;
@ApiModelProperty("是否团队负责人")
private Integer isTeam;
@ApiModelProperty("团队父id")
private Integer parentId;
@ApiModelProperty("团队启用禁用") @ApiModelProperty("团队启用禁用")
private Integer isEnable; private Integer isEnable;

@ -63,4 +63,6 @@ public interface HrUserAccountMapper extends BaseMapper<HrUserAccount> {
boolean save(Student student); boolean save(Student student);
List<OrganizationInfo> selectOrganizationInfo(@Param("openId")String openId); List<OrganizationInfo> selectOrganizationInfo(@Param("openId")String openId);
int selectTeamByOpenId(String id);
} }

@ -1100,30 +1100,74 @@
<select id="selectOrganizationInfo" resultType="com.huoran.users.entity.res.OrganizationInfo"> <select id="selectOrganizationInfo" resultType="com.huoran.users.entity.res.OrganizationInfo">
SELECT SELECT
CASE CASE
WHEN WHEN he_parent.audit_status = 2 THEN
ec.audit_status = 2 THEN ec.company_name
ec.company_name ELSE tc.classification_name ELSE
CASE
WHEN tc.is_team = 0 THEN
tc_parent.classification_name
ELSE
tc.classification_name
END
END AS organizationName, END AS organizationName,
ec.platform_source AS platform_id, ec.platform_source AS platform_id,
ec.credit_code,
CASE
WHEN tc.is_team = 0 THEN
he_parent.credit_code
ELSE
ec.credit_code
END as credit_code,
CASE CASE
WHEN ec.audit_status = 2 THEN WHEN tc.is_team = 0 THEN
'已认证' ELSE '未认证或审核中' CASE
END AS authentication, WHEN he_parent.audit_status = 2 THEN
'已认证' ELSE '未认证或审核中'
END
ELSE
CASE
WHEN ec.audit_status = 2 THEN
'已认证' ELSE '未认证或审核中'
END
END
AS authentication,
pt.classification_id AS teamId, pt.classification_id AS teamId,
ta.account_id, ta.account_id,
tc.is_enable, tc.is_enable,
ec.audit_status, CASE
ta.manage_id WHEN tc.is_team = 0 THEN
he_parent.audit_status
ELSE
ec.audit_status
END as audit_status,
ta.manage_id ,tc.is_team,tc.parent_id
FROM FROM
hr_user_account hu hr_user_account hu
left JOIN hr_enterprise_certification ec ON hu.app_open_id = ec.open_id LEFT JOIN hr_enterprise_certification ec ON hu.app_open_id = ec.open_id
AND ec.platform_source = hu.platform_id AND ec.platform_source = hu.platform_id
INNER JOIN k_platform_team_account ta ON ta.account_id = hu.id INNER JOIN k_platform_team_account ta ON ta.account_id = hu.id
INNER JOIN k_platform_team pt ON ta.manage_id = pt.manage_id INNER JOIN k_platform_team pt ON ta.manage_id = pt.manage_id
INNER JOIN k_platform_team_classification tc ON tc.id = pt.classification_id and tc.is_del = 0 INNER JOIN k_platform_team_classification tc ON tc.id = pt.classification_id
AND tc.is_del = 0
LEFT JOIN k_platform_team_classification tc_parent ON tc.parent_id = tc_parent.id
LEFT JOIN hr_enterprise_certification he_parent ON hu.app_open_id = he_parent.open_id AND tc_parent.id = pt.classification_id
WHERE
hu.app_open_id = #{openId}
AND hu.is_del = 0
</select>
<select id="selectTeamByOpenId" resultType="java.lang.Integer">
SELECT
SUM(is_team) team
FROM
hr_user_account a
join k_platform_team_account ta on a.id = ta.account_id
join k_platform_team pt on pt.manage_id = ta.manage_id
join k_platform_team_classification tc on tc.id = pt.classification_id
WHERE WHERE
hu.app_open_id = #{openId} and hu.is_del = 0 a.app_open_id = #{id}
AND a.is_del = 0
AND a.platform_id !=7
</select> </select>
<update id="unbindMobilePhone" parameterType="java.lang.Integer"> <update id="unbindMobilePhone" parameterType="java.lang.Integer">

@ -88,4 +88,6 @@ public interface IHrUserAccountService extends IService<HrUserAccount> {
UserInfoDetailsRes viewUserDetails(String openId); UserInfoDetailsRes viewUserDetails(String openId);
R updateAvatars(String openId, String url, String userName,String platformId); R updateAvatars(String openId, String url, String userName,String platformId);
int selectTeam(String id);
} }

@ -416,7 +416,7 @@ public class HrUserAccountServiceImpl extends ServiceImpl<HrUserAccountMapper, H
//查询账号详情List //查询账号详情List
List<HrUserAccount> userAccountList = hrUserAccountMapper.selectList(new QueryWrapper<HrUserAccount>() List<HrUserAccount> userAccountList = hrUserAccountMapper.selectList(new QueryWrapper<HrUserAccount>()
.eq("app_open_id", openId)); .eq("app_open_id", openId).orderByDesc("platform_id"));
if (userAccountList.size() == 0){ if (userAccountList.size() == 0){
res.setStatus(true); res.setStatus(true);
res.setMessage("用户不存在,请先重新登录注册!"); res.setMessage("用户不存在,请先重新登录注册!");
@ -426,15 +426,10 @@ public class HrUserAccountServiceImpl extends ServiceImpl<HrUserAccountMapper, H
//查询个人端用户信息 //查询个人端用户信息
Integer userId = null; Integer userId = null;
String phone = null; String phone = null;
String platformId = null;
Integer accountId = null;
for (HrUserAccount hrUserAccount : userAccountList) { for (HrUserAccount hrUserAccount : userAccountList) {
if (hrUserAccount.getPlatformId().equals("7")){ if (hrUserAccount.getPlatformId().equals("7")){
userId = hrUserAccount.getUserId(); userId = hrUserAccount.getUserId();
phone = hrUserAccount.getPhone(); phone = hrUserAccount.getPhone();
}else {
platformId= hrUserAccount.getPlatformId();
accountId=hrUserAccount.getId();
} }
} }
HrUserInfo hrUserInfo = hrUserInfoMapper.selectByUserId(userId); HrUserInfo hrUserInfo = hrUserInfoMapper.selectByUserId(userId);
@ -477,6 +472,11 @@ public class HrUserAccountServiceImpl extends ServiceImpl<HrUserAccountMapper, H
return update>0 ? R.ok():R.error(); return update>0 ? R.ok():R.error();
} }
@Override
public int selectTeam(String id) {
return baseMapper.selectTeamByOpenId(id);
}
@Override @Override
public R oneClickEnableVerification(Integer accountId) { public R oneClickEnableVerification(Integer accountId) {

Loading…
Cancel
Save