report 10
This commit is contained in:
parent
437632f39c
commit
a53cf4212f
2 changed files with 30 additions and 32 deletions
|
|
@ -19,7 +19,7 @@ import HttpSuccess from "../interfaces/http-success";
|
|||
import HttpStatusCode from "../interfaces/http-status";
|
||||
import HttpError from "../interfaces/http-error";
|
||||
import { Command } from "../entities/Command";
|
||||
import { Brackets, LessThan, MoreThan, Double, In, Not ,Between } from "typeorm";
|
||||
import { Brackets, LessThan, MoreThan, Double, In, Not, Between } from "typeorm";
|
||||
import { CommandType } from "../entities/CommandType";
|
||||
import { CommandSend } from "../entities/CommandSend";
|
||||
import { Profile, CreateProfileAllFields } from "../entities/Profile";
|
||||
|
|
@ -1013,11 +1013,10 @@ export class CommandController extends Controller {
|
|||
if (command.commandExcecuteDate == null)
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบวันที่คำสั่งมีผล");
|
||||
|
||||
let profiles = command && command.commandRecives.length > 0
|
||||
? command.commandRecives
|
||||
.filter((x) => x.profileId != null)
|
||||
.map((x) => x.profileId)
|
||||
: [];
|
||||
let profiles =
|
||||
command && command.commandRecives.length > 0
|
||||
? command.commandRecives.filter((x) => x.profileId != null).map((x) => x.profileId)
|
||||
: [];
|
||||
|
||||
await new CallAPI()
|
||||
.PostData(request, "/placement/noti/profiles", {
|
||||
|
|
@ -1073,12 +1072,12 @@ export class CommandController extends Controller {
|
|||
|
||||
const command = await this.commandRepository.find({
|
||||
relations: ["commandType", "commandRecives"],
|
||||
where:{
|
||||
where: {
|
||||
commandExcecuteDate: Between(today, tomorrow),
|
||||
status: "WAITING"
|
||||
}
|
||||
status: "WAITING",
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
const data = {
|
||||
client_id: "gettoken",
|
||||
client_secret: process.env.AUTH_ACCOUNT_SECRET,
|
||||
|
|
@ -1100,27 +1099,27 @@ export class CommandController extends Controller {
|
|||
]);
|
||||
if (_data == null) {
|
||||
return new HttpError(HttpStatus.UNAUTHORIZED, "ชื่อผู้ใช้งานหรือรหัสผ่านไม่ถูกต้อง");
|
||||
}
|
||||
}
|
||||
|
||||
command.forEach(async (x) => {
|
||||
const path = this.commandTypePath(x.commandType.code);
|
||||
if (path == null) throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบประเภทคำสั่งนี้ในระบบ");
|
||||
const msg = {
|
||||
data: {
|
||||
id: x.id,
|
||||
status: "REPORTED",
|
||||
lastUpdateUserId: "system",
|
||||
lastUpdateFullName: "system",
|
||||
// lastUpdateUserId: _data.user.sub,
|
||||
// lastUpdateFullName: _data.user.name,
|
||||
lastUpdatedAt: new Date(),
|
||||
},
|
||||
user: _data.user,
|
||||
token: _data.access_token,
|
||||
};
|
||||
sendToQueue(msg);
|
||||
})
|
||||
|
||||
const path = this.commandTypePath(x.commandType.code);
|
||||
if (path == null) throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบประเภทคำสั่งนี้ในระบบ");
|
||||
const msg = {
|
||||
data: {
|
||||
id: x.id,
|
||||
status: "REPORTED",
|
||||
lastUpdateUserId: "system",
|
||||
lastUpdateFullName: "system",
|
||||
// lastUpdateUserId: _data.user.sub,
|
||||
// lastUpdateFullName: _data.user.name,
|
||||
lastUpdatedAt: new Date(),
|
||||
},
|
||||
user: _data.user,
|
||||
token: _data.access_token,
|
||||
};
|
||||
sendToQueue(msg);
|
||||
});
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
||||
|
|
@ -2782,7 +2781,7 @@ export class CommandController extends Controller {
|
|||
case "C-PM-09":
|
||||
return "/retirement/other/out/report";
|
||||
case "C-PM-10":
|
||||
return "/xxxxxx";
|
||||
return "/probation/report/command10/officer/report";
|
||||
case "C-PM-11":
|
||||
return "/probation/report/command11/officer/report";
|
||||
case "C-PM-12":
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { Body, Controller, Get, Path, Post, Request, Route, Security, Tags } from "tsoa";
|
||||
import { Body, Controller, Get, Post, Request, Route, Security, Tags } from "tsoa";
|
||||
import { AppDataSource } from "../database/data-source";
|
||||
import { RequestWithUser } from "../middlewares/user";
|
||||
import HttpError from "../interfaces/http-error";
|
||||
|
|
@ -14,7 +14,6 @@ import { StateUserComment } from "../entities/StateUserComment";
|
|||
import { MetaWorkflow } from "../entities/MetaWorkflow";
|
||||
import { MetaState } from "../entities/MetaState";
|
||||
import { MetaStateOperator } from "../entities/MetaStateOperator";
|
||||
import { PosMasterAssign } from "../entities/PosMasterAssign";
|
||||
import { PosMaster } from "../entities/PosMaster";
|
||||
import { IsNull, Not } from "typeorm";
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue