|
@@ -9,6 +9,7 @@ import com.persagy.dmp.digital.client.DigitalRelationCaclClient;
|
|
|
import com.persagy.dmp.digital.entity.ObjectRelation;
|
|
|
import com.persagy.proxy.adm.constant.AdmObjectInfoConstant;
|
|
|
import com.persagy.proxy.adm.constant.BusinessErrorRwdCode;
|
|
|
+import com.persagy.proxy.adm.model.AdmManualRelationCalcDel;
|
|
|
import com.persagy.proxy.adm.model.AdmRelationAddRequest;
|
|
|
import com.persagy.proxy.adm.request.AdmCreateResponse;
|
|
|
import com.persagy.proxy.adm.service.AdmManualRelCalService;
|
|
@@ -271,4 +272,31 @@ public class AdmManualRelCalServiceImpl implements AdmManualRelCalService {
|
|
|
// sp2bd_ArchForArch,sp2fl_ArchForArch,sp2sh_ArchForArch,sp2sp_ArchForArch
|
|
|
|
|
|
}
|
|
|
+ /***
|
|
|
+ * Description: 删除关系
|
|
|
+ * @param admManualRelationCalcDel : 请求参数
|
|
|
+ * @return : com.persagy.proxy.adm.request.AdmCreateResponse
|
|
|
+ * @author : lijie
|
|
|
+ * @date :2021/8/31 12:10
|
|
|
+ * Update By lijie 2021/8/31 12:10
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public AdmCreateResponse delRels(InstanceUrlParam context, AdmManualRelationCalcDel admManualRelationCalcDel) {
|
|
|
+ ObjectRelation objectRelation = new ObjectRelation();
|
|
|
+ Map<String, AdmRelationTypeEnum> relationTypeMap = AdmRelationTypeEnum.getRelationTypeMap();
|
|
|
+ if (relationTypeMap.containsKey(admManualRelationCalcDel.getRelType())){
|
|
|
+ return AdmCreateResponse.failure("不存在的关系类型");
|
|
|
+ }
|
|
|
+ AdmRelationTypeEnum relationTypeEnum = relationTypeMap.get(admManualRelationCalcDel.getRelType());
|
|
|
+ objectRelation.setGraphCode(relationTypeEnum.getGraphCode());
|
|
|
+ objectRelation.setRelCode(relationTypeEnum.getRelCode());
|
|
|
+ objectRelation.setObjFrom(admManualRelationCalcDel.getFromId());
|
|
|
+ objectRelation.setObjTo(admManualRelationCalcDel.getToId());
|
|
|
+ CommonResult<List<ObjectRelation>> commonResult = digitalRelationCaclClient.deleteObjRelationsByRelId(context.getGroupCode(),
|
|
|
+ context.getProjectId(), context.getAppId(), "0", objectRelation);
|
|
|
+ if (!"success".equals(commonResult.getResult())){
|
|
|
+ return AdmCreateResponse.failure(commonResult.getMessage());
|
|
|
+ }
|
|
|
+ return AdmCreateResponse.success("删除关系成功");
|
|
|
+ }
|
|
|
}
|