|
|
|
import { Injectable } from '@angular/core';
|
|
|
|
import {HttpClient} from '_@angular_common@9.0.7@@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);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 新增
|
|
|
|
*
|
|
|
|
* @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);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|