This commit is contained in:
dinggang 2022-12-15 16:45:47 +08:00
commit 81fe70aa42
7 changed files with 37 additions and 10 deletions

View File

@ -140,13 +140,14 @@ public class ActTaskController {
*/
if (!(params.containsKey("processDefinitionKey") && org.apache.commons.lang3.StringUtils.isNotEmpty(params.get("processDefinitionKey").toString()))) {
List<Long> useIds = sysRoleUserService.getUserIdListByRoleId(Long.parseLong(defaultAssigneeRoleId));
if (useIds.stream().filter(index -> index == SecurityUser.getUserId()).findFirst().isPresent()) { // 拥有会客厅审核权限
if (useIds.contains(Long.parseLong(userId))) { // 拥有会客厅审核权限
int meetingroom_book = jdbcTemplate.queryForObject("SELECT COUNT(id) FROM t_meetingroom_book WHERE state = 1;", Integer.class);
page.setTotal(page.getTotal() + meetingroom_book);
Integer limit = 10;
if (params.get(Constant.LIMIT) != null) {
limit = Integer.parseInt((String) params.get(Constant.LIMIT));
}
int mettingLimit = limit - page.getList().size();
if (page.getList().size() < limit) {
List<Map<String, Object>> meetingroom_bookTask = jdbcTemplate.queryForList("SELECT " +
" t_meetingroom_book.id AS `taskId`, " +
@ -160,7 +161,7 @@ public class ActTaskController {
" t_meetingroom_book " +
" LEFT JOIN t_meetingroom ON t_meetingroom_book.room_id = t_meetingroom.id " +
"WHERE " +
" state = 1;");
" state = 1 LIMIT " + mettingLimit);
List<TaskDTO> meetingroom_bookTaskDto = meetingroom_bookTask
.stream().map(index -> {
TaskDTO taskDTO = JSON.parseObject(JSON.toJSONString(index), TaskDTO.class);

View File

@ -38,6 +38,8 @@ import org.activiti.engine.history.HistoricProcessInstance;
import org.activiti.engine.history.HistoricProcessInstanceQuery;
import org.activiti.engine.task.Task;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.JdbcTemplate;
@ -63,6 +65,7 @@ import java.util.stream.Collectors;
@RequestMapping("/act/his")
@Api(tags = "流程历史")
public class HistoryController {
private static final Logger logger = LoggerFactory.getLogger(HistoryController.class);
@Autowired
protected HistoryService historyService_;
@ -140,15 +143,17 @@ public class HistoryController {
params.replace("processDefinitionKey", params.get("processDefinitionKey").toString() + "%");
}
PageData<ProcessActivityDTO> page = activitiService.getMyProcessInstancePage(params);
List<Long> useIds = sysRoleUserService.getUserIdListByRoleId(Long.parseLong(defaultAssigneeRoleId));
if (!(params.containsKey("processDefinitionKey") && org.apache.commons.lang3.StringUtils.isNotEmpty(params.get("processDefinitionKey").toString()))) {
if (useIds.stream().filter(index -> index == SecurityUser.getUserId()).findFirst().isPresent()) { // 拥有会客厅审核权限
List<Long> useIds = sysRoleUserService.getUserIdListByRoleId(Long.parseLong(defaultAssigneeRoleId));
if (useIds.contains(SecurityUser.getUserId())) { // 拥有会客厅审核权限
logger.info(SecurityUser.getUserId() + " 拥有会客厅权限");
int meetingroom_book = jdbcTemplate.queryForObject("SELECT COUNT(id) FROM t_meetingroom_book WHERE state != 1;", Integer.class);
page.setTotal(page.getTotal() + meetingroom_book);
Integer limit = 10;
if (params.get(Constant.LIMIT) != null) {
limit = Integer.parseInt((String) params.get(Constant.LIMIT));
}
int mettingLimit = limit - page.getList().size();
if (page.getList().size() < limit) {
List<Map<String, Object>> meetingroom_bookTask = jdbcTemplate.queryForList("SELECT " +
" t_meetingroom_book.id AS `businessKey`, " +
@ -162,7 +167,7 @@ public class HistoryController {
" t_meetingroom_book " +
" LEFT JOIN t_meetingroom ON t_meetingroom_book.room_id = t_meetingroom.id " +
"WHERE " +
" state != 1 ;");
" state != 1 LIMIT " + mettingLimit);
List<ProcessActivityDTO> meetingroom_bookTaskDto = meetingroom_bookTask
.stream().map(index -> {
ProcessActivityDTO taskDTO = JSON.parseObject(JSON.toJSONString(index), ProcessActivityDTO.class);
@ -219,6 +224,7 @@ public class HistoryController {
detailDTO.setExecutionId(task.getExecutionId());
detailDTO.setProcessDefinitionId(task.getProcessDefinitionId());
detailDTO.setComment("待审核");
detailDTO.setTaskId(task.getId());
final List<HistoryDetailDTO> taskHandleDetailInfo_ = new ArrayList<>();
taskHandleDetailInfo_.add(detailDTO);
taskHandleDetailInfo_.addAll(list);

View File

@ -351,7 +351,10 @@ public class ActTaskService extends BaseServiceImpl {
StringBuilder stringBuilder = new StringBuilder();
List<String> proviDeptsName = resourceDao.selectProvideDeptNameByIds(resourceIds);
proviDeptsName.forEach(x -> stringBuilder.append(x).append(","));
String string = stringBuilder.substring(0, stringBuilder.length() - 1);
String string = "";
if (stringBuilder.length() > 0) {
string = stringBuilder.substring(0, stringBuilder.length() - 1);
}
dto.setProvideDept(string);
}, executor);

View File

@ -15,6 +15,8 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpEntity;
@ -39,6 +41,7 @@ import java.util.*;
@Api(tags = "网关统计")
@Log4j2
public class MonitorController {
private static final Logger logger = LoggerFactory.getLogger(MonitorController.class);
@Autowired
private RestTemplate restTemplate;
@ -151,9 +154,20 @@ public class MonitorController {
outputStream.write(buffer, 0, len);
len = inputStream.read(buffer);
}
outputStream.close();
inputStream.close();
} catch (Exception e) {
e.printStackTrace();
log.error("网关接口异常", e);
response.setStatus(500);
try {
ServletOutputStream outputStream = response.getOutputStream();
outputStream.write("api error".getBytes());
outputStream.flush();
outputStream.close();
} catch (Exception exception) {
}
}
}

View File

@ -668,7 +668,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
}
@Override
@Cacheable(value = resourceSelectTotalKey, key = "'totle'")
@Cacheable(value = resourceSelectTotalKey, key = "'totol'")
public Object selectTotal() {
HashMap<String, Object> resultMap = new HashMap<>();
List<Map> re = resourceDao.selectTypeCount(null);

View File

@ -72,6 +72,9 @@ big_date:
assignee_role_name: 部门审批人
assignee_district_role_name: 区审批人
assignee_city_role_name: 市审批人
# 会客厅审核员角色
assignee_meet_role_id: 1599681595457933313
# 平台部署级别 (PROVINCE:省 PREFECTURE:地级市 DISTRICT:区县 STREET:街道)
stage: PREFECTURE

View File

@ -116,7 +116,7 @@
eternal="false"
timeToIdleSeconds="15"
timeToLiveSeconds="60"
overflowToDisk="true"
diskPersistent="true"
overflowToDisk="false"
diskPersistent="false"
memoryStoreEvictionPolicy="LRU"/>
</ehcache>