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
3125b7e4
Commit
3125b7e4
authored
May 21, 2024
by
yukang
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
82e42e9e
e5e8cbd4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
127 additions
and
53 deletions
+127
-53
ComputeTypeEnum.java
src/main/java/com/baosight/hggp/common/ComputeTypeEnum.java
+67
-0
HGSCTools.java
src/main/java/com/baosight/hggp/hg/sc/tools/HGSCTools.java
+15
-8
ServiceHGSJ001.java
.../java/com/baosight/hggp/hg/sj/service/ServiceHGSJ001.java
+9
-9
ServiceHGSJ002.java
.../java/com/baosight/hggp/hg/sj/service/ServiceHGSJ002.java
+19
-19
ServiceHGSJ002A.java
...java/com/baosight/hggp/hg/sj/service/ServiceHGSJ002A.java
+17
-17
No files found.
src/main/java/com/baosight/hggp/common/ComputeTypeEnum.java
0 → 100644
View file @
3125b7e4
package
com
.
baosight
.
hggp
.
common
;
import
com.baosight.iplat4j.core.ei.EiBlock
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author LiuYang
* @version 1.0 2024/5/21
*/
public
enum
ComputeTypeEnum
{
CD
(
1
,
"长度"
),
SL
(
2
,
"数量"
);
private
Integer
code
;
private
String
value
;
ComputeTypeEnum
(
Integer
code
,
String
value
)
{
this
.
code
=
code
;
this
.
value
=
value
;
}
public
static
EiBlock
generatorEiBlock
()
{
EiBlock
block
=
new
EiBlock
(
"compute_type_block_id"
);
List
<
Map
<
String
,
Object
>>
rows
=
new
ArrayList
<
Map
<
String
,
Object
>>()
{{
add
(
new
HashMap
<
String
,
Object
>()
{{
put
(
HGConstants
.
TEXT_FIELD
,
CD
.
code
+
"-"
+
CD
.
value
);
put
(
HGConstants
.
VALUE_FIELD
,
CD
.
code
);
}});
add
(
new
HashMap
<
String
,
Object
>()
{{
put
(
HGConstants
.
TEXT_FIELD
,
SL
.
code
+
"-"
+
SL
.
value
);
put
(
HGConstants
.
VALUE_FIELD
,
SL
.
code
);
}});
}};
block
.
setRows
(
rows
);
return
block
;
}
public
static
ComputeTypeEnum
getEnumByCode
(
Integer
code
){
for
(
ComputeTypeEnum
en
:
ComputeTypeEnum
.
values
()){
if
(
code
.
compareTo
(
en
.
code
)==
0
){
return
en
;
}
}
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
;
}
}
src/main/java/com/baosight/hggp/hg/sc/tools/HGSCTools.java
View file @
3125b7e4
package
com
.
baosight
.
hggp
.
hg
.
sc
.
tools
;
import
com.baosight.hggp.common.ComputeTypeEnum
;
import
com.baosight.hggp.common.ProductTypeEnum
;
import
com.baosight.hggp.core.dao.DaoBase
;
import
com.baosight.hggp.core.dao.DaoUtils
;
...
...
@@ -393,14 +394,20 @@ public class HGSCTools {
if
(
StringUtils
.
equals
(
product
.
getInventCode
(),
planInfo
.
getProductCode
())){
//额定工时
BigDecimal
timing
=
sj
.
getStandardJob
().
multiply
(
sj
.
getStandardDays
()).
divide
(
sj
.
getStandardNum
());
if
(
StringUtils
.
equals
(
sj
.
getUnit
(),
"米"
))
{
workHour
.
set
(
product
.
getLength
().
multiply
(
new
BigDecimal
(
planInfo
.
getQuantity
())).
multiply
(
unitConver
).
multiply
(
composingCoeff
)
.
divide
(
timing
)
.
multiply
(
baseWorkHour
).
add
(
finalRemainder
));
}
else
{
workHour
.
set
(
new
BigDecimal
(
planInfo
.
getQuantity
()).
multiply
(
composingCoeff
)
.
divide
(
timing
)
.
multiply
(
baseWorkHour
).
add
(
finalRemainder
));
ComputeTypeEnum
computeType
=
ComputeTypeEnum
.
getEnumByCode
(
sj
.
getComputeType
());
switch
(
computeType
){
case
CD:
workHour
.
set
(
product
.
getLength
().
multiply
(
new
BigDecimal
(
planInfo
.
getQuantity
())).
multiply
(
unitConver
).
multiply
(
composingCoeff
)
.
divide
(
timing
)
.
multiply
(
baseWorkHour
).
add
(
finalRemainder
));
break
;
case
SL:
workHour
.
set
(
new
BigDecimal
(
planInfo
.
getQuantity
()).
multiply
(
composingCoeff
)
.
divide
(
timing
)
.
multiply
(
baseWorkHour
).
add
(
finalRemainder
));
break
;
default
:
break
;
}
}
});
...
...
src/main/java/com/baosight/hggp/hg/sj/service/ServiceHGSJ001.java
View file @
3125b7e4
...
...
@@ -48,13 +48,13 @@ public class ServiceHGSJ001 extends ServiceEPBase {
public
EiInfo
delete
(
EiInfo
inInfo
)
{
int
i
=
0
;
try
{
HGSJ001
h
psc012
=
new
HGSJ001
();
HGSJ001
h
gsj001
=
new
HGSJ001
();
EiBlock
eiBlock
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
);
for
(
i
=
0
;
i
<
eiBlock
.
getRowCount
();
i
++)
{
Map
<?,
?>
map
=
eiBlock
.
getRow
(
i
);
h
psc012
.
fromMap
(
map
);
h
psc012
.
setDeleteFlag
(
CommonConstant
.
YesNo
.
YES_1
);
DaoUtils
.
update
(
HGSJ001
.
DELETE_FLAG
,
h
psc012
.
toMap
());
h
gsj001
.
fromMap
(
map
);
h
gsj001
.
setDeleteFlag
(
CommonConstant
.
YesNo
.
YES_1
);
DaoUtils
.
update
(
HGSJ001
.
DELETE_FLAG
,
h
gsj001
.
toMap
());
}
inInfo
.
setStatus
(
EiConstant
.
STATUS_SUCCESS
);
inInfo
.
setMsgByKey
(
"ep.1000"
,
new
String
[]{
String
.
valueOf
(
i
),
I18nMessages
.
getText
(
"label.delete"
,
"删除"
)});
...
...
@@ -97,17 +97,17 @@ public class ServiceHGSJ001 extends ServiceEPBase {
/**
* 新增操作
*/
public
void
add
(
HGSJ001
h
psc012
)
{
public
void
add
(
HGSJ001
h
gsj001
)
{
//生成工序编码
h
psc012
.
setProcessCode
(
SequenceGenerator
.
getNextSequence
(
HGConstant
.
SequenceId
.
PROCESS_CODE
));
DaoUtils
.
insert
(
HGSJ001
.
INSERT
,
h
psc012
);
h
gsj001
.
setProcessCode
(
SequenceGenerator
.
getNextSequence
(
HGConstant
.
SequenceId
.
PROCESS_CODE
));
DaoUtils
.
insert
(
HGSJ001
.
INSERT
,
h
gsj001
);
}
/**
* 修改操作
*/
public
void
modify
(
HGSJ001
h
psc012
)
{
DaoUtils
.
update
(
HGSJ001
.
UPDATE
,
hpsc012
);
public
void
modify
(
HGSJ001
h
gsj001
)
{
DaoUtils
.
update
(
HGSJ001
.
UPDATE
,
hgsj001
);
}
public
EiInfo
updateStatus
(
EiInfo
inInfo
){
...
...
src/main/java/com/baosight/hggp/hg/sj/service/ServiceHGSJ002.java
View file @
3125b7e4
...
...
@@ -41,7 +41,7 @@ public class ServiceHGSJ002 extends ServiceEPBase {
@Override
public
EiInfo
query
(
EiInfo
inInfo
)
{
inInfo
.
setCell
(
EiConstant
.
queryBlock
,
ACConstants
.
ROW_CODE_0
,
HGSJ002
.
FIELD_DELETE_FLAG
,
CommonConstant
.
YesNo
.
NO_0
);
return
super
.
query
(
inInfo
,
HGSJ002
.
QUERY
);
return
super
.
query
(
inInfo
,
HGSJ002
.
QUERY
,
new
HGSJ002
()
);
}
@OperationLogAnnotation
(
operModul
=
"工艺流程"
,
operType
=
"删除"
,
operDesc
=
"删除操作"
)
...
...
@@ -49,13 +49,13 @@ public class ServiceHGSJ002 extends ServiceEPBase {
public
EiInfo
delete
(
EiInfo
inInfo
)
{
int
i
=
0
;
try
{
HGSJ002
h
psc013
=
new
HGSJ002
();
HGSJ002
h
gsj002
=
new
HGSJ002
();
EiBlock
eiBlock
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
);
for
(
i
=
0
;
i
<
eiBlock
.
getRowCount
();
i
++)
{
Map
<?,
?>
map
=
eiBlock
.
getRow
(
i
);
h
psc013
.
fromMap
(
map
);
h
psc013
.
setDeleteFlag
(
CommonConstant
.
YesNo
.
YES_1
);
DaoUtils
.
update
(
HGSJ002
.
DELETE_FLAG
,
h
psc013
);
h
gsj002
.
fromMap
(
map
);
h
gsj002
.
setDeleteFlag
(
CommonConstant
.
YesNo
.
YES_1
);
DaoUtils
.
update
(
HGSJ002
.
DELETE_FLAG
,
h
gsj002
);
}
inInfo
.
setStatus
(
EiConstant
.
STATUS_SUCCESS
);
inInfo
.
setMsgByKey
(
"ep.1000"
,
new
String
[]{
String
.
valueOf
(
i
),
I18nMessages
.
getText
(
"label.delete"
,
"删除"
)});
...
...
@@ -77,13 +77,13 @@ public class ServiceHGSJ002 extends ServiceEPBase {
try
{
List
<
Map
>
resultRows
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRows
();
// 写入数据
for
(
int
i
=
0
;
i
<
resultRows
.
size
();
i
++
)
{
HGSJ002
h
psc013
=
new
HGSJ002
();
h
psc013
.
fromMap
(
resultRows
.
get
(
i
)
);
if
(
h
psc013
.
getId
()
==
null
||
hpsc013
.
getId
()
==
0
)
{
this
.
add
(
h
psc013
);
for
(
Map
resultRow
:
resultRows
)
{
HGSJ002
h
gsj002
=
new
HGSJ002
();
h
gsj002
.
fromMap
(
resultRow
);
if
(
h
gsj002
.
getId
()
==
null
||
hgsj002
.
getId
()
==
0
)
{
this
.
add
(
h
gsj002
);
}
else
{
this
.
modify
(
h
psc013
);
this
.
modify
(
h
gsj002
);
}
}
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
...
...
@@ -97,17 +97,17 @@ public class ServiceHGSJ002 extends ServiceEPBase {
/**
* 新增操作
*/
public
void
add
(
HGSJ002
h
psc013
)
{
public
void
add
(
HGSJ002
h
gsj002
)
{
//生成流程编码
h
psc013
.
setFlowCode
(
SequenceGenerator
.
getNextSequence
(
HGConstant
.
SequenceId
.
FLOW_CODE
));
DaoUtils
.
insert
(
HGSJ002
.
INSERT
,
h
psc013
);
h
gsj002
.
setFlowCode
(
SequenceGenerator
.
getNextSequence
(
HGConstant
.
SequenceId
.
FLOW_CODE
));
DaoUtils
.
insert
(
HGSJ002
.
INSERT
,
h
gsj002
);
}
/**
* 修改操作
*/
public
void
modify
(
HGSJ002
h
psc013
)
{
DaoUtils
.
update
(
HGSJ002
.
UPDATE
,
h
psc013
);
public
void
modify
(
HGSJ002
h
gsj002
)
{
DaoUtils
.
update
(
HGSJ002
.
UPDATE
,
h
gsj002
);
}
/**
...
...
@@ -117,12 +117,12 @@ public class ServiceHGSJ002 extends ServiceEPBase {
public
EiInfo
updateStatus
(
EiInfo
inInfo
){
int
i
=
0
;
try
{
HGSJ002
h
psc013
=
new
HGSJ002
();
HGSJ002
h
gsj002
=
new
HGSJ002
();
EiBlock
eiBlock
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
);
for
(
i
=
0
;
i
<
eiBlock
.
getRowCount
();
i
++)
{
Map
<?,
?>
map
=
eiBlock
.
getRow
(
i
);
h
psc013
.
fromMap
(
map
);
DaoUtils
.
update
(
HGSJ002
.
UPDATE_STATUS
,
h
psc013
);
h
gsj002
.
fromMap
(
map
);
DaoUtils
.
update
(
HGSJ002
.
UPDATE_STATUS
,
h
gsj002
);
}
inInfo
.
setStatus
(
EiConstant
.
STATUS_SUCCESS
);
inInfo
.
setMsgByKey
(
"ep.1000"
,
new
String
[]{
String
.
valueOf
(
i
),
I18nMessages
.
getText
(
"label.update"
,
"修改"
)});
...
...
src/main/java/com/baosight/hggp/hg/sj/service/ServiceHGSJ002A.java
View file @
3125b7e4
...
...
@@ -50,13 +50,13 @@ public class ServiceHGSJ002A extends ServiceEPBase {
public
EiInfo
delete
(
EiInfo
inInfo
)
{
int
i
=
0
;
try
{
HGSJ002A
h
psc013
a
=
new
HGSJ002A
();
HGSJ002A
h
gsj002
a
=
new
HGSJ002A
();
EiBlock
eiBlock
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
);
for
(
i
=
0
;
i
<
eiBlock
.
getRowCount
();
i
++)
{
Map
<?,
?>
map
=
eiBlock
.
getRow
(
i
);
h
psc013
a
.
fromMap
(
map
);
h
psc013
a
.
setDeleteFlag
(
CommonConstant
.
YesNo
.
YES_1
);
DaoUtils
.
update
(
HGSJ002A
.
DELETE_FLAG
,
h
psc013
a
);
h
gsj002
a
.
fromMap
(
map
);
h
gsj002
a
.
setDeleteFlag
(
CommonConstant
.
YesNo
.
YES_1
);
DaoUtils
.
update
(
HGSJ002A
.
DELETE_FLAG
,
h
gsj002
a
);
}
inInfo
.
setStatus
(
EiConstant
.
STATUS_SUCCESS
);
inInfo
.
setMsgByKey
(
"ep.1000"
,
new
String
[]{
String
.
valueOf
(
i
),
I18nMessages
.
getText
(
"label.delete"
,
"删除"
)});
...
...
@@ -83,16 +83,16 @@ public class ServiceHGSJ002A extends ServiceEPBase {
String
flowName
=
inInfo
.
getCellStr
(
EiConstant
.
queryBlock
,
ACConstants
.
ROW_CODE_0
,
HGSJ002A
.
FIELD_FLOW_NAME
);
// 写入数据
for
(
int
i
=
0
;
i
<
resultRows
.
size
();
i
++)
{
HGSJ002A
h
psc013
a
=
new
HGSJ002A
();
h
psc013
a
.
fromMap
(
resultRows
.
get
(
i
));
if
(
h
psc013a
.
getId
()
==
null
||
hpsc013
a
.
getId
()
==
0
)
{
h
psc013
a
.
setParendId
(
parendId
);
h
psc013
a
.
setFactoryCode
(
factoryCode
);
h
psc013
a
.
setFlowCode
(
flowCode
);
h
psc013
a
.
setFlowName
(
flowName
);
this
.
add
(
h
psc013
a
);
HGSJ002A
h
gsj002
a
=
new
HGSJ002A
();
h
gsj002
a
.
fromMap
(
resultRows
.
get
(
i
));
if
(
h
gsj002a
.
getId
()
==
null
||
hgsj002
a
.
getId
()
==
0
)
{
h
gsj002
a
.
setParendId
(
parendId
);
h
gsj002
a
.
setFactoryCode
(
factoryCode
);
h
gsj002
a
.
setFlowCode
(
flowCode
);
h
gsj002
a
.
setFlowName
(
flowName
);
this
.
add
(
h
gsj002
a
);
}
else
{
this
.
modify
(
h
psc013
a
);
this
.
modify
(
h
gsj002
a
);
}
}
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
...
...
@@ -106,14 +106,14 @@ public class ServiceHGSJ002A extends ServiceEPBase {
/**
* 新增操作
*/
public
void
add
(
HGSJ002A
h
psc013
a
)
{
DaoUtils
.
insert
(
HGSJ002A
.
INSERT
,
h
psc013
a
);
public
void
add
(
HGSJ002A
h
gsj002
a
)
{
DaoUtils
.
insert
(
HGSJ002A
.
INSERT
,
h
gsj002
a
);
}
/**
* 修改操作
*/
public
void
modify
(
HGSJ002A
h
psc013
a
)
{
DaoUtils
.
update
(
HGSJ002A
.
UPDATE
,
h
psc013
a
);
public
void
modify
(
HGSJ002A
h
gsj002
a
)
{
DaoUtils
.
update
(
HGSJ002A
.
UPDATE
,
h
gsj002
a
);
}
}
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