Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
9bc59bc7
Commit
9bc59bc7
authored
Apr 25, 2021
by
庄冰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
冗余代码-误删恢复
parent
5d315062
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
0 deletions
+42
-0
center-order/app/base/service/impl/qcutils/baseqcSve.js
+42
-0
No files found.
center-order/app/base/service/impl/qcutils/baseqcSve.js
View file @
9bc59bc7
...
...
@@ -647,6 +647,48 @@ class BaseQcService {
})
}
/*
返回20位业务订单号
prefix:业务前缀
*/
async
getBusUid
(
prefix
)
{
prefix
=
(
prefix
||
""
);
if
(
prefix
)
{
prefix
=
prefix
.
toUpperCase
();
}
var
prefixlength
=
prefix
.
length
;
var
subLen
=
8
-
prefixlength
;
var
uidStr
=
""
;
if
(
subLen
>
0
)
{
uidStr
=
await
this
.
getUidInfo
(
subLen
,
60
);
}
var
timStr
=
moment
().
format
(
"YYYYMMDDHHmm"
);
return
prefix
+
timStr
+
uidStr
;
}
/*
len:返回长度
radix:参与计算的长度,最大为62
*/
async
getUidInfo
(
len
,
radix
)
{
var
chars
=
'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
.
split
(
''
);
//长度62,到yz长度为长36
var
uuid
=
[],
i
;
radix
=
radix
||
chars
.
length
;
if
(
len
)
{
for
(
i
=
0
;
i
<
len
;
i
++
)
uuid
[
i
]
=
chars
[
0
|
Math
.
random
()
*
radix
];
}
else
{
var
r
;
uuid
[
8
]
=
uuid
[
13
]
=
uuid
[
18
]
=
uuid
[
23
]
=
'-'
;
uuid
[
14
]
=
'4'
;
for
(
i
=
0
;
i
<
36
;
i
++
)
{
if
(
!
uuid
[
i
])
{
r
=
0
|
Math
.
random
()
*
16
;
uuid
[
i
]
=
chars
[(
i
==
19
)
?
(
r
&
0x3
)
|
0x8
:
r
];
}
}
}
return
uuid
.
join
(
''
);
}
}
module
.
exports
=
BaseQcService
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment