Browse Source

20210407v修改提醒信息

recovery
zy_Java 4 years ago
parent
commit
b362214bae
  1. 20
      tall/src/main/java/com/ccsens/tall/bean/dto/TaskDto.java
  2. 8
      tall/src/main/java/com/ccsens/tall/bean/vo/MessageVo.java
  3. 11
      tall/src/main/java/com/ccsens/tall/service/ProRoleService.java
  4. 4
      tall/src/main/resources/application.yml

20
tall/src/main/java/com/ccsens/tall/bean/dto/TaskDto.java

@ -85,20 +85,20 @@ public class TaskDto {
@Data @Data
@ApiModel("添加时设置任务提醒") @ApiModel("添加时设置任务提醒")
public static class TaskRemindByAdd{ 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; private Byte remindTiming = 0;
@ApiModelProperty("时长 提醒时机是“开始时”或“结束时”可以为空") @ApiModelProperty("时长 提醒时机是“开始时”或“结束时”可以为空")
private Long duration = 0L; private Long duration = 0L;
@ApiModelProperty("时间单位 0分钟 1小时 2天") @ApiModelProperty("时间单位 0分钟 1小时 2天 3秒")
private Byte unit; private Byte unit;
public Long getDuration(){ public Long getDuration(){
if(ObjectUtil.isNull(unit)) { if(ObjectUtil.isNull(unit)) {
throw new BaseException("时间单位不能为空"); throw new BaseException("时间单位不能为空");
} }
if(remindTiming == 7){ // if(remindTiming == 7){
return duration; // return duration;
} // }
switch (unit) { switch (unit) {
case 0: case 0:
return duration * 60 * 1000L; return duration * 60 * 1000L;
@ -106,6 +106,8 @@ public class TaskDto {
return duration * 60 * 60 * 1000L; return duration * 60 * 60 * 1000L;
case 2: case 2:
return duration * 24 * 60 * 60 * 1000L; return duration * 24 * 60 * 60 * 1000L;
case 3:
return duration * 1000L;
default: default:
return duration; return duration;
} }
@ -321,9 +323,9 @@ public class TaskDto {
if(ObjectUtil.isNull(unit)) { if(ObjectUtil.isNull(unit)) {
throw new BaseException("时间单位不能为空"); throw new BaseException("时间单位不能为空");
} }
if(remindTiming == 7){ // if(remindTiming == 7){
return duration; // return duration;
} // }
switch (unit) { switch (unit) {
case 0: case 0:
return duration * 60 * 1000L; return duration * 60 * 1000L;
@ -331,6 +333,8 @@ public class TaskDto {
return duration * 60 * 60 * 1000L; return duration * 60 * 60 * 1000L;
case 2: case 2:
return duration * 24 * 60 * 60 * 1000L; return duration * 24 * 60 * 60 * 1000L;
case 3:
return duration * 1000L;
default: default:
return duration; return duration;
} }

8
tall/src/main/java/com/ccsens/tall/bean/vo/MessageVo.java

@ -36,6 +36,8 @@ public class MessageVo {
private Long projectId; private Long projectId;
@ApiModelProperty("操作者ID") @ApiModelProperty("操作者ID")
private Long operatorId; private Long operatorId;
@ApiModelProperty("任务id")
private Long taskId;
@ApiModelProperty("消息列表") @ApiModelProperty("消息列表")
private List<Message> messages = new ArrayList<>(); private List<Message> messages = new ArrayList<>();
@ -47,6 +49,12 @@ public class MessageVo {
this.operatorId = operatorId; 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) { public Inform appendMessage(Message message) {
messages.add(message); messages.add(message);
return this; return this;

11
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); proMemberExample.createCriteria().andUserIdEqualTo(userId).andProjectIdEqualTo(projectId).andRecStatusEqualTo((byte)0);
List<ProMember> proMembers = proMemberMapper.selectByExample(proMemberExample); List<ProMember> proMembers = proMemberMapper.selectByExample(proMemberExample);
Long memberId=0L; Long memberId=0L;
if(CollectionUtil.isNotEmpty(proMembers)&&proMembers.size()==1){ if(CollectionUtil.isNotEmpty(proMembers)){
memberId=proMembers.get(0).getId(); if(proMembers.size()==1){
memberId=proMembers.get(0).getId();
}else {
throw new BaseException(CodeEnum.CHONGFU);
}
}else { }else {
throw new BaseException(CodeEnum.CHONGFU); return proRoleDao.selectSecondRolesByProjectId(projectId);
} }
//查看角色展示列表中是否有数据 //查看角色展示列表中是否有数据
ProMemberRoleShowExample proMemberRoleShowExample=new ProMemberRoleShowExample(); ProMemberRoleShowExample proMemberRoleShowExample=new ProMemberRoleShowExample();
proMemberRoleShowExample.createCriteria().andMemberIdEqualTo(memberId).andRecStatusEqualTo((byte)0); proMemberRoleShowExample.createCriteria().andMemberIdEqualTo(memberId).andRecStatusEqualTo((byte)0);

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

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

Loading…
Cancel
Save