|
@@ -18,7 +18,11 @@ import com.persagy.dmp.common.constant.RelCodeEnum;
|
|
|
import com.persagy.dmp.common.context.AppContext;
|
|
|
import com.persagy.dmp.common.exception.BusinessException;
|
|
|
import com.persagy.dmp.common.helper.SpringHelper;
|
|
|
+import com.persagy.dmp.common.model.entity.AuditableEntity;
|
|
|
import com.persagy.dmp.common.model.response.CommonResult;
|
|
|
+import com.persagy.dmp.delivery.client.DigitalObjectTypeCollectFacade;
|
|
|
+import com.persagy.dmp.delivery.dto.ObjectTypeCollectDTO;
|
|
|
+import com.persagy.dmp.delivery.entity.ObjectTypeCollect;
|
|
|
import com.persagy.dmp.digital.client.DigitalObjectFacade;
|
|
|
import com.persagy.dmp.digital.entity.ObjectDigital;
|
|
|
import com.persagy.dmp.digital.entity.ObjectRelation;
|
|
@@ -101,23 +105,46 @@ public class AdmModelServiceImpl implements AdmModelService {
|
|
|
public void saveModelFile(AdmModelFile modelFile) {
|
|
|
admModelFileMapper.insertEntity(modelFile);
|
|
|
}
|
|
|
-
|
|
|
/**
|
|
|
- * 创建关系查询对象
|
|
|
- * @param objectMapper : objectMapper
|
|
|
- * @param graphCode : 图类型编码
|
|
|
- * @param relCode : 边类型编码
|
|
|
- * @param buildingIds : 建筑id
|
|
|
- * @return : com.fasterxml.jackson.databind.node.ObjectNode
|
|
|
+ * 根据正逆向交付查询对象类型交付范围
|
|
|
+ * @param deliveryWay : 正逆向交付方式,0-逆向,1-正向
|
|
|
+ * @return : java.util.List<com.persagy.dmp.delivery.dto.ObjectTypeCollectDTO>
|
|
|
* @author : lijie
|
|
|
- * Update By 2022/1/19 14:18
|
|
|
+ * Update By 2022/1/20 18:26
|
|
|
*/
|
|
|
- private ObjectNode createRelationQueryNode(ObjectMapper objectMapper, String graphCode, String relCode,
|
|
|
- Set<String> buildingIds) {
|
|
|
+ @Override
|
|
|
+ public List<ObjectTypeCollect> queryObjectTypeCollectByDeliveryWay(Integer deliveryWay) {
|
|
|
+ if (null==deliveryWay){
|
|
|
+ return new ArrayList<>();
|
|
|
+ }
|
|
|
+ QueryCriteria queryCriteria = new QueryCriteria();
|
|
|
+ ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
|
|
|
ObjectNode objectNode = objectMapper.createObjectNode();
|
|
|
- objectNode.put(ObjectRelation.GRAPH_CODE_HUM,graphCode);
|
|
|
- objectNode.put(ObjectRelation.REL_CODE_HUM,relCode);
|
|
|
- objectNode.putPOJO(ObjectRelation.OBJ_FROM_HUM,buildingIds);
|
|
|
- return objectNode;
|
|
|
+ objectNode.put(AuditableEntity.PROP_VALID,Boolean.TRUE);
|
|
|
+ objectNode.put(CommonConstant.QUERY_PROJECTID,AppContext.getContext().getProjectId());
|
|
|
+ objectNode.put(CommonConstant.QUERY_GROUPCODE,AppContext.getContext().getGroupCode());
|
|
|
+ objectNode.put(AdmServerConstant.DELIVERY_WAY,deliveryWay);
|
|
|
+ objectNode.put(AdmServerConstant.DELIVERY_TYPE,"0");
|
|
|
+ objectNode.put(AdmServerConstant.IS_DELIVERY,"1");
|
|
|
+ queryCriteria.setCriteria(objectNode);
|
|
|
+ CommonResult<List<ObjectTypeCollect>> commonResult = DigitalObjectTypeCollectFacade
|
|
|
+ .queryPrototype(AppContext.getContext().getGroupCode(), AppContext.getContext().getProjectId(),
|
|
|
+ AppContext.getContext().getAppId(), AppContext.getContext().getAccountId(), queryCriteria);
|
|
|
+ if (!CommonConstant.QUERY_SUCCESS.equals(commonResult.getResult())){
|
|
|
+ throw new BusinessException(commonResult.getResult(),commonResult.getMessage());
|
|
|
+ }
|
|
|
+ if (CollUtil.isNotEmpty(commonResult.getData())){
|
|
|
+ return commonResult.getData();
|
|
|
+ }
|
|
|
+ // 暂时加个逻辑,如果没有就查询0
|
|
|
+ objectNode.put(CommonConstant.QUERY_PROJECTID,CommonConstant.DEFAULT_ID);
|
|
|
+ objectNode.put(CommonConstant.QUERY_GROUPCODE,CommonConstant.DEFAULT_ID);
|
|
|
+ CommonResult<List<ObjectTypeCollect>> zeroCommonResult = DigitalObjectTypeCollectFacade
|
|
|
+ .queryPrototype(AppContext.getContext().getGroupCode(), AppContext.getContext().getProjectId(),
|
|
|
+ AppContext.getContext().getAppId(), AppContext.getContext().getAccountId(), queryCriteria);
|
|
|
+ if (!CommonConstant.QUERY_SUCCESS.equals(zeroCommonResult.getResult())){
|
|
|
+ throw new BusinessException(zeroCommonResult.getResult(),zeroCommonResult.getMessage());
|
|
|
+ }
|
|
|
+ return zeroCommonResult.getData();
|
|
|
}
|
|
|
}
|