|
@@ -808,13 +808,13 @@ int OCPP_insert_transaction_msg(uint8_t isStartTransaction, char *transactionMsg
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
-int OCPP_insert_deduct_info(int txId, char *creditNo, uint8_t deductResult, uint8_t isDonateInvoice)
|
|
|
+int OCPP_insert_deduct_info(int txId, char *creditNo, uint8_t deductResult, uint8_t isDonateInvoice, double amount, char *vemData)
|
|
|
{
|
|
|
int result = PASS;
|
|
|
char* errMsg = NULL;
|
|
|
char sqlStr[8192];
|
|
|
|
|
|
- sprintf(sqlStr, "insert into report_deduct_info(txId, creditNo, deductResult, isDonateInvoice, isUploaded) values('%d', '%s', '%d', '%d', '0');", txId, creditNo, deductResult, isDonateInvoice);
|
|
|
+ sprintf(sqlStr, "insert into report_deduct_info(txId, creditNo, deductResult, isDonateInvoice, amount, vemData, isUploaded) values('%d', '%s', '%d', '%d', '%.2f', '%s', '0');", txId, creditNo, deductResult, isDonateInvoice, amount, vemData);
|
|
|
|
|
|
if (sqlite3_exec(db, sqlStr, 0, 0, &errMsg) != SQLITE_OK)
|
|
|
{
|
|
@@ -853,11 +853,12 @@ int queryDeductCallBack(void *data, int columenCount, char **columnValue, char *
|
|
|
{
|
|
|
sprintf((char*)ShmOCPP16DataPH->DataTransfer[0].VendorId, "%s", ShmSysConfigAndInfo->SysConfig.chargePointVendor);
|
|
|
sprintf((char*)ShmOCPP16DataPH->DataTransfer[0].MessageId,"%s","ID_CreditDeductResult");
|
|
|
- sprintf((char*)ShmOCPP16DataPH->DataTransfer[0].Data, "{\\\"txId\\\":%d,\\\"creditNo\\\":\\\"%s\\\",\\\"deductResult\\\":%s,\\\"isDonateInvoice\\\":%s}",
|
|
|
+ sprintf((char*)ShmOCPP16DataPH->DataTransfer[0].Data, "{\\\"txId\\\":%d,\\\"creditNo\\\":\\\"%s\\\",\\\"deductResult\\\":%s,\\\"isDonateInvoice\\\":%s,\\\"amount\\\":%s}",
|
|
|
atoi(columnValue[1]),
|
|
|
columnValue[2],
|
|
|
atoi(columnValue[3])==1?"true":"false",
|
|
|
- atoi(columnValue[4])==1?"true":"false");
|
|
|
+ atoi(columnValue[4])==1?"true":"false",
|
|
|
+ columnValue[5]);
|
|
|
|
|
|
ShmOCPP16DataPH->CsMsg.bits[0].DataTransferReq = 1;
|
|
|
|
|
@@ -4025,7 +4026,7 @@ void CheckSystemValue(void)
|
|
|
//===============================
|
|
|
if(ShmOCPP16DataPH->TcciCustomData.ReportCreditDeductReq)
|
|
|
{
|
|
|
- OCPP_insert_deduct_info(ShmOCPP16DataPH->TcciCustomData.DeductInfo.txId, (char*)ShmOCPP16DataPH->TcciCustomData.DeductInfo.creditNo, ShmOCPP16DataPH->TcciCustomData.DeductInfo.deductResult, ShmOCPP16DataPH->TcciCustomData.DeductInfo.isDonateInvoice);
|
|
|
+ OCPP_insert_deduct_info(ShmOCPP16DataPH->TcciCustomData.DeductInfo.txId, (char*)ShmOCPP16DataPH->TcciCustomData.DeductInfo.creditNo, ShmOCPP16DataPH->TcciCustomData.DeductInfo.deductResult, ShmOCPP16DataPH->TcciCustomData.DeductInfo.isDonateInvoice, ShmOCPP16DataPH->TcciCustomData.DeductInfo.amount, (char*)ShmOCPP16DataPH->TcciCustomData.DeductInfo.vemData);
|
|
|
|
|
|
ShmOCPP16DataPH->TcciCustomData.ReportCreditDeductReq = FALSE;
|
|
|
}
|