main
rong.liu 11 months ago
parent 4079690f2d
commit ce0b3b1b42
  1. 66
      nakadai/src/main/java/com/huoran/nakadai/controller/PlatformTeamAccountController.java
  2. 9
      nakadai/src/main/java/com/huoran/nakadai/entity/EnterpriseCertification.java
  3. 6
      nakadai/src/main/java/com/huoran/nakadai/entity/req/EnterpriseCertificationLIstReq.java
  4. 8
      nakadai/src/main/java/com/huoran/nakadai/entity/req/TeamInfo.java
  5. 35
      nakadai/src/main/java/com/huoran/nakadai/entity/vo/TeamClassificationVO.java
  6. 7
      nakadai/src/main/java/com/huoran/nakadai/mapper/PlatformTeamMapper.java
  7. 2
      nakadai/src/main/java/com/huoran/nakadai/mapper/SupplierClassificationConfigMapper.java
  8. 10
      nakadai/src/main/java/com/huoran/nakadai/mapper/xml/EnterpriseCertificationMapper.xml
  9. 28
      nakadai/src/main/java/com/huoran/nakadai/mapper/xml/PlatformTeamMapper.xml
  10. 3
      nakadai/src/main/java/com/huoran/nakadai/mapper/xml/SupplierClassificationConfigMapper.xml
  11. 8
      nakadai/src/main/java/com/huoran/nakadai/service/PlatformTeamService.java
  12. 3
      nakadai/src/main/java/com/huoran/nakadai/service/SupplierClassificationConfigService.java
  13. 12
      nakadai/src/main/java/com/huoran/nakadai/service/impl/PlatformTeamServiceImpl.java
  14. 4
      nakadai/src/main/java/com/huoran/nakadai/service/impl/SupplierClassificationConfigServiceImpl.java

@ -6,12 +6,16 @@ import com.huoran.common.exception.CustomException;
import com.huoran.common.exception.ExceptionEnum; import com.huoran.common.exception.ExceptionEnum;
import com.huoran.common.response.R; import com.huoran.common.response.R;
import com.huoran.common.utils.TokenUtils; import com.huoran.common.utils.TokenUtils;
import com.huoran.nakadai.entity.*; import com.huoran.nakadai.entity.PlatformTeam;
import com.huoran.nakadai.entity.PlatformTeamClassification;
import com.huoran.nakadai.entity.req.*; import com.huoran.nakadai.entity.req.*;
import com.huoran.nakadai.entity.res.PartnerAccountResp; import com.huoran.nakadai.entity.res.PartnerAccountResp;
import com.huoran.nakadai.entity.res.PlatformTeamAccountResp; import com.huoran.nakadai.entity.res.PlatformTeamAccountResp;
import com.huoran.nakadai.entity.vo.TeamMemberVo; import com.huoran.nakadai.entity.vo.TeamClassificationVO;
import com.huoran.nakadai.service.*; import com.huoran.nakadai.service.PlatformTeamAccountService;
import com.huoran.nakadai.service.PlatformTeamClassificationService;
import com.huoran.nakadai.service.PlatformTeamService;
import com.huoran.nakadai.service.SupplierClassificationConfigService;
import com.huoran.nakadai.utils.GenerateCodeUtil; import com.huoran.nakadai.utils.GenerateCodeUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -25,6 +29,7 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid; import javax.validation.Valid;
import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects; import java.util.Objects;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
@ -51,15 +56,16 @@ public class PlatformTeamAccountController {
@Autowired @Autowired
public PlatformTeamClassificationService platformTeamClassificationService; public PlatformTeamClassificationService platformTeamClassificationService;
@Autowired
public SupplierClassificationConfigService supplierClassificationConfigService;
@Autowired @Autowired
private RedisTemplate<String, String> redisTemplate; private RedisTemplate<String, String> redisTemplate;
@PostMapping("/generateInvitationCode") @PostMapping("/generateInvitationCode")
@ApiOperation(value = "生成不同平台专属邀请码") @ApiOperation(value = "生成不同平台专属邀请码")
public R generateInvitationCode( public R generateInvitationCode(@ApiParam(name = "platformId", value = "平台id", required = true) @RequestParam("platformId") String platformId, HttpServletRequest request) {
@ApiParam(name = "platformId", value = "平台id", required = true)
@RequestParam("platformId") String platformId,HttpServletRequest request) {
//平台唯一标识码 //平台唯一标识码
String uniqueIdentification = platformId + TokenUtils.getIdByJwtToken(request) + "kindergartenInvitationCode"; String uniqueIdentification = platformId + TokenUtils.getIdByJwtToken(request) + "kindergartenInvitationCode";
//存在直接返回邀请码 //存在直接返回邀请码
@ -75,9 +81,7 @@ public class PlatformTeamAccountController {
@ApiOperation(value = "平台邀请二维码生成") @ApiOperation(value = "平台邀请二维码生成")
@GetMapping(value = "/generationQrCode", produces = "image/png") @GetMapping(value = "/generationQrCode", produces = "image/png")
public void generationQrCode( public void generationQrCode(@ApiParam(name = "url", value = "链接", required = true) @RequestParam String url, HttpServletResponse response) {
@ApiParam(name = "url", value = "链接", required = true)
@RequestParam String url, HttpServletResponse response){
platformTeamAccountService.generationQrCode(url, response); platformTeamAccountService.generationQrCode(url, response);
} }
@ -145,11 +149,7 @@ public class PlatformTeamAccountController {
@GetMapping("/removeOrganization") @GetMapping("/removeOrganization")
@ApiOperation(value = "移除组织") @ApiOperation(value = "移除组织")
public R removeOrganization( public R removeOrganization(@ApiParam(name = "teamId", value = "团队id") @RequestParam Integer teamId, @ApiParam(name = "manageId", value = "组织id") @RequestParam Integer manageId) {
@ApiParam(name = "teamId", value = "团队id")
@RequestParam Integer teamId,
@ApiParam(name = "manageId", value = "组织id")
@RequestParam Integer manageId) {
PlatformTeamClassification teamClassification = platformTeamClassificationService.getById(teamId); PlatformTeamClassification teamClassification = platformTeamClassificationService.getById(teamId);
if (teamClassification.getIsTeam() == 1) { if (teamClassification.getIsTeam() == 1) {
throw new CustomException(ExceptionEnum.PARTNER_REMOVAL); throw new CustomException(ExceptionEnum.PARTNER_REMOVAL);
@ -158,17 +158,13 @@ public class PlatformTeamAccountController {
platformTeamClassificationService.removeById(teamId); platformTeamClassificationService.removeById(teamId);
//TODO 删除该团队相关角色信息 //TODO 删除该团队相关角色信息
platformTeamAccountService.removeById(manageId); platformTeamAccountService.removeById(manageId);
boolean remove = platformTeamService.remove(new QueryWrapper<PlatformTeam>(). boolean remove = platformTeamService.remove(new QueryWrapper<PlatformTeam>().eq("manage_id", manageId).eq("classification_id", teamId));
eq("manage_id", manageId).
eq("classification_id", teamId));
return remove ? R.ok() : R.error(); return remove ? R.ok() : R.error();
} }
@ApiOperation(value = "后台更新团队状态,禁用无法查询到该组织") @ApiOperation(value = "后台更新团队状态,禁用无法查询到该组织")
@PostMapping("/updateTeamStatus") @PostMapping("/updateTeamStatus")
public R updateTeamStatus( public R updateTeamStatus(@RequestParam("teamId") @ApiParam(value = "团队id") Integer teamId, @RequestParam("isEnable") @ApiParam(value = "是否禁用(1->禁用,0->启用)") Integer isEnable) {
@RequestParam("teamId") @ApiParam(value = "团队id") Integer teamId,
@RequestParam("isEnable") @ApiParam(value = "是否禁用(1->禁用,0->启用)") Integer isEnable) {
PlatformTeamClassification platformTeamClassification = new PlatformTeamClassification(); PlatformTeamClassification platformTeamClassification = new PlatformTeamClassification();
platformTeamClassification.setId(teamId); platformTeamClassification.setId(teamId);
platformTeamClassification.setIsEnable(isEnable); platformTeamClassification.setIsEnable(isEnable);
@ -193,9 +189,7 @@ public class PlatformTeamAccountController {
@ApiOperation(value = "获取当前平台用户的团队信息", response = PartnerAccountResp.class) @ApiOperation(value = "获取当前平台用户的团队信息", response = PartnerAccountResp.class)
@GetMapping("/getTeamsByPlatformId") @GetMapping("/getTeamsByPlatformId")
public R getTeamsByPlatformId( public R getTeamsByPlatformId(@ApiParam(name = "platformId", value = "平台id") @RequestParam Integer platformId, HttpServletRequest request) {
@ApiParam(name = "platformId", value = "平台id")
@RequestParam Integer platformId,HttpServletRequest request) {
String accountId = TokenUtils.getIdByJwtToken(request); String accountId = TokenUtils.getIdByJwtToken(request);
return platformTeamAccountService.getTeamsByPlatformId(accountId, platformId); return platformTeamAccountService.getTeamsByPlatformId(accountId, platformId);
} }
@ -211,17 +205,35 @@ public class PlatformTeamAccountController {
public R updateTeamInfo(@RequestBody TeamInfo teamInfo) { public R updateTeamInfo(@RequestBody TeamInfo teamInfo) {
PlatformTeamClassification platformTeamClassification = new PlatformTeamClassification(); PlatformTeamClassification platformTeamClassification = new PlatformTeamClassification();
BeanUtils.copyProperties(teamInfo, platformTeamClassification); BeanUtils.copyProperties(teamInfo, platformTeamClassification);
// 供应商角色下编辑分类
// 查询供应商的分类信息(只有当前团队为供应商才有supplierClassification数据)
Integer accountId = platformTeamService.getAccountIdByTeamId(teamInfo.getId());
//删除原有分类重新新增分类配置信息
supplierClassificationConfigService.deleteByAccountId(accountId);
//设置分类配置信息中的accountId
teamInfo.getSupplierClassificationConfigs().forEach(config -> config.setAccountId(accountId));
//新增分类配置信息
supplierClassificationConfigService.saveBatch(teamInfo.getSupplierClassificationConfigs());
boolean update = platformTeamClassificationService.updateById(platformTeamClassification); boolean update = platformTeamClassificationService.updateById(platformTeamClassification);
return update ?R.ok():R.error(); return update ?R.ok():R.error();
} }
@ApiOperation(value = "查询团队信息") @ApiOperation(value = "查询团队信息")
@GetMapping("/queryTeamInfo") @GetMapping("/queryTeamInfo")
public R queryTeamInfo( public R queryTeamInfo(@ApiParam(value = "团队id") @RequestParam("teamId") Integer teamId) {
@ApiParam(value = "团队id")
@RequestParam("teamId") Integer teamId) {
PlatformTeamClassification teamInfo = platformTeamClassificationService.getById(teamId); PlatformTeamClassification teamInfo = platformTeamClassificationService.getById(teamId);
return R.ok().put("teamInfo",teamInfo); //查询供应商的分类信息(只有当前团队为供应商才有supplierClassification数据)
List<TeamClassificationVO> supplierClassification = platformTeamService.getTeamClassificationVOByTeamId(teamId);
return R.ok().put("teamInfo", teamInfo).put("supplierClassification", supplierClassification);
} }
@PostMapping("/inviteJoinOrganization") @PostMapping("/inviteJoinOrganization")

@ -129,4 +129,13 @@ public class EnterpriseCertification implements Serializable {
@ApiModelProperty(value = "微信唯一标识") @ApiModelProperty(value = "微信唯一标识")
private String openId; private String openId;
@ApiModelProperty(value = "供应商分类id")
@TableField(exist = false)
private Integer supplierClassificationId;
@ApiModelProperty(value = "供应商分类名称")
@TableField(exist = false)
private String supplierClassificationName;
} }

@ -47,6 +47,12 @@ public class EnterpriseCertificationLIstReq {
@ApiModelProperty(value = "市") @ApiModelProperty(value = "市")
private String city; private String city;
@ApiModelProperty(value = "供应商分类id")
private Integer supplierClassificationId;
/*@ApiModelProperty(value = "供应商分类名称")
private String supplierClassificationName;*/
@ApiModelProperty(value = "当前页数", name = "pageNum", example = "1", required = true) @ApiModelProperty(value = "当前页数", name = "pageNum", example = "1", required = true)
private Integer pageNum; private Integer pageNum;
@ApiModelProperty(value = "当前页需要显示的数量", name = "pageSize", example = "10", required = true) @ApiModelProperty(value = "当前页需要显示的数量", name = "pageSize", example = "10", required = true)

@ -1,10 +1,11 @@
package com.huoran.nakadai.entity.req; package com.huoran.nakadai.entity.req;
import com.baomidou.mybatisplus.annotation.IdType; import com.huoran.nakadai.entity.SupplierClassificationConfig;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.List;
@Data @Data
public class TeamInfo { public class TeamInfo {
@ -55,4 +56,7 @@ public class TeamInfo {
@ApiModelProperty(value = "phone") @ApiModelProperty(value = "phone")
private String phone; private String phone;
@ApiModelProperty(value = "供应商分类配置")
private List<SupplierClassificationConfig> supplierClassificationConfigs;
} }

@ -0,0 +1,35 @@
package com.huoran.nakadai.entity.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* <p>
* 幼教产业团队账号与分类中间表
* </p>
*
* @author chen
* @since 2023-12-12
*/
@Data
public class TeamClassificationVO {
@ApiModelProperty(value = "团队id")
private Integer teamId;
@ApiModelProperty(value = "账户id")
private Integer accountId;
@ApiModelProperty(value = "供应商分类id")
private Integer supplierClassificationId;
@ApiModelProperty(value = "供应商分类名称")
private String supplierClassificationName;
@ApiModelProperty(value = "供应商分类配置id")
private Integer classificationConfigId;
}

@ -2,7 +2,11 @@ package com.huoran.nakadai.mapper;
import com.huoran.nakadai.entity.PlatformTeam; import com.huoran.nakadai.entity.PlatformTeam;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.huoran.nakadai.entity.vo.TeamClassificationVO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* <p> * <p>
@ -14,5 +18,8 @@ import org.apache.ibatis.annotations.Mapper;
*/ */
@Mapper @Mapper
public interface PlatformTeamMapper extends BaseMapper<PlatformTeam> { public interface PlatformTeamMapper extends BaseMapper<PlatformTeam> {
List<TeamClassificationVO> getTeamClassificationVOByTeamId(@Param("teamId") Integer teamId);
Integer getAccountIdByTeamId(@Param("teamId") Integer teamId);
} }

@ -2,6 +2,7 @@ package com.huoran.nakadai.mapper;
import com.huoran.nakadai.entity.SupplierClassificationConfig; import com.huoran.nakadai.entity.SupplierClassificationConfig;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
/** /**
* <p> * <p>
@ -13,4 +14,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/ */
public interface SupplierClassificationConfigMapper extends BaseMapper<SupplierClassificationConfig> { public interface SupplierClassificationConfigMapper extends BaseMapper<SupplierClassificationConfig> {
boolean deleteByAccountId(@Param("accountId") Integer accountId);
} }

@ -46,7 +46,9 @@
cla.id AS teamId, cla.id AS teamId,
logo_url, logo_url,
brief_introduction, brief_introduction,
cla.create_time as organizationCreationTime cla.create_time AS organizationCreationTime,
cc.classification_id as supplierClassificationId,
sc.classification_name as supplierClassificationName
FROM FROM
hr_enterprise_certification c hr_enterprise_certification c
INNER JOIN hr_user_account a ON a.id = c.account_id INNER JOIN hr_user_account a ON a.id = c.account_id
@ -55,6 +57,8 @@
LEFT JOIN k_platform_team_account ta ON ta.account_id = a.id LEFT JOIN k_platform_team_account ta ON ta.account_id = a.id
LEFT JOIN k_platform_team t ON ta.manage_id = t.manage_id LEFT JOIN k_platform_team t ON ta.manage_id = t.manage_id
LEFT JOIN k_platform_team_classification cla ON cla.id = t.classification_id LEFT JOIN k_platform_team_classification cla ON cla.id = t.classification_id
LEFT JOIN supplier_classification_config cc ON cc.account_id = c.account_id
LEFT JOIN supplier_classification sc ON sc.id = cc.classification_id
AND is_team = 1 AND is_team = 1
AND cla.is_del = 0 AND cla.is_del = 0
WHERE WHERE
@ -64,6 +68,10 @@
WHERE WHERE
t.platform_source = #{req.platformSource} t.platform_source = #{req.platformSource}
<if test=" req.supplierClassificationId!= null">
and t.supplierClassificationId =#{req.supplierClassificationId}
</if>
<if test=" req.auditStatus!= null and req.auditStatus!= '' or req.auditStatus ==0"> <if test=" req.auditStatus!= null and req.auditStatus!= '' or req.auditStatus ==0">
and t.audit_status =#{req.auditStatus,jdbcType=INTEGER} and t.audit_status =#{req.auditStatus,jdbcType=INTEGER}

@ -2,4 +2,32 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.huoran.nakadai.mapper.PlatformTeamMapper"> <mapper namespace="com.huoran.nakadai.mapper.PlatformTeamMapper">
<select id="getTeamClassificationVOByTeamId"
resultType="com.huoran.nakadai.entity.vo.TeamClassificationVO">
SELECT
ta.account_id AS accountId,
sc.classification_name AS supplierClassificationName,
sc.id AS supplierClassificationId,
t.id AS teamId,
cc.id AS classificationConfigId
FROM
k_platform_team t
INNER JOIN k_platform_team_account ta ON ta.manage_id = t.manage_id
INNER JOIN k_platform_team_classification c ON c.id = t.classification_id
INNER JOIN supplier_classification_config cc ON cc.account_id = ta.account_id
INNER JOIN supplier_classification sc ON sc.id = cc.classification_id
WHERE t.id = #{teamId} AND ta.platform_id = 6
</select>
<select id="getAccountIdByTeamId" resultType="java.lang.Integer">
SELECT
ta.account_id
FROM
k_platform_team t
INNER JOIN k_platform_team_account ta ON ta.manage_id = t.manage_id
INNER JOIN k_platform_team_classification c ON c.id = t.classification_id
WHERE
t.classification_id = #{teamId}
AND is_team = 1
</select>
</mapper> </mapper>

@ -2,4 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.huoran.nakadai.mapper.SupplierClassificationConfigMapper"> <mapper namespace="com.huoran.nakadai.mapper.SupplierClassificationConfigMapper">
<delete id="deleteByAccountId">
DELETE from supplier_classification_config WHERE account_id = #{accountId}
</delete>
</mapper> </mapper>

@ -1,7 +1,10 @@
package com.huoran.nakadai.service; package com.huoran.nakadai.service;
import com.huoran.nakadai.entity.PlatformTeam;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.huoran.nakadai.entity.PlatformTeam;
import com.huoran.nakadai.entity.vo.TeamClassificationVO;
import java.util.List;
/** /**
* <p> * <p>
@ -12,5 +15,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
* @since 2023-12-12 * @since 2023-12-12
*/ */
public interface PlatformTeamService extends IService<PlatformTeam> { public interface PlatformTeamService extends IService<PlatformTeam> {
List<TeamClassificationVO> getTeamClassificationVOByTeamId(Integer teamId);
//根据团队id获取团队负责人账号id
Integer getAccountIdByTeamId(Integer teamId);
} }

@ -12,5 +12,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
* @since 2023-12-27 * @since 2023-12-27
*/ */
public interface SupplierClassificationConfigService extends IService<SupplierClassificationConfig> { public interface SupplierClassificationConfigService extends IService<SupplierClassificationConfig> {
//删除用户的供应商配置信息
boolean deleteByAccountId(Integer accountId);
} }

@ -1,11 +1,14 @@
package com.huoran.nakadai.service.impl; package com.huoran.nakadai.service.impl;
import com.huoran.nakadai.entity.PlatformTeam; import com.huoran.nakadai.entity.PlatformTeam;
import com.huoran.nakadai.entity.vo.TeamClassificationVO;
import com.huoran.nakadai.mapper.PlatformTeamMapper; import com.huoran.nakadai.mapper.PlatformTeamMapper;
import com.huoran.nakadai.service.PlatformTeamService; import com.huoran.nakadai.service.PlatformTeamService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
/** /**
* <p> * <p>
* 幼教产业团队账号与分类中间表 服务实现类 * 幼教产业团队账号与分类中间表 服务实现类
@ -17,4 +20,13 @@ import org.springframework.stereotype.Service;
@Service @Service
public class PlatformTeamServiceImpl extends ServiceImpl<PlatformTeamMapper, PlatformTeam> implements PlatformTeamService { public class PlatformTeamServiceImpl extends ServiceImpl<PlatformTeamMapper, PlatformTeam> implements PlatformTeamService {
@Override
public List<TeamClassificationVO> getTeamClassificationVOByTeamId(Integer teamId) {
return baseMapper.getTeamClassificationVOByTeamId(teamId);
}
@Override
public Integer getAccountIdByTeamId(Integer teamId) {
return baseMapper.getAccountIdByTeamId(teamId);
}
} }

@ -17,4 +17,8 @@ import org.springframework.stereotype.Service;
@Service @Service
public class SupplierClassificationConfigServiceImpl extends ServiceImpl<SupplierClassificationConfigMapper, SupplierClassificationConfig> implements SupplierClassificationConfigService { public class SupplierClassificationConfigServiceImpl extends ServiceImpl<SupplierClassificationConfigMapper, SupplierClassificationConfig> implements SupplierClassificationConfigService {
@Override
public boolean deleteByAccountId(Integer accountId) {
return baseMapper.deleteByAccountId(accountId);
}
} }

Loading…
Cancel
Save