更新水電報表api
This commit is contained in:
parent
718f2768f7
commit
5c8abc1f19
@ -9,6 +9,7 @@ using System.IO;
|
||||
using static FrontendWebApi.Models.Bill;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System.Text.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
|
||||
// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
|
||||
@ -17,8 +18,8 @@ namespace FrontendWebApi.ApiControllers
|
||||
{
|
||||
//[Route("api/[controller]")]
|
||||
//[ApiController]
|
||||
public class TenantBillController
|
||||
//public class TenantBillController : MyBaseApiController<TenantBillController>
|
||||
//public class TenantBillController
|
||||
public class TenantBillController : MyBaseApiController<TenantBillController>
|
||||
{
|
||||
private readonly IBackendRepository backendRepository;
|
||||
|
||||
@ -60,7 +61,7 @@ namespace FrontendWebApi.ApiControllers
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<ApiResult<string>> AddOneTenantList(TenantList tl)
|
||||
public async Task<ApiResult<string>> AddOneTenantList([FromBody] TenantList tl)
|
||||
{
|
||||
ApiResult<string> apiResult = new ApiResult<string>();
|
||||
|
||||
@ -91,7 +92,7 @@ namespace FrontendWebApi.ApiControllers
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<ApiResult<string>> UpdateOneTenantList(TenantList tl)
|
||||
public async Task<ApiResult<string>> UpdateOneTenantList([FromBody] TenantList tl)
|
||||
{
|
||||
ApiResult<string> apiResult = new ApiResult<string>();
|
||||
|
||||
@ -122,7 +123,7 @@ namespace FrontendWebApi.ApiControllers
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<ApiResult<string>> DelOneTenantList(TenantList tl)
|
||||
public async Task<ApiResult<string>> DelOneTenantList([FromBody] TenantList tl)
|
||||
{
|
||||
ApiResult<string> apiResult = new ApiResult<string>();
|
||||
|
||||
@ -144,13 +145,21 @@ namespace FrontendWebApi.ApiControllers
|
||||
return apiResult;
|
||||
}
|
||||
|
||||
public class MyJsonData
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public int Age { get; set; }
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<ApiResult<List<TenantBill>>> GetTenantBill(string tableType, string building_tag)
|
||||
public async Task<ApiResult<List<TenantBill>>> GetTenantBill([FromBody] TenantBill tb)
|
||||
{
|
||||
ApiResult<List<TenantBill>> apiResult = new ApiResult<List<TenantBill>>();
|
||||
List<TenantBill> tenantBill = new List<TenantBill>();
|
||||
try
|
||||
{
|
||||
string tableType = tb.tableType;
|
||||
string building_tag = tb.building_tag;
|
||||
string ElecOrWater = tableType == "elec" ? "E4" : "W1";
|
||||
string sqlString = null;
|
||||
if (building_tag == "ALL")
|
||||
@ -193,13 +202,13 @@ namespace FrontendWebApi.ApiControllers
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<ApiResult<string>> UpdateTenantBill(TenantBill tb, string tableType)
|
||||
public async Task<ApiResult<string>> UpdateTenantBill([FromBody] TenantBill tb)
|
||||
{
|
||||
ApiResult<string> apiResult = new ApiResult<string>();
|
||||
|
||||
try
|
||||
{
|
||||
string bill_per = tableType == "elec" ? "bill_perKWH" : "bill_perRCV";
|
||||
string bill_per = tb.tableType == "elec" ? "bill_perKWH" : "bill_perRCV";
|
||||
var updated_at = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
var start_timestamp = tb.start_timestamp.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
var end_timestamp = tb.end_timestamp.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
|
@ -11,6 +11,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Autodesk.Forge" Version="1.9.7" />
|
||||
<PackageReference Include="Haukcode.WkHtmlToPdfDotNet" Version="1.5.86" />
|
||||
<PackageReference Include="iTextSharp" Version="5.5.13.2" />
|
||||
<PackageReference Include="Microsoft.AspNet.WebApi.Cors" Version="5.2.7" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.1.21" />
|
||||
|
@ -34,8 +34,11 @@ namespace FrontendWebApi.Models
|
||||
public string updated_by { get; set; }
|
||||
public DateTime? updated_at { get; set; }
|
||||
public string tenant_guid { get; set; }
|
||||
public string tableType { get; set; }
|
||||
public string building_tag { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class OutputBill
|
||||
{
|
||||
public string tenant_name { get; set; }
|
||||
|
@ -13,40 +13,39 @@
|
||||
"JwtLifeSeconds": 3600
|
||||
},
|
||||
"DBConfig": {
|
||||
"MySqlDBConfig": {
|
||||
"Server": "FYlY+w0XDIz+jmF2rlZWJw==", //0.201
|
||||
"Port": "js2LutKe+rdjzdxMPQUrvQ==",
|
||||
//"Database": "VJB2XC+lAtzuHObDGMVOAA==", //30
|
||||
"MySqlDBConfig": {
|
||||
"Server": "CYGthbCeGtAXT4s1NOSJHQ==", //0.132
|
||||
"Port": "mkF51jVbg40V5K5eTh2Ckw==",
|
||||
//"Database": "VJB2XC+lAtzuHObDGMVOAA==", //30
|
||||
//"Database": "IgYBsgG2VLKKxFb64j7LOA==", //wsp
|
||||
//"Database": "7gWfmZ28HGIJZbxEbK+0yg==", //tpe_dome_dome
|
||||
"Database": "+5RAiFLJVU+LRyDxF1K/pcLZaoZa4k/thZqF6xKoCag=", //dome_online_0821
|
||||
"Database": "7gWfmZ28HGIJZbxEbK+0yg==", //tpe_dome_dome
|
||||
//"Database": "siTUcDaC/g2yGTMFWD72Kg==", //tpe_dome_hotel
|
||||
//"Database": "iuaY0h0+TWkir44/eZLDqw==", //tpe_dome_office
|
||||
//"Database": "Rq7Gn4x6LwBvVtl7GY8LbA==", //MCUT
|
||||
//"Database": "Rq7Gn4x6LwBvVtl7GY8LbA==", //mcut
|
||||
//"Database": "XZ2fOBnta9kdVGEb7y92cg==", //ibms_mcut
|
||||
"Root": "SzdxEgaJJ7tcTCrUl2zKsA==",
|
||||
"Password": "FVAPxztxpY4gJJKQ/se4bQ=="
|
||||
}
|
||||
//"MSSqlDBConfig": {
|
||||
// "Server": "avZg8PA8C9GVgYZBgEKzCg==",
|
||||
// "Port": "lJA0KPkG6RvFfTgWiXFyUw==",
|
||||
// "Database": "VvfWH/59gQguY2eA2xBCug==",
|
||||
// "Root": "sD8GZ9UPiIQGU6dU011/4A==",
|
||||
// "Password": "2gi7rOmGha2VdXC5vtHxhg=="
|
||||
//}
|
||||
//"MSSqlDBConfig": {
|
||||
// "Server": "avZg8PA8C9GVgYZBgEKzCg==",
|
||||
// "Port": "lJA0KPkG6RvFfTgWiXFyUw==",
|
||||
// "Database": "VvfWH/59gQguY2eA2xBCug==",
|
||||
// "Root": "sD8GZ9UPiIQGU6dU011/4A==",
|
||||
// "Password": "2gi7rOmGha2VdXC5vtHxhg=="
|
||||
//}
|
||||
|
||||
//"MSSqlDBConfig": { //172.16.220.250
|
||||
// "Server": "zp3Nilx0PISEEC4caZWqCg==",
|
||||
// "Port": "7puf4kd9qJ/q0fq2QASWeQ==",
|
||||
// "Database": "VvfWH/59gQguY2eA2xBCug==",
|
||||
// "Root": "sD8GZ9UPiIQGU6dU011/4A==",
|
||||
// "Password": "Jue6jMFRi11meN6xbdKwDA=="
|
||||
//}
|
||||
//"MSSqlDBConfig": {
|
||||
// "Server": "FPhyer7n0h/pw/yCMzKcPQ==",
|
||||
// "Port": "7puf4kd9qJ/q0fq2QASWeQ==",
|
||||
// "Database": "VvfWH/59gQguY2eA2xBCug==",
|
||||
// "Root": "sD8GZ9UPiIQGU6dU011/4A==",
|
||||
// "Password": "Jue6jMFRi11meN6xbdKwDA=="
|
||||
//}
|
||||
//"MSSqlDBConfig": { //172.16.220.250
|
||||
// "Server": "zp3Nilx0PISEEC4caZWqCg==",
|
||||
// "Port": "7puf4kd9qJ/q0fq2QASWeQ==",
|
||||
// "Database": "VvfWH/59gQguY2eA2xBCug==",
|
||||
// "Root": "sD8GZ9UPiIQGU6dU011/4A==",
|
||||
// "Password": "Jue6jMFRi11meN6xbdKwDA=="
|
||||
//}
|
||||
//"MSSqlDBConfig": {
|
||||
// "Server": "FPhyer7n0h/pw/yCMzKcPQ==",
|
||||
// "Port": "7puf4kd9qJ/q0fq2QASWeQ==",
|
||||
// "Database": "VvfWH/59gQguY2eA2xBCug==",
|
||||
// "Root": "sD8GZ9UPiIQGU6dU011/4A==",
|
||||
// "Password": "Jue6jMFRi11meN6xbdKwDA=="
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -11,49 +11,41 @@
|
||||
"SignKey": "TaipeiDome123456", //ñ<EFBFBD><EFBFBD>//<EFBFBD>̤<EFBFBD>16<EFBFBD>r<EFBFBD><EFBFBD>
|
||||
"JwtLifeSeconds": 86400
|
||||
},
|
||||
"DBConfig": {
|
||||
//"MySqlDBConfig": {
|
||||
// "Server": "avZg8PA8C9GVgYZBgEKzCg==",
|
||||
// "Port": "JKuuq+uwXTv3d/3a4itt6A==",
|
||||
// "Database": "VvfWH/59gQguY2eA2xBCug==",
|
||||
// "Root": "HHJtgEbqTcvCJtK4Lzg1Jg==",
|
||||
// "Password": "2gi7rOmGha2VdXC5vtHxhg=="
|
||||
//},
|
||||
"MySqlDBConfig": {
|
||||
"Server": "FYlY+w0XDIz+jmF2rlZWJw==", //0.201
|
||||
"Port": "js2LutKe+rdjzdxMPQUrvQ==",
|
||||
//"Database": "VJB2XC+lAtzuHObDGMVOAA==", //三菱
|
||||
//"Database": "IgYBsgG2VLKKxFb64j7LOA==", //wsp
|
||||
//"Database": "Rq7Gn4x6LwBvVtl7GY8LbA==", //MCUT
|
||||
//"Database": "7gWfmZ28HGIJZbxEbK+0yg==", //tpe_dome_dome
|
||||
//"Database": "siTUcDaC/g2yGTMFWD72Kg==", //tpe_dome_hotel
|
||||
//"Database": "iuaY0h0+TWkir44/eZLDqw==", //tpe_dome_office
|
||||
"Database": "+5RAiFLJVU+LRyDxF1K/pcLZaoZa4k/thZqF6xKoCag=", //dome_online_0821
|
||||
"Root": "SzdxEgaJJ7tcTCrUl2zKsA==",
|
||||
"Password": "FVAPxztxpY4gJJKQ/se4bQ=="
|
||||
},
|
||||
"MSSqlDBConfig": {
|
||||
"Server": "bJm+UAtbeaTjDmp/A5ep2w==", //0.130
|
||||
"Port": "S5cUXKnKOacFtFy9+0dtpw==",
|
||||
"Database": "VvfWH/59gQguY2eA2xBCug==", //taipei_dome
|
||||
"Root": "4GCCJGAXzLa8ecdmPAkYKg==",
|
||||
"Password": "0O24es2ZRF5uoJ4aU+YCdg=="
|
||||
"DBConfig": {
|
||||
"MySqlDBConfig": {
|
||||
"Server": "CYGthbCeGtAXT4s1NOSJHQ==", //0.132
|
||||
"Port": "mkF51jVbg40V5K5eTh2Ckw==",
|
||||
//"Database": "VJB2XC+lAtzuHObDGMVOAA==", //30
|
||||
//"Database": "IgYBsgG2VLKKxFb64j7LOA==", //wsp
|
||||
"Database": "7gWfmZ28HGIJZbxEbK+0yg==", //tpe_dome_dome
|
||||
//"Database": "siTUcDaC/g2yGTMFWD72Kg==", //tpe_dome_hotel
|
||||
//"Database": "Rq7Gn4x6LwBvVtl7GY8LbA==", //mcut
|
||||
//"Database": "XZ2fOBnta9kdVGEb7y92cg==", //ibms_mcut
|
||||
"Root": "SzdxEgaJJ7tcTCrUl2zKsA==",
|
||||
"Password": "FVAPxztxpY4gJJKQ/se4bQ=="
|
||||
},
|
||||
"MSSqlDBConfig": {
|
||||
"Server": "bJm+UAtbeaTjDmp/A5ep2w==", //0.130
|
||||
"Port": "S5cUXKnKOacFtFy9+0dtpw==",
|
||||
"Database": "VvfWH/59gQguY2eA2xBCug==", //taipei_dome
|
||||
"Root": "4GCCJGAXzLa8ecdmPAkYKg==",
|
||||
"Password": "0O24es2ZRF5uoJ4aU+YCdg=="
|
||||
}
|
||||
//"MSSqlDBConfig": {
|
||||
// "Server": "avZg8PA8C9GVgYZBgEKzCg==",
|
||||
// "Port": "lJA0KPkG6RvFfTgWiXFyUw==",
|
||||
// "Database": "VvfWH/59gQguY2eA2xBCug==",
|
||||
// "Root": "sD8GZ9UPiIQGU6dU011/4A==",
|
||||
// "Password": "2gi7rOmGha2VdXC5vtHxhg=="
|
||||
//}
|
||||
//"MSSqlDBConfig": {
|
||||
// "Server": "ueFp+VFb200lhh1Uctc97WH0/tX6tfXYU2v1oxCWuuM=",
|
||||
// "Port": "S5cUXKnKOacFtFy9+0dtpw==",
|
||||
// "Database": "VvfWH/59gQguY2eA2xBCug==",
|
||||
// "Root": "+plVKQ+enAqt7BYV2uMQng==",
|
||||
// "Password": "0O24es2ZRF5uoJ4aU+YCdg=="
|
||||
//}
|
||||
}
|
||||
//"MSSqlDBConfig": {
|
||||
// "Server": "avZg8PA8C9GVgYZBgEKzCg==",
|
||||
// "Port": "lJA0KPkG6RvFfTgWiXFyUw==",
|
||||
// "Database": "VvfWH/59gQguY2eA2xBCug==",
|
||||
// "Root": "sD8GZ9UPiIQGU6dU011/4A==",
|
||||
// "Password": "2gi7rOmGha2VdXC5vtHxhg=="
|
||||
//}
|
||||
//"MSSqlDBConfig": {
|
||||
// "Server": "ueFp+VFb200lhh1Uctc97WH0/tX6tfXYU2v1oxCWuuM=",
|
||||
// "Port": "S5cUXKnKOacFtFy9+0dtpw==",
|
||||
// "Database": "VvfWH/59gQguY2eA2xBCug==",
|
||||
// "Root": "+plVKQ+enAqt7BYV2uMQng==",
|
||||
// "Password": "0O24es2ZRF5uoJ4aU+YCdg=="
|
||||
//}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user