package cn.superdesk.uniorder.service.organisation;

import cn.superdesk.uniorder.common.rest.response.R;
import cn.superdesk.uniorder.common.security.dto.LoginSysUser;
import cn.superdesk.uniorder.dao.entity.organisation.UnifiedSupplier;
import cn.superdesk.uniorder.dto.param.organisation.SysSupplierQueryParam;
import cn.superdesk.uniorder.dto.param.organisation.UnifiedSupplierQueryCriteria;
import cn.superdesk.uniorder.dto.receive.consumer.superdeskmall.SlaveSupplierReceiveParam;
import cn.superdesk.uniorder.dto.receive.consumer.superdeskmall.SuperMallSupplierReceiveParam;
import cn.superdesk.uniorder.dto.vo.organisation.UnifiedSupplierVo;
import cn.superdesk.uniorder.dto.vo.sys.SysSelectVo;
import cn.superdesk.uniorder.dto.vo.sys.SysSupplierVo;
import cn.superdesk.uniorder.service.base.BaseService;
import com.github.pagehelper.PageInfo;

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

/**
 * @Description: 商户/供应商 对账主体
 * @Author: linjinyu
 * @CreateDate: 2021/4/27 上午10:52
 * @UpdateUser: linjinyu
 * @UpdateDate: 2021/4/27 上午10:52
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
public interface SysSupplierService extends BaseService<UnifiedSupplier> {

    /****************************************** extends BaseService 部分 start ******************************************/

    int insertSelective(UnifiedSupplier entity);

    int updateByPrimaryKeySelective(UnifiedSupplier entity);

    @Deprecated
    void deleteObj(Long id);

    @Deprecated
    UnifiedSupplier findById(Long id);

    @Deprecated
    PageInfo<UnifiedSupplier> findByPaging(Map<String, Object> conditions, Integer pageNun, Integer pageSize);

    @Deprecated
    List<UnifiedSupplier> findAll(Map<String, Object> queryMap);

    List<UnifiedSupplierVo> findByCriteria(UnifiedSupplierQueryCriteria unifiedSupplierCriteria);

    /****************************************** extends BaseService 部分   end ******************************************/


    int addUnifiedSupplier(UnifiedSupplier entity, LoginSysUser loginSysUser);

    int updateUnifiedSupplier(UnifiedSupplier entity, LoginSysUser loginSysUser);

    int deleteUnifiedSupplier(Long id, LoginSysUser loginSysUser);

    UnifiedSupplier findUnifiedSupplierById(Long id);

    R<List<UnifiedSupplier>> pageQuery(Map<String, Object> conditions, int pageNun, int pageSize);

    /******************************************  start ******************************************/


    /****************************************** 工具方法  start ******************************************/

    List<UnifiedSupplier> findByOutSaleIds(List<Long> outSaleIds);

    Map<Long, UnifiedSupplier> convertOutSaleIds2MapOutSaleId2Entity(List<Long> outSaleIds);

    /****************************************** 工具方法   end ******************************************/


    R<List<UnifiedSupplierVo>> pageQuery(
            UnifiedSupplierQueryCriteria queryCriteria,
            LoginSysUser loginSysUser);

    void mergeUnifiedSupplier(Long saleId, String saleName, String serviceNo);


    /****************************************** kafka 超级前台 企业采购 企业福利 start ******************************************/

    void kafkaMergeReceiveMerchant4SuperdeskMall(SuperMallSupplierReceiveParam superMallSupplierReceiveParam);

    void kafkaDeleteReceiveMerchant4SuperdeskMall(SuperMallSupplierReceiveParam superMallSupplierReceiveParam);

    /****************************************** kafka 超级前台 企业采购 企业福利   end ******************************************/

    /****************************************** kafka 侨城汇专用 start ******************************************/
    /**
     * 侨城汇 专用 商户信息同步
     *
     * @param slaveSupplierReceiveParam
     */
    void kafkaMergeReceiveMerchant4SuperdeskMallFLSC_QCH(SlaveSupplierReceiveParam slaveSupplierReceiveParam);

    /**
     * 20200707 林志鹏说是没删除
     *
     * @param message
     */
    @Deprecated
    void kafkaDeleteReceiveMerchant4SuperdeskMallFLSC_QCH(String message);


    /****************************************** kafka 侨城汇专用   end ******************************************/

    /**
     * 同步集采供应商数据
     *
     * @param message
     */
    void mergeReceiveSupplier4Qchjc(String message);

    List<SysSupplierVo> findSupplierList(SysSupplierQueryParam param);

    List<SysSelectVo> selectList(Map<String,Object> params);
}
