Merge branch 'master' into docker_package

This commit is contained in:
wangliwen 2022-07-01 10:03:23 +08:00
commit 1547954471
8 changed files with 56 additions and 32 deletions

View File

@ -144,19 +144,22 @@ public class AbilityCenterControllerV2 {
List<TAbilityApplicationDTO> dtoList = temp.get(deptId);
Boolean basic_facilities =
dtoList.stream().map(index -> {
Optional<ResourceDTO> resourceDTOOptional =
Optional.ofNullable(resourceService.get(Long.valueOf(index.getResourceId())));
return !resourceDTOOptional.isPresent() || !"基础设施".equals(resourceDTOOptional.get().getType());
}
)
Optional<ResourceDTO> resourceDTOOptional =
Optional.ofNullable(resourceService.get(Long.valueOf(index.getResourceId()))); // 从本库内查不到 视为其它平台的基础设施资源
return !resourceDTOOptional.isPresent() || !"基础设施".equals(resourceDTOOptional.get().getType());
}
)
.filter(index -> !index).findAny().orElse(Boolean.TRUE);
logger.error("--------------------是否全是基础设施{}----------------------------------------------", basic_facilities);
final List<Long> ids = dtoList.stream().map(TAbilityApplicationDTO::getId).collect(Collectors.toList()); // 发起申请的表单id
// 仿照请求接口 /act/running/startOfBusinessKey
ProcessStartDTO processStartDTO = new ProcessStartDTO();
processStartDTO.setBusinessKey(basic_facilities ?
tAbilityApplicationDTOList.stream().filter(index -> StringUtils.isNotEmpty(index.getResourceId())).map(TAbilityApplicationDTO::getResourceId).findFirst().orElse(null)
tAbilityApplicationDTOList.stream()
.filter(index -> StringUtils.isNotEmpty(index.getResourceId()))
.map(TAbilityApplicationDTO::getResourceId)
.findFirst()
.orElse(null)
: JSON.toJSONString(ids)); // 申请的id列表 json字符 做businesskey
processStartDTO.setProcessDefinitionKey(key); //限定
AuditingBaseDTO auditingBaseDTO = new AuditingBaseDTO();

View File

@ -135,8 +135,8 @@ public class HistoryController {
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码从1开始", paramType = "query", required = true, dataType = "int"),
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int")
})
public Result<Page<ProcessActivityDTO>> getDeptHandledInstancePage(@ApiIgnore @RequestParam Map<String, Object> params){
Page<ProcessActivityDTO> page=activitiService.getDeptProcessInstancePage(params);
public Result<Page<ProcessActivityDTO>> getDeptHandledInstancePage(@ApiIgnore @RequestParam Map<String, Object> params) {
Page<ProcessActivityDTO> page = activitiService.getDeptProcessInstancePage(params);
setExtraProcessProperties(page.getRecords());
return new Result().ok(page);
}
@ -153,7 +153,7 @@ public class HistoryController {
return new Result().ok(list);
}
private void setExtraProcessProperties(List<ProcessActivityDTO> list){
private void setExtraProcessProperties(List<ProcessActivityDTO> list) {
for (ProcessActivityDTO activityDTO : list) {
if (StringUtils.isNotEmpty(activityDTO.getStartUserId())) {
SysUserDTO userDTO = sysUserService.get(Long.valueOf(activityDTO.getStartUserId()));
@ -163,12 +163,22 @@ public class HistoryController {
SysUserDTO userDTO = sysUserService.get(Long.valueOf(activityDTO.getAssignee()));
activityDTO.setAssigneeName(userDTO != null ? userDTO.getRealName() : "");
}
TAbilityApplicationDTO abilityApplicationDTO =
abilityApplicationService.get(Long.valueOf(activityDTO.getBusinessKey()));
TResourceMountApplyDTO tResourceMountApplyDTO = tResourceMountApplyService.get(Long.valueOf(activityDTO.getBusinessKey()));
TDemandDataDTO tDemandDataDTO = tDemandDataService.get(Long.valueOf(activityDTO.getBusinessKey()));
if (abilityApplicationDTO != null) {
activityDTO.setResourceName(abilityApplicationDTO.getSystem());
List<TAbilityApplicationDTO> abilityApplicationDTOS =
abilityApplicationService.getByInstanceId(activityDTO.getProcessInstanceId());
TResourceMountApplyDTO tResourceMountApplyDTO = null;
TDemandDataDTO tDemandDataDTO = null;
if (!activityDTO.getBusinessKey().startsWith("[") && !activityDTO.getBusinessKey().startsWith("{")) { // json 内容批量申请
tResourceMountApplyDTO = tResourceMountApplyService.get(Long.valueOf(activityDTO.getBusinessKey()));
tDemandDataDTO = tDemandDataService.get(Long.valueOf(activityDTO.getBusinessKey()));
}
if (abilityApplicationDTOS != null && !abilityApplicationDTOS.isEmpty()) {
StringBuffer stringBuffer = new StringBuffer();
abilityApplicationDTOS.stream().map(TAbilityApplicationDTO::getSystem).filter(index -> StringUtils.isNotEmpty(index)).forEach(index -> {
stringBuffer.append(index);
stringBuffer.append(",");
});
stringBuffer.deleteCharAt(stringBuffer.length() - 1);
activityDTO.setResourceName(stringBuffer.toString());
} else if (tResourceMountApplyDTO != null) {
activityDTO.setResourceName(tResourceMountApplyDTO.getResourceDTO().getName());
} else if (tDemandDataDTO != null) {

View File

@ -262,14 +262,19 @@ public class ActHistoryService {
for (ProcessInstanceDTO dto : list) {
List<TAbilityApplicationDTO> abilityApplicationDTO = tAbilityApplicationService.getByInstanceId(dto.getProcessInstanceId()); // 获取申请表单
if (abilityApplicationDTO != null && !abilityApplicationDTO.isEmpty()) {
StringBuffer stringBuffer = new StringBuffer();
abilityApplicationDTO.stream().map(TAbilityApplicationDTO::getSystem).filter(index -> StringUtils.isNotEmpty(index)).forEach(index -> {
stringBuffer.append(index);
stringBuffer.append(",");
});
stringBuffer.deleteCharAt(stringBuffer.length() - 1);
dto.setName(stringBuffer.toString());
dto.setResourceId(null);
if (abilityApplicationDTO.stream().filter(index -> StringUtils.isNotEmpty(index.getCameraList())).findAny().isPresent()) { // 存在摄像头
dto.setName("申请摄像头列表");
dto.setResourceId(null);
} else {
StringBuffer stringBuffer = new StringBuffer();
abilityApplicationDTO.stream().map(TAbilityApplicationDTO::getSystem).filter(index -> StringUtils.isNotEmpty(index)).forEach(index -> {
stringBuffer.append(index);
stringBuffer.append(",");
});
stringBuffer.deleteCharAt(stringBuffer.length() - 1);
dto.setName(stringBuffer.toString());
dto.setResourceId(null);
}
} else {
TAbilityApplicationDTO abilityApplicationDTO1 = tAbilityApplicationService.getByBusinessKey(dto.getBusinessKey());
if (abilityApplicationDTO1 != null) {

View File

@ -246,6 +246,14 @@ public class ActTaskService extends BaseServiceImpl {
listDto.add(dto);
continue;
}
/**
* 所有类型都没获取到
*/
processVariable.putAll(task.getProcessVariables());
dto.setParams(processVariable);
listDto.add(dto);
}
return listDto;
}

View File

@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import io.renren.modules.monitor.entity.CameraChannel;
import lombok.Data;
import lombok.EqualsAndHashCode;
@ -98,7 +97,7 @@ public class TAbilityApplicationEntity implements Serializable {
/**
* 摄像头列表
*/
@TableField(value = "camera_list", typeHandler = FastjsonTypeHandler.class)
// @TableField(value = "camera_list", typeHandler = FastjsonTypeHandler.class)
private String cameraList;
/**

View File

@ -1397,7 +1397,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
return new PageData<>(list, list.size());
}
//分别根据部门获取应用组件数和收藏组件数
//分别根据部门获取应用组件数和申请组件数
Map<String, Object> paraMap = new ConcurrentHashMap<>();
paraMap.put("resourceType", params.get("resourceType"));
CompletableFuture<Void> voidCompletableFuture01 = CompletableFuture.runAsync(() -> {

View File

@ -20,8 +20,7 @@
<result property="delFlag" column="del_flag"/>
<result property="enclosure" column="enclosure"/>
<result property="gatewayCode" column="gateway_code"/>
<result property="cameraList" column="camera_list"
typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/>
<result property="cameraList" column="camera_list"/>
<result property="applicationScene" column="application_scene"
typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/>
</resultMap>

View File

@ -1243,7 +1243,7 @@
WHERE
a.del_flag = 0
<if test="id != null and id != ''">
and (b.id = #{id} OR INSTR(b.pids,#{id})
and (b.id = #{id} OR INSTR(b.pids,#{id}))
</if>
<if test="resourceType != null and resourceType != ''">
AND
@ -1295,14 +1295,14 @@
<select id="assemblyCarByDept" parameterType="java.util.Map" resultType="java.util.Map">
SELECT COUNT(distinct(a.resource_id)) as carNum,c.id FROM tb_resource_car a INNER JOIN sys_user b ON a.creator =
b.id INNER JOIN sys_dept c ON b.dept_id = c.id INNER JOIN tb_data_resource d on a.resource_id = d.id
WHERE a.del_flag = 0 AND d.type = #{resourceType} AND (c.id =#{id} or INSTR(c.pids,#{id})) group by c.id
WHERE a.del_flag = 0 AND c.id =#{id} AND d.type = #{resourceType} group by c.id
</select>
<!--根据组件类型查询部门使用组件的数量-->
<select id="assemblyUseByDept" parameterType="java.util.Map" resultType="java.util.Map">
SELECT COUNT(distinct(a.key_id)) as useNum,c.id FROM tb_data_resource_rel a INNER JOIN sys_user b ON a.creator =
b.id INNER JOIN sys_dept c ON b.dept_id = c.id INNER JOIN tb_data_resource d on a.key_id = d.id
WHERE a.del_flag = 0 AND d.type = #{resourceType} AND (c.id = #{id} or INSTR(c.pids,#{id} )) group by c.id
WHERE a.del_flag = 0 AND d.type = #{resourceType} AND c.id = #{id} group by c.id
</select>
<select id="selectCountByDepts" resultType="java.util.Map">