Merge branch 'develop' of github.com:Frappet/hrms-api-org into develop
This commit is contained in:
commit
67f820d283
3 changed files with 44 additions and 43 deletions
|
|
@ -402,7 +402,7 @@ export class ProfileController extends Controller {
|
|||
*
|
||||
* @param {string} id Id โปรไฟล์
|
||||
*/
|
||||
@Get("kk1/{id}")
|
||||
@Get("kk1old/{id}")
|
||||
public async getKk1(@Path() id: string, @Request() req: RequestWithUser) {
|
||||
const profiles = await this.profileRepo.findOne({
|
||||
relations: ["currentSubDistrict", "currentDistrict", "currentProvince", "profileAvatars"],
|
||||
|
|
@ -874,7 +874,7 @@ export class ProfileController extends Controller {
|
|||
*
|
||||
* @param {string} id Id โปรไฟล์
|
||||
*/
|
||||
@Get("kk1new/{id}")
|
||||
@Get("kk1/{id}")
|
||||
public async getKk1new(@Path() id: string, @Request() req: RequestWithUser) {
|
||||
const profiles = await this.profileRepo.findOne({
|
||||
relations: ["currentSubDistrict", "currentDistrict", "currentProvince","registrationSubDistrict", "registrationDistrict", "registrationProvince", "profileAvatars"],
|
||||
|
|
@ -1014,10 +1014,10 @@ export class ProfileController extends Controller {
|
|||
? cert_raw.slice(-2).map((item) => ({
|
||||
certificateType: item.certificateType ?? null,
|
||||
issuer: item.issuer ?? null,
|
||||
certificateNo: Extension.ToThaiNumber(item.certificateNo) ?? null,
|
||||
issueDate: Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.issueDate)) ?? null,
|
||||
expireDate: Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.expireDate)) ?? null,
|
||||
issueToExpireDate: Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.issueDate)) ?? "" + item.expireDate?" - " + Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.expireDate)): null,
|
||||
certificateNo: item.certificateNo?Extension.ToThaiNumber(item.certificateNo):null,
|
||||
issueDate: item.issueDate?Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.issueDate)):null,
|
||||
expireDate: item.expireDate?Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.expireDate)):null,
|
||||
issueToExpireDate: item.issueDate?Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.issueDate)):"" + item.expireDate?" - " + Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.expireDate)): null,
|
||||
}))
|
||||
: [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -31,8 +31,8 @@ import { Profile } from "../entities/Profile";
|
|||
import { viewRegistryOfficer } from "../entities/view/viewRegistryOfficer";
|
||||
import { viewRegistryEmployee } from "../entities/view/viewRegistryEmployee";
|
||||
import { EmployeeTempPosMaster } from "../entities/EmployeeTempPosMaster";
|
||||
// import { WebSocket } from "ws";
|
||||
// import { wss } from "../app";
|
||||
import { WebSocket } from "ws";
|
||||
import { wss } from "../app";
|
||||
|
||||
@Route("api/v1/org/report")
|
||||
@Tags("Report")
|
||||
|
|
@ -3565,17 +3565,17 @@ export class ReportController extends Controller {
|
|||
}
|
||||
// console.log(">>",data);
|
||||
|
||||
// wss.clients.forEach((client: any) => {
|
||||
// if (client.readyState === WebSocket.OPEN) {
|
||||
// const message = JSON.stringify({ template: "report2", reportName: "report2", data: { data } });
|
||||
// console.log("📤 Sending data to client:", message);
|
||||
// client.send(message, (err:any) => {
|
||||
// if (err) {
|
||||
// console.error("❌ Error sending message:", err);
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
wss.clients.forEach((client: any) => {
|
||||
if (client.readyState === WebSocket.OPEN) {
|
||||
const message = JSON.stringify({ template: "report2", reportName: "report2", data: { data } });
|
||||
console.log("📤 Sending data to client:", message);
|
||||
client.send(message, (err:any) => {
|
||||
if (err) {
|
||||
console.error("❌ Error sending message:", err);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
return new HttpSuccess({ template: "report2", reportName: "report2", data: { data } });
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue