no message

This commit is contained in:
Kittapath 2024-05-20 15:25:18 +07:00
parent 1961c05172
commit 7763544a93
45 changed files with 22 additions and 1661 deletions

View file

@ -1210,31 +1210,31 @@ export class PositionController extends Controller {
//แก้ค้นหา
let _position: any[] = [];
let x: any = null
let y: any = null
if (body.keyword != null && body.keyword != ""){
let x: any = null;
let y: any = null;
if (body.keyword != null && body.keyword != "") {
const position = await this.positionRepository.find({
relations: ["posType", "posLevel", "posExecutive"],
where: { posMasterId: In(posMaster.map(x => x.id))},
order: { createdAt: "ASC" }
where: { posMasterId: In(posMaster.map((x) => x.id)) },
order: { createdAt: "ASC" },
});
for(let data of position){
x = data.posMasterId
if(y != x){
if(
data.positionName.includes(body.keyword) ||
for (let data of position) {
x = data.posMasterId;
if (y != x) {
if (
data.positionName.includes(body.keyword) ||
data.posType.posTypeName.includes(body.keyword) ||
data.posLevel.posLevelName.includes(body.keyword)
){
_position.push(data)
) {
_position.push(data);
}
}
y = x
y = x;
}
}
if(_position.length > 0){
posMaster = posMaster.filter((x) => _position.some(y => y.posMasterId === x.id));
if (_position.length > 0) {
posMaster = posMaster.filter((x) => _position.some((y) => y.posMasterId === x.id));
}
const formattedData = await Promise.all(
@ -1337,7 +1337,7 @@ export class PositionController extends Controller {
profilePosition: profile == null || profile.position == null ? null : profile.position,
profilePostype: type == null || type.posTypeName == null ? null : type.posTypeName,
profilePoslevel: level == null || level.posLevelName == null ? null : level.posLevelName,
positions: positions.map((position:any) => ({
positions: positions.map((position: any) => ({
id: position.id,
positionName: position.positionName,
positionField: position.positionField,
@ -2833,6 +2833,7 @@ export class PositionController extends Controller {
};
}
}
console.log("3333333333333333333333333333333");
const [posMaster, total] = await AppDataSource.getRepository(EmployeePosMaster)
.createQueryBuilder("posMaster")
@ -2860,6 +2861,7 @@ export class PositionController extends Controller {
.orderBy("posMaster.posMasterOrder", "ASC")
.getManyAndCount();
console.log("2222222222222222222222222222222222");
const formattedData = await Promise.all(
posMaster.map(async (posMaster) => {
let shortName = "";
@ -2958,6 +2960,7 @@ export class PositionController extends Controller {
};
}),
);
console.log("1111111111111111111111111111111111111");
return new HttpSuccess({ data: formattedData, total });
}
}