Merge pull request 'Attn raw data upload' (#56) from dev_chapal into devqc

Reviewed-on: http://103.197.204.162:3025/CelHRTeam/EchoTex_Payroll/pulls/56
This commit is contained in:
chapal 2026-05-19 12:31:57 +06:00
commit 3e5a97bd8c
2 changed files with 13 additions and 5 deletions

View File

@ -164,13 +164,13 @@ export class ReadAttendanceRawdataComponent {
this.uploadeddata.rowNo = i.toString(); this.uploadeddata.rowNo = i.toString();
this.uploadeddata.employeeNo = temp[0].replace(/^"(.*)"$/, '$1'); this.uploadeddata.employeeNo = temp[0].replace(/^"(.*)"$/, '$1');
this.uploadeddata.punchTime = temp[1].replace(/^"(.*)"$/, '$1'); this.uploadeddata.punchTime = temp[1].replace(/^"(.*)"$/, '$1');
//this.uploadeddata.punchTime = temp[2].replace(/^"(.*)"$/, '$1'); this.uploadeddata.cardNo = temp[2].replace(/^"(.*)"$/, '$1');
//this.uploadeddata.deviceNo = temp[3].replace(/^"(.*)"$/, '$1'); //this.uploadeddata.deviceNo = temp[3].replace(/^"(.*)"$/, '$1');
//this.uploadeddata.deviceIPAddress = temp[4].replace(/^"(.*)"$/, '$1'); //this.uploadeddata.deviceIPAddress = temp[4].replace(/^"(.*)"$/, '$1');
//this.uploadeddata.entryMode = temp[5].replace(/^"(.*)"$/, '$1'); //this.uploadeddata.entryMode = temp[5].replace(/^"(.*)"$/, '$1');
this.uploadeddata.employeeNo = this.uploadeddata.employeeNo.replace(/\s/g, ''); this.uploadeddata.employeeNo = this.uploadeddata.employeeNo.replace(/\s/g, '');
//this.uploadeddata.cardNo = this.uploadeddata.cardNo.replace(/\s/g, ''); this.uploadeddata.cardNo = this.uploadeddata.cardNo.replace(/\s/g, '');
//this.uploadeddata.entryMode = this.uploadeddata.entryMode.replace(/\s/g, ''); //this.uploadeddata.entryMode = this.uploadeddata.entryMode.replace(/\s/g, '');
////console.log(this.uploadeddata.EmpID); ////console.log(this.uploadeddata.EmpID);
this.uploadeddatas.push(this.uploadeddata); this.uploadeddatas.push(this.uploadeddata);
@ -219,7 +219,7 @@ export class ReadAttendanceRawdataComponent {
this._notificationService.showError("Employee No not Found"); this._notificationService.showError("Employee No not Found");
return; return;
} }
debugger;
if (this.mandatoryItems.length <= 0) { if (this.mandatoryItems.length <= 0) {
this.attnRawDatas = []; this.attnRawDatas = [];
this.uploadeddatas.forEach(x => { this.uploadeddatas.forEach(x => {
@ -242,14 +242,14 @@ export class ReadAttendanceRawdataComponent {
//item.punchTime = fromdt; //item.punchTime = fromdt;
////// working if the format is dd/mm/yyyy hh:mm:ss ////// working if the format is dd/mm/yyyy hh:mm:ss
debugger;
item.punchTime = new Date; // otherwise error item.punchTime = new Date; // otherwise error
item.punchTimeDateString = x.punchTime; item.punchTimeDateString = x.punchTime;
//console.log(item.punchTime); //console.log(item.punchTime);
item.employeeID = this.employees.find(e => e.employeeNo.trim().toLowerCase() == x.employeeNo.trim().toLowerCase()) == undefined ? 0 : this.employees.find(e => e.employeeNo.trim().toLowerCase() == x.employeeNo.trim().toLowerCase()).id; item.employeeID = this.employees.find(e => e.employeeNo.trim().toLowerCase() == x.employeeNo.trim().toLowerCase()) == undefined ? 0 : this.employees.find(e => e.employeeNo.trim().toLowerCase() == x.employeeNo.trim().toLowerCase()).id;
item.employeeNo = x.employeeNo, item.employeeNo = x.employeeNo,
item.entryMode = (x.entryMode == undefined || x.entryMode.length <= 0) ? 0 : this.entryModes.find(e => e.name.trim().toLowerCase() == x.entryMode.trim().toLowerCase()).value, item.entryMode = (x.entryMode == undefined || x.entryMode.length <= 0) ? 0 : this.entryModes.find(e => e.name.trim().toLowerCase() == x.entryMode.trim().toLowerCase()).value,
item.cardNo = (x.cardNo !== undefined || x.cardNo !== "" || x.cardNo !== null) ? item.employeeNo : item.cardNo, item.cardNo = (x.cardNo == undefined || x.cardNo == "" || x.cardNo == null) ? item.employeeNo : x.cardNo,
item.deviceNo = (x.deviceNo !== undefined || x.deviceNo !== "" || x.deviceNo !== null) ? "" : item.deviceNo, item.deviceNo = (x.deviceNo !== undefined || x.deviceNo !== "" || x.deviceNo !== null) ? "" : item.deviceNo,
item.deviceIPAddress = (x.deviceIPAddress !== undefined || x.deviceIPAddress !== "" || x.deviceIPAddress !== null) ? "" : item.deviceIPAddress item.deviceIPAddress = (x.deviceIPAddress !== undefined || x.deviceIPAddress !== "" || x.deviceIPAddress !== null) ? "" : item.deviceIPAddress
item.isManualEntry = true; item.isManualEntry = true;

View File

@ -2429,6 +2429,14 @@ namespace HRM.UI.Controllers.Attendance
{ {
//List<AttnRawData> items = new List<AttnRawData>(); //List<AttnRawData> items = new List<AttnRawData>();
//items = JsonConvert.DeserializeObject<List<AttnRawData>>(data.dataList.ToString()); //items = JsonConvert.DeserializeObject<List<AttnRawData>>(data.dataList.ToString());
//DataTable accessCards = new AccessCardService().getCardInformation((int)EnumCardStatus.Attached);
foreach (AttnRawData item in items)
{
if (item.CardID == 0)
{
}
}
_attnRawDataService.SaveAuto(items); _attnRawDataService.SaveAuto(items);
} }
catch (Exception e) catch (Exception e)