|
|
@ -1,6 +1,5 @@
|
|
|
|
package io.renren.modules.activiti.controller;
|
|
|
|
package io.renren.modules.activiti.controller;
|
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.druid.pool.DruidDataSource;
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
import io.renren.common.annotation.LogOperation;
|
|
|
|
import io.renren.common.annotation.LogOperation;
|
|
|
@ -11,7 +10,6 @@ import io.renren.common.utils.Result;
|
|
|
|
import io.renren.modules.activiti.dto.BatchCompleteDTO;
|
|
|
|
import io.renren.modules.activiti.dto.BatchCompleteDTO;
|
|
|
|
import io.renren.modules.activiti.dto.TaskDTO;
|
|
|
|
import io.renren.modules.activiti.dto.TaskDTO;
|
|
|
|
import io.renren.modules.activiti.service.ActTaskService;
|
|
|
|
import io.renren.modules.activiti.service.ActTaskService;
|
|
|
|
import io.renren.modules.device.dto.TbDeviceApplyDTO;
|
|
|
|
|
|
|
|
import io.renren.modules.security.user.SecurityUser;
|
|
|
|
import io.renren.modules.security.user.SecurityUser;
|
|
|
|
import io.renren.modules.security.user.UserDetail;
|
|
|
|
import io.renren.modules.security.user.UserDetail;
|
|
|
|
import io.renren.modules.sys.dto.SysUserDTO;
|
|
|
|
import io.renren.modules.sys.dto.SysUserDTO;
|
|
|
@ -26,17 +24,14 @@ import org.activiti.engine.repository.ProcessDefinition;
|
|
|
|
import org.activiti.engine.repository.ProcessDefinitionQuery;
|
|
|
|
import org.activiti.engine.repository.ProcessDefinitionQuery;
|
|
|
|
import org.activiti.engine.task.TaskQuery;
|
|
|
|
import org.activiti.engine.task.TaskQuery;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.dao.DataAccessException;
|
|
|
|
|
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import springfox.documentation.annotations.ApiIgnore;
|
|
|
|
import springfox.documentation.annotations.ApiIgnore;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.*;
|
|
|
|
import java.util.LinkedHashMap;
|
|
|
|
import java.util.concurrent.CompletableFuture;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.concurrent.ExecutorService;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.concurrent.Executors;
|
|
|
|
|
|
|
|
import java.util.logging.Logger;
|
|
|
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -48,10 +43,6 @@ import java.util.stream.Collectors;
|
|
|
|
@RequestMapping("/act/task")
|
|
|
|
@RequestMapping("/act/task")
|
|
|
|
@Api(tags = "任务管理")
|
|
|
|
@Api(tags = "任务管理")
|
|
|
|
public class ActTaskController {
|
|
|
|
public class ActTaskController {
|
|
|
|
|
|
|
|
|
|
|
|
private static final Integer CPU_NUM = Runtime.getRuntime().availableProcessors();
|
|
|
|
|
|
|
|
private static final ExecutorService executor = Executors.newWorkStealingPool(CPU_NUM * 3);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private ActTaskService actTaskService;
|
|
|
|
private ActTaskService actTaskService;
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
@ -428,182 +419,6 @@ public class ActTaskController {
|
|
|
|
return new Result();
|
|
|
|
return new Result();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/getZwyBusinessList")
|
|
|
|
|
|
|
|
@ApiOperation("个人中心查询政务云资源申请列表")
|
|
|
|
|
|
|
|
@LogOperation("个人中心查询政务云资源申请列表")
|
|
|
|
|
|
|
|
@ApiImplicitParams({
|
|
|
|
|
|
|
|
@ApiImplicitParam(name = "name", value = "业务名称", paramType = "query", dataType = "String"),
|
|
|
|
|
|
|
|
@ApiImplicitParam(name = "applyType", value = "申请类型", paramType = "query", dataType = "String"),
|
|
|
|
|
|
|
|
@ApiImplicitParam(name = "status", value = "状态", paramType = "query", dataType = "String"),
|
|
|
|
|
|
|
|
@ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query", required = true, dataType = "Integer"),
|
|
|
|
|
|
|
|
@ApiImplicitParam(name = "pageSize", value = "分页大小", paramType = "query", required = true, dataType = "Integer")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
public Result getZwyBusinessList(String name, String applyType, String status, int pageNum, int pageSize) {
|
|
|
|
|
|
|
|
UserDetail user = SecurityUser.getUser();
|
|
|
|
|
|
|
|
JdbcTemplate jdbcTemplate = getJDBCTemplate();
|
|
|
|
|
|
|
|
StringBuilder sql = new StringBuilder("SELECT BSNUM, BUSINESS_NAME, APPLYTYPE, CREATE_TIME, STATUS " +
|
|
|
|
|
|
|
|
"FROM VIEW_CLOUD_BUSINESS_INDEX WHERE 1 = 1 AND ACCOUNT = " + user.getUsername());
|
|
|
|
|
|
|
|
if (!StringUtils.isEmpty(name)) {
|
|
|
|
|
|
|
|
sql.append(" AND BUSINESS_NAME LIKE CONCAT('%', ").append(name).append(", '%') ");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!StringUtils.isEmpty(applyType)) {
|
|
|
|
|
|
|
|
sql.append(" AND APPLYTYPE = ").append(applyType);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!StringUtils.isEmpty(status)) {
|
|
|
|
|
|
|
|
sql.append(" AND STATUS = ").append(status);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
sql.append("ORDER BY CREATE_TIME DESC");
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
Map<String, Object> resultMap = new HashMap<>();
|
|
|
|
|
|
|
|
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql.toString());
|
|
|
|
|
|
|
|
resultMap.put("total", list.size());
|
|
|
|
|
|
|
|
List<Map<String, Object>> result = list.stream().skip((pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
|
|
|
|
|
|
|
|
resultMap.put("list", result);
|
|
|
|
|
|
|
|
return new Result().ok(resultMap);
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
return new Result().error("数据查询异常,请联系云资源数据库管理人员!");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/getZwyVideoList")
|
|
|
|
|
|
|
|
@ApiOperation("个人中心查询政务云视频申请列表")
|
|
|
|
|
|
|
|
@LogOperation("个人中心查询政务云视频申请列表")
|
|
|
|
|
|
|
|
@ApiImplicitParams({
|
|
|
|
|
|
|
|
@ApiImplicitParam(name = "name", value = "业务名称", paramType = "query", dataType = "String"),
|
|
|
|
|
|
|
|
@ApiImplicitParam(name = "status", value = "状态", paramType = "query", dataType = "String"),
|
|
|
|
|
|
|
|
@ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query", required = true, dataType = "Integer"),
|
|
|
|
|
|
|
|
@ApiImplicitParam(name = "pageSize", value = "分页大小", paramType = "query", required = true, dataType = "Integer")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
public Result getZwyVideoList(String name, String status, int pageNum, int pageSize) {
|
|
|
|
|
|
|
|
UserDetail user = SecurityUser.getUser();
|
|
|
|
|
|
|
|
JdbcTemplate jdbcTemplate = getJDBCTemplate();
|
|
|
|
|
|
|
|
StringBuilder sql = new StringBuilder("SELECT BSNUM, BUSINESS_NAME, CREATE_TIME, STATUS " +
|
|
|
|
|
|
|
|
"FROM VIEW_VIDEO_BUSINESS_INDEX WHERE 1 = 1 AND ACCOUNT = " + user.getUsername());
|
|
|
|
|
|
|
|
if (!StringUtils.isEmpty(name)) {
|
|
|
|
|
|
|
|
sql.append(" AND BUSINESS_NAME LIKE CONCAT('%', ").append(name).append(", '%') ");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!StringUtils.isEmpty(status)) {
|
|
|
|
|
|
|
|
sql.append(" AND STATUS = ").append(status);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
sql.append("ORDER BY CREATE_TIME DESC");
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
Map<String, Object> resultMap = new HashMap<>();
|
|
|
|
|
|
|
|
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql.toString());
|
|
|
|
|
|
|
|
resultMap.put("total", list.size());
|
|
|
|
|
|
|
|
List<Map<String, Object>> result = list.stream().skip((pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
|
|
|
|
|
|
|
|
resultMap.put("list", result);
|
|
|
|
|
|
|
|
return new Result().ok(resultMap);
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
return new Result().error("数据查询异常,请联系云资源数据库管理人员!");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/getZwyBusinessInfoById")
|
|
|
|
|
|
|
|
@ApiOperation("根据政务云资源申请业务ID查询详情")
|
|
|
|
|
|
|
|
@LogOperation("根据政务云资源申请业务ID查询详情")
|
|
|
|
|
|
|
|
@ApiImplicitParams({
|
|
|
|
|
|
|
|
@ApiImplicitParam(name = "id", value = "业务ID", paramType = "query",required = true, dataType = "String")
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
public Result getZwyBusinessInfoById(String id) {
|
|
|
|
|
|
|
|
JdbcTemplate jdbcTemplate = getJDBCTemplate();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
ArrayList<Map> arrayList = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//云主机
|
|
|
|
|
|
|
|
CompletableFuture<Void> yzj = CompletableFuture.runAsync(() -> {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
StringBuilder sql = new StringBuilder("SELECT BSNUM, SOURCE_TYPE, NAME, DISPOSE " +
|
|
|
|
|
|
|
|
" FROM VIEW_CLOUD_HOST_INFO WHERE 1 = 1 AND BSNUM = ");
|
|
|
|
|
|
|
|
sql.append(id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql.toString());
|
|
|
|
|
|
|
|
arrayList.addAll(list);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, executor);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//云数据库
|
|
|
|
|
|
|
|
CompletableFuture<Void> ysjk = CompletableFuture.runAsync(() -> {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
StringBuilder sql = new StringBuilder("SELECT BSNUM, SOURCE_TYPE, NAME, DISPOSE " +
|
|
|
|
|
|
|
|
" FROM VIEW_CLOUD_HOST_INFO WHERE 1 = 1 AND BSNUM = ");
|
|
|
|
|
|
|
|
sql.append(id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql.toString());
|
|
|
|
|
|
|
|
arrayList.addAll(list);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, executor);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//对象存储
|
|
|
|
|
|
|
|
CompletableFuture<Void> dxcc = CompletableFuture.runAsync(() -> {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
StringBuilder sql = new StringBuilder("SELECT BSNUM, SOURCE_TYPE, NAME, DISPOSE " +
|
|
|
|
|
|
|
|
" FROM VIEW_CLOUD_HOST_INFO WHERE 1 = 1 AND BSNUM = ");
|
|
|
|
|
|
|
|
sql.append(id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql.toString());
|
|
|
|
|
|
|
|
arrayList.addAll(list);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, executor);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//托管服务
|
|
|
|
|
|
|
|
CompletableFuture<Void> tgfw = CompletableFuture.runAsync(() -> {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
StringBuilder sql = new StringBuilder("SELECT BSNUM, SOURCE_TYPE, NAME, DISPOSE " +
|
|
|
|
|
|
|
|
" FROM VIEW_CLOUD_HOST_INFO WHERE 1 = 1 AND BSNUM = ");
|
|
|
|
|
|
|
|
sql.append(id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql.toString());
|
|
|
|
|
|
|
|
arrayList.addAll(list);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, executor);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CompletableFuture all = CompletableFuture.allOf(yzj, ysjk, dxcc, tgfw);
|
|
|
|
|
|
|
|
all.join();
|
|
|
|
|
|
|
|
return new Result().ok(arrayList);
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
return new Result().error("数据查询异常,请联系云资源数据库管理人员!");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/getZwyVideoInfoById")
|
|
|
|
|
|
|
|
@ApiOperation("根据政务云视频申请业务ID查询详情")
|
|
|
|
|
|
|
|
@LogOperation("根据政务云视频申请业务ID查询详情")
|
|
|
|
|
|
|
|
@ApiImplicitParams({
|
|
|
|
|
|
|
|
@ApiImplicitParam(name = "id", value = "业务ID", paramType = "query",required = true, dataType = "String")
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
public Result getZwyVideoInfoById(String id) {
|
|
|
|
|
|
|
|
JdbcTemplate jdbcTemplate = getJDBCTemplate();
|
|
|
|
|
|
|
|
StringBuilder sql = new StringBuilder("SELECT BSNUM, CAMERATYPE, NAME, ORG_NAME " +
|
|
|
|
|
|
|
|
"FROM VIEW_VIDEO_BUSINESS_RELATION WHERE 1 = 1 AND BSNUM = ");
|
|
|
|
|
|
|
|
sql.append(id);
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql.toString());
|
|
|
|
|
|
|
|
return new Result().ok(list);
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
return new Result().error("数据查询异常,请联系云资源数据库管理人员!");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private JdbcTemplate getJDBCTemplate() {
|
|
|
|
|
|
|
|
DruidDataSource druidDataSource = new DruidDataSource();
|
|
|
|
|
|
|
|
druidDataSource.setUrl("jdbc:oracle:thin:@15.72.183.89:1521:orcl");
|
|
|
|
|
|
|
|
druidDataSource.setDriverClassName("oracle.jdbc.OracleDriver");
|
|
|
|
|
|
|
|
druidDataSource.setUsername("csynuser");
|
|
|
|
|
|
|
|
druidDataSource.setPassword("csynuser123");
|
|
|
|
|
|
|
|
jdbcTemplate.setDataSource(druidDataSource);
|
|
|
|
|
|
|
|
return jdbcTemplate;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("batchBackToFirst")
|
|
|
|
@PostMapping("batchBackToFirst")
|
|
|
|
@ApiOperation("驳回,回退至第一个用户任务(重新录入表单)")
|
|
|
|
@ApiOperation("驳回,回退至第一个用户任务(重新录入表单)")
|
|
|
|
@LogOperation("驳回,回退至第一个用户任务(重新录入表单)")
|
|
|
|
@LogOperation("驳回,回退至第一个用户任务(重新录入表单)")
|
|
|
|