Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hg-smart
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
platform
hg-smart
Commits
9463a474
Commit
9463a474
authored
Jun 27, 2024
by
liuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2024-06-27 添加存货类型大类
parent
6b4f59bd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
91 additions
and
0 deletions
+91
-0
InventTypeDetailEnum.java
...n/java/com/baosight/hggp/common/InventTypeDetailEnum.java
+91
-0
No files found.
src/main/java/com/baosight/hggp/common/InventTypeDetailEnum.java
0 → 100644
View file @
9463a474
package
com
.
baosight
.
hggp
.
common
;
import
com.baosight.iplat4j.core.ei.EiBlock
;
import
java.util.*
;
/**
* @author LiuYang
* @version 1.0 2024/6/27
*/
public
enum
InventTypeDetailEnum
{
COMPONENT
(
1
,
"构件"
),
SEMI_FINISHED_PRODUCT
(
2
,
"零件"
),
RAW
(
3
,
"原料"
),
CONSUMABLE
(
4
,
"耗材"
);
private
Integer
code
;
private
String
value
;
InventTypeDetailEnum
(
Integer
code
,
String
value
)
{
this
.
code
=
code
;
this
.
value
=
value
;
}
public
static
InventTypeDetailEnum
getEnumByCode
(
Integer
code
){
for
(
InventTypeDetailEnum
en
:
InventTypeDetailEnum
.
values
()){
if
(
code
.
compareTo
(
en
.
code
)==
0
){
return
en
;
}
}
return
null
;
}
public
static
String
getNameByCode
(
Integer
code
){
InventTypeDetailEnum
en
=
getEnumByCode
(
code
);
if
(
Objects
.
nonNull
(
en
)){
return
en
.
getValue
();
}
return
null
;
}
public
Integer
getCode
()
{
return
code
;
}
public
void
setCode
(
Integer
code
)
{
this
.
code
=
code
;
}
public
String
getValue
()
{
return
value
;
}
public
void
setValue
(
String
value
)
{
this
.
value
=
value
;
}
public
static
Integer
[]
getInentTypeTwo
(){
return
new
Integer
[]{
COMPONENT
.
code
,
SEMI_FINISHED_PRODUCT
.
code
};
}
public
static
Integer
[]
getProdTypeFour
(){
return
new
Integer
[]{
COMPONENT
.
code
,
SEMI_FINISHED_PRODUCT
.
code
,
RAW
.
code
,
CONSUMABLE
.
code
};
}
public
static
EiBlock
generatorEiBlock
()
{
EiBlock
block
=
new
EiBlock
(
"invent_type_detail_block_id"
);
List
<
Map
<
String
,
Object
>>
rows
=
new
ArrayList
<
Map
<
String
,
Object
>>()
{{
add
(
new
HashMap
<
String
,
Object
>()
{{
put
(
HGConstants
.
TEXT_FIELD
,
COMPONENT
.
code
+
HGConstants
.
SPLICING_SYMBOL
+
COMPONENT
.
value
);
put
(
HGConstants
.
VALUE_FIELD
,
COMPONENT
.
code
);
}});
add
(
new
HashMap
<
String
,
Object
>()
{{
put
(
HGConstants
.
TEXT_FIELD
,
SEMI_FINISHED_PRODUCT
.
code
+
HGConstants
.
SPLICING_SYMBOL
+
SEMI_FINISHED_PRODUCT
.
value
);
put
(
HGConstants
.
VALUE_FIELD
,
SEMI_FINISHED_PRODUCT
.
code
);
}});
add
(
new
HashMap
<
String
,
Object
>()
{{
put
(
HGConstants
.
TEXT_FIELD
,
RAW
.
code
+
HGConstants
.
SPLICING_SYMBOL
+
RAW
.
value
);
put
(
HGConstants
.
VALUE_FIELD
,
RAW
.
code
);
}});
add
(
new
HashMap
<
String
,
Object
>()
{{
put
(
HGConstants
.
TEXT_FIELD
,
CONSUMABLE
.
code
+
HGConstants
.
SPLICING_SYMBOL
+
CONSUMABLE
.
value
);
put
(
HGConstants
.
VALUE_FIELD
,
CONSUMABLE
.
code
);
}});
}};
block
.
setRows
(
rows
);
return
block
;
}
}
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