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

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. 64
      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 id="obtainRole" resultType="java.lang.String">
SELECT
a.platform_id
DISTINCT(a.platform_id)
FROM
nakadai.hr_user_account a
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);
}
@ApiOperation(value = "获取当前平台用户的团队信息", response = PartnerAccountResp.class)
@ApiOperation(value = "获取当前平台用户的团队信息(接口弃用,组织信息从用户信息中获取)", response = PartnerAccountResp.class)
@GetMapping("/getTeamsByPlatformId")
public R getTeamsByPlatformId(@ApiParam(name = "platformId", value = "平台id") @RequestParam Integer platformId, HttpServletRequest request) {
String accountId = platformTeamAccountService.getCurrentPlatformAccount(TokenUtils.getIdByJwtToken(request), platformId);

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

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

@ -97,6 +97,20 @@ public class HrUserAccountController {
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")
private Integer teamId;
@ApiModelProperty("是否团队负责人")
private Integer isTeam;
@ApiModelProperty("团队父id")
private Integer parentId;
@ApiModelProperty("团队启用禁用")
private Integer isEnable;

@ -63,4 +63,6 @@ public interface HrUserAccountMapper extends BaseMapper<HrUserAccount> {
boolean save(Student student);
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
CASE
WHEN
ec.audit_status = 2 THEN
ec.company_name ELSE tc.classification_name
WHEN he_parent.audit_status = 2 THEN
ec.company_name
ELSE
CASE
WHEN tc.is_team = 0 THEN
tc_parent.classification_name
ELSE
tc.classification_name
END
END AS organizationName,
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
WHEN tc.is_team = 0 THEN
CASE
WHEN he_parent.audit_status = 2 THEN
'已认证' ELSE '未认证或审核中'
END
ELSE
CASE
WHEN ec.audit_status = 2 THEN
'已认证' ELSE '未认证或审核中'
END AS authentication,
END
END
AS authentication,
pt.classification_id AS teamId,
ta.account_id,
tc.is_enable,
ec.audit_status,
ta.manage_id
CASE
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
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
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_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
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>
<update id="unbindMobilePhone" parameterType="java.lang.Integer">

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

Loading…
Cancel
Save