|
@@ -5,6 +5,7 @@ import com.persagy.dmp.config.DmpParameterStorage;
|
|
|
import com.persagy.dmp.rwd.config.RwdConstants;
|
|
|
import com.persagy.dmp.rwd.entity.ObjectInstance;
|
|
|
import com.persagy.dmp.rwd.entity.QObjectInstance;
|
|
|
+import com.persagy.dmp.rwd.entity.QRelationInstance;
|
|
|
import com.persagy.dmp.rwd.model.DmpMessage;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -33,6 +34,7 @@ public class ObjectInstanceDeleteService extends BaseService {
|
|
|
}
|
|
|
|
|
|
QObjectInstance qt = QObjectInstance.objectInstance;
|
|
|
+ QRelationInstance rqt = QRelationInstance.relationInstance;
|
|
|
for (String id : idList) {
|
|
|
Optional<ObjectInstance> one = objectInstanceRepository.findOne(qt.id.eq(id)
|
|
|
.and(qt.groupCode.eq(DmpParameterStorage.getGroupCode()))
|
|
@@ -49,6 +51,8 @@ public class ObjectInstanceDeleteService extends BaseService {
|
|
|
entityManager.clear();
|
|
|
|
|
|
// TODO 关系处理
|
|
|
+ jpaQueryFactory.delete(rqt).where(rqt.objFrom.eq(entity.getId())).execute();
|
|
|
+ jpaQueryFactory.delete(rqt).where(rqt.objTo.eq(entity.getId())).execute();
|
|
|
|
|
|
// 消息通知
|
|
|
DmpMessage message = new DmpMessage(RwdConstants.MESSAGE_INSTANCE_OBJECT_DELETE, id);
|