Merge remote-tracking branch 'origin/main' into main

main
rong.liu 10 months ago
commit fd9a4b870c
  1. 2
      competition/src/main/java/com/huoran/competition/mapper/xml/CompetitionMapper.xml
  2. 4
      gateway/src/main/resources/jwt.properties
  3. 8
      nakadai/src/main/java/com/huoran/nakadai/controller/PlatformTeamAccountController.java
  4. 51
      nakadai/src/main/java/com/huoran/nakadai/controller/ProductController.java
  5. 2
      nakadai/src/main/java/com/huoran/nakadai/entity/ExplosiveRecommendation.java
  6. 7
      nakadai/src/main/java/com/huoran/nakadai/entity/param/ProductParam.java
  7. 3
      nakadai/src/main/java/com/huoran/nakadai/entity/req/AppletCallbackReq.java
  8. 3
      nakadai/src/main/java/com/huoran/nakadai/entity/req/InviteJoinInfo.java
  9. 6
      nakadai/src/main/java/com/huoran/nakadai/mapper/xml/EnterpriseCertificationMapper.xml
  10. 8
      nakadai/src/main/java/com/huoran/nakadai/mapper/xml/HrStaffMapper.xml
  11. 2
      nakadai/src/main/java/com/huoran/nakadai/mapper/xml/OrderMapper.xml
  12. 2
      nakadai/src/main/java/com/huoran/nakadai/mapper/xml/PlatformTeamAccountMapper.xml
  13. 2
      nakadai/src/main/java/com/huoran/nakadai/service/PlatformTeamAccountService.java
  14. 107
      nakadai/src/main/java/com/huoran/nakadai/service/impl/PlatformTeamAccountServiceImpl.java
  15. 14
      users/src/main/java/com/huoran/users/controller/HrUserAccountController.java
  16. 6
      users/src/main/java/com/huoran/users/entity/res/OrganizationInfo.java
  17. 2
      users/src/main/java/com/huoran/users/mapper/HrUserAccountMapper.java
  18. 72
      users/src/main/java/com/huoran/users/mapper/xml/HrUserAccountMapper.xml
  19. 2
      users/src/main/java/com/huoran/users/service/IHrUserAccountService.java
  20. 7
      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

@ -101,4 +101,6 @@ jwt.ignoreUrlList=/users/users/user/captcha,\
/nakadai/tags/tagsList,\
/nakadai/nakadai/partner/schemeManagement/schemeList,\
/nakadai/kindergarten/platformTeamAccount/weChatAppletCallbackByKindergarten,\
/nakadai/kindergarten/platformTeamAccount/kindergartenWeChatApplication
/nakadai/kindergarten/platformTeamAccount/kindergartenWeChatApplication,\
/nakadai/kindergarten/platformTeamAccount/loginWithPhoneNumber,\
/nakadai/kindergarten/platformTeamAccount/inviteJoinOrganization

@ -229,7 +229,13 @@ public class PlatformTeamAccountController {
return platformTeamAccountService.kindergartenWeChatApplication(appletCallbackReq);
}
@ApiOperation(value = "获取当前平台用户的团队信息", response = PartnerAccountResp.class)
@ApiOperation(value = "幼教产品微信小程序查询手机号登录")
@PostMapping("/loginWithPhoneNumber")
public R loginWithPhoneNumber(@RequestBody @Valid AppletCallbackReq appletCallbackReq) {
return platformTeamAccountService.getUserAccountByPhone(appletCallbackReq);
}
@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);

@ -45,6 +45,7 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
@Api(tags = "商品列表、商品发布管理")
@ -110,9 +111,9 @@ public class ProductController {
@ApiOperation(value = "获取商品信息", response = Product.class)
public ServerResponseEntity<Product> info(@RequestParam("prodId") Integer prodId, HttpServletRequest request) {
Product prod = productService.getProductByProdId(prodId);
if (!Objects.equals(prod.getShopId(), TokenUtils.getShopIdByJwtToken(request))) {
throw new YamiShopBindException("没有权限获取该商品规格信息");
}
// if (!Objects.equals(prod.getShopId(), TokenUtils.getShopIdByJwtToken(request))) {
// throw new YamiShopBindException("没有权限获取该商品规格信息");
// }
List<Sku> skuList = skuService.listByProdId(prodId);
prod.setSkuList(skuList);
@ -125,13 +126,13 @@ public class ProductController {
@PostMapping("/save")
@ApiOperation(value = "保存商品信息")
public ServerResponseEntity<String> save(@Valid @RequestBody ProductParam productParam,HttpServletRequest request) {
// productParam.setShopId(TokenUtils.getShopIdByJwtToken(request));
checkParam(productParam);
Product product = BeanUtil.copyProperties(productParam, Product.class);
// product.setDeliveryMode(Json.toJsonString(productParam.getDeliveryModeVo()));
product.setShopId(TokenUtils.getShopIdByJwtToken(request));
// product.setDeliveryMode(Json.toJsonString(productParam.getDeliveryModeVo()));
product.setUpdateTime(new Date());
if (product.getStatus() == 0) {
if (product.getStatus() == 1) {
product.setPutawayTime(new Date());
}
product.setCreateTime(new Date());
@ -143,6 +144,7 @@ public class ProductController {
@PostMapping("/update")
@ApiOperation(value = "修改商品信息")
public ServerResponseEntity<String> update(@Valid @RequestBody ProductParam productParam,HttpServletRequest request) {
// productParam.setShopId(TokenUtils.getShopIdByJwtToken(request));
checkParam(productParam);
Product dbProduct = productService.getProductByProdId(productParam.getProdId());
if (!Objects.equals(dbProduct.getShopId(), TokenUtils.getShopIdByJwtToken(request))) {
@ -178,9 +180,9 @@ public class ProductController {
*/
public ServerResponseEntity<Void> delete(Integer prodId,HttpServletRequest request) {
Product dbProduct = productService.getProductByProdId(prodId);
if (!Objects.equals(dbProduct.getShopId(), TokenUtils.getShopIdByJwtToken(request))) {
throw new YamiShopBindException("无法获取非本店铺商品信息");
}
// if (!Objects.equals(dbProduct.getShopId(), TokenUtils.getShopIdByJwtToken(request))) {
// throw new YamiShopBindException("无法获取非本店铺商品信息");
// }
List<Sku> dbSkus = skuService.listByProdId(dbProduct.getProdId());
// 删除商品
productService.removeProductByProdId(prodId);
@ -233,6 +235,15 @@ public class ProductController {
}
private void checkParam(ProductParam productParam) {
QueryWrapper<Product> productQueryWrapper = new QueryWrapper<>();
productQueryWrapper.eq("prod_name",productParam.getProdName());
if (productParam.getProdId()!= null){
productQueryWrapper.notIn("prod_id",productParam.getProdId());
}
Product one = productService.getOne(productQueryWrapper);
if (one != null){
throw new YamiShopBindException("商品名称已存在");
}
// if (CollectionUtil.isEmpty(productParam.getTagList())) {
// throw new YamiShopBindException("请选择产品分组");
// }
@ -244,14 +255,20 @@ public class ProductController {
// throw new YamiShopBindException("请选择配送方式");
// }
List<Sku> skuList = productParam.getSkuList();
boolean isAllUnUse = true;
for (Sku sku : skuList) {
if (sku.getStatus() == 1) {
isAllUnUse = false;
}
}
if (isAllUnUse) {
throw new YamiShopBindException("至少要启用一种商品规格");
List<String> stringList = skuList.stream().map(Sku::getSkuName)
.collect(Collectors.toList());
long count = stringList.stream().distinct().count();
if (stringList.size() != count) {
throw new YamiShopBindException("商品规格名称重复");
}
// boolean isAllUnUse = true;
// for (Sku sku : skuList) {
// if (sku.getStatus() == 1) {
// isAllUnUse = false;
// }
// }
// if (isAllUnUse) {
// throw new YamiShopBindException("至少要启用一种商品规格");
// }
}
}

@ -66,7 +66,7 @@ public class ExplosiveRecommendation implements Serializable {
private String selectLinkId;
@ApiModelProperty(value = "对应链接id的主键(如:选择活动则保存的活动id)")
private Integer correspondingLinkId;
private String correspondingLinkId;
@ApiModelProperty(value = "跳转链接")
private String jumpLink;

@ -76,7 +76,7 @@ public class ProductParam {
@ApiModelProperty(value = "简要描述,卖点等")
private String brief;
@NotBlank(message = "请选择图片上传")
// @NotBlank(message = "请选择图片上传")
@ApiModelProperty(value = "商品主图")
private String pic;
@ -90,7 +90,7 @@ public class ProductParam {
/**
* 商品分类
*/
@NotNull(message = "请选择商品分类")
// @NotNull(message = "请选择商品分类")
@ApiModelProperty(value = "商品分类")
private Long categoryId;
@ -106,6 +106,9 @@ public class ProductParam {
@ApiModelProperty(value = "商品详情")
private String content;
@ApiModelProperty(value = "店铺id")
private Integer shopId;
/**
* 是否能够用户自提
*/

@ -20,6 +20,9 @@ public class AppletCallbackReq {
@ApiModelProperty("平台标识:5幼儿园,6供应商,7个人端")
private Integer platformId;
@ApiModelProperty(value = "姓名")
private String name;
@ApiModelProperty("唯一标识")
private String openId;

@ -11,6 +11,9 @@ public class InviteJoinInfo {
@ApiModelProperty(value = "手机验证码")
private String code;
@ApiModelProperty(value = "姓名")
private String name;
@ApiModelProperty(value = "电话")
private String phone;

@ -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
@ -135,7 +137,7 @@
AND u.is_del = 0
) t
WHERE
t.id = #{id}
t.id = #{id} GROUP BY id
</select>
<select id="queryAccountInformation" resultType="com.huoran.common.entity.UserAccount">
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>

@ -6,17 +6,17 @@
<insert id="addUserInfo" parameterType="com.huoran.nakadai.entity.UserInfo" useGeneratedKeys="true"
keyProperty="userId">
INSERT INTO nakadai.hr_user_info (user_name, unique_identification, email,role_id,school_id,create_time,
update_time,user_avatars)
VALUES (#{userName}, #{uniqueIdentification}, #{email},0,0,now(), now(),#{userAvatars})
update_time,user_avatars,last_login_time,login_number)
VALUES (#{userName}, #{uniqueIdentification}, #{email},0,0,now(), now(),#{userAvatars},now(),#{loginNumber})
</insert>
<!--新增账号信息-->
<insert id="addUserAccount" parameterType="com.huoran.common.entity.UserAccount" useGeneratedKeys="true"
keyProperty="id">
INSERT INTO nakadai.hr_user_account(user_id, account,phone , password, work_number, school_id, platform_id,
type, create_time, update_time,app_open_id)
type, create_time, update_time,app_open_id,platform_bind_time,phone_binding_time)
VALUES (#{userId}, #{account},#{phone}, #{password}, #{workNumber}, 0, #{platformId}, #{type},
now(), now(),#{appOpenId})
now(), now(),#{appOpenId},now(),now())
</insert>
<update id="modifyUserInfo" parameterType="com.huoran.nakadai.entity.UserInfo">

@ -410,7 +410,7 @@
WHEN o.order_type = 2 THEN
IFNULL( ec.company_name, ua.account )
WHEN o.order_type = 1 THEN
IFNULL( uai.real_name, ua.account )
IFNULL( uai.real_name, avatars.account )
END) LIKE CONCAT('%', #{orderParam.queryCriteria} ,'%'))
</if>
<if test="orderParam.orderType != null">

@ -146,7 +146,7 @@
hpa.account_id,
a.account,
pc.classification_name as teamName,
pc.id as partnerClassificationId,
pc.id as classificationId,
pc.is_team,
pc.parent_id,
pc.create_time as joinTime,

@ -26,6 +26,8 @@ public interface PlatformTeamAccountService extends IService<PlatformTeamAccount
R kindergartenWeChatApplication(AppletCallbackReq appletCallbackReq);
R getUserAccountByPhone(AppletCallbackReq appletCallbackReq);
R getTeamsByPlatformId(String accountId, Integer platformId);
R pagePlatformTeamAccountList(PlatformTeamAccountListReq req);

@ -1,6 +1,7 @@
package com.huoran.nakadai.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
@ -109,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) { // 如果是个人账号,保存信息并跳过当前循环
@ -161,35 +163,50 @@ public class PlatformTeamAccountServiceImpl extends ServiceImpl<PlatformTeamAcco
}
@Override
public R kindergartenWeChatApplication(AppletCallbackReq appletCallbackReq) {
public R getUserAccountByPhone(AppletCallbackReq appletCallbackReq) {
Map<String, Object> data = new HashedMap<String, Object>();
UserAccount userAccount = baseMapper.selectAccountByOpenId(appletCallbackReq.getOpenId(), appletCallbackReq.getPlatformId());
//该平台已经注册
if (userAccount != null){
data.put("registerId", userAccount.getId());
data.put("openId", appletCallbackReq.getOpenId());
return R.ok().put("data",data);
}
if (appletCallbackReq.getPhone()!= null){
UserAccount userAccountByPhone = baseMapper.selectAccount(appletCallbackReq.getPhone(),appletCallbackReq.getPlatformId().toString());
ArrayList<String> arrayList = new ArrayList<>();
arrayList.add("5");
arrayList.add("6");
for (String platformId : arrayList) {
UserAccount userAccountByPhone = baseMapper.selectAccount(appletCallbackReq.getPhone(), platformId);
//根据手机号查询用户
if (userAccountByPhone != null){
if (!userAccountByPhone.getIsEnable()){
throw new CustomException(ExceptionEnum.ACCOUNT_DISABLED);
}
if (userAccountByPhone.getAppOpenId().equals("0")){
data.put("platformId", platformId);
//邀请添加用户没有openid,登录更新openId
baseMapper.updateAccountOpenId(appletCallbackReq.getOpenId(),userAccountByPhone.getId());
//查询个人端账号更新openid
UserAccount userAccount = baseMapper.selectAccount(appletCallbackReq.getPhone(), "7");
baseMapper.updateAccountOpenId(appletCallbackReq.getOpenId(),userAccount.getId());
//更新登录时间
baseMapper.updateUserInfo(userAccountByPhone.getUserId());
data.put("token", JwtUtils.getJwtToken(userAccountByPhone.getId().toString(),getShopId(appletCallbackReq.getOpenId(),appletCallbackReq.getPlatformId()),appletCallbackReq.getPlatformId()));
}
data.put("token", JwtUtils.getJwtToken(userAccountByPhone.getId().toString(),getShopId(appletCallbackReq.getOpenId(),Integer.valueOf(platformId)),Integer.valueOf(platformId)));
data.put("openId", appletCallbackReq.getOpenId());
//TODO 团队信息待处理
// data.put("teamId",platformTeamClassification.getId());
// data.put("teamName",teamName);
return R.ok().put("data",data);
}
}
return R.ok();
}
@Override
public R kindergartenWeChatApplication(AppletCallbackReq appletCallbackReq) {
Map<String, Object> data = new HashedMap<String, Object>();
UserAccount userAccount = baseMapper.selectAccountByOpenId(appletCallbackReq.getOpenId(), appletCallbackReq.getPlatformId());
//该平台已经注册
if (userAccount != null){
data.put("registerId", userAccount.getId());
data.put("openId", appletCallbackReq.getOpenId());
return R.ok().put("data",data);
}
String randomNumber5 = cn.hutool.core.util.RandomUtil.randomNumbers(5);
String randomNumber6 = cn.hutool.core.util.RandomUtil.randomNumbers(6);
String randomNumber7 = cn.hutool.core.util.RandomUtil.randomNumbers(7);
@ -213,9 +230,12 @@ public class PlatformTeamAccountServiceImpl extends ServiceImpl<PlatformTeamAcco
}
break;
case 7:
userName = "个人" + randomNumber7;
userName = "用户" + randomNumber7;
break;
}
if (appletCallbackReq.getName()!=null){
userName = appletCallbackReq.getName();
}
//企业认证获取个人平台手机号进行绑定
UserAccount account = baseMapper.selectAccountByOpenId(appletCallbackReq.getOpenId(), 7);
if (account != null) {
@ -228,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());
}
@ -290,7 +310,6 @@ public class PlatformTeamAccountServiceImpl extends ServiceImpl<PlatformTeamAcco
UserInfo userInfo = new UserInfo();
userInfo.setUserName(userName);
userInfo.setLoginNumber(1);
userInfo.setLastLoginTime(new Date());
staffMapper.addUserInfo(userInfo);
// 创建并设置用户账户
@ -373,7 +392,7 @@ public class PlatformTeamAccountServiceImpl extends ServiceImpl<PlatformTeamAcco
//查询邀请用户是否存在账号
UserAccount userAccount = baseMapper.selectAccount(inviteJoinInfo.getPhone(),inviteJoinInfo.getPlatformId().toString());
Integer manageId ;
Integer manageId = 0;
//邀请人为成员且账号存在,则直接拉入该团队,不可重复拉入
if (userAccount != null) {
//无法加入自己的团队
@ -384,14 +403,14 @@ public class PlatformTeamAccountServiceImpl extends ServiceImpl<PlatformTeamAcco
//查询合伙人账号
PlatformTeamAccount platformTeamAccount = baseMapper.selectOne(new QueryWrapper<PlatformTeamAccount>().
eq("account_id", userAccount.getId()));
manageId = platformTeamAccount.getManageId();
//被邀请人有合伙人账号,判断是否已经存在当前团队中
//被邀请人有团队账号,判断是否已经存在当前团队中
if (ObjectUtil.isNotNull(platformTeamAccount)){
manageId = platformTeamAccount.getManageId();
List<PlatformTeam> platformTeamList = platformTeamMapper.selectList(new QueryWrapper<PlatformTeam>().
eq("manage_id", platformTeamAccount.getManageId()));
//查询团队下的成员是否存在团队中
List<PlatformTeamClassification> teamMeb = platformTeamClassificationMapper.selectList(new QueryWrapper<PlatformTeamClassification>().
eq("parent_id", inviteJoinInfo.getClassificationId()));
@ -405,6 +424,51 @@ public class PlatformTeamAccountServiceImpl extends ServiceImpl<PlatformTeamAcco
}
}
}
//不存在加入当前组织
PlatformTeamClassification platformTeamAdmin = platformTeamClassificationMapper.selectById(inviteJoinInfo.getClassificationId());
//新增团队成员
PlatformTeamClassification platformTeamMeb = new PlatformTeamClassification();
platformTeamMeb.setIsTeam(0);
platformTeamMeb.setParentId(inviteJoinInfo.getClassificationId());
platformTeamMeb.setLevel(platformTeamAdmin.getLevel() + 1);
platformTeamMeb.setClassificationName(platformTeamAdmin.getClassificationName());
int insert = platformTeamClassificationMapper.insert(platformTeamMeb);
//团队分类
if (insert > 0) {
PlatformTeam platformTeam = new PlatformTeam();
platformTeam.setManageId(platformTeamAccount.getManageId());
platformTeam.setClassificationId(platformTeamMeb.getId());
platformTeamMapper.insert(platformTeam);
}
return insert > 0 ? R.ok() : R.error();
//拉入当前团队
}else {
//添加团队管理账号
PlatformTeamAccount platformTeamAccount1 = new PlatformTeamAccount();
platformTeamAccount1.setAccountId(userAccount.getId());
platformTeamAccount1.setPlatformId(inviteJoinInfo.getPlatformId());
String username = partnerAccountMapper.selectUsername(inviteJoinInfo.getAccountId());
platformTeamAccount1.setInvitationAccount(username);
baseMapper.insert(platformTeamAccount1);
PlatformTeamClassification platformTeamAdmin = platformTeamClassificationMapper.selectById(inviteJoinInfo.getClassificationId());
//新增团队成员
PlatformTeamClassification platformTeamMeb = new PlatformTeamClassification();
platformTeamMeb.setIsTeam(0);
platformTeamMeb.setParentId(inviteJoinInfo.getClassificationId());
platformTeamMeb.setLevel(platformTeamAdmin.getLevel() + 1);
platformTeamMeb.setClassificationName(platformTeamAdmin.getClassificationName());
int insert = platformTeamClassificationMapper.insert(platformTeamMeb);
//团队分类
if (insert > 0) {
PlatformTeam platformTeam = new PlatformTeam();
platformTeam.setManageId(platformTeamAccount1.getManageId());
platformTeam.setClassificationId(platformTeamMeb.getId());
platformTeamMapper.insert(platformTeam);
}
return insert > 0 ? R.ok() : R.error();
}
}else {
//不存在创建账号,拉入组织
@ -412,6 +476,7 @@ public class PlatformTeamAccountServiceImpl extends ServiceImpl<PlatformTeamAcco
appletCallbackReq.setPlatformId(inviteJoinInfo.getPlatformId());
appletCallbackReq.setPhone(inviteJoinInfo.getPhone());
appletCallbackReq.setOpenId("0");
appletCallbackReq.setName(inviteJoinInfo.getName());
R r = kindergartenWeChatApplication(appletCallbackReq);
Map<String, Object> data =(Map<String, Object>) r.get("data");
Integer registerId =(Integer) data.get("registerId");

@ -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);
}

@ -843,13 +843,13 @@
count(u.login_number) as login_number,
max(CASE WHEN a.platform_id = 7 THEN u.user_name ELSE NULL END) as user_name,
a.work_number,
GROUP_CONCAT(s.platform_name) as platformName,
GROUP_CONCAT( DISTINCT s.platform_name) as platformName,
CASE
WHEN count(ai.id) > 0 THEN '已认证'
ELSE '未认证'
END as authentication,
CASE
WHEN a.platform_id != 7 AND ta.invitation_account IS NULL THEN '自行注册'
WHEN ta.invitation_account IS NULL THEN '自行注册'
WHEN a.platform_id != 7 AND ta.invitation_account IS NOT NULL THEN ta.invitation_account
ELSE NULL
END as accountSource
@ -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_enterprise_certification ec
INNER JOIN hr_user_account hu ON hu.app_open_id = ec.open_id
AND ec.platform_source = hu.platform_id and hu.is_del = 0
hr_user_account hu
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
ec.open_id = #{openId}
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("用户不存在,请先重新登录注册!");
@ -472,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