Compare commits

..

2 Commits

Author SHA1 Message Date
f8e081d7d1 AI Integration successful 2026-07-13 11:27:47 +06:00
21a06545ce sql query changed 2026-07-13 09:11:18 +06:00
3 changed files with 6 additions and 36 deletions

View File

@ -84,8 +84,7 @@ namespace HRM.DA
{ {
if (reportGroupType == EnumReportGroupType.Salary) if (reportGroupType == EnumReportGroupType.Salary)
{ {
//sql = SQLParser.MakeSQL("select distinct(Head) as Head from vwEmployeeSalary"); sql = SQLParser.MakeSQL("select distinct(Head) as Head from vwEmployeeSalary");
sql = SQLParser.MakeSQL("SELECT DISTINCT DESCRIPTION AS Head FROM SALARYMONTHLYDETAIL WHERE ITEMGROUP IN (1,2,3,5,8)");
} }
else if(reportGroupType == EnumReportGroupType.Leave) else if(reportGroupType == EnumReportGroupType.Leave)
{ {

View File

@ -17,32 +17,7 @@
<span *ngIf="item.isChart" class="chart-icon">📊</span> <span *ngIf="item.isChart" class="chart-icon">📊</span>
</li> </li>
</ul> </ul>
<!--<div class="flex justify-content-between align-items-center">
<div class="flex p-gap-2 align-items-center">
<kendo-dropdownlist
[data]="reportGroups"
[defaultItem]="{ description: 'Select AI Purpose....', value: null }"
[textField]="'description'"
[valueField]="'value'"
[valuePrimitive]="true"
[(ngModel)]="selectedReportGroup"
(valueChange)="onReportGroupChange($event)"
class="w-14rem">
</kendo-dropdownlist>
<button (click)="openAvailableInfoDialog()" [disabled]="selectedReportGroup === null || selectedReportGroup === undefined" kendoButton themeColor="secondary">Field Column</button>
</div>
<div class="flex p-gap-2 align-items-center">
<button [disabled]="selectedReportGroup === null || selectedReportGroup === undefined"
kendoButton themeColor="primary"
(click)="ShowAllQueryLog()">Chat History</button>
<button kendoButton themeColor="primary"
(click)="onCallOpenAI_One()"
(keydown.enter)="handleEnterKey($event)">Execute</button>
</div>
</div>-->
<div class="toolbar-container"> <div class="toolbar-container">
<!-- Left Side -->
<div class="toolbar-left"> <div class="toolbar-left">
<kendo-dropdownlist [data]="reportGroups" <kendo-dropdownlist [data]="reportGroups"
[defaultItem]="{ description: 'Select AI Purpose....', value: null }" [defaultItem]="{ description: 'Select AI Purpose....', value: null }"
@ -57,20 +32,16 @@
Field Column Field Column
</button> </button>
</div> </div>
<!-- Right Side -->
<div class="toolbar-right"> <div class="toolbar-right">
<button [disabled]="selectedReportGroup === null || selectedReportGroup === undefined" <button [disabled]="selectedReportGroup === null || selectedReportGroup === undefined"
kendoButton themeColor="primary" (click)="ShowAllQueryLog()"> kendoButton themeColor="primary" (click)="ShowAllQueryLog()">
Chat History Chat History
</button> </button>
<button kendoButton themeColor="primary" (click)="onCallOpenAI_One()" <button kendoButton themeColor="primary" (click)="onCallOpenAI_One()"
(keydown.enter)="handleEnterKey($event)"> (keydown.enter)="handleEnterKey($event)">
Execute Execute
</button> </button>
</div> </div>
</div> </div>
</div> </div>

View File

@ -122,7 +122,7 @@ export class HRMOpenAITestComponent implements OnInit{
} }
LoadCurrentUserAllQueryLog(reportGroupType : EnumReportGroupType){ LoadCurrentUserAllQueryLog(reportGroupType : EnumReportGroupType){
this.loadingpanelService.ShowLoadingPanel = false; this.loadingpanelService.ShowLoadingPanel = true;
this.opeAiService.GetCurrentUserAllQueryLog(reportGroupType).subscribe( this.opeAiService.GetCurrentUserAllQueryLog(reportGroupType).subscribe(
(resp: any) => { (resp: any) => {
this.currentUserAllQueryLog = resp; this.currentUserAllQueryLog = resp;
@ -220,7 +220,7 @@ export class HRMOpenAITestComponent implements OnInit{
return; return;
} }
this.isUserPromptIsNotRelated = false; this.isUserPromptIsNotRelated = false;
this.loadingpanelService.ShowLoadingPanel = false; this.loadingpanelService.ShowLoadingPanel = true;
this.opeAiService.AskOpenAI(data).subscribe( this.opeAiService.AskOpenAI(data).subscribe(
(resp: any) => { (resp: any) => {
this.OpenAIResponce = JSON.parse(resp); this.OpenAIResponce = JSON.parse(resp);
@ -404,7 +404,7 @@ export class HRMOpenAITestComponent implements OnInit{
|| this.selectedReportGroup === EnumReportGroupType.Training || this.selectedReportGroup === EnumReportGroupType.Training
|| this.selectedReportGroup === EnumReportGroupType.Attendance || this.selectedReportGroup === EnumReportGroupType.Attendance
|| this.selectedReportGroup === EnumReportGroupType.Leave)){ || this.selectedReportGroup === EnumReportGroupType.Leave)){
this.loadingpanelService.ShowLoadingPanel = false; this.loadingpanelService.ShowLoadingPanel = true;
this.reportColumnDefinition = []; this.reportColumnDefinition = [];
this.tableColumnDefinition = []; this.tableColumnDefinition = [];
this.opeAiService.GetReportColumnDefinition(this.selectedReportGroup).subscribe( this.opeAiService.GetReportColumnDefinition(this.selectedReportGroup).subscribe(
@ -452,7 +452,7 @@ export class HRMOpenAITestComponent implements OnInit{
let oQueryLog : OpenAIQueryLog = this.currentUserAllQueryLog.find(x => x.id === id) ?? undefined; let oQueryLog : OpenAIQueryLog = this.currentUserAllQueryLog.find(x => x.id === id) ?? undefined;
if(oQueryLog != undefined){ if(oQueryLog != undefined){
this.isShowCurrentUserAllQueryLog = false this.isShowCurrentUserAllQueryLog = false
this.loadingpanelService.ShowLoadingPanel = false; this.loadingpanelService.ShowLoadingPanel = true;
this.inputUserCommand = oQueryLog.userPrompt; this.inputUserCommand = oQueryLog.userPrompt;
this.selectedReportGroup = oQueryLog.reportGroup; this.selectedReportGroup = oQueryLog.reportGroup;
if(oQueryLog.title && oQueryLog.title !== ""){ if(oQueryLog.title && oQueryLog.title !== ""){
@ -549,7 +549,7 @@ export class HRMOpenAITestComponent implements OnInit{
const data = { const data = {
oQueryLog : this.currentChat oQueryLog : this.currentChat
} }
this.loadingpanelService.ShowLoadingPanel = false; this.loadingpanelService.ShowLoadingPanel = true;
this.opeAiService.ChatShareWithOthers(data).subscribe( this.opeAiService.ChatShareWithOthers(data).subscribe(
(resp: any) => { (resp: any) => {
}, },