package com.persagy.proxy.dictionary.service;

import com.persagy.proxy.adm.request.AdmQueryCriteria;
import com.persagy.proxy.dictionary.model.AdmDefFuncIdGather;
import com.persagy.proxy.dictionary.model.AdmDict;
import com.persagy.proxy.adm.request.AdmDictQueryCriteria;
import com.persagy.proxy.adm.request.AdmCreateRequest;
import com.persagy.proxy.adm.request.AdmResponse;
import com.persagy.proxy.common.entity.InstanceUrlParam;
import com.persagy.proxy.dictionary.model.AdmDictDeliverieInfosRequest;
import com.persagy.proxy.dictionary.model.AdmEquipDictInfos;
import com.persagy.proxy.object.model.AdmObjectInfo;

import java.util.List;
import java.util.Map;

/**
 * @ClassName IAdmDictService
 * @Description: 字典查询
 * @Author linhuili
 * @Date 2021/8/31 14:30
 * @Version V1.0
 **/
public interface IAdmDictService<T> extends IAdmDictBaseService<T>{

    /**
     * 查询字典分类
     * @param context
     * @param request
     * @param clazz
     * @return
     * @throws Exception
     */
    AdmResponse queryCategory(InstanceUrlParam context , AdmDict request, Class<T> clazz);


    /**
     * 重置项目下的定制信息点
     * @param context
     * @param clazz
     * @return
     * @throws Exception
     */
    AdmResponse resetDic(InstanceUrlParam context , AdmDictQueryCriteria request ,String fieldName, Class<T> clazz) throws Exception;

    /**
     * 设置-项目定制化字典
     * @param context
     * @param request
     * @return
     * @throws Exception
     */
    AdmResponse settingDicProject(InstanceUrlParam context , AdmCreateRequest<AdmDefFuncIdGather> request, Class<T> clazz) throws Exception;


    /**
     * 查询所有字典信息 M 和 L 类型,包括自定义信息点
     * @param context
     * @param dictTypeList
     * @return
     */
    AdmResponse queryMorlDict(InstanceUrlParam context,List<String> dictTypeList);


    /**
     * 查询信息点
     * @param context
     * @param request
     * @param fieldName
     * @param clazz
     * @return
     */
    AdmResponse query(InstanceUrlParam context, AdmDictQueryCriteria request,String fieldName, Class<T> clazz);

    /**
     * 查询已交付信息点
     * @param request
     * @return
     */
    Map<String, AdmObjectInfo> queryDictDeliveredInfos(InstanceUrlParam context, AdmDictDeliverieInfosRequest request, Class<T> clazz);

    /**
     * 组装通用对象查询条件
     * @param request
     * @return
     */
    AdmQueryCriteria commbineObjectQueryCriteria(AdmDictDeliverieInfosRequest request);
    /**
     * 初始化待交付的信息点
     * @param admObjectInfoMap
     * @param deliveredInfos
     * @param deliveredCodes
     */
    void initDeliveredInfos(Map<String, AdmObjectInfo> admObjectInfoMap, List<AdmObjectInfo> deliveredInfos, List<String> deliveredCodes);
}
