Merge branch 'master' into docker_package
This commit is contained in:
commit
60d3505364
|
@ -1,5 +1,6 @@
|
||||||
package io.renren.modules.processForm.controller;
|
package io.renren.modules.processForm.controller;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
import io.renren.common.annotation.LogOperation;
|
import io.renren.common.annotation.LogOperation;
|
||||||
import io.renren.common.constant.Constant;
|
import io.renren.common.constant.Constant;
|
||||||
import io.renren.common.page.PageData;
|
import io.renren.common.page.PageData;
|
||||||
|
@ -22,6 +23,7 @@ import io.renren.modules.resource.service.ResourceService;
|
||||||
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.SysDeptDTO;
|
import io.renren.modules.sys.dto.SysDeptDTO;
|
||||||
|
import io.renren.modules.sys.service.SysDeptService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
|
@ -34,6 +36,7 @@ import org.springframework.web.bind.annotation.*;
|
||||||
import springfox.documentation.annotations.ApiIgnore;
|
import springfox.documentation.annotations.ApiIgnore;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -59,6 +62,8 @@ public class TAbilityApplicationController {
|
||||||
private ActivitiService activitiService;
|
private ActivitiService activitiService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private JdbcTemplate jdbcTemplate;
|
private JdbcTemplate jdbcTemplate;
|
||||||
|
@Autowired
|
||||||
|
private SysDeptService sysDeptService;
|
||||||
@Value("${project.place}")
|
@Value("${project.place}")
|
||||||
private Integer projectPlace;
|
private Integer projectPlace;
|
||||||
|
|
||||||
|
@ -70,14 +75,8 @@ public class TAbilityApplicationController {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping("my_page")
|
@GetMapping("my_page")
|
||||||
@ApiOperation("我的申请分页")
|
|
||||||
@LogOperation("我的申请分页")
|
@LogOperation("我的申请分页")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType = "int"), @ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int"), @ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType = "String"), @ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType = "String")})
|
||||||
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType = "int"),
|
|
||||||
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int"),
|
|
||||||
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType = "String"),
|
|
||||||
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType = "String")
|
|
||||||
})
|
|
||||||
public Result<PageData<TAbilityApplicationDTO>> myPage(@ApiIgnore @RequestParam Map<String, Object> params) {
|
public Result<PageData<TAbilityApplicationDTO>> myPage(@ApiIgnore @RequestParam Map<String, Object> params) {
|
||||||
final UserDetail user = SecurityUser.getUser();
|
final UserDetail user = SecurityUser.getUser();
|
||||||
params.put("abilityprocess_v2", Boolean.TRUE); // 是否根据流程 abilityprocess_v2 来分页
|
params.put("abilityprocess_v2", Boolean.TRUE); // 是否根据流程 abilityprocess_v2 来分页
|
||||||
|
@ -86,6 +85,24 @@ public class TAbilityApplicationController {
|
||||||
return new Result<PageData<TAbilityApplicationDTO>>().ok(page);
|
return new Result<PageData<TAbilityApplicationDTO>>().ok(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新旧数据(无申请能力所属部门)
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
|
||||||
|
@GetMapping("deal")
|
||||||
|
public Result<String> test() {
|
||||||
|
List<Map<String, Object>> re = jdbcTemplate.queryForList("SELECT t_ability_application.id,t_ability_application.resource_id,tb_data_resource.dept_id from t_ability_application JOIN tb_data_resource ON t_ability_application.resource_id = tb_data_resource.id WHERE resource_owner_dept IS NULL;");
|
||||||
|
re.stream().forEach(index -> {
|
||||||
|
SysDeptDTO sysDeptDTO = sysDeptService.get(Long.valueOf(index.get("dept_id").toString()));
|
||||||
|
if (sysDeptDTO != null) {
|
||||||
|
jdbcTemplate.update(String.format("UPDATE t_ability_application SET resource_owner_dept = '%s' WHERE id = %s", JSON.toJSONString(sysDeptDTO), index.get("id").toString()));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return new Result<String>().ok(LocalDateTime.now().toString());
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("getByApplyFlag/{applyFlag}")
|
@GetMapping("getByApplyFlag/{applyFlag}")
|
||||||
@ApiOperation("根据申请标识获取能力申请信息")
|
@ApiOperation("根据申请标识获取能力申请信息")
|
||||||
@LogOperation("根据申请标识获取能力申请信息")
|
@LogOperation("根据申请标识获取能力申请信息")
|
||||||
|
@ -98,8 +115,7 @@ public class TAbilityApplicationController {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
List<TAbilityApplicationDTO> applicationDTOS = tAbilityApplicationService.list(params);
|
List<TAbilityApplicationDTO> applicationDTOS = tAbilityApplicationService.list(params);
|
||||||
Map<String, List<TAbilityApplicationDTO>> result =
|
Map<String, List<TAbilityApplicationDTO>> result = applicationDTOS.stream().collect(Collectors.groupingBy(t -> {
|
||||||
applicationDTOS.stream().collect(Collectors.groupingBy(t -> {
|
|
||||||
SysDeptDTO sysDeptDTO = t.getResourceOwnerDept();
|
SysDeptDTO sysDeptDTO = t.getResourceOwnerDept();
|
||||||
if (sysDeptDTO == null) {
|
if (sysDeptDTO == null) {
|
||||||
return "无部门信息"; // 无部门信息
|
return "无部门信息"; // 无部门信息
|
||||||
|
@ -111,24 +127,19 @@ public class TAbilityApplicationController {
|
||||||
return new Result<TAbilityApplicationV2DTO>().ok(null);
|
return new Result<TAbilityApplicationV2DTO>().ok(null);
|
||||||
}
|
}
|
||||||
TAbilityApplicationV2DTO tAbilityApplicationV2DTO = ConvertUtils.sourceToTarget(applicationDTOS.get(0), TAbilityApplicationV2DTO.class);
|
TAbilityApplicationV2DTO tAbilityApplicationV2DTO = ConvertUtils.sourceToTarget(applicationDTOS.get(0), TAbilityApplicationV2DTO.class);
|
||||||
Map<String, List<Map<String, Object>>> re =
|
Map<String, List<Map<String, Object>>> re = result.keySet().stream().map(index -> {
|
||||||
result.keySet().stream().map(index -> {
|
|
||||||
final List<TAbilityApplicationDTO> tAbilityApplicationDTOList = result.get(index);
|
final List<TAbilityApplicationDTO> tAbilityApplicationDTOList = result.get(index);
|
||||||
List<ResourceDTO> resourceDTOS =
|
List<ResourceDTO> resourceDTOS = tAbilityApplicationDTOList.stream().filter(tAbilityApplicationDTO -> StringUtils.isEmpty(tAbilityApplicationDTO.getCameraList())) // 过滤非摄像头申请
|
||||||
tAbilityApplicationDTOList.stream()
|
|
||||||
.filter(tAbilityApplicationDTO -> StringUtils.isEmpty(tAbilityApplicationDTO.getCameraList())) // 过滤非摄像头申请
|
|
||||||
.map(tAbilityApplicationDTO -> resourceService.get(Long.valueOf(tAbilityApplicationDTO.getResourceId()))).collect(Collectors.toList());
|
.map(tAbilityApplicationDTO -> resourceService.get(Long.valueOf(tAbilityApplicationDTO.getResourceId()))).collect(Collectors.toList());
|
||||||
List<HistoryDetailDTO> taskHandleDetailInfo = activitiService.getTaskHandleDetailInfo(tAbilityApplicationDTOList.get(0).getInstanceId());
|
List<HistoryDetailDTO> taskHandleDetailInfo = activitiService.getTaskHandleDetailInfo(tAbilityApplicationDTOList.get(0).getInstanceId());
|
||||||
|
|
||||||
List<Map> camera = new ArrayList<>();
|
List<Object> camera = new ArrayList<>();
|
||||||
switch (Constant.ProjectPlace.getByFlag(projectPlace)) { // 处理基础设施
|
switch (Constant.ProjectPlace.getByFlag(projectPlace)) { // 处理基础设施
|
||||||
case TSINGTAO_XHA:
|
case TSINGTAO_XHA:
|
||||||
break;
|
break;
|
||||||
case TSINGTAO: { // 大数据局
|
case TSINGTAO: { // 大数据局
|
||||||
camera = tAbilityApplicationDTOList.stream()
|
camera = (List<Object>) resourceService.getApplyCameraList(Long.valueOf(tAbilityApplicationDTOList.get(0).getInstanceId()));
|
||||||
.filter(tAbilityApplicationDTO -> StringUtils.isNotEmpty(tAbilityApplicationDTO.getCameraList()))
|
// camera = tAbilityApplicationDTOList.stream().filter(tAbilityApplicationDTO -> StringUtils.isNotEmpty(tAbilityApplicationDTO.getCameraList())).map(index_ -> jdbcTemplate.queryForObject("SELECT * FROM t_camera_channel WHERE idt_camera_channel = " + index_.getResourceId(), Map.class)).filter(index_ -> !index_.isEmpty()).collect(Collectors.toList());
|
||||||
.map(index_ -> jdbcTemplate.queryForObject("SELECT * FROM t_camera_channel WHERE idt_camera_channel = " + index_.getResourceId(), Map.class))
|
|
||||||
.filter(index_ -> !index_.isEmpty()).collect(Collectors.toList());
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case BAOTOU:
|
case BAOTOU:
|
||||||
|
@ -136,7 +147,7 @@ public class TAbilityApplicationController {
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Map> finalCamera = camera;
|
List<Object> finalCamera = camera;
|
||||||
Map<String, Object> resourceApplication = new HashMap<String, Object>() {
|
Map<String, Object> resourceApplication = new HashMap<String, Object>() {
|
||||||
{
|
{
|
||||||
put("instanceId", tAbilityApplicationDTOList.get(0).getInstanceId()); // 流程id
|
put("instanceId", tAbilityApplicationDTOList.get(0).getInstanceId()); // 流程id
|
||||||
|
@ -164,12 +175,7 @@ public class TAbilityApplicationController {
|
||||||
@GetMapping("page")
|
@GetMapping("page")
|
||||||
@ApiOperation("分页")
|
@ApiOperation("分页")
|
||||||
@LogOperation("分页")
|
@LogOperation("分页")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType = "int"), @ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int"), @ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType = "String"), @ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType = "String")})
|
||||||
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType = "int"),
|
|
||||||
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int"),
|
|
||||||
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType = "String"),
|
|
||||||
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType = "String")
|
|
||||||
})
|
|
||||||
public Result<PageData<TAbilityApplicationDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params) {
|
public Result<PageData<TAbilityApplicationDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params) {
|
||||||
PageData<TAbilityApplicationDTO> page = tAbilityApplicationService.page(params);
|
PageData<TAbilityApplicationDTO> page = tAbilityApplicationService.page(params);
|
||||||
|
|
||||||
|
@ -229,10 +235,7 @@ public class TAbilityApplicationController {
|
||||||
@PostMapping("updateInstanceId")
|
@PostMapping("updateInstanceId")
|
||||||
@ApiOperation("更新实例ID")
|
@ApiOperation("更新实例ID")
|
||||||
@LogOperation("更新实例ID")
|
@LogOperation("更新实例ID")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({@ApiImplicitParam(name = "businessKey", value = "业务KEY", paramType = "query", required = true, dataType = "String"), @ApiImplicitParam(name = "processInstanceId", value = "实例ID", paramType = "query", required = true, dataType = "String")})
|
||||||
@ApiImplicitParam(name = "businessKey", value = "业务KEY", paramType = "query", required = true, dataType = "String"),
|
|
||||||
@ApiImplicitParam(name = "processInstanceId", value = "实例ID", paramType = "query", required = true, dataType = "String")
|
|
||||||
})
|
|
||||||
public Result updateInstanceId(String businessKey, String processInstanceId) {
|
public Result updateInstanceId(String businessKey, String processInstanceId) {
|
||||||
Long id = Long.valueOf(businessKey);
|
Long id = Long.valueOf(businessKey);
|
||||||
tAbilityApplicationService.updateInstanceId(processInstanceId, id);
|
tAbilityApplicationService.updateInstanceId(processInstanceId, id);
|
||||||
|
|
Loading…
Reference in New Issue