From 71fec41e32d5de04a5f70e48ae6928c920ba3248 Mon Sep 17 00:00:00 2001 From: cheney <1251790704@qq.com> Date: Fri, 15 Dec 2023 19:11:44 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E8=AE=A4=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/huoran/common/entity/UserAccount.java | 2 + .../com/huoran/common/entity/UserInfo.java | 2 +- .../huoran/common}/utils/HttpClientUtils.java | 2 +- gateway/src/main/resources/jwt.properties | 4 +- .../huoran/nakadai/NakadaiApplication.java | 2 +- .../PlatformTeamAccountController.java | 213 +++++++++++++++++ .../PlatformTeamClassificationController.java | 23 ++ .../controller/PlatformTeamController.java | 23 ++ .../huoran/nakadai/entity/PlatformTeam.java | 41 ++++ .../nakadai/entity/PlatformTeamAccount.java | 47 ++++ .../entity/PlatformTeamClassification.java | 85 +++++++ .../huoran/nakadai/entity/UserAccount.java | 8 +- .../entity/req/AccountRegisterReq.java | 47 ++++ .../nakadai/entity/req/AppletCallbackReq.java | 28 +++ .../req/PlatformTeamAccountListReq.java | 39 +++ .../entity/res/PlatformTeamAccountResp.java | 97 ++++++++ .../nakadai/entity/res/TeamAccountResp.java | 98 ++++++++ .../huoran/nakadai/mapper/HrStaffMapper.java | 2 + .../mapper/PartnerClassificationMapper.java | 2 + .../nakadai/mapper/PartnerTeamMapper.java | 2 + .../mapper/PlatformTeamAccountMapper.java | 39 +++ .../PlatformTeamClassificationMapper.java | 20 ++ .../nakadai/mapper/PlatformTeamMapper.java | 18 ++ .../mapper/xml/PlatformTeamAccountMapper.xml | 136 +++++++++++ .../xml/PlatformTeamClassificationMapper.xml | 29 +++ .../nakadai/mapper/xml/PlatformTeamMapper.xml | 5 + .../service/PlatformTeamAccountService.java | 34 +++ .../PlatformTeamClassificationService.java | 16 ++ .../nakadai/service/PlatformTeamService.java | 16 ++ .../impl/PlatformTeamAccountServiceImpl.java | 223 ++++++++++++++++++ ...PlatformTeamClassificationServiceImpl.java | 20 ++ .../service/impl/PlatformTeamServiceImpl.java | 20 ++ .../nakadai/utils/WeChatPropertiesUtil.java | 18 ++ .../src/main/resources/bootstrap.properties | 26 +- .../huoran/nakadai/code/CodeGenerator.java | 8 +- .../users/config/WeChatPropertiesUtil.java | 16 ++ .../users/controller/UserLoginController.java | 22 ++ .../users/entity/req/AccountRegisterReq.java | 44 ++++ .../users/entity/req/AppletCallbackReq.java | 9 + .../com/huoran/users/entity/vo/LoginVo.java | 2 +- .../huoran/users/mapper/HrUserInfoMapper.java | 8 + .../com/huoran/users/mapper/RoleMapper.java | 2 + .../users/mapper/xml/HrUserInfoMapper.xml | 21 ++ .../users/service/IHrUserInfoService.java | 5 + .../service/impl/HrUserInfoServiceImpl.java | 98 +++++++- users/src/main/resources/bootstrap.properties | 7 +- 46 files changed, 1604 insertions(+), 25 deletions(-) rename {users/src/main/java/com/huoran/users => common/src/main/java/com/huoran/common}/utils/HttpClientUtils.java (98%) create mode 100644 nakadai/src/main/java/com/huoran/nakadai/controller/PlatformTeamAccountController.java create mode 100644 nakadai/src/main/java/com/huoran/nakadai/controller/PlatformTeamClassificationController.java create mode 100644 nakadai/src/main/java/com/huoran/nakadai/controller/PlatformTeamController.java create mode 100644 nakadai/src/main/java/com/huoran/nakadai/entity/PlatformTeam.java create mode 100644 nakadai/src/main/java/com/huoran/nakadai/entity/PlatformTeamAccount.java create mode 100644 nakadai/src/main/java/com/huoran/nakadai/entity/PlatformTeamClassification.java create mode 100644 nakadai/src/main/java/com/huoran/nakadai/entity/req/AccountRegisterReq.java create mode 100644 nakadai/src/main/java/com/huoran/nakadai/entity/req/AppletCallbackReq.java create mode 100644 nakadai/src/main/java/com/huoran/nakadai/entity/req/PlatformTeamAccountListReq.java create mode 100644 nakadai/src/main/java/com/huoran/nakadai/entity/res/PlatformTeamAccountResp.java create mode 100644 nakadai/src/main/java/com/huoran/nakadai/entity/res/TeamAccountResp.java create mode 100644 nakadai/src/main/java/com/huoran/nakadai/mapper/PlatformTeamAccountMapper.java create mode 100644 nakadai/src/main/java/com/huoran/nakadai/mapper/PlatformTeamClassificationMapper.java create mode 100644 nakadai/src/main/java/com/huoran/nakadai/mapper/PlatformTeamMapper.java create mode 100644 nakadai/src/main/java/com/huoran/nakadai/mapper/xml/PlatformTeamAccountMapper.xml create mode 100644 nakadai/src/main/java/com/huoran/nakadai/mapper/xml/PlatformTeamClassificationMapper.xml create mode 100644 nakadai/src/main/java/com/huoran/nakadai/mapper/xml/PlatformTeamMapper.xml create mode 100644 nakadai/src/main/java/com/huoran/nakadai/service/PlatformTeamAccountService.java create mode 100644 nakadai/src/main/java/com/huoran/nakadai/service/PlatformTeamClassificationService.java create mode 100644 nakadai/src/main/java/com/huoran/nakadai/service/PlatformTeamService.java create mode 100644 nakadai/src/main/java/com/huoran/nakadai/service/impl/PlatformTeamAccountServiceImpl.java create mode 100644 nakadai/src/main/java/com/huoran/nakadai/service/impl/PlatformTeamClassificationServiceImpl.java create mode 100644 nakadai/src/main/java/com/huoran/nakadai/service/impl/PlatformTeamServiceImpl.java create mode 100644 users/src/main/java/com/huoran/users/entity/req/AccountRegisterReq.java diff --git a/common/src/main/java/com/huoran/common/entity/UserAccount.java b/common/src/main/java/com/huoran/common/entity/UserAccount.java index 2fd415c..489bfe4 100644 --- a/common/src/main/java/com/huoran/common/entity/UserAccount.java +++ b/common/src/main/java/com/huoran/common/entity/UserAccount.java @@ -81,6 +81,8 @@ public class UserAccount implements Serializable { @TableField(exist = false) private String userName; + @ApiModelProperty(value = "小程序id") + private String appOpenId; @ApiModelProperty(value = "绑定时间") private String phoneBindingTime; diff --git a/common/src/main/java/com/huoran/common/entity/UserInfo.java b/common/src/main/java/com/huoran/common/entity/UserInfo.java index 1b14b1b..7f37218 100644 --- a/common/src/main/java/com/huoran/common/entity/UserInfo.java +++ b/common/src/main/java/com/huoran/common/entity/UserInfo.java @@ -76,7 +76,7 @@ public class UserInfo implements Serializable { private Integer isDel; @ApiModelProperty(value = "最后登陆时间") - private String lastLoginTime; + private Date lastLoginTime; @ApiModelProperty(value = "绑定多个角色id") private String roleId; diff --git a/users/src/main/java/com/huoran/users/utils/HttpClientUtils.java b/common/src/main/java/com/huoran/common/utils/HttpClientUtils.java similarity index 98% rename from users/src/main/java/com/huoran/users/utils/HttpClientUtils.java rename to common/src/main/java/com/huoran/common/utils/HttpClientUtils.java index 74892a9..edabca4 100644 --- a/users/src/main/java/com/huoran/users/utils/HttpClientUtils.java +++ b/common/src/main/java/com/huoran/common/utils/HttpClientUtils.java @@ -1,4 +1,4 @@ -package com.huoran.users.utils; +package com.huoran.common.utils; import org.apache.http.NameValuePair; import org.apache.http.client.config.RequestConfig; diff --git a/gateway/src/main/resources/jwt.properties b/gateway/src/main/resources/jwt.properties index 0743393..4540c90 100644 --- a/gateway/src/main/resources/jwt.properties +++ b/gateway/src/main/resources/jwt.properties @@ -99,4 +99,6 @@ jwt.ignoreUrlList=/users/users/user/captcha,\ /nakadai/nakadai/subject/subjectCategoryCited,\ /nakadai/productType/productTypeList,\ /nakadai/tags/tagsList,\ - /nakadai/nakadai/partner/schemeManagement/schemeList + /nakadai/nakadai/partner/schemeManagement/schemeList,\ + /nakadai/kindergarten/platformTeamAccount/weChatAppletCallbackByKindergarten,\ + /nakadai/kindergarten/platformTeamAccount/kindergartenWeChatApplication diff --git a/nakadai/src/main/java/com/huoran/nakadai/NakadaiApplication.java b/nakadai/src/main/java/com/huoran/nakadai/NakadaiApplication.java index b3be7f9..90d47c2 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/NakadaiApplication.java +++ b/nakadai/src/main/java/com/huoran/nakadai/NakadaiApplication.java @@ -17,7 +17,7 @@ import org.springframework.scheduling.annotation.EnableScheduling; //@EnableRabbit//开启rabbitmq @EnableFeignClients(basePackages = "com.huoran.api") @MapperScan(basePackages = "com.huoran.nakadai.mapper") -@ComponentScan(basePackages = {"com.huoran","com.huoran.nakadai.config.interceptor"}) +@ComponentScan(basePackages = {"com.huoran"}) public class NakadaiApplication { public static void main(String[] args) { diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/PlatformTeamAccountController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/PlatformTeamAccountController.java new file mode 100644 index 0000000..668b269 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/controller/PlatformTeamAccountController.java @@ -0,0 +1,213 @@ +package com.huoran.nakadai.controller; + + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.huoran.common.exception.CustomException; +import com.huoran.common.exception.ExceptionEnum; +import com.huoran.common.response.R; +import com.huoran.common.utils.TokenUtils; +import com.huoran.nakadai.entity.*; +import com.huoran.nakadai.entity.req.*; +import com.huoran.nakadai.entity.res.PartnerAccountResp; +import com.huoran.nakadai.entity.res.PlatformTeamAccountResp; +import com.huoran.nakadai.entity.vo.TeamMemberVo; +import com.huoran.nakadai.service.*; +import com.huoran.nakadai.utils.GenerateCodeUtil; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; +import java.util.Map; +import java.util.Objects; +import java.util.concurrent.TimeUnit; + +/** + *

+ * 幼教产业平台团队账号表 + *

+ * + * @author chen + * @since 2023-12-12 + */ +@Api(tags = "幼教产业平台幼儿园与供应商团队账号管理") +@RestController +@RequestMapping("/kindergarten/platformTeamAccount") +public class PlatformTeamAccountController { + + @Autowired + public PlatformTeamAccountService platformTeamAccountService; + + @Autowired + public PlatformTeamService platformTeamService; + + @Autowired + public PlatformTeamClassificationService platformTeamClassificationService; + + @Autowired + private RedisTemplate redisTemplate; + + + @PostMapping("/generateInvitationCode") + @ApiOperation(value = "生成不同平台专属邀请码") + public R generateInvitationCode( + @ApiParam(name = "platformId", value = "平台id", required = true) + @RequestParam("platformId") String platformId,HttpServletRequest request) { + //平台唯一标识码 + String uniqueIdentification = platformId+TokenUtils.getIdByJwtToken(request)+"kindergartenInvitationCode"; + //存在直接返回邀请码 + String code = redisTemplate.opsForValue().get(uniqueIdentification); + if (StringUtils.isEmpty(code)){ + code = GenerateCodeUtil.generateCode(); + redisTemplate.opsForValue().set(uniqueIdentification,code,7, TimeUnit.DAYS); + } + //过期时间 + Long expireTime = redisTemplate.opsForValue().getOperations().getExpire(uniqueIdentification); + return Objects.requireNonNull(R.ok().put("invitationCode", code)).put("expireTime",expireTime); + } + + @ApiOperation(value = "平台邀请二维码生成") + @GetMapping(value = "/generationQrCode",produces = "image/png") + public void generationQrCode( + @ApiParam(name = "url", value = "链接", required = true) + @RequestParam String url, HttpServletResponse response){ + platformTeamAccountService.generationQrCode(url,response); + } + + + +// @PostMapping("/platformTeamAccountMergeList") +// @ApiOperation(value = "平台团队账号列表--合并数据查询(以账号为维度查询合并-后台调用)", response = PlatformTeamAccountResp.class) +// public R partnerAccountMergeList(@RequestBody @Valid PlatformTeamAccountListReq req) { +// return platformTeamAccountService.platformTeamAccountMergeList(req); +// } + +// @PostMapping("/teamPartnerList") +// @ApiOperation(value = "团队合伙人列表(以团队维度查询-小程序调用)", response = PlatformTeamAccountResp.class) +// public R teamPartnerList(@RequestBody @Valid PlatformTeamAccountListReq req) { +// return platformTeamAccountService.teamPartnerList(req); +// } + +// @PostMapping("/queryTeamMembers") +// @ApiOperation(value = "查询团队成员", response = PlatformTeamAccountResp.class) +// public R queryTeamMembers(@RequestBody TeamMemberVo teamMemberVo) { +// return platformTeamAccountService.queryTeamMembers(teamMemberVo); +// } + + +// @GetMapping("/partnerAccountDetail") +// // @ApiOperation(value = "合伙人账号详情", response = PlatformTeamAccountResp.class) +// public R partnerAccountDetail(@ApiParam(name = "accountId", value = "合伙人账号账号id") +// @RequestParam Integer accountId) { +// return platformTeamAccountService.partnerAccountDetail(accountId); +// } + + +// @PostMapping("/modifyPartnerAccount") +// // @ApiOperation(value = "编辑合伙人账号") +// public R modifyPartnerAccount(@RequestBody @Valid PartnerAccountUpdateReq updateReq) { +// return platformTeamAccountService.modifyPartnerAccount(updateReq); +// } + + +// @PostMapping("/generateTransferCode") +// @ApiOperation(value = "生成转让邀请码") +// public R generateTransferCode(@RequestParam("accountId") String accountId) { +// //存在直接返回邀请码 +// String code = redisTemplate.opsForValue().get(accountId+"transferCode"); +// if (StringUtils.isEmpty(code)){ +// code = GenerateCodeUtil.generateCode(); +// redisTemplate.opsForValue().set(accountId+"transferCode",code,1, TimeUnit.DAYS); +// } +// //过期时间 +// Long expireTime = redisTemplate.opsForValue().getOperations().getExpire(accountId+"transferCode"); +// return R.ok().put("transferCode",code).put("expireTime",expireTime); +// } + +// @PostMapping("/transferAdmin") +// @ApiOperation(value = "新增转让超管") +// public R transferAdmin(@RequestBody @Valid TransferAdminReq transferAdminReq) { +// return platformTeamAccountService.transferAdmin(transferAdminReq); +// } + +// @PostMapping("/transferTeam") +// @ApiOperation(value = "团队内转让超管") +// public R transferTeam(@RequestBody @Valid TransferTeamReq transferTeamReq) { +// return platformTeamAccountService.transferTeam(transferTeamReq); +// } + + +// @PostMapping("/delPartnerAccount") +// @ApiOperation(value = "删除合伙人") +// public R delPartnerAccount( +// @ApiParam(name = "accountId", value = "账号id") +// @RequestParam Integer accountId) { +// return platformTeamAccountService.delPartnerAccount(accountId); +// } + + +// @GetMapping("/partnerRemoval") +// @ApiOperation(value = "移除团队") +// public R partnerRemoval( +// @ApiParam(name = "teamId", value = "团队id") +// @RequestParam String teamId, +// @ApiParam(name = "partnerId", value = "合伙人id") +// @RequestParam String partnerId) { +// PartnerClassification partnerClassification = partnerClassificationService.getById(teamId); +// if (partnerClassification.getIsTeam() == 1) { +// throw new CustomException(ExceptionEnum.PARTNER_REMOVAL); +// } +// PartnerAccount partnerAccount = platformTeamAccountService.getById(partnerId); +// //删除团队成员 +// partnerClassificationService.removeById(Integer.parseInt(teamId)); +// //同步删除该团队相关角色信息 +// partnerClassificationService.removeRole(teamId,partnerAccount.getAccountId()); +// return partnerTeamService.remove(new QueryWrapper(). +// eq("partner_id", partnerId). +// eq("classification_id", teamId)) ? R.ok() : R.error(); +// } + + +// @ApiOperation(value = "查询合伙人账号信息") +// @PostMapping("/queryPartnerAccount") +// public R queryPartnerAccount(@RequestParam String phone) { +// return platformTeamAccountService.queryPartnerAccount(phone); +// } + + //================================以下接口为小程序调用=================================== + @ApiOperation(value = "幼教产品微信小程序回调登录") + @PostMapping("/weChatAppletCallbackByKindergarten") + public R weChatAppletCallbackByKindergarten(@RequestBody @Valid AppletCallbackReq appletCallbackReq, HttpServletResponse response) throws Exception { + Map result = platformTeamAccountService.kindergartenWeChatAccountApplication(appletCallbackReq); + return R.ok().put("data",result); + } + + + @ApiOperation(value = "幼教产品微信小程序账号注册(根据openid)") + @PostMapping("/kindergartenWeChatApplication") + public R kindergartenWeChatApplication(@RequestBody @Valid AppletCallbackReq appletCallbackReq) { + return platformTeamAccountService.kindergartenWeChatApplication(appletCallbackReq); + } + + @ApiOperation(value = "获取当前平台用户的团队信息", response = PartnerAccountResp.class) + @GetMapping("/getTeamsByPlatformId") + public R getTeamsByPlatformId( + @ApiParam(name = "platformId", value = "平台id") + @RequestParam Integer platformId,HttpServletRequest request) { + String accountId = TokenUtils.getIdByJwtToken(request); + return platformTeamAccountService.getTeamsByPlatformId(accountId,platformId); + } + + @PostMapping("/platformTeamAccountList") + @ApiOperation(value = "小程序根据不同平台查询分类下所有团队及成员", response = PlatformTeamAccountResp.class) + public R platformTeamAccountList(@RequestBody @Valid PlatformTeamAccountListReq req) { + return platformTeamAccountService.pagePlatformTeamAccountList(req); + } +} + diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/PlatformTeamClassificationController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/PlatformTeamClassificationController.java new file mode 100644 index 0000000..2a52d89 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/controller/PlatformTeamClassificationController.java @@ -0,0 +1,23 @@ +package com.huoran.nakadai.controller; + + +import io.swagger.annotations.Api; +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 幼教产业平台团队分类表 前端控制器 + *

+ * + * @author chen + * @since 2023-12-12 + */ +@Api(tags = "幼教产业平台幼儿园与供应商团队分类管理") +@RestController +@RequestMapping("/kindergarten/platformTeamClassification") +public class PlatformTeamClassificationController { + +} + diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/PlatformTeamController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/PlatformTeamController.java new file mode 100644 index 0000000..02d944a --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/controller/PlatformTeamController.java @@ -0,0 +1,23 @@ +package com.huoran.nakadai.controller; + + +import io.swagger.annotations.Api; +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 幼教产业团队账号与分类中间表 前端控制器 + *

+ * + * @author chen + * @since 2023-12-12 + */ +@Api(tags = "幼教产业平台幼儿园与供应商团队管理") +@RestController +@RequestMapping("/kindergarten/platformTeam") +public class PlatformTeamController { + +} + diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/PlatformTeam.java b/nakadai/src/main/java/com/huoran/nakadai/entity/PlatformTeam.java new file mode 100644 index 0000000..098d9a2 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/PlatformTeam.java @@ -0,0 +1,41 @@ +package com.huoran.nakadai.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * 幼教产业团队账号与分类中间表 + *

+ * + * @author chen + * @since 2023-12-12 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("k_platform_team") +@ApiModel(value="PlatformTeam对象", description="幼教产业团队账号与分类中间表") +public class PlatformTeam implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "团队主键id") + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + @ApiModelProperty(value = "团队账号主键id") + private Integer manageId; + + @ApiModelProperty(value = "团队分类id") + private Integer classificationId; + + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/PlatformTeamAccount.java b/nakadai/src/main/java/com/huoran/nakadai/entity/PlatformTeamAccount.java new file mode 100644 index 0000000..ce2e146 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/PlatformTeamAccount.java @@ -0,0 +1,47 @@ +package com.huoran.nakadai.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * 幼教产业平台团队账号表 + *

+ * + * @author chen + * @since 2023-12-12 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("k_platform_team_account") +@ApiModel(value="PlatformTeamAccount对象", description="幼教产业平台团队账号表") +public class PlatformTeamAccount implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "主键ID") + @TableId(value = "manage_id", type = IdType.AUTO) + private Integer manageId; + + @ApiModelProperty(value = "绑定账号id") + private Integer accountId; + + @ApiModelProperty(value = "邀请账号") + private String invitationAccount; + + @ApiModelProperty(value = "是否删除(0、未删除 1、已删除)") + private Integer isDel; + + @ApiModelProperty(value = "平台id") + private Integer platformId; + + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/PlatformTeamClassification.java b/nakadai/src/main/java/com/huoran/nakadai/entity/PlatformTeamClassification.java new file mode 100644 index 0000000..d3ed032 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/PlatformTeamClassification.java @@ -0,0 +1,85 @@ +package com.huoran.nakadai.entity; + +import com.baomidou.mybatisplus.annotation.*; + +import java.util.Date; +import java.io.Serializable; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * 幼教产业平台团队分类表 + *

+ * + * @author chen + * @since 2023-12-12 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("k_platform_team_classification") +@ApiModel(value="PlatformTeamClassification对象", description="幼教产业平台团队分类表") +public class PlatformTeamClassification implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "主键") + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + @ApiModelProperty(value = "团队分类名称") + private String classificationName; + + @ApiModelProperty(value = "父id 一级为0", example = "0", name = "parentId") + private Integer parentId; + + @ApiModelProperty(value = "层级") + private Integer level; + + @ApiModelProperty(value = "子级") + @TableField(exist = false) + private List children; + + @ApiModelProperty(value = "层级拼接") + @TableField(exist = false) + private String splicingLevel; + + @ApiModelProperty(value = "logo_url") + private String logo_url; + + @ApiModelProperty(value = "地址") + private String address; + + @ApiModelProperty(value = "简介") + private String briefIntroduction; + + @ApiModelProperty(value = "更新时间") + @TableField(fill = FieldFill.INSERT_UPDATE) + @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd") + private Date updateTime; + + @ApiModelProperty(value = "创建时间") + @TableField(fill = FieldFill.INSERT) + @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd") + private Date createTime; + + @ApiModelProperty(value = "逻辑删除") + @TableLogic + private Integer isDel; + + @ApiModelProperty(value = "是否为团队(默认0不是团体,1为团队)") + private Integer isTeam; + + @ApiModelProperty(value = "团队主键id") + @TableField(exist = false) + private Integer manageId; + + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/UserAccount.java b/nakadai/src/main/java/com/huoran/nakadai/entity/UserAccount.java index 0a18d23..2fde1cf 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/entity/UserAccount.java +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/UserAccount.java @@ -51,12 +51,18 @@ public class UserAccount implements Serializable { @ApiModelProperty(value = "所属平台id") private String platformId; - @ApiModelProperty(value = "所属平台id") + @ApiModelProperty(value = "小程序id") private String appOpenId; + @ApiModelProperty(value = "开放平台与公众平台唯一id") + private String unionid; + @ApiModelProperty(value = "平台(系统)绑定时间") private Date platformBindTime; + @ApiModelProperty(value = "手机绑定时间") + private Date phoneBindingTime; + @ApiModelProperty(value = "平台端区分:0->教师端 1->学生端 2->无端") private Integer type; diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/req/AccountRegisterReq.java b/nakadai/src/main/java/com/huoran/nakadai/entity/req/AccountRegisterReq.java new file mode 100644 index 0000000..c55f81b --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/req/AccountRegisterReq.java @@ -0,0 +1,47 @@ +package com.huoran.nakadai.entity.req; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +@Data +public class AccountRegisterReq { + + @ApiModelProperty(value = "姓名") + private String userName; + + @ApiModelProperty(value = "账号") + private String account; + + @ApiModelProperty(value = "密码") + private String password; + + @ApiModelProperty(value = "平台id") + @NotNull(message = "请选择平台注册!") + private String platformId; + + @ApiModelProperty(value = "唯一标识账号") + @NotNull(message = "唯一标识不能为空!") + private String uniqueIdentification; + + @ApiModelProperty(value = "手机号") + @NotNull(message = "手机号不能为空") + private String phone; + + @ApiModelProperty(value = "邮箱") + private String email; + + @ApiModelProperty(value = "小程序openid") + private String appOpenId; + +// @ApiModelProperty(value = "意向省份") +// private Integer provinceId; +// +// @ApiModelProperty(value = "意向城市") +// private Integer cityId; +// +// @ApiModelProperty(value = "openId") +// private String openId; + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/req/AppletCallbackReq.java b/nakadai/src/main/java/com/huoran/nakadai/entity/req/AppletCallbackReq.java new file mode 100644 index 0000000..8d23a23 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/req/AppletCallbackReq.java @@ -0,0 +1,28 @@ +package com.huoran.nakadai.entity.req; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; + + +/** + * @Author chen + * @DATE 2022/7/12 15:03 + * @Version 1.0 + */ +@Data +public class AppletCallbackReq { + + @ApiModelProperty("微信code") + private String code; + + @ApiModelProperty("平台标识:5幼儿园,6供应商,7个人端") + private Integer platformId; + + @ApiModelProperty("唯一标识") + private String openId; + + @ApiModelProperty("手机号") + private String phone; +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/req/PlatformTeamAccountListReq.java b/nakadai/src/main/java/com/huoran/nakadai/entity/req/PlatformTeamAccountListReq.java new file mode 100644 index 0000000..616443c --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/req/PlatformTeamAccountListReq.java @@ -0,0 +1,39 @@ +package com.huoran.nakadai.entity.req; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.util.ArrayList; + +/** + * @Author chen + * @DATE 2022/5/18 17:15 + * @Version 1.0 + */ +@Data +public class PlatformTeamAccountListReq { + + @ApiModelProperty(value = "类型:必填一个(1.有团队 2.未加入团队)", required = true, example = "1") + private Integer type; + + @ApiModelProperty(value = "搜索关键词", example = "1") + private String keyWord; + + @ApiModelProperty(value = "分类主键ID", example = "2") + @NotNull(message = "先选择分类/团队进行查询!") + private String classificationId; + + @ApiModelProperty(value = "平台ID", example = "5") + @NotNull(message = "平台ID不能为空") + private String platformId; + + @ApiModelProperty(value = "当前页数", name = "pageNum", example = "1", required = true) + private Integer pageNum; + + @ApiModelProperty(value = "当前页需要显示的数量", name = "pageSize", example = "10", required = true) + private Integer pageSize; + + //合伙人id + private ArrayList ids; +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/res/PlatformTeamAccountResp.java b/nakadai/src/main/java/com/huoran/nakadai/entity/res/PlatformTeamAccountResp.java new file mode 100644 index 0000000..ddc0794 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/res/PlatformTeamAccountResp.java @@ -0,0 +1,97 @@ +package com.huoran.nakadai.entity.res; + +import com.huoran.nakadai.entity.PartnerClassification; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.math.BigDecimal; +import java.util.List; + +/** + * @Author chen + * @DATE 2022/5/18 17:04 + * @Version 1.0 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@ApiModel(value = "platformTeamAccountResp", description = "平台团队列表") +public class PlatformTeamAccountResp { + + @ApiModelProperty(value = "主键IDd") + private Integer manageId; + + @ApiModelProperty(value = "父id") + private Integer parentId; + + @ApiModelProperty(value = "邀请人") + private String invitationAccount; + + @ApiModelProperty(value = "分类id") + private String classificationId; + + @ApiModelProperty(value = "分类名称(团队名称)") + private String classificationName; + + @ApiModelProperty(value = "账号id") + private Integer accountId; + + @ApiModelProperty(value = "职工姓名") + private String userName; + + @ApiModelProperty(value = "职工工号") + private String workNumber; + + @ApiModelProperty(value = "唯一标识账号") + private String uniqueIdentification; + + @ApiModelProperty("用户头像路径") + private String userAvatars; + + @ApiModelProperty(value = "电话") + private String phone; + + @ApiModelProperty(value = "邮箱") + private String email; + + //用于列表逗号隔开展示 + @ApiModelProperty(value = "角色") + private String roleName; + + @ApiModelProperty(value = "角色id") + private String roleId; + + @ApiModelProperty(value = "账号") + private String account; + + @ApiModelProperty(value = "登陆次数") + private Integer loginNumber; + + @ApiModelProperty(value = "最后登陆时间") + private String lastLoginTime; + + @ApiModelProperty(value = "用户id") + private Integer userId; + + @ApiModelProperty(value = "团队id") + private Integer teamId; + + @ApiModelProperty(value = "商务经理ids") + private List businessManagerIds; + +// @ApiModelProperty(value = "团队信息") +// private PartnerClassification partnerClassificationList; + + @ApiModelProperty(value = "是否是团队") + private String isTeam; + + @ApiModelProperty(value = "团队数") + private Integer teamSize; + + @ApiModelProperty(value = "团队名称") + private String teamName; + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/res/TeamAccountResp.java b/nakadai/src/main/java/com/huoran/nakadai/entity/res/TeamAccountResp.java new file mode 100644 index 0000000..090417d --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/res/TeamAccountResp.java @@ -0,0 +1,98 @@ +package com.huoran.nakadai.entity.res; + +import com.huoran.nakadai.entity.PartnerClassification; +import com.huoran.nakadai.entity.PlatformTeamClassification; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.math.BigDecimal; +import java.util.List; + +/** + * @Author chen + * @DATE 2022/5/18 17:04 + * @Version 1.0 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@ApiModel(value = "TeamAccountResp", description = "平台团队列表") +public class TeamAccountResp { + + @ApiModelProperty(value = "团队管理id") + private Integer manageId; + + @ApiModelProperty(value = "父id") + private Integer parentId; + + @ApiModelProperty(value = "邀请人") + private String invitationAccount; + + @ApiModelProperty(value = "团队分类id") + private String classificationId; + + @ApiModelProperty(value = "合伙人分类名称(团队名称)") + private String classificationName; + + @ApiModelProperty(value = "账号id") + private Integer accountId; + + @ApiModelProperty(value = "职工姓名") + private String userName; + + @ApiModelProperty(value = "职工工号") + private String workNumber; + + @ApiModelProperty(value = "唯一标识账号") + private String uniqueIdentification; + + @ApiModelProperty("用户头像路径") + private String userAvatars; + + @ApiModelProperty(value = "电话") + private String phone; + + @ApiModelProperty(value = "邮箱") + private String email; + + //用于列表逗号隔开展示 + @ApiModelProperty(value = "角色") + private String roleName; + + @ApiModelProperty(value = "角色id") + private String roleId; + + @ApiModelProperty(value = "账号") + private String account; + + @ApiModelProperty(value = "登陆次数") + private Integer loginNumber; + + @ApiModelProperty(value = "最后登陆时间") + private String lastLoginTime; + + @ApiModelProperty(value = "用户id") + private Integer userId; + + @ApiModelProperty(value = "团队id") + private Integer teamId; + + @ApiModelProperty(value = "团队信息") + private PlatformTeamClassification platformTeamClassificationList; + + @ApiModelProperty(value = "是否是团队") + private String isTeam; + + @ApiModelProperty(value = "区域") + private String area; + + @ApiModelProperty(value = "团队数") + private Integer teamSize; + + @ApiModelProperty(value = "团队名称") + private String teamName; + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/HrStaffMapper.java b/nakadai/src/main/java/com/huoran/nakadai/mapper/HrStaffMapper.java index 8ebaa8c..27dd59e 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/mapper/HrStaffMapper.java +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/HrStaffMapper.java @@ -8,6 +8,7 @@ import com.huoran.nakadai.entity.UserAccount; import com.huoran.nakadai.entity.UserInfo; import com.huoran.nakadai.entity.req.StaffListReq; import com.huoran.nakadai.entity.res.StaffResp; +import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -20,6 +21,7 @@ import java.util.List; * @author chen * @since 2022-03-22 */ +@Mapper public interface HrStaffMapper extends BaseMapper { int addUserInfo(UserInfo userInfo); diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/PartnerClassificationMapper.java b/nakadai/src/main/java/com/huoran/nakadai/mapper/PartnerClassificationMapper.java index 1fc987b..c191a05 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/mapper/PartnerClassificationMapper.java +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/PartnerClassificationMapper.java @@ -3,6 +3,7 @@ package com.huoran.nakadai.mapper; import com.huoran.nakadai.entity.PartnerClassification; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.huoran.nakadai.entity.res.TeamInformationResp; +import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -15,6 +16,7 @@ import java.util.List; * @author chen * @since 2022-05-18 */ +@Mapper public interface PartnerClassificationMapper extends BaseMapper { List selectIdByPid(@Param("id") Integer id,@Param("type") Integer type); diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/PartnerTeamMapper.java b/nakadai/src/main/java/com/huoran/nakadai/mapper/PartnerTeamMapper.java index ee36cdc..a4da81c 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/mapper/PartnerTeamMapper.java +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/PartnerTeamMapper.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.huoran.nakadai.entity.PartnerTeam; import com.huoran.nakadai.entity.res.PartnerAccountResp; import com.huoran.nakadai.entity.res.UserInfoByPhoneRes; +import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -16,6 +17,7 @@ import java.util.List; * @author chen * @since 2022-05-18 */ +@Mapper public interface PartnerTeamMapper extends BaseMapper { List getMembersUnderTheSameTeam(Integer classificationId); diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/PlatformTeamAccountMapper.java b/nakadai/src/main/java/com/huoran/nakadai/mapper/PlatformTeamAccountMapper.java new file mode 100644 index 0000000..66b38fc --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/PlatformTeamAccountMapper.java @@ -0,0 +1,39 @@ +package com.huoran.nakadai.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.huoran.nakadai.entity.PlatformTeamAccount; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.huoran.nakadai.entity.UserAccount; +import com.huoran.nakadai.entity.req.PlatformTeamAccountListReq; +import com.huoran.nakadai.entity.res.PlatformTeamAccountResp; +import com.huoran.nakadai.entity.res.TeamAccountResp; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.ArrayList; +import java.util.List; + +/** + *

+ * 幼教产业平台团队账号表 Mapper 接口 + *

+ * + * @author chen + * @since 2023-12-12 + */ +@Mapper +public interface PlatformTeamAccountMapper extends BaseMapper { + + IPage platformTeamAccountMergeList(Page page, PlatformTeamAccountListReq req); + + Integer selectAccount(@Param("phone") String phone,@Param("platformId") String platformId); + + UserAccount selectAccountByOpenId(@Param("openid") String openid,@Param("platformId") Integer platform); + + List getTeamsByPlatformId(@Param("accountId")String accountId,@Param("platformId") Integer platformId); + + ArrayList selectTeamIdByClassificationId(@Param("classificationId")String classificationId); + + IPage pagePlatformTeamAccountList(Page page, PlatformTeamAccountListReq req); +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/PlatformTeamClassificationMapper.java b/nakadai/src/main/java/com/huoran/nakadai/mapper/PlatformTeamClassificationMapper.java new file mode 100644 index 0000000..73241be --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/PlatformTeamClassificationMapper.java @@ -0,0 +1,20 @@ +package com.huoran.nakadai.mapper; + +import com.huoran.nakadai.entity.PlatformTeamClassification; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + *

+ * 幼教产业平台团队分类表 Mapper 接口 + *

+ * + * @author chen + * @since 2023-12-12 + */ +@Mapper +public interface PlatformTeamClassificationMapper extends BaseMapper { + + PlatformTeamClassification getParentInformationBasedOnChild(@Param("id") String classificationId); +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/PlatformTeamMapper.java b/nakadai/src/main/java/com/huoran/nakadai/mapper/PlatformTeamMapper.java new file mode 100644 index 0000000..6945dc6 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/PlatformTeamMapper.java @@ -0,0 +1,18 @@ +package com.huoran.nakadai.mapper; + +import com.huoran.nakadai.entity.PlatformTeam; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + *

+ * 幼教产业团队账号与分类中间表 Mapper 接口 + *

+ * + * @author chen + * @since 2023-12-12 + */ +@Mapper +public interface PlatformTeamMapper extends BaseMapper { + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/PlatformTeamAccountMapper.xml b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/PlatformTeamAccountMapper.xml new file mode 100644 index 0000000..d593b46 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/PlatformTeamAccountMapper.xml @@ -0,0 +1,136 @@ + + + + + + + + + + + diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/PlatformTeamClassificationMapper.xml b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/PlatformTeamClassificationMapper.xml new file mode 100644 index 0000000..40d3208 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/PlatformTeamClassificationMapper.xml @@ -0,0 +1,29 @@ + + + + + + diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/PlatformTeamMapper.xml b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/PlatformTeamMapper.xml new file mode 100644 index 0000000..57e926f --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/PlatformTeamMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/PlatformTeamAccountService.java b/nakadai/src/main/java/com/huoran/nakadai/service/PlatformTeamAccountService.java new file mode 100644 index 0000000..13df417 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/service/PlatformTeamAccountService.java @@ -0,0 +1,34 @@ +package com.huoran.nakadai.service; + +import com.huoran.common.response.R; +import com.huoran.nakadai.entity.PlatformTeamAccount; +import com.baomidou.mybatisplus.extension.service.IService; +import com.huoran.nakadai.entity.req.AccountRegisterReq; +import com.huoran.nakadai.entity.req.AppletCallbackReq; +import com.huoran.nakadai.entity.req.PlatformTeamAccountListReq; + +import javax.servlet.http.HttpServletResponse; +import java.util.Map; + +/** + *

+ * 幼教产业平台团队账号表 服务类 + *

+ * + * @author chen + * @since 2023-12-12 + */ +public interface PlatformTeamAccountService extends IService { + + void generationQrCode(String url, HttpServletResponse response); + + R platformTeamAccountMergeList(PlatformTeamAccountListReq req); + + Map kindergartenWeChatAccountApplication(AppletCallbackReq appletCallbackReq) throws Exception; + + R kindergartenWeChatApplication(AppletCallbackReq appletCallbackReq); + + R getTeamsByPlatformId(String accountId, Integer platformId); + + R pagePlatformTeamAccountList(PlatformTeamAccountListReq req); +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/PlatformTeamClassificationService.java b/nakadai/src/main/java/com/huoran/nakadai/service/PlatformTeamClassificationService.java new file mode 100644 index 0000000..47241cf --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/service/PlatformTeamClassificationService.java @@ -0,0 +1,16 @@ +package com.huoran.nakadai.service; + +import com.huoran.nakadai.entity.PlatformTeamClassification; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 幼教产业平台团队分类表 服务类 + *

+ * + * @author chen + * @since 2023-12-12 + */ +public interface PlatformTeamClassificationService extends IService { + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/PlatformTeamService.java b/nakadai/src/main/java/com/huoran/nakadai/service/PlatformTeamService.java new file mode 100644 index 0000000..239d37b --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/service/PlatformTeamService.java @@ -0,0 +1,16 @@ +package com.huoran.nakadai.service; + +import com.huoran.nakadai.entity.PlatformTeam; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 幼教产业团队账号与分类中间表 服务类 + *

+ * + * @author chen + * @since 2023-12-12 + */ +public interface PlatformTeamService extends IService { + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/impl/PlatformTeamAccountServiceImpl.java b/nakadai/src/main/java/com/huoran/nakadai/service/impl/PlatformTeamAccountServiceImpl.java new file mode 100644 index 0000000..33868c2 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/service/impl/PlatformTeamAccountServiceImpl.java @@ -0,0 +1,223 @@ +package com.huoran.nakadai.service.impl; + + +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.huoran.common.response.R; +import com.huoran.common.utils.HttpClientUtils; +import com.huoran.common.utils.JwtUtils; +import com.huoran.common.utils.MD5; +import com.huoran.nakadai.entity.*; +import com.huoran.nakadai.entity.req.AccountRegisterReq; +import com.huoran.nakadai.entity.req.AppletCallbackReq; +import com.huoran.nakadai.entity.req.PlatformTeamAccountListReq; +import com.huoran.nakadai.entity.res.PartnerAccountResp; +import com.huoran.nakadai.entity.res.PlatformTeamAccountResp; +import com.huoran.nakadai.entity.res.TeamAccountResp; +import com.huoran.nakadai.mapper.HrStaffMapper; +import com.huoran.nakadai.mapper.PlatformTeamAccountMapper; +import com.huoran.nakadai.mapper.PlatformTeamClassificationMapper; +import com.huoran.nakadai.mapper.PlatformTeamMapper; +import com.huoran.nakadai.service.PlatformTeamAccountService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.huoran.nakadai.utils.QrCodeUtil; +import com.huoran.nakadai.utils.WeChatPropertiesUtil; +import org.apache.commons.collections4.map.HashedMap; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import javax.servlet.http.HttpServletResponse; +import java.util.*; +import java.util.stream.Collectors; + +/** + *

+ * 幼教产业平台团队账号表 服务实现类 + *

+ * + * @author chen + * @since 2023-12-12 + */ +@Service +public class PlatformTeamAccountServiceImpl extends ServiceImpl implements PlatformTeamAccountService { + + @Autowired + private HrStaffMapper staffMapper; + + @Autowired + private PlatformTeamClassificationMapper platformTeamClassificationMapper; + + @Autowired + private PlatformTeamMapper platformTeamMapper; + + private static final String REQUEST_URL = "https://api.weixin.qq.com/sns/jscode2session"; + private static final String GRANT_TYPE = "authorization_code"; + + @Override + public void generationQrCode(String url, HttpServletResponse response) { + response.setHeader("Content-Type", "image/png"); + response.setHeader("Content-Disposition", "inline;filename=qrcode.png"); + QrCodeUtil.encode(url, response); + } + + @Override + public R platformTeamAccountMergeList(PlatformTeamAccountListReq req) { + Page page = new Page<>(req.getPageNum(), req.getPageSize()); + //查询团队合伙人 + IPage partnerAccountList = baseMapper.platformTeamAccountMergeList(page, req); + + return R.ok().put("pageList", partnerAccountList); + } + + @Override + public Map kindergartenWeChatAccountApplication(AppletCallbackReq appletCallbackReq) throws Exception { + String code = appletCallbackReq.getCode(); + + Map data = new HashedMap<>(); + JSONObject sessionKeyOrOpenId = this.getSessionKeyOrOpenIdByKindergarten(code); + String openid =(String) sessionKeyOrOpenId.get("openid"); + + // 根据openid查询用户,存在则返回登录状态 + ArrayList arrayList = new ArrayList<>(); + arrayList.add(5); + arrayList.add(6); + arrayList.add(7); + + boolean userExists = false; // 添加标志位,判断用户是否存在 + + for (Integer platformId : arrayList) { + UserAccount userAccount = baseMapper.selectAccountByOpenId(openid,platformId); + // 有平台存在返回登录信息 + if (userAccount!= null){ + data.put("state", "login"); + data.put("platformId", platformId); + data.put("token", JwtUtils.getJwtToken(userAccount.getId().toString())); + userExists = true; // 如果用户存在,将标志位设为true + break; // 如果找到用户,就不需要继续查找 + } + } + + // 如果用户不存在,返回状态为"绑定" + if (!userExists) { + data.put("state", "bind"); + } + + data.put("sessionKey", sessionKeyOrOpenId); + return data; + } + + + @Override + public R kindergartenWeChatApplication(AppletCallbackReq appletCallbackReq) { + Map data = new HashedMap(); + String randomNumbers = cn.hutool.core.util.RandomUtil.randomNumbers(6); + String accountId = null; + String userName = ""; + String accountName = ""; + + // 根据不同的平台ID设置用户名和账户名 + switch (appletCallbackReq.getPlatformId()) { + case 5: + userName = "幼儿园" + randomNumbers; + accountName = "幼儿园" + randomNumbers; + break; + case 6: + userName = "供应商" + randomNumbers; + accountName = "供应商" + randomNumbers; + break; + case 7: + userName = "个人" + randomNumbers; + accountName = "个人" + randomNumbers; + break; + } + + // 创建并设置用户信息 + UserInfo userInfo = new UserInfo(); + userInfo.setUserName(userName); + userInfo.setLoginNumber(1); + userInfo.setLastLoginTime(new Date()); + staffMapper.addUserInfo(userInfo); + + // 创建并设置用户账户 + UserAccount userAccount = new UserAccount(); + userAccount.setPhone(appletCallbackReq.getPhone()); + userAccount.setPhoneBindingTime(new Date()); + userAccount.setPassword(MD5.encrypt("1122aa")); + userAccount.setUserId(userInfo.getUserId()); + userAccount.setType(2); // 平台端区分:0->教师端 1->学生端 2->无端 + userAccount.setPlatformId(appletCallbackReq.getPlatformId().toString()); + userAccount.setAppOpenId(appletCallbackReq.getOpenId()); + userAccount.setAccount(accountName); + staffMapper.addUserAccount(userAccount); + accountId = userAccount.getId().toString(); + + // 如果平台ID不是7,添加供应商信息和团队信息 + if (appletCallbackReq.getPlatformId() != 7) { + // 添加供应商信息 + PlatformTeamAccount platformTeamAccount = new PlatformTeamAccount(); + platformTeamAccount.setAccountId(userAccount.getId()); + platformTeamAccount.setPlatformId(appletCallbackReq.getPlatformId()); + baseMapper.insert(platformTeamAccount); + + // 添加所属供应商分类,分类为空直接新增团队 + PlatformTeamClassification platformTeamClassification = new PlatformTeamClassification(); + platformTeamClassification.setIsTeam(1); + platformTeamClassification.setParentId(1); + platformTeamClassification.setLevel(1); + String teamName = userAccount.getAccount() + "的团队"; + + platformTeamClassification.setClassificationName(teamName); + int insert = platformTeamClassificationMapper.insert(platformTeamClassification); + if (insert > 0) { + PlatformTeam platformTeam = new PlatformTeam(); + platformTeam.setManageId(platformTeamAccount.getManageId()); + platformTeam.setClassificationId(platformTeamClassification.getId()); + platformTeamMapper.insert(platformTeam); + } + data.put("teamId",platformTeamClassification.getId()); + } + + // 注册成功返回token + data.put("token", JwtUtils.getJwtToken(accountId)); + return R.ok().put("data",data); + } + + @Override + public R getTeamsByPlatformId(String accountId, Integer platformId) { + List teamsByPlatformId = baseMapper.getTeamsByPlatformId(accountId,platformId); + teamsByPlatformId.forEach(teamAccountResp -> { + PlatformTeamClassification platformTeamClassification = platformTeamClassificationMapper.getParentInformationBasedOnChild(teamAccountResp.getClassificationId()); + teamAccountResp.setPlatformTeamClassificationList(platformTeamClassification); + }); + return R.ok().put("data", teamsByPlatformId); + } + + @Override + public R pagePlatformTeamAccountList(PlatformTeamAccountListReq req) { + Page page = new Page<>(req.getPageNum(), req.getPageSize()); + //查询分类下所有团队id + ArrayList ids = baseMapper.selectTeamIdByClassificationId(req.getClassificationId()); + req.setIds(ids); + IPage platformTeamAccountList = baseMapper.pagePlatformTeamAccountList(page, req); + return R.ok().put("pageList", platformTeamAccountList); + } + + private JSONObject getSessionKeyOrOpenIdByKindergarten(String code) throws Exception { + Map requestUrlParam = new HashMap<>(); + requestUrlParam.put("appid", WeChatPropertiesUtil.KINDERGARTEN_WX_OPEN_APP_ID); + requestUrlParam.put("secret", WeChatPropertiesUtil.KINDERGARTEN_WX_OPEN_APP_SECRET); + // 小程序端返回的code + requestUrlParam.put("js_code", code); + // 默认参数 + requestUrlParam.put("grant_type", GRANT_TYPE); + + // 发送post请求读取调用微信接口获取openid用户唯一标识 + String result = HttpClientUtils.doPost(REQUEST_URL, requestUrlParam); + return JSON.parseObject(result); + } +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/impl/PlatformTeamClassificationServiceImpl.java b/nakadai/src/main/java/com/huoran/nakadai/service/impl/PlatformTeamClassificationServiceImpl.java new file mode 100644 index 0000000..b38f8ad --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/service/impl/PlatformTeamClassificationServiceImpl.java @@ -0,0 +1,20 @@ +package com.huoran.nakadai.service.impl; + +import com.huoran.nakadai.entity.PlatformTeamClassification; +import com.huoran.nakadai.mapper.PlatformTeamClassificationMapper; +import com.huoran.nakadai.service.PlatformTeamClassificationService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 幼教产业平台团队分类表 服务实现类 + *

+ * + * @author chen + * @since 2023-12-12 + */ +@Service +public class PlatformTeamClassificationServiceImpl extends ServiceImpl implements PlatformTeamClassificationService { + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/impl/PlatformTeamServiceImpl.java b/nakadai/src/main/java/com/huoran/nakadai/service/impl/PlatformTeamServiceImpl.java new file mode 100644 index 0000000..f61de8a --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/service/impl/PlatformTeamServiceImpl.java @@ -0,0 +1,20 @@ +package com.huoran.nakadai.service.impl; + +import com.huoran.nakadai.entity.PlatformTeam; +import com.huoran.nakadai.mapper.PlatformTeamMapper; +import com.huoran.nakadai.service.PlatformTeamService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 幼教产业团队账号与分类中间表 服务实现类 + *

+ * + * @author chen + * @since 2023-12-12 + */ +@Service +public class PlatformTeamServiceImpl extends ServiceImpl implements PlatformTeamService { + +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/utils/WeChatPropertiesUtil.java b/nakadai/src/main/java/com/huoran/nakadai/utils/WeChatPropertiesUtil.java index 041fc99..9934072 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/utils/WeChatPropertiesUtil.java +++ b/nakadai/src/main/java/com/huoran/nakadai/utils/WeChatPropertiesUtil.java @@ -31,6 +31,20 @@ public class WeChatPropertiesUtil implements InitializingBean { @Value("${operation.wxopen.redirect_url}") private String operationRedirectUrl; + @Value("${kindergarten.wxopen.appid}") + private String kindergartenAppId; + + @Value("${kindergarten.wxopen.appsecret}") + private String kindergartenAppSecret; + + @Value("${kindergarten.wxopen.redirect_url}") + private String kindergartenRedirectUrl; + + + public static String KINDERGARTEN_WX_OPEN_APP_ID; + public static String KINDERGARTEN_WX_OPEN_APP_SECRET; + public static String KINDERGARTEN_WX_OPEN_REDIRECT_URL; + public static String PARTNER_WX_OPEN_APP_ID; public static String PARTNER_WX_OPEN_APP_SECRET; public static String PARTNER_WX_OPEN_REDIRECT_URL; @@ -48,5 +62,9 @@ public class WeChatPropertiesUtil implements InitializingBean { OPERATION_WX_OPEN_APP_ID = operationAppId; OPERATION_WX_OPEN_APP_SECRET = operationAppSecret; OPERATION_WX_OPEN_REDIRECT_URL = operationRedirectUrl; + + KINDERGARTEN_WX_OPEN_APP_ID = kindergartenAppId; + KINDERGARTEN_WX_OPEN_APP_SECRET = kindergartenAppSecret; + KINDERGARTEN_WX_OPEN_REDIRECT_URL = kindergartenRedirectUrl; } } diff --git a/nakadai/src/main/resources/bootstrap.properties b/nakadai/src/main/resources/bootstrap.properties index 86b8cc3..10226b4 100644 --- a/nakadai/src/main/resources/bootstrap.properties +++ b/nakadai/src/main/resources/bootstrap.properties @@ -6,7 +6,6 @@ spring.cloud.nacos.config.server-addr=127.0.0.1:8848 #namespace spring.cloud.nacos.config.namespace=kindergarten-microservice-configuration-namespace - #合伙人微信小程序配置 partner.wxopen.appid=wx2b506fdb0eeee65d partner.wxopen.appsecret=d14ccc2f188e6e64a263086f91dfa71c @@ -16,16 +15,21 @@ partner.wxopen.redirect_url=http://192.168.31.116:9000/apiHrmsAuth/hrms/auth/use #运营微信小程序配置 operation.wxopen.appid=wx88cd6037d54f230a operation.wxopen.appsecret=82c18212b17bf8b2fa17c680feb5b012 -operation.wxopen.redirect_url=http://192.168.31.116:9000/apiHrmsAuth/hrms/auth/userlogin/user/callback - -spring.mail.host=smtp.qq.com -spring.mail.port=587 -spring.mail.username=1251790704@qq.com -spring.mail.password=tgbteukyosdnhadh -spring.mail.default-encoding=UTF-8 -spring.mail.properties.mail.smtp.socketFactoryClass=javax.net.ssl.SSLSocketFactory -spring.mail.properties.mail.debug=true -spring.mail.from=1251790704@qq.com +operation.wxopen.redirect_url=http://192.168.31.116:9000/apiHrmsAuth/hrms/auth/userlogin/user/callback\ + +#幼教微信小程序配置 +kindergarten.wxopen.appid=wxd210bb4686c9c580 +kindergarten.wxopen.appsecret=23b2ecfdd893f1feef31fd1a8ce65379 +kindergarten.wxopen.redirect_url=http://192.168.31.116:9000/apiHrmsAuth/hrms/auth/userlogin/user/callback + +#spring.mail.host=smtp.qq.com +#spring.mail.port=587 +#spring.mail.username=1251790704@qq.com +#spring.mail.password=tgbteukyosdnhadh +#spring.mail.default-encoding=UTF-8 +#spring.mail.properties.mail.smtp.socketFactoryClass=javax.net.ssl.SSLSocketFactory +#spring.mail.properties.mail.debug=true +#spring.mail.from=1251790704@qq.com #email.url=D:/copyWriting/ diff --git a/nakadai/src/test/java/com/huoran/nakadai/code/CodeGenerator.java b/nakadai/src/test/java/com/huoran/nakadai/code/CodeGenerator.java index 11f720e..d876104 100644 --- a/nakadai/src/test/java/com/huoran/nakadai/code/CodeGenerator.java +++ b/nakadai/src/test/java/com/huoran/nakadai/code/CodeGenerator.java @@ -43,10 +43,10 @@ public class CodeGenerator { // 3、数据源配置 // 3、数据源配置 DataSourceConfig dsc = new DataSourceConfig(); - dsc.setUrl("jdbc:mysql://121.37.12.51:3308/nakadai?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8"); + dsc.setUrl("jdbc:mysql://139.9.47.170:3306/nakadai?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8"); dsc.setDriverName("com.mysql.cj.jdbc.Driver"); dsc.setUsername("root"); - dsc.setPassword("root"); + dsc.setPassword("HuoRan@2021"); dsc.setDbType(DbType.MYSQL); mpg.setDataSource(dsc); @@ -63,9 +63,9 @@ public class CodeGenerator { // 5、策略配置 StrategyConfig strategy = new StrategyConfig(); - strategy.setInclude("sys_platform"); + strategy.setInclude("k_platform_team","k_platform_team_account","k_platform_team_classification"); strategy.setNaming(NamingStrategy.underline_to_camel);//数据库表映射到实体的命名策略 - strategy.setTablePrefix("sys_"); //生成实体时去掉表前缀 + strategy.setTablePrefix("k_"); //生成实体时去掉表前缀 strategy.setColumnNaming(NamingStrategy.underline_to_camel);//数据库表字段映射到实体的命名策略 strategy.setEntityLombokModel(true); // lombok 模型 @Accessors(chain = true) setter链式操作 diff --git a/users/src/main/java/com/huoran/users/config/WeChatPropertiesUtil.java b/users/src/main/java/com/huoran/users/config/WeChatPropertiesUtil.java index 81395e0..82adcef 100644 --- a/users/src/main/java/com/huoran/users/config/WeChatPropertiesUtil.java +++ b/users/src/main/java/com/huoran/users/config/WeChatPropertiesUtil.java @@ -31,6 +31,15 @@ public class WeChatPropertiesUtil implements InitializingBean { @Value("${operation.wxopen.redirect_url}") private String operationRedirectUrl; + @Value("${kindergarten.wxopen.appid}") + private String kindergartenAppId; + + @Value("${kindergarten.wxopen.appsecret}") + private String kindergartenAppSecret; + + @Value("${kindergarten.wxopen.redirect_url}") + private String kindergartenRedirectUrl; + public static String PARTNER_WX_OPEN_APP_ID; public static String PARTNER_WX_OPEN_APP_SECRET; public static String PARTNER_WX_OPEN_REDIRECT_URL; @@ -40,6 +49,10 @@ public class WeChatPropertiesUtil implements InitializingBean { public static String OPERATION_WX_OPEN_APP_SECRET; public static String OPERATION_WX_OPEN_REDIRECT_URL; + public static String KINDERGARTEN_WX_OPEN_APP_ID; + public static String KINDERGARTEN_WX_OPEN_APP_SECRET; + public static String KINDERGARTEN_WX_OPEN_REDIRECT_URL; + @Override public void afterPropertiesSet() throws Exception { PARTNER_WX_OPEN_APP_ID = partnerAppId; @@ -48,5 +61,8 @@ public class WeChatPropertiesUtil implements InitializingBean { OPERATION_WX_OPEN_APP_ID = operationAppId; OPERATION_WX_OPEN_APP_SECRET = operationAppSecret; OPERATION_WX_OPEN_REDIRECT_URL = operationRedirectUrl; + KINDERGARTEN_WX_OPEN_APP_ID = kindergartenAppId; + KINDERGARTEN_WX_OPEN_APP_SECRET = kindergartenAppSecret; + KINDERGARTEN_WX_OPEN_REDIRECT_URL = kindergartenRedirectUrl; } } diff --git a/users/src/main/java/com/huoran/users/controller/UserLoginController.java b/users/src/main/java/com/huoran/users/controller/UserLoginController.java index 52ddb38..b2af983 100644 --- a/users/src/main/java/com/huoran/users/controller/UserLoginController.java +++ b/users/src/main/java/com/huoran/users/controller/UserLoginController.java @@ -7,6 +7,7 @@ import com.huoran.common.utils.TokenUtils; import com.huoran.users.entity.HrUserAccount; import com.huoran.users.entity.PlatformLogin; import com.huoran.users.entity.dto.LoginDTO; +import com.huoran.users.entity.req.AccountRegisterReq; import com.huoran.users.entity.req.AppletCallbackReq; import com.huoran.users.entity.req.UnbindAccountsReq; import com.huoran.users.entity.req.WxUserBindingReq; @@ -121,6 +122,27 @@ public class UserLoginController { return platformLoginService.platformLoginStatistics(platform,schoolId); } + @ApiOperation(value = "幼教产品个人端账号快速注册登录") + @PostMapping("/personalAccountApplication") + public R personalAccountApplication(@RequestBody @Valid AccountRegisterReq registerReq) { + return userInfoService.personalAccountApplication(registerReq); + } + + + + /** + * 微信小程序绑定回调 + */ + @ApiOperation(value = "微信小程序绑定回调(幼教产业版)") + @PostMapping("/weChatAppletCallbackByKindergarten") + public R weChatAppletCallbackByKindergarten(@RequestBody AppletCallbackReq appletCallbackReq, HttpServletResponse response) throws Exception { + + Map result = userInfoService.weChatAppletCallbackByKindergarten(appletCallbackReq, response); + + return R.ok().put("data",result); + } + + /** * 登录成功后返回token值,用于其他模块验证 * @param loginVo 登录信息 diff --git a/users/src/main/java/com/huoran/users/entity/req/AccountRegisterReq.java b/users/src/main/java/com/huoran/users/entity/req/AccountRegisterReq.java new file mode 100644 index 0000000..970df81 --- /dev/null +++ b/users/src/main/java/com/huoran/users/entity/req/AccountRegisterReq.java @@ -0,0 +1,44 @@ +package com.huoran.users.entity.req; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +@Data +public class AccountRegisterReq { + + @ApiModelProperty(value = "姓名,可不填写") + private String userName; + + @ApiModelProperty(value = "账号,可不填写") + private String account; + + @ApiModelProperty(value = "密码,可不填写") + private String password; + + @ApiModelProperty(value = "平台id,个人端默认为7",example = "7") + @NotNull(message = "请选择平台注册!") + private String platformId; + + @ApiModelProperty(value = "唯一标识账号") + @NotNull(message = "唯一标识不能为空!") + private String uniqueIdentification; + + @ApiModelProperty(value = "手机号") + @NotNull(message = "手机号不能为空") + private String phone; + + @ApiModelProperty(value = "邮箱") + private String email; + + @ApiModelProperty(value = "小程序openid") + private String appOpenId; + +// @ApiModelProperty(value = "意向省份") +// private Integer provinceId; +// +// @ApiModelProperty(value = "意向城市") +// private Integer cityId; + +} diff --git a/users/src/main/java/com/huoran/users/entity/req/AppletCallbackReq.java b/users/src/main/java/com/huoran/users/entity/req/AppletCallbackReq.java index 9a36107..a7ef609 100644 --- a/users/src/main/java/com/huoran/users/entity/req/AppletCallbackReq.java +++ b/users/src/main/java/com/huoran/users/entity/req/AppletCallbackReq.java @@ -1,7 +1,9 @@ package com.huoran.users.entity.req; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; + /** * @Author chen * @DATE 2022/7/12 15:03 @@ -9,6 +11,13 @@ import lombok.Data; */ @Data public class AppletCallbackReq { + + @ApiModelProperty("微信标识") private String code; + + @ApiModelProperty("头像地址") private String avatarUrl; + + @ApiModelProperty("平台标识,1职站,2数据平台,3中台,4合伙人,5幼儿园,6供应商,7个人端") + private Integer platform; } diff --git a/users/src/main/java/com/huoran/users/entity/vo/LoginVo.java b/users/src/main/java/com/huoran/users/entity/vo/LoginVo.java index ae78ace..5430d74 100644 --- a/users/src/main/java/com/huoran/users/entity/vo/LoginVo.java +++ b/users/src/main/java/com/huoran/users/entity/vo/LoginVo.java @@ -22,7 +22,7 @@ public class LoginVo { @NotEmpty(message = "验证码不能为空") private String code; - @ApiModelProperty("平台标识,1职站,2数据平台,3中台") + @ApiModelProperty("平台标识,1职站,2数据平台,3中台,4合伙人,5幼儿园,6供应商,7个人端") @NotNull(message = "登录平台不能为空") private Integer platform; diff --git a/users/src/main/java/com/huoran/users/mapper/HrUserInfoMapper.java b/users/src/main/java/com/huoran/users/mapper/HrUserInfoMapper.java index dec435a..a3f5c2f 100644 --- a/users/src/main/java/com/huoran/users/mapper/HrUserInfoMapper.java +++ b/users/src/main/java/com/huoran/users/mapper/HrUserInfoMapper.java @@ -1,6 +1,8 @@ package com.huoran.users.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.huoran.common.entity.UserAccount; +import com.huoran.common.entity.UserInfo; import com.huoran.common.entity.resp.PhoneBindingrResp; import com.huoran.users.entity.DataRole; import com.huoran.users.entity.HrUserAccount; @@ -54,4 +56,10 @@ public interface HrUserInfoMapper extends BaseMapper { List userBindingPhoneInfo(@Param("account") HrUserAccount account); ProfileDetailsRes personalFile(Integer userId); + + Integer selectAccount(@Param("phone") String phone,@Param("platformId") String platformId); + + int addUserInfo(UserInfo userInfo); + + int addUserAccount(UserAccount userAccount); } diff --git a/users/src/main/java/com/huoran/users/mapper/RoleMapper.java b/users/src/main/java/com/huoran/users/mapper/RoleMapper.java index 42d1108..79ffbf0 100644 --- a/users/src/main/java/com/huoran/users/mapper/RoleMapper.java +++ b/users/src/main/java/com/huoran/users/mapper/RoleMapper.java @@ -2,6 +2,7 @@ package com.huoran.users.mapper; import com.huoran.users.entity.Role; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; /** *

@@ -11,6 +12,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; * @author chen * @since 2021-09-29 */ +@Mapper public interface RoleMapper extends BaseMapper { Integer selectCustomerSuper(Integer id); diff --git a/users/src/main/java/com/huoran/users/mapper/xml/HrUserInfoMapper.xml b/users/src/main/java/com/huoran/users/mapper/xml/HrUserInfoMapper.xml index 7be8383..6575ad3 100644 --- a/users/src/main/java/com/huoran/users/mapper/xml/HrUserInfoMapper.xml +++ b/users/src/main/java/com/huoran/users/mapper/xml/HrUserInfoMapper.xml @@ -1,6 +1,22 @@ + + + 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}) + + + + + 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) + VALUES (#{userId}, #{account},#{phone}, #{password}, #{workNumber}, 0, #{platformId}, #{type}, + now(), now(),#{appOpenId}) +