Merge branch 'master' into docker_package
This commit is contained in:
commit
8059071f89
|
@ -406,7 +406,7 @@ public class ActHistoryService {
|
||||||
if (between <= interval) { // 间隔天数小于限制天数
|
if (between <= interval) { // 间隔天数小于限制天数
|
||||||
index.setAllowReminders(Boolean.FALSE); // 不允许催办
|
index.setAllowReminders(Boolean.FALSE); // 不允许催办
|
||||||
index.setDoneReminders(Boolean.TRUE); // 存在催办记录
|
index.setDoneReminders(Boolean.TRUE); // 存在催办记录
|
||||||
index.setNextRemindersDays((int) (interval - between)); // 距离下次催办天数为0
|
index.setNextRemindersDays((int) (interval - between)); // 距离下次催办天数
|
||||||
} else {
|
} else {
|
||||||
index.setAllowReminders(Boolean.TRUE); // 不允许催办
|
index.setAllowReminders(Boolean.TRUE); // 不允许催办
|
||||||
index.setDoneReminders(Boolean.TRUE); // 存在催办记录
|
index.setDoneReminders(Boolean.TRUE); // 存在催办记录
|
||||||
|
|
|
@ -24,6 +24,7 @@ import io.renren.modules.processForm.dto.TAbilityApplicationV2DTO;
|
||||||
import io.renren.modules.processForm.entity.TAbilityApplicationEntity;
|
import io.renren.modules.processForm.entity.TAbilityApplicationEntity;
|
||||||
import io.renren.modules.processForm.excel.TAbilityApplicationExcel;
|
import io.renren.modules.processForm.excel.TAbilityApplicationExcel;
|
||||||
import io.renren.modules.processForm.service.TAbilityApplicationService;
|
import io.renren.modules.processForm.service.TAbilityApplicationService;
|
||||||
|
import io.renren.modules.reminders.service.TRemindersService;
|
||||||
import io.renren.modules.resource.dto.ResourceDTO;
|
import io.renren.modules.resource.dto.ResourceDTO;
|
||||||
import io.renren.modules.resource.excel.census.config.CustomCellWriteHeightConfig;
|
import io.renren.modules.resource.excel.census.config.CustomCellWriteHeightConfig;
|
||||||
import io.renren.modules.resource.excel.census.config.CustomCellWriteWeightConfig;
|
import io.renren.modules.resource.excel.census.config.CustomCellWriteWeightConfig;
|
||||||
|
@ -57,7 +58,9 @@ import java.io.IOException;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.temporal.ChronoUnit;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@ -98,6 +101,12 @@ public class TAbilityApplicationController {
|
||||||
@Value("${infrastructure.dept-can-apply-max}")
|
@Value("${infrastructure.dept-can-apply-max}")
|
||||||
private Integer infrastructureMax;
|
private Integer infrastructureMax;
|
||||||
|
|
||||||
|
@Value("${reminders.interval:7}") // 流程发起后多少天允许催办
|
||||||
|
private Integer interval;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private TRemindersService tRemindersService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据能力资源id获取该能力申请使用分页
|
* 根据能力资源id获取该能力申请使用分页
|
||||||
|
@ -142,14 +151,14 @@ public class TAbilityApplicationController {
|
||||||
PageData<TAbilityApplicationDTO> page = tAbilityApplicationService.page(params);
|
PageData<TAbilityApplicationDTO> page = tAbilityApplicationService.page(params);
|
||||||
List<TAbilityApplicationDTO> list =
|
List<TAbilityApplicationDTO> list =
|
||||||
page.getList().stream().map(index -> {
|
page.getList().stream().map(index -> {
|
||||||
|
String inStanceIdSql = String.format("SELECT DISTINCT instance_id FROM t_ability_application WHERE apply_flag = '%s' LIMIT 1", index.getApplyFlag());
|
||||||
Integer inStanceId =
|
Integer inStanceId =
|
||||||
jdbcTemplate.queryForObject(String.format("SELECT DISTINCT instance_id FROM t_ability_application WHERE apply_flag = '%s' LIMIT 1", index.getApplyFlag()), Integer.class);
|
jdbcTemplate.queryForObject(inStanceIdSql, Integer.class);
|
||||||
if (inStanceId == null) {
|
if (inStanceId == null) {
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<TAbilityApplicationDTO> dtos =
|
List<TAbilityApplicationDTO> dtos = tAbilityApplicationService.getByInstanceId(inStanceId + "");
|
||||||
tAbilityApplicationService.getByInstanceId(inStanceId + "");
|
|
||||||
if (!dtos.isEmpty()) {
|
if (!dtos.isEmpty()) {
|
||||||
dtos.stream()
|
dtos.stream()
|
||||||
.limit(1L)
|
.limit(1L)
|
||||||
|
@ -161,7 +170,6 @@ public class TAbilityApplicationController {
|
||||||
} else {
|
} else {
|
||||||
index.setSystem("视频资源申请:" + index.getSystem());
|
index.setSystem("视频资源申请:" + index.getSystem());
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -172,6 +180,35 @@ public class TAbilityApplicationController {
|
||||||
Boolean ended = jdbcTemplate.queryForObject(sql, Boolean.class);
|
Boolean ended = jdbcTemplate.queryForObject(sql, Boolean.class);
|
||||||
index.setEnded(Boolean.TRUE.equals(ended));
|
index.setEnded(Boolean.TRUE.equals(ended));
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 处理催办条件与催办信息
|
||||||
|
*/
|
||||||
|
Optional<Task> nowTask = taskService.createTaskQuery().processInstanceId(index.getInstanceId())
|
||||||
|
.orderByTaskCreateTime().desc().active().list().stream().findFirst(); // 尝试获取当前task
|
||||||
|
if (nowTask.isPresent()) { // 存在正在进行的任务
|
||||||
|
LocalDate localDate = tRemindersService.selectRemindersTime(nowTask.get().getId());
|
||||||
|
if (localDate == null) { // 未进行过催办
|
||||||
|
index.setAllowReminders(Boolean.TRUE); // 允许催办
|
||||||
|
index.setDoneReminders(Boolean.FALSE); // 不存在催办记录
|
||||||
|
index.setNextRemindersDays(0); // 距离下次催办天数为0
|
||||||
|
} else { // 进行过催办
|
||||||
|
long between = ChronoUnit.DAYS.between(localDate, LocalDate.now()); // 上次催办距离今天已过天数
|
||||||
|
if (between <= interval) { // 间隔天数小于限制天数
|
||||||
|
index.setAllowReminders(Boolean.FALSE); // 不允许催办
|
||||||
|
index.setDoneReminders(Boolean.TRUE); // 存在催办记录
|
||||||
|
index.setNextRemindersDays((int) (interval - between)); // 距离下次催办天数
|
||||||
|
} else {
|
||||||
|
index.setAllowReminders(Boolean.TRUE); // 不允许催办
|
||||||
|
index.setDoneReminders(Boolean.TRUE); // 存在催办记录
|
||||||
|
index.setNextRemindersDays(0); // 距离下次催办天数为0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
index.setAllowReminders(Boolean.FALSE);
|
||||||
|
index.setDoneReminders(Boolean.FALSE);
|
||||||
|
index.setNextRemindersDays(0);
|
||||||
|
}
|
||||||
|
|
||||||
return index;
|
return index;
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
page.setList(list);
|
page.setList(list);
|
||||||
|
|
|
@ -97,4 +97,15 @@ public class TAbilityApplicationDTO extends AuditingBaseDTO implements Serializa
|
||||||
|
|
||||||
@ApiModelProperty(value = "申请价格")
|
@ApiModelProperty(value = "申请价格")
|
||||||
private BigDecimal applyPrice;
|
private BigDecimal applyPrice;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 催办功能增加字段
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "该流程的节点当前是否允许催办")
|
||||||
|
private Boolean allowReminders;
|
||||||
|
@ApiModelProperty(value = "该流程的节点当前是否已经进行过催办")
|
||||||
|
private Boolean doneReminders;
|
||||||
|
@ApiModelProperty(value = "该流程的节点需几天后进行催办")
|
||||||
|
private Integer nextRemindersDays;
|
||||||
}
|
}
|
|
@ -49,16 +49,6 @@ public class TRemindersServiceImpl extends CrudServiceImpl<TRemindersDao, TRemin
|
||||||
@Value("${reminders.interval:7}") // 流程发起后多少天允许催办
|
@Value("${reminders.interval:7}") // 流程发起后多少天允许催办
|
||||||
private Integer interval;
|
private Integer interval;
|
||||||
|
|
||||||
// @Autowired
|
|
||||||
// private RestTemplate restTemplate;
|
|
||||||
// @Autowired
|
|
||||||
// private SysUserDao sysUserDao;
|
|
||||||
// @Autowired
|
|
||||||
// private SysNoticeUserService sysNoticeUserService;
|
|
||||||
// @Autowired
|
|
||||||
// private NoticeUntil noticeUntil;
|
|
||||||
// @Autowired
|
|
||||||
// private ActTaskService actTaskService;
|
|
||||||
@Autowired
|
@Autowired
|
||||||
protected HistoryService historyService;
|
protected HistoryService historyService;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|
Loading…
Reference in New Issue