refactor: añadidos valores a piñon a la tabla workerTimeControlConfig
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
bca8a324d8
commit
4b60aacbbe
|
@ -0,0 +1,6 @@
|
||||||
|
ALTER TABLE `vn`.`workerTimeControlConfig` ADD teleworkingStart INT NULL COMMENT 'Hora comienzo jornada de los teletrabajdores expresada en segundos';
|
||||||
|
ALTER TABLE `vn`.`workerTimeControlConfig` ADD teleworkingStartBreakTime INT NULL COMMENT 'Hora comienzo descanso de los teletrabjadores expresada en segundos';
|
||||||
|
|
||||||
|
UPDATE `vn`.`workerTimeControlConfig`
|
||||||
|
SET `teleworkingStart`=28800, `teleworkingStartBreakTime`=32400
|
||||||
|
WHERE `id`=1;
|
|
@ -2671,9 +2671,9 @@ INSERT INTO `vn`.`sectorCollectionSaleGroup` (`sectorCollectionFk`, `saleGroupFk
|
||||||
VALUES
|
VALUES
|
||||||
(1, 1);
|
(1, 1);
|
||||||
|
|
||||||
INSERT INTO `vn`.`workerTimeControlConfig` (`id`, `dayBreak`, `dayBreakDriver`, `shortWeekBreak`, `longWeekBreak`, `weekScope`, `mailPass`, `mailHost`, `mailSuccessFolder`, `mailErrorFolder`, `mailUser`, `minHoursToBreak`, `breakHours`, `hoursCompleteWeek`, `startNightlyHours`, `endNightlyHours`, `maxTimePerDay`, `breakTime`, `timeToBreakTime`, `dayMaxTime`, `shortWeekDays`, `longWeekDays`)
|
INSERT INTO `vn`.`workerTimeControlConfig` (`id`, `dayBreak`, `dayBreakDriver`, `shortWeekBreak`, `longWeekBreak`, `weekScope`, `mailPass`, `mailHost`, `mailSuccessFolder`, `mailErrorFolder`, `mailUser`, `minHoursToBreak`, `breakHours`, `hoursCompleteWeek`, `startNightlyHours`, `endNightlyHours`, `maxTimePerDay`, `breakTime`, `timeToBreakTime`, `dayMaxTime`, `shortWeekDays`, `longWeekDays`, `teleworkingStart`, `teleworkingStartBreakTime`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 43200, 32400, 129600, 259200, 604800, '', '', 'Leidos.exito', 'Leidos.error', 'timeControl', 5.33, 0.33, 40, '22:00:00', '06:00:00', 57600, 1200, 18000, 57600, 6, 13);
|
(1, 43200, 32400, 129600, 259200, 604800, '', '', 'Leidos.exito', 'Leidos.error', 'timeControl', 5.33, 0.33, 40, '22:00:00', '06:00:00', 57600, 1200, 18000, 57600, 6, 13, 28800, 32400);
|
||||||
|
|
||||||
INSERT INTO `vn`.`host` (`id`, `code`, `description`, `warehouseFk`, `bankFk`)
|
INSERT INTO `vn`.`host` (`id`, `code`, `description`, `warehouseFk`, `bankFk`)
|
||||||
VALUES
|
VALUES
|
||||||
|
|
|
@ -32,7 +32,6 @@ module.exports = Self => {
|
||||||
const models = Self.app.models;
|
const models = Self.app.models;
|
||||||
const conn = Self.dataSource.connector;
|
const conn = Self.dataSource.connector;
|
||||||
const args = ctx.args;
|
const args = ctx.args;
|
||||||
const $t = ctx.req.__; // $translate
|
|
||||||
let tx;
|
let tx;
|
||||||
const myOptions = {};
|
const myOptions = {};
|
||||||
|
|
||||||
|
@ -166,13 +165,14 @@ module.exports = Self => {
|
||||||
|
|
||||||
for (let day of days[index]) {
|
for (let day of days[index]) {
|
||||||
workerFk = day.workerFk;
|
workerFk = day.workerFk;
|
||||||
|
console.log(day);
|
||||||
if (day.timeWorkDecimal > 0 && day.timeWorkedDecimal == null
|
if (day.timeWorkDecimal > 0 && day.timeWorkedDecimal == null
|
||||||
&& (day.permissionRate ? day.permissionRate : true)) {
|
&& (day.permissionRate ? day.permissionRate : true)) {
|
||||||
if (day.timeTable == null) {
|
if (day.timeTable == null) {
|
||||||
const timed = new Date(day.dated);
|
const timed = new Date(day.dated);
|
||||||
await models.WorkerTimeControl.create({
|
await models.WorkerTimeControl.create({
|
||||||
userFk: day.workerFk,
|
userFk: day.workerFk,
|
||||||
timed: timed.setHours(8),
|
timed: timed.setHours(workerTimeControlConfig.teleworkingStart / 3600),
|
||||||
manual: true,
|
manual: true,
|
||||||
direction: 'in',
|
direction: 'in',
|
||||||
isSendMail: true
|
isSendMail: true
|
||||||
|
@ -181,7 +181,7 @@ module.exports = Self => {
|
||||||
if (day.timeWorkDecimal >= workerTimeControlConfig.timeToBreakTime / 3600) {
|
if (day.timeWorkDecimal >= workerTimeControlConfig.timeToBreakTime / 3600) {
|
||||||
await models.WorkerTimeControl.create({
|
await models.WorkerTimeControl.create({
|
||||||
userFk: day.workerFk,
|
userFk: day.workerFk,
|
||||||
timed: timed.setHours(9),
|
timed: timed.setHours(workerTimeControlConfig.teleworkingStartBreakTime / 3600),
|
||||||
manual: true,
|
manual: true,
|
||||||
direction: 'middle',
|
direction: 'middle',
|
||||||
isSendMail: true
|
isSendMail: true
|
||||||
|
@ -189,7 +189,10 @@ module.exports = Self => {
|
||||||
|
|
||||||
await models.WorkerTimeControl.create({
|
await models.WorkerTimeControl.create({
|
||||||
userFk: day.workerFk,
|
userFk: day.workerFk,
|
||||||
timed: timed.setHours(9, 20),
|
timed: timed.setHours(
|
||||||
|
workerTimeControlConfig.teleworkingStartBreakTime / 3600,
|
||||||
|
workerTimeControlConfig.breakTime / 60
|
||||||
|
),
|
||||||
manual: true,
|
manual: true,
|
||||||
direction: 'middle',
|
direction: 'middle',
|
||||||
isSendMail: true
|
isSendMail: true
|
||||||
|
@ -199,7 +202,11 @@ module.exports = Self => {
|
||||||
const [hoursWork, minutesWork, secondsWork] = getTime(day.timeWorkSexagesimal);
|
const [hoursWork, minutesWork, secondsWork] = getTime(day.timeWorkSexagesimal);
|
||||||
await models.WorkerTimeControl.create({
|
await models.WorkerTimeControl.create({
|
||||||
userFk: day.workerFk,
|
userFk: day.workerFk,
|
||||||
timed: timed.setHours(8 + hoursWork, minutesWork, secondsWork),
|
timed: timed.setHours(
|
||||||
|
workerTimeControlConfig.teleworkingStart / 3600 + hoursWork,
|
||||||
|
minutesWork,
|
||||||
|
secondsWork
|
||||||
|
),
|
||||||
manual: true,
|
manual: true,
|
||||||
direction: 'out',
|
direction: 'out',
|
||||||
isSendMail: true
|
isSendMail: true
|
||||||
|
|
|
@ -11,8 +11,17 @@
|
||||||
"id": true,
|
"id": true,
|
||||||
"type": "number"
|
"type": "number"
|
||||||
},
|
},
|
||||||
|
"breakTime": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
"timeToBreakTime": {
|
"timeToBreakTime": {
|
||||||
"type": "number"
|
"type": "number"
|
||||||
|
},
|
||||||
|
"teleworkingStart": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"teleworkingStartBreakTime": {
|
||||||
|
"type": "number"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue