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>
<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

@ -101,4 +101,6 @@ jwt.ignoreUrlList=/users/users/user/captcha,\
/nakadai/tags/tagsList,\ /nakadai/tags/tagsList,\
/nakadai/nakadai/partner/schemeManagement/schemeList,\ /nakadai/nakadai/partner/schemeManagement/schemeList,\
/nakadai/kindergarten/platformTeamAccount/weChatAppletCallbackByKindergarten,\ /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); 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") @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);

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

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

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

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

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

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

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

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

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

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

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

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