Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
yitonglei 2022-07-01 10:42:44 +08:00
commit 66356dd6c6
7 changed files with 46 additions and 31 deletions

View File

@ -232,15 +232,17 @@ public class ActivitiNoticeAspect {
Long resourceId = null; Long resourceId = null;
if (kv.containsKey("resourceId") && kv.get("resourceId") != null) { if (kv.containsKey("resourceId") && kv.get("resourceId") != null) {
resourceId = Long.valueOf(kv.get("resourceId").toString()); resourceId = Long.valueOf(kv.get("resourceId").toString());
} else if (kv.containsKey("id") && kv.get("id") != null) { } else if (kv.containsKey("id") && kv.get("id") != null && kv.containsKey("-")) {
resourceId = Long.valueOf(kv.get("id").toString()); resourceId = Long.valueOf(kv.get("id").toString());
} else {
resourceId = 0L;
} }
Optional<ResourceDTO> resourceDTO = Optional.ofNullable(resourceService.get(resourceId)); Optional<ResourceDTO> resourceDTO = Optional.ofNullable(resourceService.get(resourceId));
CompletableFuture.runAsync(() -> { // 发起人 CompletableFuture.runAsync(() -> { // 发起人
SysUserDTO userDTO = sysUserService.get(Long.valueOf(finalCreator)); SysUserDTO userDTO = sysUserService.get(Long.valueOf(finalCreator));
kv.get("resourceId"); kv.get("resourceId");
kv.get("id"); kv.get("id");
String content = "【通知】" + userDTO.getRealName() + ",您发起的" + (resourceDTO.isPresent() ? resourceDTO.get().getName() : "") + activitiNoticeOperation.process() + "已完成,审核结果为:" + finalResult; String content = "【通知】" + userDTO.getRealName() + ",您发起的" + (resourceDTO.isPresent() ? resourceDTO.get().getName() : "申请摄像头列表") + activitiNoticeOperation.process() + "已完成,审核结果为:" + finalResult;
SysNoticeDTO dto = new SysNoticeDTO(); SysNoticeDTO dto = new SysNoticeDTO();
dto.setType(2); dto.setType(2);
dto.setTitle("流程结束系统通知"); dto.setTitle("流程结束系统通知");

View File

@ -145,10 +145,9 @@ public class AbilityCenterControllerV2 {
Boolean basic_facilities = Boolean basic_facilities =
dtoList.stream().map(index -> { dtoList.stream().map(index -> {
Optional<ResourceDTO> resourceDTOOptional = Optional<ResourceDTO> resourceDTOOptional =
Optional.ofNullable(resourceService.get(Long.valueOf(index.getResourceId()))); // Optional.ofNullable(resourceService.get(Long.valueOf(index.getResourceId()))); // 从本库内查不到 视为其它平台的基础设施资源
return !resourceDTOOptional.isPresent() || !"基础设施".equals(resourceDTOOptional.get().getType()); return !resourceDTOOptional.isPresent() || !"基础设施".equals(resourceDTOOptional.get().getType());
} }
) )
.filter(index -> !index).findAny().orElse(Boolean.TRUE); .filter(index -> !index).findAny().orElse(Boolean.TRUE);
logger.error("--------------------是否全是基础设施{}----------------------------------------------", basic_facilities); logger.error("--------------------是否全是基础设施{}----------------------------------------------", basic_facilities);
@ -156,7 +155,8 @@ public class AbilityCenterControllerV2 {
// 仿照请求接口 /act/running/startOfBusinessKey // 仿照请求接口 /act/running/startOfBusinessKey
ProcessStartDTO processStartDTO = new ProcessStartDTO(); ProcessStartDTO processStartDTO = new ProcessStartDTO();
processStartDTO.setBusinessKey(basic_facilities ? processStartDTO.setBusinessKey(basic_facilities ?
tAbilityApplicationDTOList.stream().filter(index -> StringUtils.isNotEmpty(index.getResourceId())) tAbilityApplicationDTOList.stream()
.filter(index -> StringUtils.isNotEmpty(index.getResourceId()))
.map(TAbilityApplicationDTO::getResourceId) .map(TAbilityApplicationDTO::getResourceId)
.findFirst() .findFirst()
.orElse(null) .orElse(null)

View File

@ -163,12 +163,22 @@ public class HistoryController {
SysUserDTO userDTO = sysUserService.get(Long.valueOf(activityDTO.getAssignee())); SysUserDTO userDTO = sysUserService.get(Long.valueOf(activityDTO.getAssignee()));
activityDTO.setAssigneeName(userDTO != null ? userDTO.getRealName() : ""); activityDTO.setAssigneeName(userDTO != null ? userDTO.getRealName() : "");
} }
TAbilityApplicationDTO abilityApplicationDTO = List<TAbilityApplicationDTO> abilityApplicationDTOS =
abilityApplicationService.get(Long.valueOf(activityDTO.getBusinessKey())); abilityApplicationService.getByInstanceId(activityDTO.getProcessInstanceId());
TResourceMountApplyDTO tResourceMountApplyDTO = tResourceMountApplyService.get(Long.valueOf(activityDTO.getBusinessKey())); TResourceMountApplyDTO tResourceMountApplyDTO = null;
TDemandDataDTO tDemandDataDTO = tDemandDataService.get(Long.valueOf(activityDTO.getBusinessKey())); TDemandDataDTO tDemandDataDTO = null;
if (abilityApplicationDTO != null) { if (!activityDTO.getBusinessKey().startsWith("[") && !activityDTO.getBusinessKey().startsWith("{")) { // json 内容批量申请
activityDTO.setResourceName(abilityApplicationDTO.getSystem()); 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) { } else if (tResourceMountApplyDTO != null) {
activityDTO.setResourceName(tResourceMountApplyDTO.getResourceDTO().getName()); activityDTO.setResourceName(tResourceMountApplyDTO.getResourceDTO().getName());
} else if (tDemandDataDTO != null) { } else if (tDemandDataDTO != null) {

View File

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

View File

@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler; import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import io.renren.modules.monitor.entity.CameraChannel;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; 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; private String cameraList;
/** /**

View File

@ -68,7 +68,7 @@ public class CorrectionListenerV2 implements TaskListener, ExecutionListener, Ac
private TAbilityApplicationService tAbilityApplicationService; private TAbilityApplicationService tAbilityApplicationService;
@Override @Override
@ActivitiNoticeOperation(value = "资源部门负责人审批", process = "能力申请流程") @ActivitiNoticeOperation(value = "资源部门负责人审批", process = "能力申请流程v2")
public void notify(DelegateTask delegateTask) { public void notify(DelegateTask delegateTask) {
logger.error("-------------------------进入部门动态审批人流程-------------------------------"); logger.error("-------------------------进入部门动态审批人流程-------------------------------");
final String eventName = delegateTask.getEventName(); final String eventName = delegateTask.getEventName();
@ -85,7 +85,7 @@ public class CorrectionListenerV2 implements TaskListener, ExecutionListener, Ac
} }
@Override @Override
@ActivitiNoticeOperation(value = "流程结束", process = "能力申请流程", type = 2) @ActivitiNoticeOperation(value = "流程结束", process = "能力申请流程v2", type = 2)
public void notify(DelegateExecution delegateExecution) throws Exception { public void notify(DelegateExecution delegateExecution) throws Exception {
logger.error("----------------------进入部门审批结束节点---------------------------"); logger.error("----------------------进入部门审批结束节点---------------------------");
delegateExecution.getProcessBusinessKey(); delegateExecution.getProcessBusinessKey();

View File

@ -20,8 +20,7 @@
<result property="delFlag" column="del_flag"/> <result property="delFlag" column="del_flag"/>
<result property="enclosure" column="enclosure"/> <result property="enclosure" column="enclosure"/>
<result property="gatewayCode" column="gateway_code"/> <result property="gatewayCode" column="gateway_code"/>
<result property="cameraList" column="camera_list" <result property="cameraList" column="camera_list"/>
typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/>
<result property="applicationScene" column="application_scene" <result property="applicationScene" column="application_scene"
typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/> typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/>
</resultMap> </resultMap>
@ -30,7 +29,7 @@
update t_ability_application set instance_id = #{instanceId} where id = #{id} update t_ability_application set instance_id = #{instanceId} where id = #{id}
</update> </update>
<select id="getByInstanceId" resultType="io.renren.modules.processForm.entity.TAbilityApplicationEntity"> <select id="getByInstanceId" resultMap="tAbilityApplicationMap">
SELECT SELECT
t1.* t1.*
FROM FROM
@ -39,7 +38,7 @@
t1.instance_id = #{instanceId} t1.instance_id = #{instanceId}
</select> </select>
<select id="getByBusinessKey" resultType="io.renren.modules.processForm.entity.TAbilityApplicationEntity"> <select id="getByBusinessKey" resultMap="tAbilityApplicationMap">
SELECT SELECT
t1.* t1.*
FROM FROM