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

import cn.superdesk.uniorder.common.rest.response.R;
import cn.superdesk.uniorder.common.security.dto.LoginSysUser;
import cn.superdesk.uniorder.dao.entity.invoice.supplier.InvoiceApplySupplier;
import cn.superdesk.uniorder.dao.entity.invoice.supplier.InvoiceApplySupplierXGoods;
import cn.superdesk.uniorder.dto.param.invoice.supplier.InvoiceApplySupplierPageVoListQueryCriteria;
import cn.superdesk.uniorder.dto.param.invoice.supplier.InvoiceApplySupplierQueryCriteria;
import cn.superdesk.uniorder.dto.param.invoice.supplier.status.InvoiceApplySupplierOpCommonDimAccountingOrderForm;
import cn.superdesk.uniorder.dto.vo.invoice.supplier.InvoiceApplySupplierHeadVo;
import cn.superdesk.uniorder.dto.vo.invoice.supplier.InvoiceApplySupplierPageVo;
import cn.superdesk.uniorder.dto.vo.invoice.supplier.InvoiceApplySupplierSelectGoodsVo;
import cn.superdesk.uniorder.service.base.BaseService;
import com.github.pagehelper.PageInfo;

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

public interface InvoiceApplySupplierService extends BaseService<InvoiceApplySupplier> {

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

	int insertSelective(InvoiceApplySupplier entity);

    int updateByPrimaryKeySelective(InvoiceApplySupplier entity);

	@Deprecated
	void deleteObj(Long id);

	@Deprecated
	InvoiceApplySupplier findById(Long id);

	List<InvoiceApplySupplier> findByIds(List<Long> invoiceApplyIds);

	List<InvoiceApplySupplier> findByAccountingOrderSn(String accountingOrderSn);

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

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

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


	void addInvoiceApplySupplier(InvoiceApplySupplier entity);

	void updateInvoiceApplySupplier(InvoiceApplySupplier entity);

	int updateInvoiceApplySupplierByPrimaryKeySelective(InvoiceApplySupplier entity);

	void deleteInvoiceApplySupplier(Long id);



	InvoiceApplySupplier findInvoiceApplySupplierById(Long id);

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

	R<List<InvoiceApplySupplier>> pageQueryGenericParam(InvoiceApplySupplierQueryCriteria criteria);

	/****************************************** 重构前存在 start ******************************************/

	R<List<InvoiceApplySupplier>> queryInvoiceApplyList(Map<String, Object> params, int pageNum, int pageSize);

	R<List<InvoiceApplySupplierPageVo>> queryInvoiceApplySupplierPageVoList(InvoiceApplySupplierPageVoListQueryCriteria queryCriteria, LoginSysUser loginSysUser);

	InvoiceApplySupplierHeadVo getInvoiceApplyListHeadSum(Map<String, Object> params);

	List<InvoiceApplySupplierSelectGoodsVo> getStatementOfAccountGoodsListByAccountingOrderSn(String accountingOrderSn);

	List<InvoiceApplySupplierSelectGoodsVo> getStatementOfAccountGoodsListBySysUnifiedOrderGoodsIds(String accountingOrderSn, List<Long> processSysUnifiedOrderGoodsIds);


	List<InvoiceApplySupplierSelectGoodsVo> invoiceApplySelectFocusUnified(String accountingOrderSn);


	/**
	 *
	 * @param invoiceApplyEntity 实体
	 * @param invoiceApplyXGoodsProcessList 关系 accountingOrderId accountingOrderSn accountingOrderType dimCreateBy unifiedOrderId
	 * @return
	 */
	InvoiceApplySupplier opInvoiceApply(InvoiceApplySupplier invoiceApplyEntity, List<InvoiceApplySupplierXGoods> invoiceApplyXGoodsProcessList);


	String opPhysicsDelete(InvoiceApplySupplier entity, LoginSysUser loginSysUser);

	String opBecomeInvalid(InvoiceApplySupplier entity, LoginSysUser loginSysUser);

	String opBecomeInvalid(List<InvoiceApplySupplier> entitys, InvoiceApplySupplierOpCommonDimAccountingOrderForm form, LoginSysUser loginSysUser);



	void deleteInvoiceApplySupplierBatch(String accountingOrderSn);

	/****************************************** 补丁程序 start ******************************************/

	void patchInvoiceApplyFieldStatistics();

	int pathFixFieldServiceNoSourceFrom(
			String accountingOrderSn,
			String serviceNo, String sourceFrom, LoginSysUser loginSysUser);

	/****************************************** 补丁程序   end ******************************************/



}
