Browse Source

1. 台泥 完成充電回報 一定要等Receipt上傳 再回報

Jessica Tseng 3 years ago
parent
commit
98ddaf9c86
1 changed files with 9 additions and 1 deletions
  1. 9 1
      EVCB_OCPP.TaskScheduler/Services/DatabaseService.cs

+ 9 - 1
EVCB_OCPP.TaskScheduler/Services/DatabaseService.cs

@@ -120,13 +120,21 @@ namespace EVCB_OCPP.TaskScheduler.Services
                     parameters.Add("@CustomerId", customerId.ToString(), System.Data.DbType.String);
                     string sqlString = string.Empty;
 
+                    // 20220211 revised
                     if (isgoing)
                     {
                         sqlString = "SELECT Top(" + size + ") Id, ChargeBoxId,ConnectorId,StartTime,MeterStart,StartIdTag FROM [dbo].[TransactionRecord] where CustomerId=@CustomerId and StopTime='1991/1/1' and StartTransactionReportedOn='1991/1/1' ";
                     }
                     else
                     {
-                        sqlString = "SELECT Top(" + size + ") Id,ChargeBoxId,ConnectorId,StartTime,StopTime,MeterStart,MeterStop,StartIdTag ,StopReasonId,Receipt,Cost,Fee FROM [dbo].[TransactionRecord] where CustomerId=@CustomerId and StopTime!='1991/1/1' and StopTransactionReportedOn='1991/1/1' ";
+                        if (customerId == new Guid("009E603C-79CD-4620-A2B8-D9349C0E8AD8"))
+                        {
+                            sqlString = "SELECT Top(" + size + ") Id,ChargeBoxId,ConnectorId,StartTime,StopTime,MeterStart,MeterStop,StartIdTag ,StopReasonId,Receipt,Cost,Fee FROM [dbo].[TransactionRecord] where CustomerId=@CustomerId and StopTime!='1991/1/1' and StopTransactionReportedOn='1991/1/1' and  UploadedtoTTIA=1";
+                        }
+                        else
+                        {
+                            sqlString = "SELECT Top(" + size + ") Id,ChargeBoxId,ConnectorId,StartTime,StopTime,MeterStart,MeterStop,StartIdTag ,StopReasonId,Receipt,Cost,Fee FROM [dbo].[TransactionRecord] where CustomerId=@CustomerId and StopTime!='1991/1/1' and StopTransactionReportedOn='1991/1/1' ";
+                        }
                     }
 
                     result = dbConn.Query<Transaction>(sqlString, parameters).ToList();