package com.chinaweal.aiccs.aiccs.market.service;

import com.chinaweal.aiccs.aiccs.abnormal.entity.EBaseinfo;
import com.chinaweal.aiccs.aiccs.abnormal.entity.TSAbnList;
import com.chinaweal.aiccs.aiccs.market.entity.TSUsualInspect;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.chinaweal.aiccs.aiccs.revoke.Vo.EnableListAndCheckVo;
import com.chinaweal.aicorg.model.AICUser;
import com.chinaweal.youfool.framework.springboot.base.query.BaseQuery;
import com.chinaweal.youfool.framework.springboot.mybatis.plus.BaseService;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 日常检查信息 服务类
 * </p>
 *
 * @author chinaweal
 * @since 2021-10-18
 */
public interface ITSUsualInspectService extends BaseService<TSUsualInspect> {


    /**
     * 新增日常检查信息
     */
    TSUsualInspect saveTSUsualInspect(TSUsualInspect tSUsualInspect);

    /**
     * 修改日常检查信息
     */
    Map<String, Object> updateTSUsualInspect(TSUsualInspect tSUsualInspect);

    /**
     * 获取批吊现场检查结果
     */
    EnableListAndCheckVo getCheckAndRevResult(String pripid);
    /**
     * 分页查询日常检查信息
     */
    IPage<TSUsualInspect> listTSUsualInspect(BaseQuery<TSUsualInspect> query);

    /**
     * 批量列入检查
     * @param file
     * @param inspectExpireDate
     * @param source
     * @return
     */
    Map<String, Object> batchSave(MultipartFile file, String inspectExpireDate, String source);

    Map<String, Object> batchAddressSave(String ids, String inspectExpireDate, String source, String checkAddress);

    Map<String, Object> startManyTask(String ids, String inspectExpireDate, String source);

    /**
     * 列异回退接口（经营异常模块专用）
     * @param id 检查id
     * @param opinion 回退意见
     * @param source 来源 （双随机、市场所监管）
     * @param busType 业务类型 1-单独检查 2-批量检查
     * @param sourceInspectResult 检查结果 (双随机必传)
     * @param fileId 获取附件Id
     * @param pripids（一个或多个，用“;”隔开）
     ** @return
     */
    String backCheck(String id, String opinion, String source, String busType, String sourceInspectResult, String fileId, String pripids);

    /**
     * 列异回退接口（废弃）
     * @param id 检查id
     * @param opinion 回退意见
     ** @return
     */
    @Deprecated
    boolean backCheck(String id, String opinion);

    void exportNoSearchData(String id, HttpServletResponse response);

    List<TSUsualInspect> getListByPripid(String pripid);

    Map<String, List<Map<String, String>>> statistics();

    void repairData();

    List<TSUsualInspect> queryHistroyListByPripid(String pripid);

    List<TSUsualInspect> getPageByTask(Map<String, Object> param);

    Integer countByTask(Map<String, Object> param);

    Map<String, String> savewsqTSUsualInspect(TSAbnList tsAbnListModel, String bizseqUp, EBaseinfo eBaseinfo);

    TSUsualInspect getbyXyfxbizSeq(String bizseq);

    Object addContactLogByEntNo(String pripid, String originalValue, AICUser aicUser);
}
