根据申请标识获取本次申请详情(信息、流程、部门)

This commit is contained in:
wangliwen 2022-07-12 10:40:30 +08:00
parent 15cc666261
commit 45be93e850
10 changed files with 124 additions and 6 deletions

View File

@ -108,6 +108,7 @@ public class AbilityCenterController {
tAbilityApplicationDTO.setUserId(abilityBatchApplicationDTO.getUserId());
tAbilityApplicationDTO.setApproveStatus("审核中");
tAbilityApplicationDTO.setDelFlag(0);
tAbilityApplicationDTO.setEnclosureName(abilityBatchApplicationDTO.getEnclosureName());
// 仿照请求接口 /processForm/tabilityapplication
ValidatorUtils.validateEntity(tAbilityApplicationDTO, AddGroup.class, DefaultGroup.class);
tAbilityApplicationService.save(tAbilityApplicationDTO); // 写能力申请数据

View File

@ -3,6 +3,7 @@ package io.renren.modules.processForm.controller;
import io.renren.common.annotation.LogOperation;
import io.renren.common.constant.Constant;
import io.renren.common.page.PageData;
import io.renren.common.utils.ConvertUtils;
import io.renren.common.utils.ExcelUtils;
import io.renren.common.utils.Result;
import io.renren.common.validator.AssertUtils;
@ -10,9 +11,14 @@ import io.renren.common.validator.ValidatorUtils;
import io.renren.common.validator.group.AddGroup;
import io.renren.common.validator.group.DefaultGroup;
import io.renren.common.validator.group.UpdateGroup;
import io.renren.modules.activiti.dto.HistoryDetailDTO;
import io.renren.modules.activiti.service.ActivitiService;
import io.renren.modules.processForm.dto.TAbilityApplicationDTO;
import io.renren.modules.processForm.dto.TAbilityApplicationV2DTO;
import io.renren.modules.processForm.excel.TAbilityApplicationExcel;
import io.renren.modules.processForm.service.TAbilityApplicationService;
import io.renren.modules.resource.dto.ResourceDTO;
import io.renren.modules.resource.service.ResourceService;
import io.renren.modules.security.user.SecurityUser;
import io.renren.modules.security.user.UserDetail;
import io.renren.modules.sys.dto.SysDeptDTO;
@ -43,6 +49,10 @@ import java.util.stream.Collectors;
public class TAbilityApplicationController {
@Autowired
private TAbilityApplicationService tAbilityApplicationService;
@Autowired
private ResourceService resourceService;
@Autowired
private ActivitiService activitiService;
/**
@ -71,7 +81,7 @@ public class TAbilityApplicationController {
@GetMapping("getByApplyFlag/{applyFlag}")
@ApiOperation("根据申请标识获取能力申请信息")
@LogOperation("根据申请标识获取能力申请信息")
public Result<Map<String, List<TAbilityApplicationDTO>>> getByApplyFlag(@PathVariable("applyFlag") String applyFlag) {
public Result<TAbilityApplicationV2DTO> getByApplyFlag(@PathVariable("applyFlag") String applyFlag) {
final UserDetail user = SecurityUser.getUser();
Map<String, Object> params = new HashMap<String, Object>() {
{
@ -89,7 +99,37 @@ public class TAbilityApplicationController {
return sysDeptDTO.getName();
}
}));
return new Result<Map<String, List<TAbilityApplicationDTO>>>().ok(result);
if (applicationDTOS.isEmpty()) {
return new Result<TAbilityApplicationV2DTO>().ok(null);
}
TAbilityApplicationV2DTO tAbilityApplicationV2DTO = ConvertUtils.sourceToTarget(applicationDTOS.get(0), TAbilityApplicationV2DTO.class);
Map<String, List<Map<String, Object>>> re =
result.keySet().stream().map(index -> {
final List<TAbilityApplicationDTO> tAbilityApplicationDTOList = result.get(index);
List<ResourceDTO> resourceDTOS =
tAbilityApplicationDTOList.stream()
.filter(tAbilityApplicationDTO -> !tAbilityApplicationDTO.getResourceId().equals("8888888880000000001")) // 过滤非摄像头申请
.map(tAbilityApplicationDTO -> resourceService.get(Long.valueOf(tAbilityApplicationDTO.getResourceId()))).collect(Collectors.toList());
List<HistoryDetailDTO> taskHandleDetailInfo = activitiService.getTaskHandleDetailInfo(tAbilityApplicationDTOList.get(0).getInstanceId());
Map<String, Object> resourceApplication = new HashMap<String, Object>() {
{
put("instanceId", tAbilityApplicationDTOList.get(0).getInstanceId()); // 流程id
put("resourceOwnerDept", tAbilityApplicationDTOList.get(0).getResourceOwnerDept()); // 资源所属部门信息
put("resources", resourceDTOS);//申请的该部门的能力资源
put("taskHandleDetailInfo", taskHandleDetailInfo); // 流程详情
}
};
return resourceApplication;
}).collect(Collectors.groupingBy(t -> {
SysDeptDTO sysDeptDTO = (SysDeptDTO) t.get("resourceOwnerDept");
if (sysDeptDTO == null) {
return "无部门信息"; // 无部门信息
} else {
return sysDeptDTO.getName();
}
}));
tAbilityApplicationV2DTO.setResourceApplication(re);
return new Result<TAbilityApplicationV2DTO>().ok(tAbilityApplicationV2DTO);
}
@GetMapping("page")

View File

@ -54,6 +54,9 @@ public class TAbilityApplicationDTO extends AuditingBaseDTO implements Serializa
@ApiModelProperty(value = "附件")
private String enclosure;
@ApiModelProperty(value = "附件文件名")
private String enclosureName;
@ApiModelProperty(value = "摄像头ID")
private String cameraList;

View File

@ -0,0 +1,62 @@
package io.renren.modules.processForm.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
/**
* 批量申请时 返回本次申请用dto
*/
@Data
@ApiModel(value = "批量申请时 返回本次申请用dto")
public class TAbilityApplicationV2DTO implements Serializable {
private Long id;
@ApiModelProperty(value = "申请人")
private String user;
@ApiModelProperty(value = "申请人电话")
private String phone;
@ApiModelProperty(value = "申请人单位")
private String unit;
@ApiModelProperty(value = "申请人所在地区")
private String area;
@ApiModelProperty(value = "申请应用系统")
private String system;
@ApiModelProperty(value = "申请场景")
private String scene;
@ApiModelProperty(value = "申请依据")
private String basis;
@ApiModelProperty(value = "申请附件")
private String attachment;
@ApiModelProperty(value = "附件")
private String enclosure;
@ApiModelProperty(value = "附件文件名")
private String enclosureName;
@ApiModelProperty(value = "摄像头ID")
private String cameraList;
@ApiModelProperty(value = "能力申请标题")
private String title;
@ApiModelProperty(value = "应用系统")
private String applicationSystem;
@ApiModelProperty(value = "应用场景")
private List<String> applicationScene;
@ApiModelProperty(value = "应用背景")
private String applicationBackground;
@ApiModelProperty(value = "能力应用期望效果")
private String effectWish;
@ApiModelProperty(value = "申请单标识(同一次的申请标识)")
private String applyFlag;
// 以上为申请时公共信息
@ApiModelProperty(value = "资源申请情况(包含资源信息和流程流转)")
private Map<String, List<Map<String, Object>>> resourceApplication;
public TAbilityApplicationV2DTO() {
}
}

View File

@ -49,6 +49,9 @@ public class TAbilityBatchApplicationDTO extends AuditingBaseDTO implements Seri
@ApiModelProperty(value = "附件")
private String enclosure;
@ApiModelProperty(value = "附件文件名")
private String enclosureName;
@ApiModelProperty(value = "摄像头ID数组")
private String cameraList;

View File

@ -90,6 +90,12 @@ public class TAbilityApplicationEntity implements Serializable {
*/
private String enclosure;
/**
* 附件文件名
*/
private String enclosureName;
/**
* 流程通过后api网关注册的认证code用于三方接口调用
*/

View File

@ -1,2 +1,3 @@
alter table `t_ability_application` ADD COLUMN `apply_flag` varchar(255) NULL comment '申请单标识';
alter table `t_ability_application` ADD COLUMN `resource_owner_dept` json NULL comment '资源所属部门信息';
alter table `t_ability_application` ADD COLUMN `resource_owner_dept` json NULL comment '资源所属部门信息';
alter table `t_ability_application` ADD COLUMN `enclosure_name` longtext NULL comment '附件文件名';

View File

@ -64,8 +64,8 @@
<cache name="getByToken"
maxElementsInMemory="10000"
eternal="false"
timeToIdleSeconds="60"
timeToLiveSeconds="600"
timeToIdleSeconds="30"
timeToLiveSeconds="60"
overflowToDisk="true"
diskPersistent="true"
memoryStoreEvictionPolicy="LRU"/>

View File

@ -19,6 +19,7 @@
<result property="approveStatus" column="approve_status"/>
<result property="delFlag" column="del_flag"/>
<result property="enclosure" column="enclosure"/>
<result property="enclosureName" column="enclosure_name"/>
<result property="gatewayCode" column="gateway_code"/>
<result property="cameraList" column="camera_list"/>
<result property="applicationScene" column="application_scene"
@ -43,6 +44,7 @@
<result property="approveStatus" column="approve_status"/>
<result property="delFlag" column="del_flag"/>
<result property="enclosure" column="enclosure"/>
<result property="enclosureName" column="enclosure_name"/>
<result property="cameraList" column="camera_list"/>
<result property="applicationScene" column="application_scene"
typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/>

View File

@ -125,7 +125,7 @@
AND car.resource_id = res.id
AND car.resource_id = 8888888880000000001
AND car.user_id = #{userId}
AND res.dept_id = 1067246875800000066
AND res.dept_id = #{deptId}
AND car.del_flag = 0)
LIMIT ${pageNum}, ${pageSize}
</select>