Browse Source

20201126v1.9

tiaosheng
zy_Java 5 years ago
parent
commit
a6f0748704
  1. 9
      cloudutil/src/main/java/com/ccsens/cloudutil/bean/tall/dto/MemberRoleDto.java
  2. 11
      cloudutil/src/main/java/com/ccsens/cloudutil/feign/TallFeignClient.java
  3. 2
      mt/src/main/java/com/ccsens/mt/bean/dto/ScoreDto.java
  4. 4
      mt/src/main/java/com/ccsens/mt/service/CompeteService.java
  5. 18
      mt/src/main/java/com/ccsens/mt/service/CompeteTaskService.java
  6. 4
      mt/src/main/resources/application.yml
  7. 13
      mt/src/main/resources/mapper_dao/CompeteScoreDao.xml
  8. 10
      tall/src/main/java/com/ccsens/tall/service/ProRoleService.java

9
cloudutil/src/main/java/com/ccsens/cloudutil/bean/tall/dto/MemberRoleDto.java

@ -135,4 +135,13 @@ public class MemberRoleDto {
@ApiModelProperty("token")
private String token;
}
@Data
@ApiModel("给角色添加成员")
public static class DeleteRole{
@ApiModelProperty("角色id")
private Long roleId;
@ApiModelProperty("token")
private String token;
}
}

11
cloudutil/src/main/java/com/ccsens/cloudutil/feign/TallFeignClient.java

@ -232,6 +232,12 @@ public interface TallFeignClient {
*/
@RequestMapping("/members/query/memberByPhone")
JsonResponse<MemberVo.MemberList> queryMemberByPhone(MemberRoleDto.GetMemberByPhone getMemberByPhone);
/**
* 删除角色
*/
@RequestMapping("/roles/delete")
JsonResponse deleteRole(MemberRoleDto.DeleteRole deleteRole);
}
@Slf4j
@ -389,6 +395,11 @@ class TallFeignClientFallBack implements FallbackFactory<TallFeignClient> {
public JsonResponse<MemberVo.MemberList> queryMemberByPhone(MemberRoleDto.GetMemberByPhone getMemberByPhone) {
return JsonResponse.newInstance().fail();
}
@Override
public JsonResponse deleteRole(MemberRoleDto.DeleteRole deleteRole) {
return JsonResponse.newInstance().fail();
}
};
}

2
mt/src/main/java/com/ccsens/mt/bean/dto/ScoreDto.java

@ -130,7 +130,7 @@ public class ScoreDto {
@ApiModelProperty("项目id")
private Long projectId;
@ApiModelProperty("当前页")
private int page=1;
private int pageNum=1;
@ApiModelProperty("每页数量")
private int size=10;
}

4
mt/src/main/java/com/ccsens/mt/service/CompeteService.java

@ -1699,7 +1699,7 @@ public class CompeteService implements ICompeteService {
@Override
public PageInfo<ScoreVo.CountScoreCurrentSite> queryCountScoreAll(ScoreDto.ShowResult params) {
PageHelper.startPage(params.getPage(),params.getSize());
PageHelper.startPage(params.getPageNum(),params.getSize());
List<ScoreVo.CountScoreCurrentSite> countScoreCurrentSites = competeScoreDao.selectQueryCountScore(params.getProjectId());
PageInfo pageInfo = new PageInfo<>(countScoreCurrentSites);
// List<ScoreVo.CountScoreCurrentSite> countScoreCurrentSiteList = new ArrayList<>();
@ -1864,7 +1864,7 @@ public class CompeteService implements ICompeteService {
throw new BaseException(CodeEnum.PARAM_ERROR);
}
PageHelper.startPage(param.getPage(), param.getSize());
PageHelper.startPage(param.getPageNum(), param.getSize());
List<ScoreVo.CountScorePublicity> list;
if (project.getTeam() == Constant.Compete.TEAM_YES) {
// 团体赛

18
mt/src/main/java/com/ccsens/mt/service/CompeteTaskService.java

@ -108,6 +108,24 @@ public class CompeteTaskService implements ICompeteTaskService {
log.info("{},时间与之前相同",projectConfig.getProjectId());
return;
}
//如果场地数量不同,则删除该项目下所有裁判,及tall内的角色
if(projectConfig.getSiteNum() != competeProjectConfig.getSiteNum()){
CompeteJudgmentExample judgmentExample = new CompeteJudgmentExample();
judgmentExample.createCriteria().andProjectIdEqualTo(projectConfig.getProjectId());
List<CompeteJudgment> judgmentList = competeJudgmentDao.selectByExample(judgmentExample);
if(CollectionUtil.isNotEmpty(judgmentList)){
judgmentList.forEach(judgment ->{
judgment.setRecStatus((byte) 2);
competeJudgmentDao.updateByPrimaryKeySelective(judgment);
MemberRoleDto.DeleteRole deleteRole = new MemberRoleDto.DeleteRole();
deleteRole.setRoleId(judgment.getRoleId());
deleteRole.setToken(token);
log.info("删除角色:{}", judgment.getRoleId());
tallFeignClient.deleteRole(deleteRole);
});
}
}
competeProjectConfig.setProjectDuration(projectConfig.getDuration());
competeProjectConfig.setSiteNum(projectConfig.getSiteNum());
competeProjectConfig.setStartTime(projectConfig.getStartTime() == null ? 0 : projectConfig.getStartTime());

4
mt/src/main/resources/application.yml

@ -1,6 +1,6 @@
spring:
profiles:
active: test
include: common, util-test
active: dev
include: common, util-dev

13
mt/src/main/resources/mapper_dao/CompeteScoreDao.xml

@ -702,11 +702,15 @@
order by t1.groupName, rangee
</select>
<select id="queryVarietyScore" resultType="com.ccsens.mt.bean.vo.CompeteVo$TotalScoreDisplay">
SELECT
t.*,
@rownum := @rownum + 1 AS rownum
FROM
(
select s.*, c.name as companyName, GROUP_CONCAT(p.name) as peopleName, (ifnull(s.referee1,0)+ifnull(s.referee2,0)+ifnull(s.referee3,0))/3 as avg1To3,
(ifnull(s.referee4,0)+ifnull(s.referee5,0)+ifnull(s.referee6,0))/3 as avg4To6,
(ifnull(s.referee1,0)+ifnull(s.referee2,0)+ifnull(s.referee3,0))/3 + (ifnull(s.referee4,0)+ifnull(s.referee5,0)+ifnull(s.referee6,0))/3 - s.referee0 as result,
case o.waiver when 1 then '弃权' when 2 then '取消比赛资格' end as remark,
@rownum := @rownum + 1 AS rownum
case o.waiver when 1 then '弃权' when 2 then '取消比赛资格' end as remark
from
(select site_order_id, max(if(chief_judgment = 0, score, null)) as referee0, max(if(chief_judgment = 1, score, null)) as referee1,
max(if(chief_judgment = 2, score, null)) as referee2, max(if(chief_judgment = 3, score, null)) as referee3,
@ -719,12 +723,13 @@
t_compete_team t,
t_compete_team_member m,
t_compete_player p,
t_compete_company c,
( SELECT @rownum := 0 ) r
t_compete_company c
where s.site_order_id = o.id and o.player_id = t.id and t.id = m.compete_team_id and m.player_id = p.id and p.company_id = c.id
and o.rec_status = 0 and t.rec_status = 0 and m.rec_status = 0 and p.rec_status = 0 and c.rec_status = 0
group by s.site_order_id
order by result desc
)t,
(SELECT @rownum := 0)t1
</select>
<select id="selAllDaiBiaoDui" resultType="com.ccsens.mt.bean.vo.CompeteVo$DaiBiaoDUi">
select q.*,identity,GROUP_CONCAT(tcch.name) as name From

10
tall/src/main/java/com/ccsens/tall/service/ProRoleService.java

@ -329,6 +329,16 @@ public class ProRoleService implements IProRoleService {
//修改删除状态
role.setRecStatus(WebConstant.REC_STATUS.Deleted.value);
proRoleDao.updateByPrimaryKeySelective(role);
//删除该角色负责的任务
ProTaskDetailExample proTaskDetailExample = new ProTaskDetailExample();
proTaskDetailExample.createCriteria().andExecutorRoleEqualTo(roleId);
List<ProTaskDetail> taskDetailList = taskDetailDao.selectByExample(proTaskDetailExample);
if(CollectionUtil.isNotEmpty(taskDetailList)){
taskDetailList.forEach(taskDetail -> {
taskDetail.setRecStatus((byte) 2);
taskDetailDao.updateByPrimaryKeySelective(taskDetail);
});
}
// //彻底删除角色
// deleteRoleByRoleId(roleId);
} else {

Loading…
Cancel
Save