import request from '@/utils/request'

// 创建疑似窜货记录
export function createDiversionRecord(data) {
  return request({
    url: '/identity/diversion-record/create',
    method: 'post',
    data: data
  })
}

// 更新疑似窜货记录
export function updateDiversionRecord(data) {
  return request({
    url: '/identity/diversion-record/update',
    method: 'put',
    data: data
  })
}

// 删除疑似窜货记录
export function deleteDiversionRecord(id) {
  return request({
    url: '/identity/diversion-record/delete?id=' + id,
    method: 'delete'
  })
}

// 获得疑似窜货记录
export function getDiversionRecord(id) {
  return request({
    url: '/identity/diversion-record/get?id=' + id,
    method: 'get'
  })
}

// 获得疑似窜货记录分页
export function getDiversionRecordPage(query) {
  return request({
    url: '/identity/diversion-record/page',
    method: 'get',
    params: query
  })
}

// 导出疑似窜货记录 Excel
export function exportDiversionRecordExcel(query) {
  return request({
    url: '/identity/diversion-record/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}

// 根据商品编码查询所有数据 然后在查询出所有的数据的同时再过滤出所有相对应的扫码地区
export function getScanLocations(params) {
  return request({
    url: '/identity/diversion-record/getScanLocations',
    method: 'get',
	params,
  })
}

// 根据identityUrl 获取所有的扫码时间与扫码地点
export function getScanLocationAndTimeByUrl(params) {
  return request({
    url: '/identity/scan-record/getScanLocationAndTimeByUrl',
    method: 'get',
    params,
  })
}

// 根据identityUrl 获取首次的扫码时间与首次扫码地点和扫码次数
export function getFirstScanInfoByUrlAndNumber(params) {
  return request({
    url: '/identity/scan-record/getFirstScanInfoByUrlAndNumber',
    method: 'get',
    params,
  })
}
