no message

This commit is contained in:
kittapath 2025-01-13 13:08:29 +07:00
parent 77d9a382a2
commit 134296b5b1
2 changed files with 21 additions and 20 deletions

View file

@ -316,10 +316,9 @@ export class ImportDataController extends Controller {
existingProfile.map(async (item) => {
rowCount++;
const profileSalary = new ProfileSalary();
profileSalary.date =
item.MP_POS_DATE == ""
? null_
: new Date(item.MP_POS_DATE.replace(" +0700 +07:00", ""));
profileSalary.date = item.MP_POS_DATE
? new Date(item.MP_POS_DATE.replace(" +0700 +07:00", ""))
: null_;
const SALARY: any =
item.SALARY == null || item.SALARY == "" ? null_ : Number(item.SALARY);
profileSalary.amount = SALARY;
@ -344,8 +343,8 @@ export class ImportDataController extends Controller {
profileSalary.templateDoc = item.REMARK;
profileSalary.refCommandDate =
item.MP_COMMAND_DATE == ""
? null_
: new Date(item.MP_COMMAND_DATE.replace(" +0700 +07:00", ""));
? new Date(item.MP_COMMAND_DATE.replace(" +0700 +07:00", ""))
: null_;
profileSalary.refCommandCode = item.FLAG_TO_NAME_CODE;
profileSalary.refCommandName = item.FLAG_TO_NAME;
profileSalary.orgRoot = item.DEPARTMENT_NAME;
@ -364,12 +363,12 @@ export class ImportDataController extends Controller {
profileSalary.lastUpdateFullName = request.user.name;
profileSalary.createdAt =
item.USER_CREATE == ""
? null_
: new Date(item.USER_CREATE.replace(" +0700 +07:00", ""));
? new Date(item.USER_CREATE.replace(" +0700 +07:00", ""))
: null_;
profileSalary.lastUpdatedAt =
item.USER_UPDATE == ""
? null_
: new Date(item.USER_UPDATE.replace(" +0700 +07:00", ""));
? new Date(item.USER_UPDATE.replace(" +0700 +07:00", ""))
: null_;
console.log(">>>>>>>>>>>>>>>>>>>" + rowCount);
await this.salaryRepo.save(profileSalary);
}),
@ -430,8 +429,8 @@ export class ImportDataController extends Controller {
const profileSalary = new ProfileSalary();
profileSalary.date =
item.MP_POS_DATE == ""
? null_
: new Date(item.MP_POS_DATE.replace(" +0700 +07:00", ""));
? new Date(item.MP_POS_DATE.replace(" +0700 +07:00", ""))
: null_;
const SALARY: any =
item.SALARY == null || item.SALARY == "" ? null_ : Number(item.SALARY);
profileSalary.amount = SALARY;
@ -456,8 +455,8 @@ export class ImportDataController extends Controller {
profileSalary.templateDoc = item.REMARK;
profileSalary.refCommandDate =
item.MP_COMMAND_DATE == ""
? null_
: new Date(item.MP_COMMAND_DATE.replace(" +0700 +07:00", ""));
? new Date(item.MP_COMMAND_DATE.replace(" +0700 +07:00", ""))
: null_;
profileSalary.refCommandCode = item.FLAG_TO_NAME_CODE;
profileSalary.refCommandName = item.FLAG_TO_NAME;
profileSalary.orgRoot = item.DEPARTMENT_NAME;
@ -476,12 +475,12 @@ export class ImportDataController extends Controller {
profileSalary.lastUpdateFullName = request.user.name;
profileSalary.createdAt =
item.USER_CREATE == ""
? null_
: new Date(item.USER_CREATE.replace(" +0700 +07:00", ""));
? new Date(item.USER_CREATE.replace(" +0700 +07:00", ""))
: null_;
profileSalary.lastUpdatedAt =
item.USER_UPDATE == ""
? null_
: new Date(item.USER_UPDATE.replace(" +0700 +07:00", ""));
? new Date(item.USER_UPDATE.replace(" +0700 +07:00", ""))
: null_;
console.log(">>>>>>>>>>>>>>>>>>>" + rowCount);
await this.salaryRepo.save(profileSalary);
}),

View file

@ -5468,7 +5468,9 @@ export class OrganizationController extends Controller {
*
*/
@Post("find/node-all")
async findNodeAllOrg(@Body() requestBody: { node: number; nodeId: string; isRoot: boolean }) {
async findNodeAllOrg(
@Body() requestBody: { node: number | null; nodeId: string | null; isRoot: boolean },
) {
let orgRootRankSub = ["DISTRICT"];
if (requestBody.isRoot == true) {
orgRootRankSub = ["BUREAU", "OFFICE"];
@ -5476,7 +5478,7 @@ export class OrganizationController extends Controller {
switch (requestBody.node) {
case 0: {
const data = await this.orgRootRepository.find({
where: { id: requestBody.nodeId, orgRootRankSub: In(orgRootRankSub) },
where: { id: requestBody.nodeId ?? "", orgRootRankSub: In(orgRootRankSub) },
});
return new HttpSuccess(
data.map((y) => ({