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. 7
      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
@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;
}

8
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<Message> 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;

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

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

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

Loading…
Cancel
Save