|
|
|
import { Injectable } from '@angular/core';
|
|
|
|
import {HttpClient} from '@angular/common/http';
|
|
|
|
import {CommonsService} from './commons.service';
|
|
|
|
import {environment} from '../../environments/environment';
|
|
|
|
|
|
|
|
@Injectable({
|
|
|
|
providedIn: 'root'
|
|
|
|
})
|
|
|
|
export class RechargeService {
|
|
|
|
|
|
|
|
constructor(
|
|
|
|
private http: HttpClient,
|
|
|
|
private common: CommonsService
|
|
|
|
) {
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 查询列表
|
|
|
|
*
|
|
|
|
* @param paramsObject 对象
|
|
|
|
* @param callBack 回调
|
|
|
|
*/
|
|
|
|
public getListOutRechargePrice(paramsObject: object, callBack) {
|
|
|
|
this.http.get(environment.baseUrl + 'outRechargePrice/getListOutRechargePrice?' + this.common.getWhereCondition(paramsObject)).subscribe(data => {
|
|
|
|
callBack(data);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @Author Sum1Dream
|
|
|
|
* @methodName deletePrice
|
|
|
|
* @Description //上下架
|
|
|
|
* @Date 15:03 2021/8/12
|
|
|
|
* @Param mod
|
|
|
|
**/
|
|
|
|
public onAndOffShelves(id: number, callBack) {
|
|
|
|
this.http.get(environment.baseUrl + 'outRechargePrice/onAndOffShelves?id=' + id).subscribe(data => {
|
|
|
|
callBack(data);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 新增
|
|
|
|
*
|
|
|
|
* @param params 上传对象
|
|
|
|
* @param callBack 回调
|
|
|
|
* @return data 返回结果
|
|
|
|
*/
|
|
|
|
public insertPrice(params: object, callBack) {
|
|
|
|
this.http.post(environment.baseUrl + 'outRechargePrice/insertPrice', params).subscribe(data => {
|
|
|
|
callBack(data);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 修改卡券
|
|
|
|
*
|
|
|
|
* @param params 上传对象
|
|
|
|
* @param callBack 回调
|
|
|
|
* @return data 返回结果
|
|
|
|
*/
|
|
|
|
public updatePrice(params: object, callBack) {
|
|
|
|
this.http.post(environment.baseUrl + 'outRechargePrice/updatePrice', params).subscribe(data => {
|
|
|
|
callBack(data);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 根据id查询详情
|
|
|
|
*
|
|
|
|
* @param id id
|
|
|
|
* @param callBack 回调
|
|
|
|
*/
|
|
|
|
public findById(id: number, callBack) {
|
|
|
|
this.http.get(environment.baseUrl + 'outRechargePrice/findById?id=' + id).subscribe(data => {
|
|
|
|
callBack(data);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 根据id查询详情
|
|
|
|
*
|
|
|
|
* @param id id
|
|
|
|
* @param callBack 回调
|
|
|
|
*/
|
|
|
|
public deletePrice(id: number, callBack) {
|
|
|
|
this.http.get(environment.baseUrl + 'outRechargePrice/deletePrice?id=' + id).subscribe(data => {
|
|
|
|
callBack(data);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 查询订单列表
|
|
|
|
*
|
|
|
|
* @param paramsObject 对象
|
|
|
|
* @param callBack 回调
|
|
|
|
*/
|
|
|
|
public getOrderList(paramsObject: object, callBack) {
|
|
|
|
this.http.get(environment.baseUrl + 'outRechargeOrder/getOrderList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => {
|
|
|
|
callBack(data);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 根据id查询详情
|
|
|
|
*
|
|
|
|
* @param id id
|
|
|
|
* @param callBack 回调
|
|
|
|
*/
|
|
|
|
public getOrderById(id: number, callBack) {
|
|
|
|
this.http.get(environment.baseUrl + 'outRechargeOrder/getOrderById?orderId=' + id).subscribe(data => {
|
|
|
|
callBack(data);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 根据id完成订单
|
|
|
|
*
|
|
|
|
* @param id id
|
|
|
|
* @param callBack 回调
|
|
|
|
*/
|
|
|
|
public finishOrder(id: number, callBack) {
|
|
|
|
this.http.get(environment.baseUrl + 'outRechargeOrder/finishOrder?orderId=' + id).subscribe(data => {
|
|
|
|
callBack(data);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 根据id完成退款
|
|
|
|
*
|
|
|
|
* @param id id
|
|
|
|
* @param callBack 回调
|
|
|
|
*/
|
|
|
|
public orderToRefund(id: number, callBack) {
|
|
|
|
this.http.get(environment.baseUrl + 'outRechargeOrder/orderToRefund?orderId=' + id).subscribe(data => {
|
|
|
|
callBack(data);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 查询充值订单数量
|
|
|
|
*
|
|
|
|
* @param id id
|
|
|
|
* @param callBack 回调
|
|
|
|
*/
|
|
|
|
public countOrder(callBack) {
|
|
|
|
this.http.get(environment.baseUrl + 'outRechargeOrder/countOrder').subscribe(data => {
|
|
|
|
callBack(data);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 查询订单列表
|
|
|
|
*
|
|
|
|
* @param paramsObject 对象
|
|
|
|
* @param callBack 回调
|
|
|
|
*/
|
|
|
|
public getOrderCountList(paramsObject: object, callBack) {
|
|
|
|
this.http.get(environment.baseUrl + 'outRechargeOrder/getOrderCountList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => {
|
|
|
|
callBack(data);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 到处订单统计
|
|
|
|
*
|
|
|
|
* @param paramsObject 对象
|
|
|
|
* @param callBack 回调
|
|
|
|
*/
|
|
|
|
public exportOrderListCount(paramsObject: object, callBack) {
|
|
|
|
this.http.get(environment.baseUrl + 'outRechargeOrder/exportOrderListCount?' + this.common.getWhereCondition(paramsObject)).subscribe(data => {
|
|
|
|
callBack(data);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 到处订单统计
|
|
|
|
*
|
|
|
|
* @param paramsObject 对象
|
|
|
|
* @param callBack 回调
|
|
|
|
*/
|
|
|
|
public exportOrderList(paramsObject: object, callBack) {
|
|
|
|
this.http.get(environment.baseUrl + 'outRechargeOrder/exportOrderList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => {
|
|
|
|
callBack(data);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 查询订单列表
|
|
|
|
*
|
|
|
|
* @param paramsObject 对象
|
|
|
|
* @param callBack 回调
|
|
|
|
*/
|
|
|
|
public getUserCountList(paramsObject: object, callBack) {
|
|
|
|
this.http.get(environment.baseUrl + 'outRechargeOrder/getUserCountList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => {
|
|
|
|
callBack(data);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 到处订单统计
|
|
|
|
*
|
|
|
|
* @param paramsObject 对象
|
|
|
|
* @param callBack 回调
|
|
|
|
*/
|
|
|
|
public exportUserOrderListCount(paramsObject: object, callBack) {
|
|
|
|
this.http.get(environment.baseUrl + 'outRechargeOrder/exportUserOrderListCount?' + this.common.getWhereCondition(paramsObject)).subscribe(data => {
|
|
|
|
callBack(data);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 获取渠道商获取关联商品
|
|
|
|
*
|
|
|
|
* @param callBack 回调
|
|
|
|
*/
|
|
|
|
public getMemberGoods(callBack) {
|
|
|
|
this.http.get(environment.baseUrl + 'telApi/getMemberGoods').subscribe(data => {
|
|
|
|
callBack(data);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|