@things-factory/id-rule-base 7.0.0-alpha.1 → 7.0.0-alpha.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/editors/grist-code-input-popup.js +13 -11
- package/client/editors/grist-code-input.js +13 -2
- package/dist-server/service/doc-number/doc-number.js +17 -17
- package/dist-server/service/doc-number/doc-number.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/server/service/doc-number/doc-number.ts +48 -60
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/id-rule-base",
|
|
3
|
-
"version": "7.0.0-alpha.
|
|
3
|
+
"version": "7.0.0-alpha.21",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@operato/data-grist": "^2.0.0-alpha.0",
|
|
28
28
|
"@operato/input": "^2.0.0-alpha.0",
|
|
29
|
-
"@things-factory/i18n-base": "^7.0.0-alpha.
|
|
30
|
-
"@things-factory/setting-base": "^7.0.0-alpha.
|
|
31
|
-
"@things-factory/shell": "^7.0.0-alpha.
|
|
29
|
+
"@things-factory/i18n-base": "^7.0.0-alpha.21",
|
|
30
|
+
"@things-factory/setting-base": "^7.0.0-alpha.21",
|
|
31
|
+
"@things-factory/shell": "^7.0.0-alpha.21"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "6dff39aa0d60f0fcf760cca9b8453626f222fa57"
|
|
34
34
|
}
|
|
@@ -1,104 +1,92 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
CreateDateColumn,
|
|
4
|
-
UpdateDateColumn,
|
|
5
|
-
Entity,
|
|
6
|
-
Index,
|
|
7
|
-
Column,
|
|
8
|
-
RelationId,
|
|
9
|
-
ManyToOne,
|
|
10
|
-
PrimaryGeneratedColumn,
|
|
11
|
-
BeforeInsert
|
|
12
|
-
} from 'typeorm'
|
|
1
|
+
import { CreateDateColumn, UpdateDateColumn, Entity, Index, Column, RelationId, ManyToOne, PrimaryGeneratedColumn, BeforeInsert } from 'typeorm'
|
|
13
2
|
import { ObjectType, Field, Int, ID } from 'type-graphql'
|
|
14
3
|
|
|
15
4
|
import { User } from '@things-factory/auth-base'
|
|
16
5
|
import { Domain } from '@things-factory/shell'
|
|
17
6
|
|
|
18
7
|
@Entity('doc_numbers')
|
|
19
|
-
@Index('ix_doc_number_0', (docNumber: DocNumber) => [docNumber.domain,docNumber.code], { unique: true })
|
|
8
|
+
@Index('ix_doc_number_0', (docNumber: DocNumber) => [docNumber.domain, docNumber.code], { unique: true })
|
|
20
9
|
@ObjectType({ description: 'Entity for DocNumber' })
|
|
21
10
|
export class DocNumber {
|
|
22
|
-
|
|
23
11
|
@PrimaryGeneratedColumn('uuid')
|
|
24
12
|
@Field(type => ID)
|
|
25
13
|
readonly id: string
|
|
26
14
|
|
|
27
|
-
@Column(
|
|
28
|
-
@Field(
|
|
15
|
+
@Column()
|
|
16
|
+
@Field()
|
|
29
17
|
code: string
|
|
30
18
|
|
|
31
|
-
@Column(
|
|
32
|
-
@Field(
|
|
19
|
+
@Column()
|
|
20
|
+
@Field()
|
|
33
21
|
description: string
|
|
34
22
|
|
|
35
|
-
@Column({
|
|
36
|
-
@Field({ nullable:true })
|
|
23
|
+
@Column({ nullable: true })
|
|
24
|
+
@Field({ nullable: true })
|
|
37
25
|
prefix?: string
|
|
38
26
|
|
|
39
|
-
@Column({
|
|
40
|
-
@Field({ nullable:true })
|
|
27
|
+
@Column({ nullable: true })
|
|
28
|
+
@Field({ nullable: true })
|
|
41
29
|
suffix?: string
|
|
42
30
|
|
|
43
|
-
@Column({
|
|
44
|
-
@Field(type =>Int, { nullable:true })
|
|
31
|
+
@Column({ type: 'integer', nullable: true })
|
|
32
|
+
@Field(type => Int, { nullable: true })
|
|
45
33
|
startNo?: number
|
|
46
34
|
|
|
47
|
-
@Column({
|
|
48
|
-
@Field(type =>Int, { nullable:true })
|
|
35
|
+
@Column({ type: 'integer', nullable: true })
|
|
36
|
+
@Field(type => Int, { nullable: true })
|
|
49
37
|
endNo?: number
|
|
50
38
|
|
|
51
|
-
@Column({
|
|
52
|
-
@Field(type =>Int, { nullable:true })
|
|
39
|
+
@Column({ type: 'integer', nullable: true })
|
|
40
|
+
@Field(type => Int, { nullable: true })
|
|
53
41
|
currentNo?: number
|
|
54
42
|
|
|
55
|
-
@Column({
|
|
56
|
-
@Field({ nullable:true })
|
|
43
|
+
@Column({ nullable: true })
|
|
44
|
+
@Field({ nullable: true })
|
|
57
45
|
updateInterval?: string
|
|
58
46
|
|
|
59
|
-
@Column({
|
|
60
|
-
@Field({ nullable:true })
|
|
47
|
+
@Column({ nullable: true, default: false })
|
|
48
|
+
@Field({ nullable: true })
|
|
61
49
|
useDbSeqFlag?: boolean
|
|
62
50
|
|
|
63
|
-
@Column({
|
|
64
|
-
@Field({ nullable:true })
|
|
51
|
+
@Column({ nullable: true })
|
|
52
|
+
@Field({ nullable: true })
|
|
65
53
|
seqName?: string
|
|
66
54
|
|
|
67
|
-
@Column({
|
|
68
|
-
@Field(type =>Int, { nullable:false })
|
|
55
|
+
@Column({ type: 'integer', nullable: false })
|
|
56
|
+
@Field(type => Int, { nullable: false })
|
|
69
57
|
seqDigitNum: number
|
|
70
58
|
|
|
71
|
-
@Column({
|
|
72
|
-
@Field({ nullable:true })
|
|
59
|
+
@Column({ nullable: true })
|
|
60
|
+
@Field({ nullable: true })
|
|
73
61
|
separator?: string
|
|
74
62
|
|
|
75
|
-
@Column({
|
|
76
|
-
@Field({ nullable:true })
|
|
63
|
+
@Column({ nullable: true })
|
|
64
|
+
@Field({ nullable: true })
|
|
77
65
|
expression?: string
|
|
78
66
|
|
|
79
|
-
@Column({
|
|
80
|
-
@Field({ nullable:true })
|
|
67
|
+
@Column({ nullable: true })
|
|
68
|
+
@Field({ nullable: true })
|
|
81
69
|
lastDocNumber?: string
|
|
82
70
|
|
|
83
|
-
@Column({
|
|
84
|
-
@Field({ nullable:true })
|
|
71
|
+
@Column({ type: 'boolean', nullable: true, default: false })
|
|
72
|
+
@Field({ nullable: true })
|
|
85
73
|
activeFlag?: boolean
|
|
86
74
|
|
|
87
|
-
@ManyToOne(type => Domain, {createForeignKeyConstraints: false, nullable: false})
|
|
75
|
+
@ManyToOne(type => Domain, { createForeignKeyConstraints: false, nullable: false })
|
|
88
76
|
@Field({ nullable: false })
|
|
89
77
|
domain: Domain
|
|
90
78
|
|
|
91
79
|
@RelationId((docNumber: DocNumber) => docNumber.domain)
|
|
92
80
|
domainId: string
|
|
93
81
|
|
|
94
|
-
@ManyToOne(type => User, {createForeignKeyConstraints: false, nullable: true})
|
|
82
|
+
@ManyToOne(type => User, { createForeignKeyConstraints: false, nullable: true })
|
|
95
83
|
@Field({ nullable: true })
|
|
96
84
|
creator?: User
|
|
97
85
|
|
|
98
86
|
@RelationId((docNumber: DocNumber) => docNumber.creator)
|
|
99
87
|
creatorId?: string
|
|
100
88
|
|
|
101
|
-
@ManyToOne(type => User, {createForeignKeyConstraints: false, nullable: true})
|
|
89
|
+
@ManyToOne(type => User, { createForeignKeyConstraints: false, nullable: true })
|
|
102
90
|
@Field({ nullable: true })
|
|
103
91
|
updater?: User
|
|
104
92
|
|
|
@@ -115,14 +103,14 @@ export class DocNumber {
|
|
|
115
103
|
|
|
116
104
|
@BeforeInsert()
|
|
117
105
|
updateExpression() {
|
|
118
|
-
if(!this.expression || this.expression.length == 0) {
|
|
119
|
-
if(!this.startNo || this.startNo < 1) {
|
|
106
|
+
if (!this.expression || this.expression.length == 0) {
|
|
107
|
+
if (!this.startNo || this.startNo < 1) {
|
|
120
108
|
this.startNo = 1
|
|
121
109
|
}
|
|
122
110
|
|
|
123
|
-
if(!this.endNo || this.endNo <= 1) {
|
|
111
|
+
if (!this.endNo || this.endNo <= 1) {
|
|
124
112
|
let maxNo = ''
|
|
125
|
-
for(let i = 0
|
|
113
|
+
for (let i = 0; i < this.seqDigitNum; i++) {
|
|
126
114
|
maxNo = maxNo + '9'
|
|
127
115
|
}
|
|
128
116
|
this.endNo = Number(maxNo)
|
|
@@ -130,29 +118,29 @@ export class DocNumber {
|
|
|
130
118
|
|
|
131
119
|
let expr = ''
|
|
132
120
|
|
|
133
|
-
if(this.prefix) {
|
|
121
|
+
if (this.prefix) {
|
|
134
122
|
expr = this.prefix
|
|
135
|
-
|
|
136
|
-
if(this.separator) {
|
|
123
|
+
|
|
124
|
+
if (this.separator) {
|
|
137
125
|
expr += this.separator
|
|
138
|
-
}
|
|
126
|
+
}
|
|
139
127
|
}
|
|
140
128
|
|
|
141
|
-
if(this.updateInterval && this.updateInterval != 'NONE') {
|
|
129
|
+
if (this.updateInterval && this.updateInterval != 'NONE') {
|
|
142
130
|
expr += '${' + this.updateInterval + '}'
|
|
143
131
|
|
|
144
|
-
if(this.separator) {
|
|
132
|
+
if (this.separator) {
|
|
145
133
|
expr += this.separator
|
|
146
134
|
}
|
|
147
135
|
}
|
|
148
136
|
|
|
149
137
|
expr += '${SEQ}'
|
|
150
138
|
|
|
151
|
-
if(this.suffix) {
|
|
152
|
-
if(this.separator) {
|
|
139
|
+
if (this.suffix) {
|
|
140
|
+
if (this.separator) {
|
|
153
141
|
expr += this.separator
|
|
154
142
|
}
|
|
155
|
-
|
|
143
|
+
|
|
156
144
|
expr += this.suffix
|
|
157
145
|
}
|
|
158
146
|
|