no message

This commit is contained in:
Kittapath 2024-04-30 13:19:44 +07:00
parent 47c275ef04
commit 5d98acafdb

View file

@ -1751,7 +1751,26 @@ export class DevelopmentController extends Controller {
const oldProfile = getDevelopment.developmentHistorys.find(
(x) => x.citizenId == item["รหัสประจำตัวประชาชน"],
);
if (oldProfile != null) return;
if (oldProfile != null) {
if (oldProfile.isDone == true) return;
item.dateStart = item["วันที่เริ่มต้น"] == undefined ? null : item["วันที่เริ่มต้น"];
item.dateEnd = item["วันที่สิ้นสุด"] == undefined ? null : item["วันที่สิ้นสุด"];
item.order =
item["เลขที่คำสั่ง/เลขที่หนังสืออนุมัติ"] == undefined
? null
: item["เลขที่คำสั่ง/เลขที่หนังสืออนุมัติ"];
item.dateOrder =
item["คำสั่งลงวันที่/หนังสืออนุมัติลงวันที่"] == undefined
? null
: new Date(item["คำสั่งลงวันที่/หนังสืออนุมัติลงวันที่"]);
item.trainingDays = item["จำนวนวันที่อบรม"] == undefined ? null : item["จำนวนวันที่อบรม"];
item.createdUserId = request.user.sub;
item.createdFullName = request.user.name;
item.lastUpdateUserId = request.user.sub;
item.lastUpdateFullName = request.user.name;
await this.developmentHistoryRepository.save(item);
return;
}
if (item["ประเภท"] == undefined) return;
if (item["ประเภท"] == "ข้าราชการกรุงเทพมหานครสามัญ") {
await new CallAPI()
@ -1772,6 +1791,10 @@ export class DevelopmentController extends Controller {
: new Date(item["คำสั่งลงวันที่/หนังสืออนุมัติลงวันที่"]);
development.trainingDays =
item["จำนวนวันที่อบรม"] == undefined ? null : item["จำนวนวันที่อบรม"];
development.posLevelId = x.posLevelId;
development.posTypeId = x.posTypeId;
development.employeePosLevelId = null;
development.employeePosTypeId = null;
development.developmentId = id;
development.createdUserId = request.user.sub;
development.createdFullName = request.user.name;