Merge branch 'dev'
This commit is contained in:
commit
37ca5ade65
|
@ -397,7 +397,7 @@ public class ActHistoryService {
|
|||
.orderByTaskCreateTime().desc().active().list().stream().findFirst(); // 尝试获取当前task
|
||||
if (nowTask.isPresent()) { // 存在正在进行的任务
|
||||
LocalDate localDate = tRemindersService.selectRemindersTime(nowTask.get().getId());
|
||||
if (localDate == null) {// 未进行过催办
|
||||
if (localDate == null) { // 未进行过催办
|
||||
index.setAllowReminders(Boolean.TRUE); // 允许催办
|
||||
index.setDoneReminders(Boolean.FALSE); // 不存在催办记录
|
||||
index.setNextRemindersDays(0); // 距离下次催办天数为0
|
||||
|
@ -406,7 +406,7 @@ public class ActHistoryService {
|
|||
if (between <= interval) { // 间隔天数小于限制天数
|
||||
index.setAllowReminders(Boolean.FALSE); // 不允许催办
|
||||
index.setDoneReminders(Boolean.TRUE); // 存在催办记录
|
||||
index.setNextRemindersDays((int) (interval - between)); // 距离下次催办天数为0
|
||||
index.setNextRemindersDays((int) (interval - between)); // 距离下次催办天数
|
||||
} else {
|
||||
index.setAllowReminders(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.excel.TAbilityApplicationExcel;
|
||||
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.excel.census.config.CustomCellWriteHeightConfig;
|
||||
import io.renren.modules.resource.excel.census.config.CustomCellWriteWeightConfig;
|
||||
|
@ -57,7 +58,9 @@ import java.io.IOException;
|
|||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.net.URLEncoder;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
@ -98,6 +101,12 @@ public class TAbilityApplicationController {
|
|||
@Value("${infrastructure.dept-can-apply-max}")
|
||||
private Integer infrastructureMax;
|
||||
|
||||
@Value("${reminders.interval:7}") // 流程发起后多少天允许催办
|
||||
private Integer interval;
|
||||
|
||||
@Autowired
|
||||
private TRemindersService tRemindersService;
|
||||
|
||||
|
||||
/**
|
||||
* 根据能力资源id获取该能力申请使用分页
|
||||
|
@ -142,14 +151,14 @@ public class TAbilityApplicationController {
|
|||
PageData<TAbilityApplicationDTO> page = tAbilityApplicationService.page(params);
|
||||
List<TAbilityApplicationDTO> list =
|
||||
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 =
|
||||
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) {
|
||||
return index;
|
||||
}
|
||||
|
||||
List<TAbilityApplicationDTO> dtos =
|
||||
tAbilityApplicationService.getByInstanceId(inStanceId + "");
|
||||
List<TAbilityApplicationDTO> dtos = tAbilityApplicationService.getByInstanceId(inStanceId + "");
|
||||
if (!dtos.isEmpty()) {
|
||||
dtos.stream()
|
||||
.limit(1L)
|
||||
|
@ -161,7 +170,6 @@ public class TAbilityApplicationController {
|
|||
} else {
|
||||
index.setSystem("视频资源申请:" + index.getSystem());
|
||||
}
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -172,6 +180,35 @@ public class TAbilityApplicationController {
|
|||
Boolean ended = jdbcTemplate.queryForObject(sql, Boolean.class);
|
||||
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;
|
||||
}).collect(Collectors.toList());
|
||||
page.setList(list);
|
||||
|
@ -489,7 +526,7 @@ public class TAbilityApplicationController {
|
|||
@ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query", dataType = "INTEGER"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "页数大小", paramType = "query", dataType = "INTEGER")
|
||||
})
|
||||
public Result getFundStatement (@ApiIgnore @RequestParam Map<String, Object> params) {
|
||||
public Result getFundStatement(@ApiIgnore @RequestParam Map<String, Object> params) {
|
||||
return new Result().ok(tAbilityApplicationService.getFundStatement(params));
|
||||
}
|
||||
|
||||
|
@ -557,14 +594,14 @@ public class TAbilityApplicationController {
|
|||
@GetMapping("/getDistrictFundStatement")
|
||||
@ApiOperation("获取区市资金报表")
|
||||
@LogOperation("获取区市资金报表")
|
||||
public Result getDistrictFundStatement (Map<String, Object> params) {
|
||||
public Result getDistrictFundStatement(Map<String, Object> params) {
|
||||
return new Result().ok(tAbilityApplicationService.getDistrictFundStatement(params));
|
||||
}
|
||||
|
||||
@GetMapping("/getComponentFundStatement")
|
||||
@ApiOperation("获取组件节约资金列表")
|
||||
@LogOperation("获取组件节约资金列表")
|
||||
public Result getComponentFundStatement (Map<String, Object> params) {
|
||||
public Result getComponentFundStatement(Map<String, Object> params) {
|
||||
return new Result().ok(tAbilityApplicationService.getComponentFundStatement(params));
|
||||
}
|
||||
|
||||
|
@ -572,7 +609,7 @@ public class TAbilityApplicationController {
|
|||
@GetMapping("/getResourceFundStatement")
|
||||
@ApiOperation("获取应用资源节约资金列表")
|
||||
@LogOperation("获取应用资源节约资金列表")
|
||||
public Result getResourceFundStatement (Map<String, Object> params) {
|
||||
public Result getResourceFundStatement(Map<String, Object> params) {
|
||||
return new Result().ok(tAbilityApplicationService.getResourceFundStatement(params));
|
||||
}
|
||||
|
||||
|
@ -580,7 +617,7 @@ public class TAbilityApplicationController {
|
|||
@GetMapping("/getInfrastructureFundStatement")
|
||||
@ApiOperation("获取基础设施节约资金列表")
|
||||
@LogOperation("获取基础设施节约资金列表")
|
||||
public Result getInfrastructureFundStatement (Map<String, Object> params) {
|
||||
public Result getInfrastructureFundStatement(Map<String, Object> params) {
|
||||
return new Result().ok(tAbilityApplicationService.getInfrastructureFundStatement(params));
|
||||
}
|
||||
|
||||
|
@ -588,7 +625,7 @@ public class TAbilityApplicationController {
|
|||
@GetMapping("/getProvideDeptFundStatement")
|
||||
@ApiOperation("获取提供部门节约资金列表")
|
||||
@LogOperation("获取提供部门节约资金列表")
|
||||
public Result getProvideDeptFundStatement (Map<String, Object> params) {
|
||||
public Result getProvideDeptFundStatement(Map<String, Object> params) {
|
||||
return new Result().ok(tAbilityApplicationService.getProvideDeptFundStatement(params));
|
||||
}
|
||||
|
||||
|
@ -596,7 +633,7 @@ public class TAbilityApplicationController {
|
|||
@GetMapping("/getApplyDeptFundStatement")
|
||||
@ApiOperation("获取申请部门节约资金列表")
|
||||
@LogOperation("获取申请部门节约资金列表")
|
||||
public Result getApplyDeptFundStatement (Map<String, Object> params) {
|
||||
public Result getApplyDeptFundStatement(Map<String, Object> params) {
|
||||
return new Result().ok(tAbilityApplicationService.getApplyDeptFundStatement(params));
|
||||
}
|
||||
|
||||
|
@ -604,7 +641,7 @@ public class TAbilityApplicationController {
|
|||
@GetMapping("/getProvideDistrictFundStatement")
|
||||
@ApiOperation("获取提供区市节约资金列表")
|
||||
@LogOperation("获取提供区市节约资金列表")
|
||||
public Result getProvideDistrictFundStatement (Map<String, Object> params) {
|
||||
public Result getProvideDistrictFundStatement(Map<String, Object> params) {
|
||||
return new Result().ok(tAbilityApplicationService.getProvideDistrictFundStatement(params));
|
||||
}
|
||||
|
||||
|
@ -612,7 +649,7 @@ public class TAbilityApplicationController {
|
|||
@GetMapping("/getApplyDistrictFundStatement")
|
||||
@ApiOperation("获取申请区市节约资金列表")
|
||||
@LogOperation("获取申请区市节约资金列表")
|
||||
public Result getApplyDistrictFundStatement (Map<String, Object> params) {
|
||||
public Result getApplyDistrictFundStatement(Map<String, Object> params) {
|
||||
return new Result().ok(tAbilityApplicationService.getApplyDistrictFundStatement(params));
|
||||
}
|
||||
|
||||
|
|
|
@ -97,4 +97,15 @@ public class TAbilityApplicationDTO extends AuditingBaseDTO implements Serializa
|
|||
|
||||
@ApiModelProperty(value = "申请价格")
|
||||
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}") // 流程发起后多少天允许催办
|
||||
private Integer interval;
|
||||
|
||||
// @Autowired
|
||||
// private RestTemplate restTemplate;
|
||||
// @Autowired
|
||||
// private SysUserDao sysUserDao;
|
||||
// @Autowired
|
||||
// private SysNoticeUserService sysNoticeUserService;
|
||||
// @Autowired
|
||||
// private NoticeUntil noticeUntil;
|
||||
// @Autowired
|
||||
// private ActTaskService actTaskService;
|
||||
@Autowired
|
||||
protected HistoryService historyService;
|
||||
@Autowired
|
||||
|
|
Loading…
Reference in New Issue