From f64b93739b31da32f0f09c141e9947ae3c5ba982 Mon Sep 17 00:00:00 2001 From: cheney <1251790704@qq.com> Date: Tue, 19 Dec 2023 17:48:05 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E4=BF=A1=E6=81=AF=EF=BC=8C?= =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E5=9B=A2=E9=98=9F=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PlatformTeamAccountController.java | 31 ++++++++++ .../entity/PlatformTeamClassification.java | 36 ++++++++++++ .../nakadai/entity/req/AppletCallbackReq.java | 3 + .../huoran/nakadai/entity/req/TeamInfo.java | 58 +++++++++++++++++++ .../mapper/PlatformTeamAccountMapper.java | 3 + .../mapper/xml/PlatformTeamAccountMapper.xml | 5 ++ .../impl/PlatformTeamAccountServiceImpl.java | 27 +++++++-- .../controller/HrUserAccountController.java | 4 +- .../users/entity/EnterpriseCertification.java | 2 +- .../com/huoran/users/entity/HrUserInfo.java | 13 +++-- .../users/entity/res/OrganizationInfo.java | 29 ++++++++++ .../users/entity/res/UserInfoDetailsRes.java | 2 +- .../users/entity/res/UserInfoListRes.java | 3 + .../users/mapper/HrUserAccountMapper.java | 5 +- .../UserAuthenticationInformationMapper.java | 3 + .../users/mapper/xml/HrUserAccountMapper.xml | 25 +++++++- .../users/service/IHrUserAccountService.java | 2 +- .../impl/HrUserAccountServiceImpl.java | 51 ++++++++-------- 18 files changed, 260 insertions(+), 42 deletions(-) create mode 100644 nakadai/src/main/java/com/huoran/nakadai/entity/req/TeamInfo.java create mode 100644 users/src/main/java/com/huoran/users/entity/res/OrganizationInfo.java diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/PlatformTeamAccountController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/PlatformTeamAccountController.java index 668b269..9649304 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/PlatformTeamAccountController.java +++ b/nakadai/src/main/java/com/huoran/nakadai/controller/PlatformTeamAccountController.java @@ -17,6 +17,7 @@ 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.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.web.bind.annotation.*; @@ -179,6 +180,17 @@ public class PlatformTeamAccountController { // public R queryPartnerAccount(@RequestParam String phone) { // return platformTeamAccountService.queryPartnerAccount(phone); // } + @ApiOperation(value = "后台更新团队状态,禁用无法切换到该组织") + @PostMapping("/updateTeamStatus") + public R updateTeamStatus( + @RequestParam("teamId") @ApiParam(value = "团队id") Integer teamId, + @RequestParam("isEnable") @ApiParam(value = "是否禁用(1->禁用,0->启用)") Integer isEnable) { + PlatformTeamClassification platformTeamClassification = new PlatformTeamClassification(); + platformTeamClassification.setId(teamId); + platformTeamClassification.setIsEnable(isEnable); + boolean update = platformTeamClassificationService.updateById(platformTeamClassification); + return update? R.ok() : R.error(); + } //================================以下接口为小程序调用=================================== @ApiOperation(value = "幼教产品微信小程序回调登录") @@ -209,5 +221,24 @@ public class PlatformTeamAccountController { public R platformTeamAccountList(@RequestBody @Valid PlatformTeamAccountListReq req) { return platformTeamAccountService.pagePlatformTeamAccountList(req); } + + @ApiOperation(value = "小程序团队信息维护") + @PostMapping("/updateTeamInfo") + public R updateTeamInfo(@RequestBody TeamInfo teamInfo) { + PlatformTeamClassification platformTeamClassification = new PlatformTeamClassification(); + BeanUtils.copyProperties(teamInfo,platformTeamClassification); + boolean update = platformTeamClassificationService.updateById(platformTeamClassification); + return update? R.ok() : R.error(); + } + + @ApiOperation(value = "查询团队信息") + @GetMapping("/queryTeamInfo") + public R queryTeamInfo( + @ApiParam(value = "团队id") + @RequestParam("teamId") Integer teamId) { + PlatformTeamClassification teamInfo = platformTeamClassificationService.getById(teamId); + return R.ok().put("teamInfo",teamInfo); + } + } diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/PlatformTeamClassification.java b/nakadai/src/main/java/com/huoran/nakadai/entity/PlatformTeamClassification.java index d3ed032..42e6844 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/entity/PlatformTeamClassification.java +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/PlatformTeamClassification.java @@ -57,6 +57,42 @@ public class PlatformTeamClassification implements Serializable { @ApiModelProperty(value = "地址") private String address; + @ApiModelProperty(value = "是否禁用,默认为0,1为禁用") + private Integer isEnable; + + @ApiModelProperty(value = "slogan") + private String slogan; + + @ApiModelProperty(value = "province") + private String province; + + @ApiModelProperty(value = "city") + private String city; + + @ApiModelProperty(value = "picture_url") + private String pictureUrl; + + @ApiModelProperty(value = "qrCode_one_name") + private String qrCodeOneName; + + @ApiModelProperty(value = "qrCode_one_url") + private String qrCodeOneUrl; + + @ApiModelProperty(value = "qrCode_two_name") + private String qrCodeTwoName; + + @ApiModelProperty(value = "qrCode_two_url") + private String qrCodeTwoUrl; + + @ApiModelProperty(value = "qrCode_three_name") + private String qrCodeThreeName; + + @ApiModelProperty(value = "qrCode_three_name") + private String qrCodeThreeUrl; + + @ApiModelProperty(value = "qrCode_three_name") + private String phone; + @ApiModelProperty(value = "简介") private String briefIntroduction; 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 index 8d23a23..7dab0cc 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/entity/req/AppletCallbackReq.java +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/req/AppletCallbackReq.java @@ -25,4 +25,7 @@ public class AppletCallbackReq { @ApiModelProperty("手机号") private String phone; + + @ApiModelProperty("申请组织名称") + private String organizationName; } diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/req/TeamInfo.java b/nakadai/src/main/java/com/huoran/nakadai/entity/req/TeamInfo.java new file mode 100644 index 0000000..d5484f5 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/req/TeamInfo.java @@ -0,0 +1,58 @@ +package com.huoran.nakadai.entity.req; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +public class TeamInfo { + + @ApiModelProperty(value = "团队id") + private Integer id; + + @ApiModelProperty(value = "团队名称") + private String classificationName; + + @ApiModelProperty(value = "logo_url") + private String logo_url; + + @ApiModelProperty(value = "地址") + private String address; + + @ApiModelProperty(value = "简介") + private String briefIntroduction; + + @ApiModelProperty(value = "slogan") + private String slogan; + + @ApiModelProperty(value = "province") + private String province; + + @ApiModelProperty(value = "city") + private String city; + + @ApiModelProperty(value = "picture_url") + private String pictureUrl; + + @ApiModelProperty(value = "qrCode_one_name") + private String qrCodeOneName; + + @ApiModelProperty(value = "qrCode_one_url") + private String qrCodeOneUrl; + + @ApiModelProperty(value = "qrCode_two_name") + private String qrCodeTwoName; + + @ApiModelProperty(value = "qrCode_two_url") + private String qrCodeTwoUrl; + + @ApiModelProperty(value = "qrCode_three_name") + private String qrCodeThreeName; + + @ApiModelProperty(value = "qrCode_three_name") + private String qrCodeThreeUrl; + + @ApiModelProperty(value = "phone") + private String phone; +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/PlatformTeamAccountMapper.java b/nakadai/src/main/java/com/huoran/nakadai/mapper/PlatformTeamAccountMapper.java index 66b38fc..54cf0b6 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/mapper/PlatformTeamAccountMapper.java +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/PlatformTeamAccountMapper.java @@ -12,6 +12,7 @@ import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.ArrayList; +import java.util.Date; import java.util.List; /** @@ -36,4 +37,6 @@ public interface PlatformTeamAccountMapper extends BaseMapper selectTeamIdByClassificationId(@Param("classificationId")String classificationId); IPage pagePlatformTeamAccountList(Page page, PlatformTeamAccountListReq req); + + void updateUserInfo(@Param("userId")Integer userId); } 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 index d593b46..ae2240b 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/PlatformTeamAccountMapper.xml +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/PlatformTeamAccountMapper.xml @@ -1,6 +1,11 @@ + + UPDATE hr_user_info + SET last_login_time = now(), login_number = login_number + 1 + WHERE user_id = #{userId} + + UPDATE hr_user_account diff --git a/users/src/main/java/com/huoran/users/service/IHrUserAccountService.java b/users/src/main/java/com/huoran/users/service/IHrUserAccountService.java index 95afb34..3aba07a 100644 --- a/users/src/main/java/com/huoran/users/service/IHrUserAccountService.java +++ b/users/src/main/java/com/huoran/users/service/IHrUserAccountService.java @@ -85,5 +85,5 @@ public interface IHrUserAccountService extends IService { R studentAccountApplication(RegisterReq registerReq); - UserInfoDetailsRes viewUserDetails(Integer userId); + UserInfoDetailsRes viewUserDetails(String openId); } diff --git a/users/src/main/java/com/huoran/users/service/impl/HrUserAccountServiceImpl.java b/users/src/main/java/com/huoran/users/service/impl/HrUserAccountServiceImpl.java index 886b850..700a756 100644 --- a/users/src/main/java/com/huoran/users/service/impl/HrUserAccountServiceImpl.java +++ b/users/src/main/java/com/huoran/users/service/impl/HrUserAccountServiceImpl.java @@ -23,10 +23,7 @@ import com.huoran.users.entity.*; import com.huoran.users.entity.req.*; import com.huoran.users.entity.res.*; import com.huoran.users.entity.vo.CheckVo; -import com.huoran.users.mapper.EnterpriseCertificationMapper; -import com.huoran.users.mapper.HrPersonalFileMapper; -import com.huoran.users.mapper.HrUserAccountMapper; -import com.huoran.users.mapper.HrUserInfoMapper; +import com.huoran.users.mapper.*; import com.huoran.users.service.IHrUserAccountService; import com.huoran.users.service.PlatformLoginService; import org.apache.commons.lang3.StringUtils; @@ -60,6 +57,9 @@ public class HrUserAccountServiceImpl extends ServiceImpl list = hrUserAccountMapper.pageByCondition(userInfoReq); - Integer totalCount = hrUserAccountMapper.pageByConditionNum(userInfoReq).size(); - - return R.ok().put("page", list).put("total", totalCount); + Page page = new Page<>(userInfoReq.getPageNum(), userInfoReq.getPageSize()); + IPage pageList = hrUserAccountMapper.pageByCondition(page, userInfoReq); + return R.ok().put("page", pageList); } @Override @@ -404,29 +402,34 @@ public class HrUserAccountServiceImpl extends ServiceImpl() - .eq("user_id", userId)); + List userAccountList = hrUserAccountMapper.selectList(new QueryWrapper() + .eq("app_open_id", openId)); - HrUserAccount parameter = new HrUserAccount(); - if (userAccount.getPhone() == null || userAccount.getPhone().equals("")) { - parameter.setUserId(hrUserInfo.getUserId()); - } else { - parameter.setPhone(userAccount.getPhone()); + //查询用户信息 + HrUserInfo hrUserInfo = hrUserInfoMapper.selectByUserId(userAccountList.get(0).getUserId()); + hrUserInfo.setPhone(userAccountList.get(0).getPhone()); + hrUserInfo.setAuthentication("未认证"); + + UserAuthenticationInformation authenticationInformation = userAuthenticationInformationMapper.selectOne( + new QueryWrapper().eq("open_id", openId)); + if (authenticationInformation!= null){ + hrUserInfo.setUserName(authenticationInformation.getRealName()); + hrUserInfo.setAuthentication("已认证"); + hrUserInfo.setIdNumber(authenticationInformation.getIdCardNo()); } + String accounts = userAccountList.stream() + .map(hrUserAccount -> hrUserAccount.getId().toString()) + .collect(Collectors.joining(",")); - List enterpriseCertificationList = enterpriseCertificationMapper.selectList( - new QueryWrapper().eq("account_id", userAccount.getId())); + List organizationInfoList = baseMapper.selectOrganizationInfo(accounts); res.setHrUserInfo(hrUserInfo); - res.setEnterpriseCertificationList(enterpriseCertificationList); - res.setUserAccount(userAccount); + res.setOrganizationInfoList(organizationInfoList); + res.setUserAccountList(userAccountList); return res; }