package cn.superdesk.uniorder.service.invoice.common;

import cn.superdesk.uniorder.common.rest.response.R;
import cn.superdesk.uniorder.common.security.dto.LoginSysUser;
import cn.superdesk.uniorder.dao.entity.invoice.common.InvoiceType;
import cn.superdesk.uniorder.dto.param.invoice.common.InvoiceTypeCacheCriteria;
import cn.superdesk.uniorder.dto.param.invoice.common.InvoiceTypeModeRuleSuper;
import cn.superdesk.uniorder.dto.param.invoice.common.InvoiceTypeOpCriteria;
import cn.superdesk.uniorder.dto.param.invoice.common.InvoiceTypeQueryCriteria;
import cn.superdesk.uniorder.dto.vo.invoice.common.InvoiceTypeOpInvoiceSettingLoadingVo;
import cn.superdesk.uniorder.dto.vo.invoice.common.InvoiceTypePageQueryVo;
import cn.superdesk.uniorder.dto.vo.invoice.common.InvoiceTypeSelectVo;
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/7/23 下午3:57
 * @UpdateUser: linjinyu
 * @UpdateDate: 2021/7/23 下午3:57
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
public interface InvoiceTypeService extends BaseService<InvoiceType> {


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

	int insertSelective(InvoiceType entity);

    int updateByPrimaryKeySelective(InvoiceType entity);

	@Deprecated
	void deleteObj(Long id);

	@Deprecated
	InvoiceType findById(Long id);

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

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

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


	void addInvoiceType(InvoiceType entity);

	void updateInvoiceType(InvoiceType entity);

	void deleteInvoiceType(Long id);

	InvoiceType findInvoiceTypeById(Long id);

	R<List<InvoiceType>> pageQuery(InvoiceTypeQueryCriteria queryCriteria, LoginSysUser loginSysUser);

	R<List<InvoiceTypePageQueryVo>> pageQuerySugarUp(InvoiceTypeQueryCriteria queryCriteria, LoginSysUser loginSysUser);

	List<InvoiceTypeSelectVo> selectQuery(InvoiceTypeQueryCriteria queryCriteria, LoginSysUser loginSysUser);


	/****************************************** 获取部分 start ******************************************/

	InvoiceTypeModeRuleSuper getInvoiceModeRuleByInvoiceTypeIdAndModuleOrDefault(Long invoiceTypeId, String module, LoginSysUser loginSysUser);

	/**
	 *
	 * @param invoiceTypeId
	 * @param module InvoiceTypeMoudelEnum
	 * @param mode InvoiceTypeMoudelXModeEnum
	 * @param loginSysUser
	 * @return
	 */
	InvoiceTypeModeRuleSuper getInvoiceModeRuleByInvoiceTypeIdAndModuleAndMode(Long invoiceTypeId, String module, String mode, LoginSysUser loginSysUser);

	/****************************************** 获取部分   end ******************************************/

	/****************************************** 操作部分 start ******************************************/


	int opSetDefault(InvoiceTypeOpCriteria opCriteria, LoginSysUser loginSysUser);

	int opSetNormal(InvoiceTypeOpCriteria opCriteria, LoginSysUser loginSysUser);

	int opSetEnable(InvoiceTypeOpCriteria opCriteria, LoginSysUser loginSysUser);

	int opSetDisable(InvoiceTypeOpCriteria opCriteria, LoginSysUser loginSysUser);


	/****************************************** 操作部分   end ******************************************/

	/****************************************** 操作类 进阶 模块X发票种类-开票方式 start ******************************************/

	int opInvoiceSettingSetDefault(InvoiceTypeOpCriteria opCriteria, LoginSysUser loginSysUser);

	int opInvoiceSettingSetNormal(InvoiceTypeOpCriteria opCriteria, LoginSysUser loginSysUser);

	int opInvoiceSettingSetEnable(InvoiceTypeOpCriteria opCriteria, LoginSysUser loginSysUser);

	int opInvoiceSettingSetDisable(InvoiceTypeOpCriteria opCriteria, LoginSysUser loginSysUser);

	InvoiceTypeOpInvoiceSettingLoadingVo opInvoiceSettingLoading(InvoiceTypeOpCriteria opCriteria, LoginSysUser loginSysUser);

	/****************************************** 操作类 进阶 模块X发票种类-开票方式   end ******************************************/


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

	Map<String, InvoiceType> convertToMapFieldTypeName2Entity();

	Map<String, String> convertToMapFieldTypeName2JsonString();

	Map<Long, InvoiceType> convertToMapFieldId2Entity();

	Map<String, String> convertToMapFieldId2JsonString();

	/****************************************** 缓存 start ******************************************/

	void cacheInit(InvoiceTypeCacheCriteria criteria);

	void cacheRefresh(InvoiceTypeCacheCriteria criteria);

	void cacheRemove(InvoiceTypeCacheCriteria criteria);

	String cacheGet(InvoiceTypeCacheCriteria criteria);

	InvoiceType cacheGetEntity(InvoiceTypeCacheCriteria criteria);

	/****************************************** 缓存   end ******************************************/

}
