|
|
|
@ -160,7 +160,25 @@ namespace Shentun.Peis.PlugIns.Gem |
|
|
|
var result = await CancelQrCode(hisInput); |
|
|
|
if (result.MsgHeader.Status != "true") |
|
|
|
{ |
|
|
|
throw new Exception("作废申请单失败" + result.MsgHeader.Detail); |
|
|
|
//-1 申请单未找到
|
|
|
|
if(!(result.MsgHeader.Detail.Contains("未查到开单信息"))) |
|
|
|
{ |
|
|
|
|
|
|
|
var payStatus = await GetPayStatus(chargeRequestForPlugIns.ChargeRequestNo, chargeRequestForPlugIns.HisChargeNo); |
|
|
|
if (payStatus == "1") |
|
|
|
{ |
|
|
|
throw new Exception("his已缴费"); |
|
|
|
} |
|
|
|
else if (payStatus == "2") |
|
|
|
{ |
|
|
|
throw new Exception("his已作废"); |
|
|
|
} |
|
|
|
else if (payStatus == "3") |
|
|
|
{ |
|
|
|
throw new Exception("his已退费"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
await SetAppChargeRequestFlagAsync(input.ChargeRequestId, ChargeRequestFlag.AlreadyCancelCharge); |
|
|
|
return new ChargeRequestPlugInsOut(); |
|
|
|
@ -171,7 +189,45 @@ namespace Shentun.Peis.PlugIns.Gem |
|
|
|
throw new Exception("格尔木DoWorkAsync。。。"); |
|
|
|
//return base.DoWorkAsync();
|
|
|
|
} |
|
|
|
public override async Task<ChargeRequestPlugInsOut> RefundRequestAsync(ChargeRequestPlugInsInput input) |
|
|
|
{ |
|
|
|
var chargeRequestForPlugIns = await GetChargeRequestAsync(input.ChargeRequestId); |
|
|
|
if (chargeRequestForPlugIns == null) |
|
|
|
{ |
|
|
|
throw new Exception("没有申请单信息"); |
|
|
|
} |
|
|
|
|
|
|
|
var hisInput = new HisAgreeRefundInput() |
|
|
|
{ |
|
|
|
Data = new HisAgreeRefundDataInput() |
|
|
|
{ |
|
|
|
MsgHeader = new HisMsgHeaderInput() |
|
|
|
{ |
|
|
|
Sender = "PEIS", |
|
|
|
MsgType = "SVR_ODS_6105", |
|
|
|
MsgVersion = "3.1", |
|
|
|
}, |
|
|
|
Item = new HisAgreeRefundDataItemInput() |
|
|
|
{ |
|
|
|
Yjxh = chargeRequestForPlugIns.HisChargeNo, |
|
|
|
ExamRequestNo = chargeRequestForPlugIns.ChargeRequestNo |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
var result = await AgreeRefund(hisInput); |
|
|
|
if (result.MsgHeader.Status != "true") |
|
|
|
{ |
|
|
|
var payStatus = await GetPayStatus(chargeRequestForPlugIns.ChargeRequestNo, chargeRequestForPlugIns.HisChargeNo); |
|
|
|
if (payStatus != "3") |
|
|
|
{ |
|
|
|
throw new Exception("允许退费申请失败" + result.MsgHeader.Detail); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
await SetAppChargeRequestFlagAsync(input.ChargeRequestId, ChargeRequestFlag.RefundRequest); |
|
|
|
return new ChargeRequestPlugInsOut(); |
|
|
|
} |
|
|
|
public override Task DoWork() |
|
|
|
{ |
|
|
|
var queryDaysStr = InterfaceConfig.GetSection("Scheduler").GetSection("QueryDays").Value; |
|
|
|
@ -203,42 +259,23 @@ namespace Shentun.Peis.PlugIns.Gem |
|
|
|
public override async Task SyncChargeRequestFlagFromInterfaceAsync(Guid chargeRequestId) |
|
|
|
{ |
|
|
|
var chargeRequest = await GetChargeRequestAsync(chargeRequestId); |
|
|
|
var hisInput = new HisPayStatusInput() |
|
|
|
{ |
|
|
|
Data = new HisPayStatusDataInput() |
|
|
|
{ |
|
|
|
MsgHeader = new HisMsgHeaderInput() |
|
|
|
{ |
|
|
|
Sender = "PEIS", |
|
|
|
MsgType = "SVR_ODS_6105", |
|
|
|
MsgVersion = "3.1", |
|
|
|
}, |
|
|
|
Item = new HisPayStatusDataItemInput() |
|
|
|
{ |
|
|
|
Yjxh = chargeRequest.HisChargeNo, |
|
|
|
ExamRequestNo = chargeRequest.ChargeRequestNo, |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
var result = PayStatus(hisInput).Result; |
|
|
|
if (result.MsgHeader.Status != "true") |
|
|
|
{ |
|
|
|
throw new Exception("查询支付状态失败" + result.MsgHeader.Detail); |
|
|
|
} |
|
|
|
|
|
|
|
var payStatus = await GetPayStatus(chargeRequest.ChargeRequestNo, chargeRequest.HisChargeNo); |
|
|
|
|
|
|
|
//1:已支付,2.已作废3.已退费, 其他:未支付
|
|
|
|
char charRequstFlag; |
|
|
|
if (result.MsgHeader.ErrCode == "1") |
|
|
|
if (payStatus == "1") |
|
|
|
{ |
|
|
|
charRequstFlag = ChargeRequestFlag.AlreadyCharge; |
|
|
|
SetAppChargeRequestFlagAsync(chargeRequest.ChargeRequestId, charRequstFlag); |
|
|
|
|
|
|
|
} |
|
|
|
else if (result.MsgHeader.ErrCode == "2") |
|
|
|
else if (payStatus == "2") |
|
|
|
{ |
|
|
|
charRequstFlag = ChargeRequestFlag.AlreadyCancelCharge; |
|
|
|
SetAppChargeRequestFlagAsync(chargeRequest.ChargeRequestId, charRequstFlag); |
|
|
|
} |
|
|
|
else if (result.MsgHeader.ErrCode == "3") |
|
|
|
else if (payStatus == "3") |
|
|
|
{ |
|
|
|
charRequstFlag = ChargeRequestFlag.AlreadyRefund; |
|
|
|
SetAppChargeRequestFlagAsync(chargeRequest.ChargeRequestId, charRequstFlag); |
|
|
|
@ -248,17 +285,12 @@ namespace Shentun.Peis.PlugIns.Gem |
|
|
|
//throw new Exception("查询支付状态不支持的收费标志" + result.MsgHeader.ErrCode);
|
|
|
|
} |
|
|
|
} |
|
|
|
public override async Task<ChargeRequestPlugInsOut> RefundRequestAsync(ChargeRequestPlugInsInput input) |
|
|
|
|
|
|
|
private async Task<string> GetPayStatus(string chargeRequestNo, string hisChargeNo) |
|
|
|
{ |
|
|
|
var chargeRequestForPlugIns = await GetChargeRequestAsync(input.ChargeRequestId); |
|
|
|
if (chargeRequestForPlugIns == null) |
|
|
|
{ |
|
|
|
throw new Exception("没有申请单信息"); |
|
|
|
} |
|
|
|
|
|
|
|
var hisInput = new HisAgreeRefundInput() |
|
|
|
var hisInput = new HisPayStatusInput() |
|
|
|
{ |
|
|
|
Data = new HisAgreeRefundDataInput() |
|
|
|
Data = new HisPayStatusDataInput() |
|
|
|
{ |
|
|
|
MsgHeader = new HisMsgHeaderInput() |
|
|
|
{ |
|
|
|
@ -266,21 +298,20 @@ namespace Shentun.Peis.PlugIns.Gem |
|
|
|
MsgType = "SVR_ODS_6105", |
|
|
|
MsgVersion = "3.1", |
|
|
|
}, |
|
|
|
Item = new HisAgreeRefundDataItemInput() |
|
|
|
Item = new HisPayStatusDataItemInput() |
|
|
|
{ |
|
|
|
Yjxh = chargeRequestForPlugIns.HisChargeNo, |
|
|
|
ExamRequestNo = chargeRequestForPlugIns.ChargeRequestNo |
|
|
|
Yjxh = hisChargeNo, |
|
|
|
ExamRequestNo = chargeRequestNo, |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
var result = await AgreeRefund(hisInput); |
|
|
|
var result = await PayStatus(hisInput); |
|
|
|
if (result.MsgHeader.Status != "true") |
|
|
|
{ |
|
|
|
throw new Exception("允许退费申请失败" + result.MsgHeader.Detail); |
|
|
|
throw new Exception("查询支付状态失败" + result.MsgHeader.Detail); |
|
|
|
} |
|
|
|
await SetAppChargeRequestFlagAsync(input.ChargeRequestId, ChargeRequestFlag.RefundRequest); |
|
|
|
return new ChargeRequestPlugInsOut(); |
|
|
|
//1:已支付,2.已作废3.已退费, 其他:未支付
|
|
|
|
return result.MsgHeader.ErrCode; |
|
|
|
} |
|
|
|
public async Task<HisPatientQueryOut> PatientQuery(HisPatientQueryInput input) |
|
|
|
{ |
|
|
|
|