Merge remote-tracking branch 'origin/main'

# Conflicts:
#	nakadai/src/main/java/com/huoran/nakadai/controller/AliRealNameAuthenticationController.java
main
cheney 11 months ago
commit 84cc1e9b61
  1. 12
      competition/src/main/java/com/huoran/competition/controller/CompetitionController.java
  2. 115
      competition/src/main/java/com/huoran/competition/controller/CompetitionRegistrationController.java
  3. 8
      competition/src/main/java/com/huoran/competition/entity/CompetitionRegistration.java
  4. 4
      competition/src/main/java/com/huoran/competition/entity/req/AfterLoginPageCompetitionListReq.java
  5. 17
      competition/src/main/java/com/huoran/competition/entity/req/PageRegistrationStaffReq.java
  6. 48
      competition/src/main/java/com/huoran/competition/entity/vo/RegistrationNewInformationBroughtOutVO.java
  7. 59
      competition/src/main/java/com/huoran/competition/entity/vo/RegistrationVO.java
  8. 2
      competition/src/main/java/com/huoran/competition/mapper/CompetitionMapper.java
  9. 6
      competition/src/main/java/com/huoran/competition/mapper/CompetitionRegistrationMapper.java
  10. 16
      competition/src/main/java/com/huoran/competition/mapper/xml/CompetitionMapper.xml
  11. 175
      competition/src/main/java/com/huoran/competition/mapper/xml/CompetitionRegistrationMapper.xml
  12. 7
      competition/src/main/java/com/huoran/competition/service/CompetitionRegistrationService.java
  13. 3
      competition/src/main/java/com/huoran/competition/service/CompetitionService.java
  14. 118
      competition/src/main/java/com/huoran/competition/service/impl/CompetitionRegistrationServiceImpl.java
  15. 5
      competition/src/main/java/com/huoran/competition/service/impl/CompetitionServiceImpl.java
  16. 6
      nakadai/src/main/java/com/huoran/nakadai/controller/AliRealNameAuthenticationController.java
  17. 1
      nakadai/src/main/java/com/huoran/nakadai/controller/EnterpriseCertificationController.java
  18. 32
      nakadai/src/main/java/com/huoran/nakadai/controller/PlatformTeamAccountController.java
  19. 2
      nakadai/src/main/java/com/huoran/nakadai/service/impl/EnterpriseCertificationServiceImpl.java

@ -2,20 +2,16 @@ package com.huoran.competition.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.huoran.api.NakadaiClient;
import com.huoran.api.UserClient;
import com.huoran.common.aop.annotation.NoRepeatSubmit;
import com.huoran.common.constant.DelConstant;
import com.huoran.common.response.R;
import com.huoran.common.utils.TokenUtils;
import com.huoran.competition.entity.*;
import com.huoran.competition.entity.req.AfterLoginPageCompetitionListReq;
import com.huoran.competition.entity.req.CompetitionDetailReq;
import com.huoran.competition.entity.req.DisableEnableCompetitionReq;
import com.huoran.competition.entity.req.PageCompetitionListReq;
import com.huoran.competition.entity.vo.CompetitionDetailsVO;
import com.huoran.competition.entity.vo.CompetitionVO;
import com.huoran.competition.service.*;
import com.huoran.competition.service.impl.CompetitionContentServiceImpl;
@ -32,7 +28,6 @@ import java.util.Date;
import java.util.List;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
/**
* <p>
@ -162,8 +157,6 @@ public class CompetitionController {
competition.setApplicantNum(competitionRegistrationService.registrationPopulation(competitionId));
if (registration != null) {
CompetitionTeam team = competitionTeamService.getById(registration.getTeamId());
if (team != null) {
@ -324,6 +317,10 @@ public class CompetitionController {
if (!ObjectUtils.isEmpty(accountId)) {
pageCompetitionListReq.setSchoolId(schoolId);
pageCompetitionListReq.setAccountId(Integer.valueOf(accountId));
Integer role = Integer.valueOf(competitionService.queryRole(accountId));
if (!ObjectUtils.isEmpty(role)) {
pageCompetitionListReq.setRole(role);
}
}
Future<IPage<CompetitionVO>> pageFuture = competitionService.competitionAfterLogin(pageCompetitionListReq);
IPage<CompetitionVO> pageList = pageFuture.get();
@ -331,7 +328,6 @@ public class CompetitionController {
}
@ApiOperation(value = "获取当前时间")
@GetMapping("/getCurrentTime")
public R getCurrentTime() {

@ -1,17 +1,20 @@
package com.huoran.competition.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.huoran.common.aop.annotation.NoRepeatSubmit;
import com.huoran.common.response.R;
import com.huoran.common.utils.TokenUtils;
import com.huoran.competition.entity.CompetitionRegistration;
import com.huoran.competition.entity.req.PageRegistrationStaffReq;
import com.huoran.competition.entity.vo.RegistrationNewInformationBroughtOutVO;
import com.huoran.competition.entity.vo.RegistrationVO;
import com.huoran.competition.service.CompetitionRegistrationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
@ -34,14 +37,11 @@ public class CompetitionRegistrationController {
@Autowired
private CompetitionRegistrationService competitionRegistrationService;
@NoRepeatSubmit
@ApiOperation(value = "是否禁用报名人员")
@PutMapping("/disableRegistration")
public R disableRegistration(
@ApiParam(name = "competitionRegistrationId", value = "报名人员id", required = true)
@RequestParam Integer competitionRegistrationId,
@ApiParam(name = "isDisable", value = "是否禁用", required = true)
@RequestParam Integer isDisable) {
public R disableRegistration(@ApiParam(name = "competitionRegistrationId", value = "报名人员id", required = true) @RequestParam Integer competitionRegistrationId, @ApiParam(name = "isDisable", value = "是否禁用", required = true) @RequestParam Integer isDisable) {
CompetitionRegistration competitionRegistration = new CompetitionRegistration();
competitionRegistration.setId(competitionRegistrationId);
competitionRegistration.setIsDisable(isDisable);
@ -52,9 +52,7 @@ public class CompetitionRegistrationController {
@NoRepeatSubmit
@ApiOperation(value = "个人活动报名")
@PostMapping("/individualEventRegistration")
public R individualEventRegistration(
@ApiParam(name = "competitionRegistration", value = "报名人员对象", required = true)
@RequestBody CompetitionRegistration competitionRegistration, HttpServletRequest request) {
public R individualEventRegistration(@ApiParam(name = "competitionRegistration", value = "报名人员对象", required = true) @RequestBody CompetitionRegistration competitionRegistration, HttpServletRequest request) {
if (competitionRegistration.getAccountId() == null) {
String accountId = TokenUtils.getIdByJwtToken(request);
competitionRegistration.setAccountId(Integer.valueOf(accountId));
@ -63,10 +61,9 @@ public class CompetitionRegistrationController {
}
@ApiOperation(value = "报名人员分页条件查询", response = RegistrationVO.class)
@ApiOperation(value = "报名人员列表", response = RegistrationVO.class)
@PostMapping("/queryRegistrationByCondition")
public R registrationPageList(
@RequestBody PageRegistrationStaffReq req, HttpServletRequest request) {
public R registrationPageList(@RequestBody PageRegistrationStaffReq req, HttpServletRequest request) {
String accountId = TokenUtils.getIdByJwtToken(request);
return competitionRegistrationService.registrationPageConditionQuery(req);
}
@ -74,9 +71,7 @@ public class CompetitionRegistrationController {
@ApiOperation(value = "批量禁用人员参赛")
@PutMapping("/disableContests")
public R disableContests(
@ApiParam(name = "ids", value = "多个id", required = true)
@RequestParam("ids") List<String> ids) {
public R disableContests(@ApiParam(name = "ids", value = "多个id", required = true) @RequestParam("ids") List<String> ids) {
if (ids != null && ids.size() != 0) {
boolean delete = competitionRegistrationService.disableContests(ids);
return delete ? R.ok() : R.error();
@ -87,9 +82,7 @@ public class CompetitionRegistrationController {
@ApiOperation(value = "导出全部数据", response = RegistrationVO.class)
@GetMapping("/excelExport")
public void excelExport(
@ApiParam(name = "competitionId", value = "活动ID", required = true)
@RequestParam("competitionId") String competitionId, HttpServletResponse response) {
public void excelExport(@ApiParam(name = "competitionId", value = "活动ID", required = true) @RequestParam("competitionId") String competitionId, HttpServletResponse response) {
try {
PageRegistrationStaffReq req = new PageRegistrationStaffReq();
req.setCompetitionId(competitionId);
@ -103,20 +96,96 @@ public class CompetitionRegistrationController {
@ApiOperation(value = "批量导出数据")
@PostMapping(value = "/exportDataInBatches", produces = "application/json;multipart/form-data;charset=utf-8")
public void exportSubscribedRecords(
@RequestBody List<RegistrationVO> listOfExportSub,
HttpServletResponse response, HttpServletRequest request) throws Exception {
public void exportSubscribedRecords(@RequestBody List<RegistrationVO> listOfExportSub, HttpServletResponse response, HttpServletRequest request) throws Exception {
competitionRegistrationService.exportDataInBatches(listOfExportSub, response);
}
@ApiOperation(value = "取消报名")
@PostMapping(value = "/cancelRegistration")
public R cancelRegistration(
@ApiParam(name = "competitionId", value = "活动ID", required = true)
@RequestParam("competitionId") String competitionId, HttpServletRequest request) throws Exception {
public R cancelRegistration(@ApiParam(name = "competitionId", value = "活动ID", required = true) @RequestParam("competitionId") String competitionId, HttpServletRequest request) throws Exception {
String accountId = TokenUtils.getIdByJwtToken(request);
return competitionRegistrationService.cancelRegistration(competitionId, Integer.valueOf(accountId));
}
@ApiOperation(value = "手机号带出组织信息", response = RegistrationNewInformationBroughtOutVO.class)
@PostMapping("/getOrganizationInformationByPhone")
public R getOrganizationInformationByPhone(@ApiParam(name = "phone", value = "手机号", required = true) @RequestParam("phone") String phone, HttpServletResponse response) {
return competitionRegistrationService.getOrganizationalInformation(phone, null);
}
//校验是否已经报名活动
public boolean isRegistered(Integer accountId, Integer competitionId) {
QueryWrapper<CompetitionRegistration> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("account_id", accountId);
queryWrapper.eq("competition_id", competitionId);
CompetitionRegistration competitionRegistration = competitionRegistrationService.getOne(queryWrapper);
return competitionRegistration != null;
}
@ApiOperation(value = "后台-新增报名人员(这里的账号id必传,根据手机号带出的账号信息选中)")
@PostMapping("/addNewApplicantsInTheBackground")
public R addNewApplicantsInTheBackground(@ApiParam(name = "competitionRegistration", value = "报名人员对象", required = true) @RequestBody CompetitionRegistration competitionRegistration) {
if (ObjectUtils.isEmpty(competitionRegistration.getAccountId())) {
return R.error("账号id不能为空");
}
//校验是否已经报名活动过
if (isRegistered(competitionRegistration.getAccountId(), competitionRegistration.getCompetitionId())) {
return R.error("该账号已报名该活动");
}
boolean flag = competitionRegistrationService.save(competitionRegistration);
return flag ? R.ok() : R.error("新增失败");
}
@ApiOperation(value = "后台-报名人员详情(必填,列表返回的账号id)", response = RegistrationNewInformationBroughtOutVO.class)
@PostMapping("/detailsOfApplicants")
public R detailsOfApplicants(@ApiParam(name = "accountId", value = "账号id(列表返回的账号id)", required = true) @RequestParam("accountId") Integer accountId,
@ApiParam(name = "competitionId", value = "活动id", required = true) @RequestParam("competitionId") String competitionId) {
if (ObjectUtils.isEmpty(accountId)) {
return R.error("账号id不能为空");
}
return competitionRegistrationService.detailsOfApplicants(accountId, competitionId);
}
@ApiOperation(value = "后台-编辑报名人员信息(此时需要传报名人员id)")
@PostMapping("/editRegistrationInformation")
public R editRegistrationInformation(@ApiParam(name = "info", value = "编辑报名人员详情对象", required = true) @RequestBody RegistrationNewInformationBroughtOutVO info) {
if (ObjectUtils.isEmpty(info.getAccountId())) {
return R.error("账号id不能为空");
}
//判断活动id不能为空
if (ObjectUtils.isEmpty(info.getCompetitionId())) {
return R.error("活动id不能为空");
}
//校验是否已经报名活动过
if (isRegistered(info.getAccountId(), info.getCompetitionId())) {
return R.error("该账号已报名该活动");
}
boolean flag = true;
//获取原报名信息
CompetitionRegistration registration = competitionRegistrationService.getById(info.getId());
if (!ObjectUtils.isEmpty(registration)) {
//需求:如果时间被清空情况下,签到状态变更为未签到
if (ObjectUtils.isEmpty(info.getSignInTime())) {
registration.setSignInStatus(String.valueOf(2));
}
//判断如果账号id不等于原登记的账户id,则账号id做更改
if (!info.getAccountId().equals(registration.getAccountId())) {
registration.setAccountId(info.getAccountId());
}
flag = competitionRegistrationService.updateById(registration);
}
return flag ? R.ok() : R.error();
}
}

@ -1,5 +1,6 @@
package com.huoran.competition.entity;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.*;
import java.util.Date;
@ -59,4 +60,11 @@ public class CompetitionRegistration implements Serializable {
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date updateTime;
@ApiModelProperty(value = "签到情况(签到状态(0待签到 1.已签到 2未签到:活动结束后没签到的))")
private String signInStatus;
@ApiModelProperty(value = "签到时间")
private String signInTime;
}

@ -38,4 +38,8 @@ public class AfterLoginPageCompetitionListReq extends PageReq{
@ApiModelProperty(value = "活动分类id")
private Integer classificationId;
//当前角色
@ApiModelProperty(value = "当前用户角色(5:幼儿园,6:供应商)")
private Integer role;
}

@ -19,21 +19,18 @@ public class PageRegistrationStaffReq extends PageReq{
@ApiModelProperty(value = "活动ID", example = "1485860415656255489")
private String competitionId;
private Integer pageNum;
private Integer pageSize;
@ApiModelProperty(value = "禁用启用0未禁用,1禁用", example = "0")
private Integer isDisable;
@ApiModelProperty(value = "学校排序标识",example = "1正序,2倒序")
private Integer schoolOrder;
@ApiModelProperty(value = "团队排序标识",example = "null")
private Integer teamOrder;
@ApiModelProperty(value = "查询来源(1.前台/2.后台)")
private Integer querySource;
@ApiModelProperty(value = "平台来源(5:幼儿园,6:供应商)", example = "5")
private Integer platformId;
@ApiModelProperty(value = "签到状态(0待签到 1.已签到 2未签到:活动结束后没签到的)", example = "5")
private Integer signInStatus;
}

@ -0,0 +1,48 @@
package com.huoran.competition.entity.vo;
import cn.afterturn.easypoi.excel.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class RegistrationNewInformationBroughtOutVO {
@ApiModelProperty(value = "报名人员主键id(编辑时传)")
private Integer id;
@ApiModelProperty(value = "姓名")
private String userName;
@ApiModelProperty(value = "组织名称")
private String organizationName;
@ApiModelProperty(value = "组织类型/平台来源(5:幼儿园,6:供应商) 没有数据显示'无'")
private String platformId;
@ApiModelProperty(value = "手机号")
private String phone;
@ApiModelProperty(value = "账号id")
private Integer accountId;
@ApiModelProperty(value = "活动id")
private Integer competitionId;
@ApiModelProperty(value = "报名时间")
private String createTime;
@ApiModelProperty(value = "签到状态")
private String signInStatus;
@ApiModelProperty(value = "签到时间")
private String signInTime;
}

@ -1,6 +1,5 @@
package com.huoran.competition.entity.vo;
import ch.qos.logback.core.rolling.helper.IntegerTokenConverter;
import cn.afterturn.easypoi.excel.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -13,38 +12,43 @@ public class RegistrationVO {
private Integer rownum;
@ApiModelProperty(value = "学校")
@Excel(name = "学校", orderNum = "2", mergeVertical = true, isImportField = "school", width = 30)
private String school;
@ApiModelProperty(value = "学生姓名")
@Excel(name = "学生姓名", orderNum = "3", mergeVertical = true, isImportField = "username", width = 30)
@ApiModelProperty(value = "姓名")
@Excel(name = "姓名", orderNum = "2", isImportField = "username", width = 30)
private String username;
@ApiModelProperty(value = "组织名称")
@Excel(name = "组织名称", orderNum = "3", isImportField = "organizationName", width = 30)
private String organizationName;
@ApiModelProperty(value = "手机号")
@Excel(name = "手机号", orderNum = "4", mergeVertical = true, isImportField = "phone", width = 30)
private String phone;
@ApiModelProperty(value = "学号")
@Excel(name = "学号", orderNum = "5", mergeVertical = true, isImportField = "workNumber", width = 30)
private String workNumber;
@ApiModelProperty(value = "组织类型/平台来源(5:幼儿园,6:供应商) 没有数据显示'无'")
@Excel(name = "组织类型", orderNum = "4", isImportField = "platformId", width = 30)
private String platformId;
@ApiModelProperty(value = "报名时间")
@Excel(name = "报名时间", orderNum = "6", mergeVertical = true, isImportField = "createTime", width = 30)
@Excel(name = "报名时间", orderNum = "5", isImportField = "createTime", width = 30)
private String createTime;
@ApiModelProperty(value = "团队名称")
@Excel(name = "团队名称", orderNum = "7", mergeVertical = true, isImportField = "teamName", width = 30)
private String teamName;
@ApiModelProperty(value = "签到情况(签到状态(0待签到 1.已签到 2未签到:活动结束后没签到的))")
@Excel(name = "签到情况", orderNum = "6", isImportField = "signInStatus", width = 30)
private String signInStatus;
@ApiModelProperty(value = "签到时间")
@Excel(name = "签到时间", orderNum = "7", isImportField = "signInTime", width = 30)
private String signInTime;
@ApiModelProperty(value = "手机号")
@Excel(name = "手机号", orderNum = "8", isImportField = "phone", width = 30)
private String phone;
@ApiModelProperty(value = "头像")
private String userAvatars;
@ApiModelProperty(value = "团队id")
private Integer teamId;
@ApiModelProperty(value = "账号id")
private Integer accountId;
@ -52,18 +56,19 @@ public class RegistrationVO {
@ApiModelProperty(value = "用户id")
private Integer userId;
@ApiModelProperty(value = "学校id")
private Integer schoolId;
@ApiModelProperty(value = "活动id")
private Integer competitionId;
@ApiModelProperty(value = "报名id")
@ApiModelProperty(value = "当前报名生成的主键id(用于禁用/删除等报名人员)")
private Integer id;
@ApiModelProperty(value = "是否禁用")
private Integer isDisable;
@ApiModelProperty(value = "是否队长")
private Integer captain;
@ApiModelProperty(value = "内部标识")
private Integer identification;
}

@ -60,6 +60,8 @@ public interface CompetitionMapper extends BaseMapper<Competition> {
//获取sys_platform表平台信息
String obtainPlatformInformation(@Param("platformId")String platformId );
//查询当前账户的角色
String obtainRole(@Param("accountId")Integer accountId);
}

@ -6,6 +6,7 @@ import com.huoran.common.entity.School;
import com.huoran.competition.entity.CompetitionRegistration;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.huoran.competition.entity.req.PageRegistrationStaffReq;
import com.huoran.competition.entity.vo.RegistrationNewInformationBroughtOutVO;
import com.huoran.competition.entity.vo.RegistrationVO;
import org.apache.ibatis.annotations.Param;
@ -34,4 +35,9 @@ public interface CompetitionRegistrationMapper extends BaseMapper<CompetitionReg
String selectSchoolName(@Param("accountId")String accountId);
Integer countTheNumberOfApplicants(@Param("competitionId")Integer competitionId);
//根据手机号带出账户组织信息
List<RegistrationNewInformationBroughtOutVO> getOrganizationalInformation(@Param("phone")String phone,@Param("accountId")Integer accountId);
RegistrationNewInformationBroughtOutVO detailsOfApplicants(@Param("accountId")Integer accountId,@Param("competitionId")String competitionId);
}

@ -714,6 +714,8 @@
WHERE
c.is_open = 0
AND c.publish_status = 1
AND (c.competition_scope = 1
OR competition_scope = #{req.role})
<if test=" req.classificationId!=null ">
and c.classification_id=#{req.classificationId}
@ -821,4 +823,18 @@
ORDER BY
create_time DESC
</select>
<select id="obtainRole" resultType="java.lang.String">
SELECT
a.platform_id
FROM
nakadai.hr_user_account a
INNER JOIN nakadai.hr_user_info u ON u.user_id = a.user_id
AND u.is_del = 0
LEFT JOIN nakadai.k_platform_team_account ta ON ta.account_id = a.id
LEFT JOIN nakadai.k_platform_team t ON t.manage_id = ta.manage_id
LEFT JOIN nakadai.k_platform_team_classification c ON c.id = t.classification_id
WHERE
a.is_del = 0
AND a.id = #{accountId}
</select>
</mapper>

@ -21,8 +21,16 @@
</select>
<select id="selectRegistrationByCondition" resultType="com.huoran.competition.entity.vo.RegistrationVO">
SELECT
temp.* ,
(SELECT
@row_number := @row_number + 1 AS rownum,
temp.*
FROM
(
SELECT
r.competition_id AS competitionId,
r.id,
r.account_id,
(
SELECT
u.user_name
FROM
nakadai.hr_user_account ua
@ -30,85 +38,54 @@
AND u.is_del = 0
WHERE
ua.is_del = 0
AND ua.app_open_id = temp.app_open_id
AND ua.platform_id = 7) as username
FROM
(
SELECT
a.*,
@rownum := @rownum + 1 AS rownum
FROM
(
SELECT
qa.id,
qa.is_disable,
ua.phone,
ua.work_number,
( SELECT school_name FROM nakadai.school s WHERE s.school_id = ua.school_id ) AS school,
ua.school_id,
u.user_name AS enterpriseName,
u.user_id,
qa.account_id,
AND ua.app_open_id = a.app_open_id
AND ua.platform_id = 7
) AS username,
a.phone,
u.user_avatars,
qa.create_time,
qa.identification,
ct.team_name,
ct.captain,
CASE
WHEN ct.captain = 0 THEN
ct.team_id
WHEN ct.captain = 1 THEN
ct.pid
END AS team_id,
ua.app_open_id
IFNULL( c.classification_name, '无' ) AS organizationName,
( CASE ta.platform_id WHEN 6 THEN '供应商' WHEN 5 THEN '幼儿园' ELSE '无' END ) AS platformId,
r.create_time,
( CASE sign_in_status WHEN 0 THEN '待签到' WHEN 1 THEN '已签到' WHEN 2 THEN '未签到' ELSE '无' END ) AS signInStatus,
sign_in_time,
r.is_disable
FROM
c_competition_registration qa
INNER JOIN nakadai.hr_user_account ua ON ua.id = qa.account_id
AND ua.is_del = 0
INNER JOIN nakadai.hr_user_info u ON u.user_id = ua.user_id
c_competition_registration r
INNER JOIN nakadai.hr_user_account a ON a.id = r.account_id
AND a.is_del = 0
INNER JOIN nakadai.hr_user_info u ON u.user_id = a.user_id
AND u.is_del = 0
LEFT JOIN c_competition_team ct ON ct.competition_id = qa.competition_id
AND ct.account_id = qa.account_id
WHERE
qa.competition_id = #{req.competitionId}
GROUP BY
qa.id
ORDER BY
qa.create_time DESC
) a
LEFT JOIN ( SELECT @rownum := 0 ) b ON 1 = 1
) temp
LEFT JOIN nakadai.k_platform_team_account ta ON ta.account_id = a.id
LEFT JOIN nakadai.k_platform_team t ON t.manage_id = ta.manage_id
LEFT JOIN nakadai.k_platform_team_classification c ON c.id = t.classification_id
where 1=1
<if test=" req.platformId!=null">
and a.platform_id = #{req.platformId}
</if>
<if test=" req.signInStatus!=null ">
and r.sign_in_status = #{req.signInStatus}
</if>
) temp,
( SELECT @row_number := 0 ) AS t
WHERE
1 =1
temp.competitionId = #{req.competitionId}
<if test=" req.keyWord!=null and req.keyWord!='' ">
AND CONCAT( IFNULL( temp.phone, '' ),
AND CONCAT(
IFNULL( temp.phone, '' ),
IFNULL( temp.username, '' ),
IFNULL( temp.school, '' ) ,
IFNULL( temp.work_number, '' ) )
IFNULL( temp.organizationName, '' )
)
like CONCAT('%',#{req.keyWord},'%')
</if>
<if test=" req.isDisable!=null and req.isDisable!='' ">
AND temp.is_disable = #{req.isDisable}
</if>
<if test=" req.schoolOrder == 1 ">
ORDER BY LEFT(school, 1)
</if>
<if test=" req.schoolOrder == 2 ">
ORDER BY LEFT(school, 1) DESC
</if>
<if test=" req.schoolOrder!=null and req.teamOrder == 1 ">
,LEFT(team_name, 1)
</if>
<if test=" req.schoolOrder!=null and req.teamOrder == 2 ">
,LEFT(team_name, 1) DESC
</if>
<if test=" req.schoolOrder==null and req.teamOrder == 1 ">
ORDER BY LEFT(team_name, 1)
</if>
<if test=" req.schoolOrder==null and req.teamOrder == 2 ">
ORDER BY LEFT(team_name, 1) DESC
</if>
ORDER BY
temp.create_time DESC
</select>
<select id="selectApplicantByCondition" resultType="com.huoran.competition.entity.vo.RegistrationVO">
@ -168,4 +145,56 @@
WHERE
r.competition_id = #{competitionId}
</select>
<select id="getOrganizationalInformation"
resultType="com.huoran.competition.entity.vo.RegistrationNewInformationBroughtOutVO">
SELECT
u.user_name,
a.id AS accountId,
c.classification_name AS organizationName,
( CASE ta.platform_id WHEN 6 THEN '供应商' WHEN 5 THEN '幼儿园' END ) AS platformId
FROM
nakadai.hr_user_account a
INNER JOIN nakadai.hr_user_info u ON u.user_id = a.user_id
AND u.is_del = 0
LEFT JOIN nakadai.k_platform_team_account ta ON ta.account_id = a.id
LEFT JOIN nakadai.k_platform_team t ON t.manage_id = ta.manage_id
LEFT JOIN nakadai.k_platform_team_classification c ON c.id = t.classification_id
WHERE
a.is_del = 0
<if test="accountId != null">
AND a.id = #{accountId}
</if>
<if test="phone!=null and phone!=''">
AND a.phone = #{phone}
</if>
</select>
<select id="detailsOfApplicants"
resultType="com.huoran.competition.entity.vo.RegistrationNewInformationBroughtOutVO">
SELECT
r.id,
competition_id,
a.phone,
u.user_name,
r.create_time,
sign_in_time,
a.id AS accountId,
c.classification_name AS organizationName,
( CASE ta.platform_id WHEN 6 THEN '供应商' WHEN 5 THEN '幼儿园' END ) AS platformId,
( CASE sign_in_status WHEN 0 THEN '待签到' WHEN 1 THEN '已签到' WHEN 2 THEN '未签到' ELSE '无' END ) AS signInStatus
FROM
occupationlab.c_competition_registration r
INNER JOIN nakadai.hr_user_account a ON a.id = r.account_id
AND a.is_del = 0
INNER JOIN nakadai.hr_user_info u ON u.user_id = a.user_id
AND u.is_del = 0
LEFT JOIN nakadai.k_platform_team_account ta ON ta.account_id = a.id
LEFT JOIN nakadai.k_platform_team t ON t.manage_id = ta.manage_id
LEFT JOIN nakadai.k_platform_team_classification c ON c.id = t.classification_id
WHERE
r.competition_id = #{competitionId}
AND r.account_id = #{accountId}
</select>
</mapper>

@ -5,6 +5,7 @@ import com.huoran.common.response.R;
import com.huoran.competition.entity.CompetitionRegistration;
import com.baomidou.mybatisplus.extension.service.IService;
import com.huoran.competition.entity.req.PageRegistrationStaffReq;
import com.huoran.competition.entity.vo.RegistrationNewInformationBroughtOutVO;
import com.huoran.competition.entity.vo.RegistrationVO;
import javax.servlet.http.HttpServletResponse;
@ -38,4 +39,10 @@ public interface CompetitionRegistrationService extends IService<CompetitionRegi
CompetitionRegistration enquireWhetherToRegister(Integer accountId,String competitionId);
Integer registrationPopulation(String competitionId) ;
//根据手机号或者账户id带出组织信息
R getOrganizationalInformation(String phone,Integer accountId);
R detailsOfApplicants(Integer accountId,String competitionId);
}

@ -43,4 +43,7 @@ public interface CompetitionService extends IService<Competition> {
List<CompetitionStage> queryCompetitionStage(String competitionId, String accountId);
R isParticipant(IsParticipantReq req);
//查询当前账户的角色
String queryRole(String accountId);
}

@ -14,11 +14,8 @@ import com.huoran.common.exception.ExceptionEnum;
import com.huoran.common.response.R;
import com.huoran.competition.entity.Competition;
import com.huoran.competition.entity.CompetitionRegistration;
import com.huoran.competition.entity.CompetitionTeam;
import com.huoran.competition.entity.CompleteCompetitionSetup;
import com.huoran.competition.entity.req.PageRegistrationStaffReq;
import com.huoran.competition.entity.vo.ExcelData;
import com.huoran.competition.entity.vo.PersonalExcelData;
import com.huoran.competition.entity.vo.RegistrationNewInformationBroughtOutVO;
import com.huoran.competition.entity.vo.RegistrationVO;
import com.huoran.competition.mapper.*;
import com.huoran.competition.service.CompetitionRangeService;
@ -29,7 +26,6 @@ import com.huoran.competition.utils.ExcelStyleUtil;
import com.huoran.competition.utils.HandleNameAsteriskReplacementUtil;
import org.apache.poi.ss.usermodel.Workbook;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -38,7 +34,6 @@ import org.springframework.util.ObjectUtils;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
/**
@ -93,8 +88,7 @@ public class CompetitionRegistrationServiceImpl extends ServiceImpl<CompetitionR
req.setQuerySource(2);
}
if (req.getQuerySource() == 1) {
pageList
.getRecords().forEach(registrationVO -> {
pageList.getRecords().forEach(registrationVO -> {
registrationVO.setUsername(HandleNameAsteriskReplacementUtil.desensitizedName(registrationVO.getUsername()));
});
}
@ -142,39 +136,37 @@ public class CompetitionRegistrationServiceImpl extends ServiceImpl<CompetitionR
@Override
public void export(HttpServletResponse response, PageRegistrationStaffReq req) throws IOException {
Page<RegistrationVO> page = new Page<RegistrationVO>(req.getPageNum(), req.getPageSize());
IPage<RegistrationVO> applicantVOList = baseMapper.selectApplicantByCondition(page, req);
QueryWrapper<CompleteCompetitionSetup> setupQueryWrapper = new QueryWrapper<>();
setupQueryWrapper.eq("competition_id", req.getCompetitionId());
CompleteCompetitionSetup setup = completeCompetitionSetupMapper.selectOne(setupQueryWrapper);
List<ExcelData> excelDataList = new ArrayList<>();
List<PersonalExcelData> personalExcelData = new ArrayList<>();
//导出团队名称
if (setup.getCompetitionType() == 1) {
applicantVOList.getRecords().forEach(registrationVO -> {
QueryWrapper<CompetitionTeam> teamQueryWrapper = new QueryWrapper<>();
teamQueryWrapper.eq("competition_id", req.getCompetitionId());
teamQueryWrapper.eq("account_id", registrationVO.getAccountId());
CompetitionTeam team = competitionTeamMapper.selectOne(teamQueryWrapper);
if (team != null && team.getCaptain() == 0) {
registrationVO.setTeamName(team.getTeamName());
} else if (team != null) {
CompetitionTeam team1 = competitionTeamMapper.selectById(team.getPid());
registrationVO.setTeamName(team1.getTeamName());
IPage<RegistrationVO> pageList = baseMapper.selectRegistrationByCondition(page, req);
for (RegistrationVO vo : pageList.getRecords()) {
//组织类型/平台来源(5:幼儿园,6:供应商)
switch (vo.getPlatformId()) {
case "5":
vo.setPlatformId("幼儿园");
break;
case "6":
vo.setPlatformId("供应商");
break;
}
});
applicantVOList.getRecords().forEach(applicantVO -> {
ExcelData excelData = new ExcelData();
BeanUtils.copyProperties(applicantVO, excelData);
excelDataList.add(excelData);
});
} else {
//个人导出列
applicantVOList.getRecords().forEach(applicantVO -> {
PersonalExcelData personalExcelData1 = new PersonalExcelData();
BeanUtils.copyProperties(applicantVO, personalExcelData1);
personalExcelData.add(personalExcelData1);
});
//签到状态(0.待签到 1.已签到 2.未签到:活动结束后没签到的)
switch (vo.getSignInStatus()) {
case "0":
vo.setSignInStatus("待签到");
break;
case "1":
vo.setSignInStatus("已签到");
break;
case "2":
vo.setSignInStatus("未签到");
break;
}
}
// 告诉浏览器用什么软件可以打开此文件
@ -184,12 +176,8 @@ public class CompetitionRegistrationServiceImpl extends ServiceImpl<CompetitionR
//编码
response.setCharacterEncoding("UTF-8");
Workbook workbook;
if (setup.getCompetitionType() == 1) {
workbook = ExcelExportUtil.exportExcel(new ExportParams(), ExcelData.class, excelDataList);
} else {
workbook = ExcelExportUtil.exportExcel(new ExportParams(), PersonalExcelData.class, personalExcelData);
}
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), RegistrationVO.class, pageList.getRecords());
ExportParams exportParams = new ExportParams(null, "delivery", ExcelType.XSSF);
exportParams.setStyle(ExcelStyleUtil.class);
workbook.write(response.getOutputStream());
@ -197,6 +185,35 @@ public class CompetitionRegistrationServiceImpl extends ServiceImpl<CompetitionR
@Override
public void exportDataInBatches(List<RegistrationVO> listOfExportSub, HttpServletResponse response) throws IOException {
if (!listOfExportSub.isEmpty()) {
for (RegistrationVO vo : listOfExportSub) {
//组织类型/平台来源(5:幼儿园,6:供应商)
switch (vo.getPlatformId()) {
case "5":
vo.setPlatformId("幼儿园");
break;
case "6":
vo.setPlatformId("供应商");
break;
}
//签到状态(0.待签到 1.已签到 2.未签到:活动结束后没签到的)
switch (vo.getSignInStatus()) {
case "0":
vo.setSignInStatus("待签到");
break;
case "1":
vo.setSignInStatus("已签到");
break;
case "2":
vo.setSignInStatus("未签到");
break;
}
}
}
// 告诉浏览器用什么软件可以打开此文件
response.setHeader("content-Type", "application/vnd.ms-excel");
// 下载文件的默认名称
@ -277,4 +294,15 @@ public class CompetitionRegistrationServiceImpl extends ServiceImpl<CompetitionR
// return competitionRegistrations.size();
return baseMapper.countTheNumberOfApplicants(Integer.valueOf(competitionId));
}
@Override
public R getOrganizationalInformation(String phone, Integer accountId) {
return R.ok().put("data", baseMapper.getOrganizationalInformation(phone, accountId));
}
@Override
public R detailsOfApplicants(Integer accountId, String competitionId) {
RegistrationNewInformationBroughtOutVO informationBroughtOutVO = baseMapper.detailsOfApplicants(accountId, competitionId);
return R.ok().put("data", informationBroughtOutVO);
}
}

@ -613,4 +613,9 @@ public class CompetitionServiceImpl extends ServiceImpl<CompetitionMapper, Compe
}
return R.error("无法参加活动");
}
@Override
public String queryRole(String accountId) {
return baseMapper.obtainRole(Integer.valueOf(accountId));
}
}

@ -197,7 +197,7 @@ public class AliRealNameAuthenticationController {
String method = "GET";
Map<String, String> headers = new HashMap<String, String>();
//最后在header中的格式(中间是英文空格)为Authorization:APPCODE 83359fd73fe94948385f570e3c139105
headers.put("Authorization", "APPCODE " + "5a7f623d06724a4da5806c1fb0544e47");
headers.put("Authorization", "APPCODE " + "bd4ad25d0e41466eabb31d9baa16a79f");//嘉龙
Map<String, String> querys = new HashMap<String, String>();
querys.put("ComapnyName", enterpriseCertification.getCompanyName());
querys.put("CreditCode", enterpriseCertification.getCreditCode());
@ -208,6 +208,10 @@ public class AliRealNameAuthenticationController {
QueryWrapper<EnterpriseCertification> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("open_id", enterpriseCertification.getOpenId());
EnterpriseCertification certification = enterpriseCertificationService.getOne(queryWrapper);
if (certification == null) {
//通过后台删除组织信息的
return R.error("您已没有组织信息,请联系管理人员!");
}
enterpriseCertification.setId(certification.getId());
try {
HttpResponse response = HttpUtils.doGet(host, path, method, headers, querys);

@ -186,6 +186,7 @@ public class EnterpriseCertificationController {
accountQueryWrapper1.eq("platform_id",enterpriseCertification.getPlatformSource());
HrUserAccount userAccount = userAccountService.getOne(accountQueryWrapper1);*/
//删除团队表
UserAccount userAccount = service.queryAccountInformation(enterpriseCertification.getOpenId(), Integer.valueOf(enterpriseCertification.getPlatformSource()));
service.deleteAccountInformation(userAccount.getId());

@ -10,6 +10,7 @@ import com.huoran.common.utils.TokenUtils;
import com.huoran.nakadai.entity.PlatformTeam;
import com.huoran.nakadai.entity.PlatformTeamAccount;
import com.huoran.nakadai.entity.PlatformTeamClassification;
import com.huoran.nakadai.entity.SupplierClassificationConfig;
import com.huoran.nakadai.entity.req.*;
import com.huoran.nakadai.entity.res.PartnerAccountResp;
import com.huoran.nakadai.entity.res.PlatformTeamAccountResp;
@ -154,9 +155,7 @@ public class PlatformTeamAccountController {
@GetMapping("/removeOrganization")
@ApiOperation(value = "移除组织")
public R removeOrganization(
@ApiParam(name = "teamId", value = "团队id") @RequestParam Integer teamId,
@ApiParam(name = "manageId", value = "组织id") @RequestParam Integer manageId) {
public R removeOrganization(@ApiParam(name = "teamId", value = "团队id") @RequestParam Integer teamId, @ApiParam(name = "manageId", value = "组织id") @RequestParam Integer manageId) {
PlatformTeamClassification teamClassification = platformTeamClassificationService.getById(teamId);
if (teamClassification.getIsTeam() == 1) {
throw new CustomException(ExceptionEnum.PARTNER_REMOVAL);
@ -189,9 +188,7 @@ public class PlatformTeamAccountController {
@ApiOperation(value = "用户列表更新账号状态,禁用整个账号禁止登录,不管是哪个端,哪个组织")
@PostMapping("/updateAccountStatus")
public R updateAccountStatus(
@RequestParam("openId") @ApiParam(value = "openId") String openId,
@RequestParam("isEnable") @ApiParam(value = "是否禁用(1->启用,0->禁用)") Integer isEnable) {
public R updateAccountStatus(@RequestParam("openId") @ApiParam(value = "openId") String openId, @RequestParam("isEnable") @ApiParam(value = "是否禁用(1->启用,0->禁用)") Integer isEnable) {
//根据openId查询账号详情List
List<UserAccount> userAccountList = platformTeamClassificationService.selectAccountList(openId);
for (UserAccount userAccount : userAccountList) {
@ -257,14 +254,25 @@ public class PlatformTeamAccountController {
Integer accountId = platformTeamService.getAccountIdByTeamId(teamInfo.getId());
//删除原有分类重新新增分类配置信息
supplierClassificationConfigService.deleteByAccountId(accountId);
//设置分类配置信息中的accountId
teamInfo.getSupplierClassificationConfigs().forEach(config -> config.setAccountId(accountId));
QueryWrapper<SupplierClassificationConfig> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("account_id", accountId);
//删除供应商原有分类重新新增分类配置信息
List<SupplierClassificationConfig> classificationConfigs = supplierClassificationConfigService.list(queryWrapper);
if (!classificationConfigs.isEmpty()){
supplierClassificationConfigService.remove(queryWrapper);
}
if (teamInfo.getSupplierClassificationConfigs()!=null) {
for (SupplierClassificationConfig config : teamInfo.getSupplierClassificationConfigs()) {
//获取teamInfo.getSupplierClassificationConfigs()第一个账号id
config.setAccountId(accountId);
}
//新增分类配置信息
supplierClassificationConfigService.saveBatch(teamInfo.getSupplierClassificationConfigs());
}
boolean update = platformTeamClassificationService.updateById(platformTeamClassification);
@ -272,8 +280,6 @@ public class PlatformTeamAccountController {
}
@ApiOperation(value = "查询团队信息")
@GetMapping("/queryTeamInfo")
public R queryTeamInfo(@ApiParam(value = "团队id") @RequestParam("teamId") Integer teamId) {

@ -68,7 +68,7 @@ public class EnterpriseCertificationServiceImpl extends ServiceImpl<EnterpriseCe
@Override
public boolean deleteAccountInformation(Integer accountId) {
return baseMapper.deleteTeamInformation(accountId) > 0;
return baseMapper.updateAccountInformation(accountId) > 0;
}
@Override

Loading…
Cancel
Save