Compare commits

..

1 Commits

Author SHA1 Message Date
vchikalkin
706665dd4f refactor service 2023-10-03 14:40:19 +03:00
7 changed files with 8562 additions and 3505 deletions

View File

@ -1,9 +1,7 @@
{
"providerId": "Microsoft.Tools.ServiceModel.Svcutil",
"version": "2.1.0",
"ExtendedData": {
"inputs": [
"https://evolucia.elt-poisk.com/soap.php?wsdl"
"http://evolucia.elt-poisk.com/soap.php?wsdl"
],
"collectionTypes": [
"System.Array",
@ -12,7 +10,6 @@
"namespaceMappings": [
"*, ELTKasko"
],
"outputFile": "Reference",
"sync": true,
"targetFramework": "netcoreapp3.1",
"typeReuseMode": "All"

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,7 @@
"Version": "15.0.40203.910",
"ExtendedData": {
"inputs": [
"https://evolucia.elt-poisk.com/soaposago.php?wsdl"
"http://evolucia.elt-poisk.com/soaposago.php?wsdl"
],
"collectionTypes": [
"System.Array",

View File

@ -6792,7 +6792,6 @@ namespace ELTOsago
result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max;
result.MaxReceivedMessageSize = int.MaxValue;
result.AllowCookies = true;
result.Security.Mode = System.ServiceModel.BasicHttpSecurityMode.Transport;
return result;
}
throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration));
@ -6802,7 +6801,7 @@ namespace ELTOsago
{
if ((endpointConfiguration == EndpointConfiguration.EltSoap))
{
return new System.ServiceModel.EndpointAddress("https://evolucia.elt-poisk.com/soaposago.php");
return new System.ServiceModel.EndpointAddress("http://evolucia.elt-poisk.com/soaposago.php");
}
throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration));
}

View File

@ -1,6 +0,0 @@
namespace ELT.Client.Models.Common;
public class ErrorResponse
{
public string Error { get; set; }
}

View File

@ -3,7 +3,6 @@ using ELT.Client.Models.Common;
using ELTKasko;
using ELTOsago;
using Microsoft.AspNetCore.Mvc;
using AuthInfo = ELTOsago.AuthInfo;
using EltKaskoSoap = ELTKasko.EltSoap;
using ELTOsagoSoap = ELTOsago.EltSoap;
@ -38,88 +37,74 @@ public class CommonController : ControllerBase
[HttpPost("get-kasko-calculation")]
public ActionResult<KASKOCalculationResult> GetKaskoCalculation([FromBody] GetKaskoCalculationInput data)
{
try
{
var preRequestData = this.GetPreRequestData(data.Preparams);
var preRequestData = this.GetPreRequestData(data.Preparams);
var request = data.Params;
request.UsageCityKLADR = preRequestData.Kladr;
request.Mark = preRequestData.Brand;
request.Model = preRequestData.Model;
var request = data.Params;
request.UsageCityKLADR = preRequestData.Kladr;
request.Mark = preRequestData.Brand;
request.Model = preRequestData.Model;
if (request.Modification != null)
request.Modification.Name = preRequestData.Modification;
if (request.Modification != null)
request.Modification.Name = preRequestData.Modification;
var specialMachinery = data.Preparams.SpecialMachinery;
specialMachinery.SpecialMachineryMark = preRequestData.Brand;
specialMachinery.SpecialMachineryModel = preRequestData.Model;
request.SpecialMachinery = specialMachinery;
var res = _eltKaskoClient.PreliminaryKASKOCalculation(
new ELTKasko.AuthInfo
{
Login = _login,
Password = _password
}
, null
, data.CompanyId
, 0
, 0
, null
, null
, null
, "13"
, null
, false
, null
, null
, request);
if (res?.Error is { Length: > 0 })
var specialMachinery = data.Preparams.SpecialMachinery;
specialMachinery.SpecialMachineryMark = preRequestData.Brand;
specialMachinery.SpecialMachineryModel = preRequestData.Model;
request.SpecialMachinery = specialMachinery;
var res = _eltKaskoClient.PreliminaryKASKOCalculation(
new ELTKasko.AuthInfo
{
return BadRequest(res);
Login = _login,
Password = _password
}
, null
, data.CompanyId
, 0
, 0
, null
, null
, null
, "13"
, null
, false
, null
, null
, request);
return Ok(res);
}
catch (Exception e)
if (res?.Error is { Length: > 0 })
{
return StatusCode(500, new ErrorResponse { Error = e.Message });
return BadRequest(res);
}
return Ok(res);
}
[HttpPost("get-osago-calculation")]
public ActionResult<OSAGOFullCalculationResponse> GetOsagoCalculation([FromBody] GetOsagoCalculationInput data)
{
try
var prerequestData = this.GetPreRequestData(data.Preparams);
var request = data.Params;
request.UsagePlace = prerequestData.Kladr;
request.CarInfo.Mark = prerequestData.Brand;
request.CarInfo.Model = prerequestData.Model;
request.AuthInfo = new ELTOsago.AuthInfo
{
var prerequestData = this.GetPreRequestData(data.Preparams);
Login = _login,
Password = _password
};
var request = data.Params;
request.UsagePlace = prerequestData.Kladr;
request.CarInfo.Mark = prerequestData.Brand;
request.CarInfo.Model = prerequestData.Model;
request.InsuranceCompany ??= data.CompanyId;
request.AuthInfo = new AuthInfo
{
Login = _login,
Password = _password
};
var res = _eltOsagoClient.OSAGOFullCalculation(data.Params);
request.InsuranceCompany ??= data.CompanyId;
var res = _eltOsagoClient.OSAGOFullCalculation(data.Params);
if (res?.Error is { Length: > 0 })
{
return BadRequest(res);
}
return Ok(res);
}
catch (Exception e)
if (res?.Error is { Length: > 0 })
{
return StatusCode(500, new ErrorResponse { Error = e.Message });
return BadRequest(res);
}
return Ok(res);
}
}

View File

@ -1,17 +0,0 @@
version: '3.3'
services:
elt:
build:
context: .
dockerfile: ./Dockerfile
environment:
- eltLogin=${ELT_LOGIN}
- eltPassword=${ELT_PASSWORD}
restart: always
networks:
- calc_network
networks:
calc_network:
external:
name: calc_network