From b362214bae139716a636be4ddaf296a0128da93c Mon Sep 17 00:00:00 2001 From: zy_Java <654600784@qq.com> Date: Wed, 7 Apr 2021 16:19:45 +0800 Subject: [PATCH] =?UTF-8?q?20210407v=E4=BF=AE=E6=94=B9=E6=8F=90=E9=86=92?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ccsens/tall/bean/dto/TaskDto.java | 20 +++++++++++-------- .../com/ccsens/tall/bean/vo/MessageVo.java | 8 ++++++++ .../ccsens/tall/service/ProRoleService.java | 11 +++++++--- tall/src/main/resources/application.yml | 4 ++-- 4 files changed, 30 insertions(+), 13 deletions(-) diff --git a/tall/src/main/java/com/ccsens/tall/bean/dto/TaskDto.java b/tall/src/main/java/com/ccsens/tall/bean/dto/TaskDto.java index 115ec1fc..29dab668 100644 --- a/tall/src/main/java/com/ccsens/tall/bean/dto/TaskDto.java +++ b/tall/src/main/java/com/ccsens/tall/bean/dto/TaskDto.java @@ -85,20 +85,20 @@ public class TaskDto { @Data @ApiModel("添加时设置任务提醒") public static class TaskRemindByAdd{ - @ApiModelProperty("提醒时机 0不提醒 1开始前,2开始时,3开始后,4结束前,5结束时,6结束后,7自定义时间") + @ApiModelProperty("提醒时机 0不提醒 1开始前,2开始时,3开始后,4结束前,5结束时,6结束后") private Byte remindTiming = 0; @ApiModelProperty("时长 提醒时机是“开始时”或“结束时”可以为空") private Long duration = 0L; - @ApiModelProperty("时间单位 0分钟 1小时 2天") + @ApiModelProperty("时间单位 0分钟 1小时 2天 3秒") private Byte unit; public Long getDuration(){ if(ObjectUtil.isNull(unit)) { throw new BaseException("时间单位不能为空"); } - if(remindTiming == 7){ - return duration; - } +// if(remindTiming == 7){ +// return duration; +// } switch (unit) { case 0: return duration * 60 * 1000L; @@ -106,6 +106,8 @@ public class TaskDto { return duration * 60 * 60 * 1000L; case 2: return duration * 24 * 60 * 60 * 1000L; + case 3: + return duration * 1000L; default: return duration; } @@ -321,9 +323,9 @@ public class TaskDto { if(ObjectUtil.isNull(unit)) { throw new BaseException("时间单位不能为空"); } - if(remindTiming == 7){ - return duration; - } +// if(remindTiming == 7){ +// return duration; +// } switch (unit) { case 0: return duration * 60 * 1000L; @@ -331,6 +333,8 @@ public class TaskDto { return duration * 60 * 60 * 1000L; case 2: return duration * 24 * 60 * 60 * 1000L; + case 3: + return duration * 1000L; default: return duration; } diff --git a/tall/src/main/java/com/ccsens/tall/bean/vo/MessageVo.java b/tall/src/main/java/com/ccsens/tall/bean/vo/MessageVo.java index 56446962..2c2dc6f1 100644 --- a/tall/src/main/java/com/ccsens/tall/bean/vo/MessageVo.java +++ b/tall/src/main/java/com/ccsens/tall/bean/vo/MessageVo.java @@ -36,6 +36,8 @@ public class MessageVo { private Long projectId; @ApiModelProperty("操作者ID") private Long operatorId; + @ApiModelProperty("任务id") + private Long taskId; @ApiModelProperty("消息列表") private List messages = new ArrayList<>(); @@ -47,6 +49,12 @@ public class MessageVo { this.operatorId = operatorId; } + public Inform(Long projectId, Long operatorId, Long taskId) { + this.projectId = projectId; + this.operatorId = operatorId; + this.taskId = taskId; + } + public Inform appendMessage(Message message) { messages.add(message); return this; diff --git a/tall/src/main/java/com/ccsens/tall/service/ProRoleService.java b/tall/src/main/java/com/ccsens/tall/service/ProRoleService.java index 008bf71a..606a7a8a 100644 --- a/tall/src/main/java/com/ccsens/tall/service/ProRoleService.java +++ b/tall/src/main/java/com/ccsens/tall/service/ProRoleService.java @@ -258,11 +258,16 @@ public class ProRoleService implements IProRoleService { proMemberExample.createCriteria().andUserIdEqualTo(userId).andProjectIdEqualTo(projectId).andRecStatusEqualTo((byte)0); List proMembers = proMemberMapper.selectByExample(proMemberExample); Long memberId=0L; - if(CollectionUtil.isNotEmpty(proMembers)&&proMembers.size()==1){ - memberId=proMembers.get(0).getId(); + if(CollectionUtil.isNotEmpty(proMembers)){ + if(proMembers.size()==1){ + memberId=proMembers.get(0).getId(); + }else { + throw new BaseException(CodeEnum.CHONGFU); + } }else { - throw new BaseException(CodeEnum.CHONGFU); + return proRoleDao.selectSecondRolesByProjectId(projectId); } + //查看角色展示列表中是否有数据 ProMemberRoleShowExample proMemberRoleShowExample=new ProMemberRoleShowExample(); proMemberRoleShowExample.createCriteria().andMemberIdEqualTo(memberId).andRecStatusEqualTo((byte)0); diff --git a/tall/src/main/resources/application.yml b/tall/src/main/resources/application.yml index b5408a3a..ebc544af 100644 --- a/tall/src/main/resources/application.yml +++ b/tall/src/main/resources/application.yml @@ -1,5 +1,5 @@ spring: profiles: - active: dev - include: util-dev,common + active: test + include: util-test,common