|
@@ -26,6 +26,7 @@ import com.persagy.dmp.common.model.response.CommonResult;
|
|
|
import com.persagy.dmp.common.utils.ResultHelper;
|
|
|
import com.persagy.dmp.define.entity.ObjectInfoDefine;
|
|
|
import com.persagy.dmp.digital.entity.ObjectDigital;
|
|
|
+import com.persagy.dmp.digital.entity.ObjectRelation;
|
|
|
import com.persagy.dmp.rwd.basic.constant.DigitalMessageConstant;
|
|
|
import com.persagy.dmp.rwd.basic.constant.DigitalObjectType;
|
|
|
import com.persagy.dmp.rwd.basic.constant.DigitalRelCode;
|
|
@@ -215,6 +216,20 @@ public class ObjectDigitalServiceImpl extends ServiceImpl<ObjectDigitalMapper, O
|
|
|
if(CollUtil.isEmpty(idList)) {
|
|
|
return;
|
|
|
}
|
|
|
+ // 1.批量删除对象
|
|
|
+ ObjectDigital vo = new ObjectDigital();
|
|
|
+ vo.setValid(ValidEnum.FALSE.getType());
|
|
|
+ LambdaQueryWrapper<ObjectDigital> objQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ objQueryWrapper.in(ObjectDigital::getId,idList);
|
|
|
+ this.update(vo,objQueryWrapper);
|
|
|
+ // 2.批量删除关系
|
|
|
+ LambdaQueryWrapper<ObjectRelation> relationQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ relationQueryWrapper.in(ObjectRelation::getObjFrom,idList);
|
|
|
+ relationQueryWrapper.or(wrapper->wrapper.in(ObjectRelation::getObjTo,idList));
|
|
|
+ ObjectRelation objectRelation = new ObjectRelation();
|
|
|
+ objectRelation.setValid(ValidEnum.FALSE.getType());
|
|
|
+ objectRelationMapper.update(objectRelation,relationQueryWrapper);
|
|
|
+ // 3.发送删除消息
|
|
|
List<ObjectDigital> dbList = objectDigitalMapper.selectBatchIds(idList);
|
|
|
Map<String, ObjectDigital> dbMap = CollectionUtil.fieldValueMap(dbList, BaseEntity.PROP_ID);
|
|
|
idList.forEach(id -> {
|
|
@@ -223,12 +238,7 @@ public class ObjectDigitalServiceImpl extends ServiceImpl<ObjectDigitalMapper, O
|
|
|
if(dbVO == null) {
|
|
|
return;
|
|
|
}
|
|
|
- // 删除
|
|
|
- ObjectDigital vo = new ObjectDigital();
|
|
|
- vo.setId(id);
|
|
|
- vo.setValid(ValidEnum.FALSE.getType());
|
|
|
- objectDigitalMapper.updateById(vo);
|
|
|
- // 删除后消息
|
|
|
+ // 删除后发送消息
|
|
|
dbVO.setValid(ValidEnum.FALSE.getType());
|
|
|
messageSender.sendMessage(DigitalMessageConstant.OPERATE_AFTER_DELETE, null, dbVO, false);
|
|
|
});
|