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
fc8ae48e
Commit
fc8ae48e
authored
Sep 23, 2024
by
宋祥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.报工数量支持小数位填写和计算
parent
a22f748f
Show whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
261 additions
and
194 deletions
+261
-194
ServiceHGKC003.java
.../java/com/baosight/hggp/hg/kc/service/ServiceHGKC003.java
+2
-2
HGKCTools.java
src/main/java/com/baosight/hggp/hg/kc/tools/HGKCTools.java
+9
-6
HGSC005A.java
src/main/java/com/baosight/hggp/hg/sc/domain/HGSC005A.java
+21
-12
HGSC006A.java
src/main/java/com/baosight/hggp/hg/sc/domain/HGSC006A.java
+21
-12
HGSC007.java
src/main/java/com/baosight/hggp/hg/sc/domain/HGSC007.java
+21
-12
HGSC008.java
src/main/java/com/baosight/hggp/hg/sc/domain/HGSC008.java
+22
-16
ServiceHGSC006A.java
...java/com/baosight/hggp/hg/sc/service/ServiceHGSC006A.java
+2
-2
ServiceHGSC006B.java
...java/com/baosight/hggp/hg/sc/service/ServiceHGSC006B.java
+22
-19
ServiceHGSC007A.java
...java/com/baosight/hggp/hg/sc/service/ServiceHGSC007A.java
+7
-5
HGSCTools.java
src/main/java/com/baosight/hggp/hg/sc/tools/HGSCTools.java
+76
-67
HGZL002.java
src/main/java/com/baosight/hggp/hg/zl/domain/HGZL002.java
+21
-12
ServiceHGZL002.java
.../java/com/baosight/hggp/hg/zl/service/ServiceHGZL002.java
+11
-7
HGZLTools.java
src/main/java/com/baosight/hggp/hg/zl/tools/HGZLTools.java
+3
-2
HGSC007.jsp
src/main/webapp/HG/SC/HGSC007.jsp
+1
-1
HGSC007A.js
src/main/webapp/HG/SC/HGSC007A.js
+10
-9
HGSC007A.jsp
src/main/webapp/HG/SC/HGSC007A.jsp
+1
-1
HGSC008.jsp
src/main/webapp/HG/SC/HGSC008.jsp
+1
-1
HGZL002.js
src/main/webapp/HG/ZL/HGZL002.js
+6
-5
HGZL002.jsp
src/main/webapp/HG/ZL/HGZL002.jsp
+4
-3
No files found.
src/main/java/com/baosight/hggp/hg/kc/service/ServiceHGKC003.java
View file @
fc8ae48e
...
...
@@ -156,7 +156,7 @@ public class ServiceHGKC003 extends ServiceBase {
this
.
checkSubmitData
(
dbKc003
);
DaoUtils
.
update
(
HGKC003
.
UPDATE_SUBMIT_STATUS
,
dbKc003
);
// 修改计划生产任务完工数量
HGSCTools
.
complete
(
dbKc003
.
getQualityId
(),
dbKc003
.
getInvQty
()
.
intValue
()
,
dbKc003
.
getRectificationId
(),
HGSCTools
.
complete
(
dbKc003
.
getQualityId
(),
dbKc003
.
getInvQty
(),
dbKc003
.
getRectificationId
(),
HGConstant
.
StorageType
.
RK
);
// 修改库存
HGKCUtils
.
HgKc010
.
updateInv
(
dbKc003
.
getCompanyCode
(),
dbKc003
.
getWhCode
(),
dbKc003
.
getPrdtCode
(),
...
...
@@ -247,7 +247,7 @@ public class ServiceHGKC003 extends ServiceBase {
newKc003
.
setIsReturn
(
CommonConstant
.
YesNo
.
YES_1
);
DaoUtils
.
insert
(
HGKC003
.
INSERT
,
newKc003
);
//修改计划生产任务完工数量
HGSCTools
.
complete
(
fKc003
.
getQualityId
(),
newKc003
.
getInvQty
()
.
intValue
()
,
fKc003
.
getRectificationId
(),
HGConstant
.
StorageType
.
TH
);
HGSCTools
.
complete
(
fKc003
.
getQualityId
(),
newKc003
.
getInvQty
(),
fKc003
.
getRectificationId
(),
HGConstant
.
StorageType
.
TH
);
// 修改库存
HGKCUtils
.
HgKc010
.
updateInv
(
newKc003
.
getCompanyCode
(),
newKc003
.
getWhCode
(),
newKc003
.
getPrdtCode
(),
newKc003
.
getInvQty
(),
newKc003
.
getInvWeight
());
...
...
src/main/java/com/baosight/hggp/hg/kc/tools/HGKCTools.java
View file @
fc8ae48e
...
...
@@ -290,7 +290,8 @@ public class HGKCTools {
AssertUtils
.
isEmpty
(
hgzl002
.
getProductCode
(),
"存货编码不能为空!"
);
AssertUtils
.
isEmpty
(
hgzl002
.
getProductName
(),
"存货名称不能为空!"
);
AssertUtils
.
isTrue
(
Objects
.
isNull
(
hgzl002
.
getId
())||
hgzl002
.
getId
()<=
0
,
"质检单明细ID不能为空!"
);
AssertUtils
.
isTrue
(
hgzl002
.
getPassQuantity
().
compareTo
(
0
)
==
0
&&
hgzl002
.
getUnpassQuantity
().
compareTo
(
0
)
==
0
,
"合格数量与不合格数量不能都为0!"
);
AssertUtils
.
isTrue
(
hgzl002
.
getPassQuantity
().
compareTo
(
BigDecimal
.
ZERO
)
==
0
&&
hgzl002
.
getUnpassQuantity
().
compareTo
(
BigDecimal
.
ZERO
)
==
0
,
"合格数量与不合格数量不能都为0!"
);
}
}
/**
...
...
@@ -310,7 +311,7 @@ public class HGKCTools {
List
<
HGPZ005A
>
hgpz005AList
=
HGPZTools
.
HgPz005A
.
queryByInventCodes
(
inventCodes
);
hgkc003List
.
forEach
(
hgkc003
->{
//修改计划生产任务完工数量
HGSCTools
.
complete
(
hgkc003
.
getQualityId
(),
hgkc003
.
getInvQty
()
.
intValue
()
,
hgkc003
.
getRectificationId
(),
HGConstant
.
StorageType
.
RK
);
HGSCTools
.
complete
(
hgkc003
.
getQualityId
(),
hgkc003
.
getInvQty
(),
hgkc003
.
getRectificationId
(),
HGConstant
.
StorageType
.
RK
);
//查询当前工序
HGPZ005A
hgpz005A
=
hgpz005AList
.
stream
().
filter
(
o
->
o
.
getId
().
equals
(
hgkc003
.
getInventProcessId
())).
findAny
().
orElse
(
null
);
AssertUtils
.
isNull
(
hgpz005A
,
"未获取到当前工序信息!"
);
...
...
@@ -345,11 +346,11 @@ public class HGKCTools {
if
(
Objects
.
nonNull
(
code
)){
HGZL004
hgzl004
=
hgzl004List
.
stream
().
filter
(
h
->
h
.
getCheckId
().
equals
(
o
.
getId
())).
findAny
().
orElse
(
null
);
//整改通知单
hgkc003
.
setInvQty
(
new
BigDecimal
(
o
.
getUnpassQuantity
()
));
hgkc003
.
setInvQty
(
o
.
getUnpassQuantity
(
));
hgkc003
.
setRectificationId
(
hgzl004
.
getId
());
}
else
{
//工序质检单
hgkc003
.
setInvQty
(
new
BigDecimal
(
o
.
getPassQuantity
()
));
hgkc003
.
setInvQty
(
o
.
getPassQuantity
(
));
}
if
(
hgkc003
.
getInvQty
().
compareTo
(
BigDecimal
.
ZERO
)
==
0
){
return
;
...
...
@@ -416,9 +417,11 @@ public class HGKCTools {
List
<
HGPZ005A
>
hgpz005AList
=
HGPZTools
.
HgPz005A
.
queryByInventCodes
(
inventCodes
);
hgkc003List
.
forEach
(
hgkc003
->{
//修改计划生产任务完工数量
HGSCTools
.
complete
(
hgkc003
.
getQualityId
(),
hgkc003
.
getInvQty
().
intValue
(),
hgkc003
.
getRectificationId
(),
HGConstant
.
StorageType
.
RK
);
HGSCTools
.
complete
(
hgkc003
.
getQualityId
(),
hgkc003
.
getInvQty
(),
hgkc003
.
getRectificationId
(),
HGConstant
.
StorageType
.
RK
);
//查询当前工序
HGPZ005A
hgpz005A
=
hgpz005AList
.
stream
().
filter
(
o
->
o
.
getInventCode
().
equals
(
hgkc003
.
getPrdtCode
())).
findAny
().
orElse
(
null
);
HGPZ005A
hgpz005A
=
hgpz005AList
.
stream
()
.
filter
(
o
->
o
.
getInventCode
().
equals
(
hgkc003
.
getPrdtCode
())).
findAny
().
orElse
(
null
);
//查询比当前工序靠后的工序是否存在,不存在说明是最后工序,修改实时库存
List
<
HGPZ005A
>
nextHgpz005AList
=
hgpz005AList
.
stream
().
filter
(
o
->
o
.
getProcessOrder
().
compareTo
(
hgpz005A
.
getProcessOrder
())
==
1
).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
nextHgpz005AList
)){
...
...
src/main/java/com/baosight/hggp/hg/sc/domain/HGSC005A.java
View file @
fc8ae48e
...
...
@@ -128,9 +128,9 @@ public class HGSC005A extends DaoEPBase {
private
String
finishDate
=
" "
;
/* 完工日期*/
private
String
planStartDate
=
" "
;
/* 计划开始日期*/
private
String
planEndDate
=
" "
;
/* 计划结束日期*/
private
Integer
quantity
=
new
Integer
(
0
);
/* 数量*/
private
Integer
finishQuantity
=
new
Integer
(
0
);
/* 完工数量*/
private
Integer
unfinishQuantity
=
new
Integer
(
0
);
/* 未完工数量*/
private
BigDecimal
quantity
=
new
BigDecimal
(
0
);
/* 数量*/
private
BigDecimal
finishQuantity
=
new
BigDecimal
(
0
);
/* 完工数量*/
private
BigDecimal
unfinishQuantity
=
new
BigDecimal
(
0
);
/* 未完工数量*/
private
BigDecimal
singleWeight
=
new
BigDecimal
(
"0"
);
/* 单重*/
private
BigDecimal
totalWeight
=
new
BigDecimal
(
"0"
);
/* 总重*/
private
BigDecimal
finishWeight
=
new
BigDecimal
(
"0"
);
/* 完工重量*/
...
...
@@ -250,14 +250,23 @@ public class HGSC005A extends DaoEPBase {
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_quantity
);
eiColumn
.
setType
(
"N"
);
eiColumn
.
setScaleLength
(
1
);
eiColumn
.
setFieldLength
(
20
);
eiColumn
.
setDescName
(
"数量"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_finish_quantity
);
eiColumn
.
setType
(
"N"
);
eiColumn
.
setScaleLength
(
1
);
eiColumn
.
setFieldLength
(
20
);
eiColumn
.
setDescName
(
"完工数量"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_unfinish_quantity
);
eiColumn
.
setType
(
"N"
);
eiColumn
.
setScaleLength
(
1
);
eiColumn
.
setFieldLength
(
20
);
eiColumn
.
setDescName
(
"未完工数量"
);
eiMetadata
.
addMeta
(
eiColumn
);
...
...
@@ -683,7 +692,7 @@ public class HGSC005A extends DaoEPBase {
* get the quantity - 数量.
* @return the quantity
*/
public
Integer
getQuantity
()
{
public
BigDecimal
getQuantity
()
{
return
this
.
quantity
;
}
...
...
@@ -692,14 +701,14 @@ public class HGSC005A extends DaoEPBase {
*
* @param quantity - 数量
*/
public
void
setQuantity
(
Integer
quantity
)
{
public
void
setQuantity
(
BigDecimal
quantity
)
{
this
.
quantity
=
quantity
;
}
/**
* get the finishQuantity - 完工数量.
* @return the finishQuantity
*/
public
Integer
getFinishQuantity
()
{
public
BigDecimal
getFinishQuantity
()
{
return
this
.
finishQuantity
;
}
...
...
@@ -708,14 +717,14 @@ public class HGSC005A extends DaoEPBase {
*
* @param finishQuantity - 完工数量
*/
public
void
setFinishQuantity
(
Integer
finishQuantity
)
{
public
void
setFinishQuantity
(
BigDecimal
finishQuantity
)
{
this
.
finishQuantity
=
finishQuantity
;
}
/**
* get the unfinishQuantity - 未完工数量.
* @return the unfinishQuantity
*/
public
Integer
getUnfinishQuantity
()
{
public
BigDecimal
getUnfinishQuantity
()
{
return
this
.
unfinishQuantity
;
}
...
...
@@ -724,7 +733,7 @@ public class HGSC005A extends DaoEPBase {
*
* @param unfinishQuantity - 未完工数量
*/
public
void
setUnfinishQuantity
(
Integer
unfinishQuantity
)
{
public
void
setUnfinishQuantity
(
BigDecimal
unfinishQuantity
)
{
this
.
unfinishQuantity
=
unfinishQuantity
;
}
/**
...
...
@@ -933,9 +942,9 @@ public class HGSC005A extends DaoEPBase {
setFinishDate
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_finish_date
)),
finishDate
));
setPlanStartDate
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_plan_start_date
)),
planStartDate
));
setPlanEndDate
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_plan_end_date
)),
planEndDate
));
setQuantity
(
NumberUtils
.
to
Integer
(
StringUtils
.
toString
(
map
.
get
(
FIELD_quantity
)),
quantity
));
setFinishQuantity
(
NumberUtils
.
to
Integer
(
StringUtils
.
toString
(
map
.
get
(
FIELD_finish_quantity
)),
finishQuantity
));
setUnfinishQuantity
(
NumberUtils
.
to
Integer
(
StringUtils
.
toString
(
map
.
get
(
FIELD_unfinish_quantity
)),
unfinishQuantity
));
setQuantity
(
NumberUtils
.
to
BigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_quantity
)),
quantity
));
setFinishQuantity
(
NumberUtils
.
to
BigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_finish_quantity
)),
finishQuantity
));
setUnfinishQuantity
(
NumberUtils
.
to
BigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_unfinish_quantity
)),
unfinishQuantity
));
setSingleWeight
(
NumberUtils
.
toBigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_single_weight
)),
singleWeight
));
setTotalWeight
(
NumberUtils
.
toBigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_total_weight
)),
totalWeight
));
setFinishWeight
(
NumberUtils
.
toBigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_finish_weight
)),
finishWeight
));
...
...
src/main/java/com/baosight/hggp/hg/sc/domain/HGSC006A.java
View file @
fc8ae48e
...
...
@@ -127,9 +127,9 @@ public class HGSC006A extends DaoEPBase {
private
String
productName
=
" "
;
/* 产品名称*/
private
String
planStartDate
=
" "
;
/* 计划开始日期*/
private
String
planEndDate
=
" "
;
/* 计划结束日期*/
private
Integer
quantity
=
new
Integer
(
0
);
/* 数量*/
private
Integer
assignQuantity
=
new
Integer
(
0
);
/* 派工数量*/
private
Integer
unassignQuantity
=
new
Integer
(
0
);
/* 未派工数量*/
private
BigDecimal
quantity
=
new
BigDecimal
(
0
);
/* 数量*/
private
BigDecimal
assignQuantity
=
new
BigDecimal
(
0
);
/* 派工数量*/
private
BigDecimal
unassignQuantity
=
new
BigDecimal
(
0
);
/* 未派工数量*/
private
BigDecimal
singleWeight
=
new
BigDecimal
(
"0"
);
/* 单重*/
private
BigDecimal
totalWeight
=
new
BigDecimal
(
"0"
);
/* 总重*/
private
BigDecimal
assignWeight
=
new
BigDecimal
(
"0"
);
/* 派工重量*/
...
...
@@ -235,14 +235,23 @@ public class HGSC006A extends DaoEPBase {
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_quantity
);
eiColumn
.
setType
(
"N"
);
eiColumn
.
setScaleLength
(
1
);
eiColumn
.
setFieldLength
(
20
);
eiColumn
.
setDescName
(
"数量"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_assign_quantity
);
eiColumn
.
setType
(
"N"
);
eiColumn
.
setScaleLength
(
1
);
eiColumn
.
setFieldLength
(
20
);
eiColumn
.
setDescName
(
"派工数量"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_unassign_quantity
);
eiColumn
.
setType
(
"N"
);
eiColumn
.
setScaleLength
(
1
);
eiColumn
.
setFieldLength
(
20
);
eiColumn
.
setDescName
(
"未派工数量"
);
eiMetadata
.
addMeta
(
eiColumn
);
...
...
@@ -656,7 +665,7 @@ public class HGSC006A extends DaoEPBase {
* get the quantity - 数量.
* @return the quantity
*/
public
Integer
getQuantity
()
{
public
BigDecimal
getQuantity
()
{
return
this
.
quantity
;
}
...
...
@@ -665,14 +674,14 @@ public class HGSC006A extends DaoEPBase {
*
* @param quantity - 数量
*/
public
void
setQuantity
(
Integer
quantity
)
{
public
void
setQuantity
(
BigDecimal
quantity
)
{
this
.
quantity
=
quantity
;
}
/**
* get the assignQuantity - 派工数量.
* @return the assignQuantity
*/
public
Integer
getAssignQuantity
()
{
public
BigDecimal
getAssignQuantity
()
{
return
this
.
assignQuantity
;
}
...
...
@@ -681,14 +690,14 @@ public class HGSC006A extends DaoEPBase {
*
* @param assignQuantity - 派工数量
*/
public
void
setAssignQuantity
(
Integer
assignQuantity
)
{
public
void
setAssignQuantity
(
BigDecimal
assignQuantity
)
{
this
.
assignQuantity
=
assignQuantity
;
}
/**
* get the unassignQuantity - 未派工数量.
* @return the unassignQuantity
*/
public
Integer
getUnassignQuantity
()
{
public
BigDecimal
getUnassignQuantity
()
{
return
this
.
unassignQuantity
;
}
...
...
@@ -697,7 +706,7 @@ public class HGSC006A extends DaoEPBase {
*
* @param unassignQuantity - 未派工数量
*/
public
void
setUnassignQuantity
(
Integer
unassignQuantity
)
{
public
void
setUnassignQuantity
(
BigDecimal
unassignQuantity
)
{
this
.
unassignQuantity
=
unassignQuantity
;
}
/**
...
...
@@ -921,9 +930,9 @@ public class HGSC006A extends DaoEPBase {
setProductName
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_product_name
)),
productName
));
setPlanStartDate
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_plan_start_date
)),
planStartDate
));
setPlanEndDate
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_plan_end_date
)),
planEndDate
));
setQuantity
(
NumberUtils
.
to
Integer
(
StringUtils
.
toString
(
map
.
get
(
FIELD_quantity
)),
quantity
));
setAssignQuantity
(
NumberUtils
.
to
Integer
(
StringUtils
.
toString
(
map
.
get
(
FIELD_assign_quantity
)),
assignQuantity
));
setUnassignQuantity
(
NumberUtils
.
to
Integer
(
StringUtils
.
toString
(
map
.
get
(
FIELD_unassign_quantity
)),
unassignQuantity
));
setQuantity
(
NumberUtils
.
to
BigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_quantity
)),
quantity
));
setAssignQuantity
(
NumberUtils
.
to
BigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_assign_quantity
)),
assignQuantity
));
setUnassignQuantity
(
NumberUtils
.
to
BigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_unassign_quantity
)),
unassignQuantity
));
setSingleWeight
(
NumberUtils
.
toBigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_single_weight
)),
singleWeight
));
setTotalWeight
(
NumberUtils
.
toBigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_total_weight
)),
totalWeight
));
setAssignWeight
(
NumberUtils
.
toBigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_assign_weight
)),
assignWeight
));
...
...
src/main/java/com/baosight/hggp/hg/sc/domain/HGSC007.java
View file @
fc8ae48e
...
...
@@ -152,9 +152,9 @@ public class HGSC007 extends DaoEPBase {
private
String
groupCode
=
" "
;
/* 工作组编号*/
private
String
groupName
=
" "
;
/* 工作组名称*/
private
String
completeDate
=
" "
;
/* 完工日期*/
private
Integer
quantity
=
new
Integer
(
0
);
/* 数量*/
private
Integer
finishQuantity
=
new
Integer
(
0
);
/* 完工数量*/
private
Integer
unfinishQuantity
=
new
Integer
(
0
);
/* 未完工数量*/
private
BigDecimal
quantity
=
new
BigDecimal
(
0
);
/* 数量*/
private
BigDecimal
finishQuantity
=
new
BigDecimal
(
0
);
/* 完工数量*/
private
BigDecimal
unfinishQuantity
=
new
BigDecimal
(
0
);
/* 未完工数量*/
private
BigDecimal
singleWeight
=
new
BigDecimal
(
"0"
);
/* 单重*/
private
BigDecimal
totalWeight
=
new
BigDecimal
(
"0"
);
/* 总重*/
private
BigDecimal
finishWeight
=
new
BigDecimal
(
"0"
);
/* 完工重量*/
...
...
@@ -289,14 +289,23 @@ public class HGSC007 extends DaoEPBase {
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_quantity
);
eiColumn
.
setType
(
"N"
);
eiColumn
.
setScaleLength
(
1
);
eiColumn
.
setFieldLength
(
20
);
eiColumn
.
setDescName
(
"数量"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_finish_quantity
);
eiColumn
.
setType
(
"N"
);
eiColumn
.
setScaleLength
(
1
);
eiColumn
.
setFieldLength
(
20
);
eiColumn
.
setDescName
(
"完工数量"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_unfinish_quantity
);
eiColumn
.
setType
(
"N"
);
eiColumn
.
setScaleLength
(
1
);
eiColumn
.
setFieldLength
(
20
);
eiColumn
.
setDescName
(
"未完工数量"
);
eiMetadata
.
addMeta
(
eiColumn
);
...
...
@@ -824,7 +833,7 @@ public class HGSC007 extends DaoEPBase {
* get the quantity - 数量.
* @return the quantity
*/
public
Integer
getQuantity
()
{
public
BigDecimal
getQuantity
()
{
return
this
.
quantity
;
}
...
...
@@ -833,14 +842,14 @@ public class HGSC007 extends DaoEPBase {
*
* @param quantity - 数量
*/
public
void
setQuantity
(
Integer
quantity
)
{
public
void
setQuantity
(
BigDecimal
quantity
)
{
this
.
quantity
=
quantity
;
}
/**
* get the finishQuantity - 完工数量.
* @return the finishQuantity
*/
public
Integer
getFinishQuantity
()
{
public
BigDecimal
getFinishQuantity
()
{
return
this
.
finishQuantity
;
}
...
...
@@ -849,14 +858,14 @@ public class HGSC007 extends DaoEPBase {
*
* @param finishQuantity - 完工数量
*/
public
void
setFinishQuantity
(
Integer
finishQuantity
)
{
public
void
setFinishQuantity
(
BigDecimal
finishQuantity
)
{
this
.
finishQuantity
=
finishQuantity
;
}
/**
* get the unfinishQuantity - 未完工数量.
* @return the unfinishQuantity
*/
public
Integer
getUnfinishQuantity
()
{
public
BigDecimal
getUnfinishQuantity
()
{
return
this
.
unfinishQuantity
;
}
...
...
@@ -865,7 +874,7 @@ public class HGSC007 extends DaoEPBase {
*
* @param unfinishQuantity - 未完工数量
*/
public
void
setUnfinishQuantity
(
Integer
unfinishQuantity
)
{
public
void
setUnfinishQuantity
(
BigDecimal
unfinishQuantity
)
{
this
.
unfinishQuantity
=
unfinishQuantity
;
}
/**
...
...
@@ -1120,9 +1129,9 @@ public class HGSC007 extends DaoEPBase {
setGroupCode
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_group_code
)),
groupCode
));
setGroupName
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_group_name
)),
groupName
));
setCompleteDate
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_complete_date
)),
completeDate
));
setQuantity
(
NumberUtils
.
to
Integer
(
StringUtils
.
toString
(
map
.
get
(
FIELD_quantity
)),
quantity
));
setFinishQuantity
(
NumberUtils
.
to
Integer
(
StringUtils
.
toString
(
map
.
get
(
FIELD_finish_quantity
)),
finishQuantity
));
setUnfinishQuantity
(
NumberUtils
.
to
Integer
(
StringUtils
.
toString
(
map
.
get
(
FIELD_unfinish_quantity
)),
unfinishQuantity
));
setQuantity
(
NumberUtils
.
to
BigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_quantity
)),
quantity
));
setFinishQuantity
(
NumberUtils
.
to
BigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_finish_quantity
)),
finishQuantity
));
setUnfinishQuantity
(
NumberUtils
.
to
BigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_unfinish_quantity
)),
unfinishQuantity
));
setSingleWeight
(
NumberUtils
.
toBigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_single_weight
)),
singleWeight
));
setTotalWeight
(
NumberUtils
.
toBigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_total_weight
)),
totalWeight
));
setFinishWeight
(
NumberUtils
.
toBigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_finish_weight
)),
finishWeight
));
...
...
src/main/java/com/baosight/hggp/hg/sc/domain/HGSC008.java
View file @
fc8ae48e
...
...
@@ -142,7 +142,7 @@ public class HGSC008 extends DaoEPBase {
private
String
groupCode
=
" "
;
/* 工作组编号*/
private
String
groupName
=
" "
;
/* 工作组名称*/
private
String
registerDate
=
" "
;
/* 报工日期*/
private
Integer
quantity
=
new
Integer
(
0
);
/* 数量*/
private
BigDecimal
quantity
=
new
BigDecimal
(
0
);
/* 数量*/
private
BigDecimal
singleWeight
=
new
BigDecimal
(
"0"
);
/* 单重*/
private
BigDecimal
totalWeight
=
new
BigDecimal
(
"0"
);
/* 总重*/
private
String
accountCode
=
" "
;
/* 帐套*/
...
...
@@ -158,18 +158,18 @@ public class HGSC008 extends DaoEPBase {
//补充字段
private
Integer
registeredQuantity
=
new
Integer
(
0
);
private
BigDecimal
registeredQuantity
=
new
BigDecimal
(
0
);
private
BigDecimal
registeredWeight
=
new
BigDecimal
(
0
);
private
Integer
unregisterQuantity
=
new
Integer
(
0
);
private
BigDecimal
unregisterQuantity
=
new
BigDecimal
(
0
);
private
BigDecimal
unregisterWeight
=
new
BigDecimal
(
0
);
private
Integer
taskQuantity
=
new
Integer
(
0
);
private
BigDecimal
taskQuantity
=
new
BigDecimal
(
0
);
private
BigDecimal
taskWeight
=
new
BigDecimal
(
0
);
public
Integer
getRegisteredQuantity
()
{
public
BigDecimal
getRegisteredQuantity
()
{
return
registeredQuantity
;
}
public
void
setRegisteredQuantity
(
Integer
registeredQuantity
)
{
public
void
setRegisteredQuantity
(
BigDecimal
registeredQuantity
)
{
this
.
registeredQuantity
=
registeredQuantity
;
}
...
...
@@ -181,11 +181,11 @@ public class HGSC008 extends DaoEPBase {
this
.
registeredWeight
=
registeredWeight
;
}
public
Integer
getUnregisterQuantity
()
{
public
BigDecimal
getUnregisterQuantity
()
{
return
unregisterQuantity
;
}
public
void
setUnregisterQuantity
(
Integer
unregisterQuantity
)
{
public
void
setUnregisterQuantity
(
BigDecimal
unregisterQuantity
)
{
this
.
unregisterQuantity
=
unregisterQuantity
;
}
...
...
@@ -197,11 +197,11 @@ public class HGSC008 extends DaoEPBase {
this
.
unregisterWeight
=
unregisterWeight
;
}
public
Integer
getTaskQuantity
()
{
public
BigDecimal
getTaskQuantity
()
{
return
taskQuantity
;
}
public
void
setTaskQuantity
(
Integer
taskQuantity
)
{
public
void
setTaskQuantity
(
BigDecimal
taskQuantity
)
{
this
.
taskQuantity
=
taskQuantity
;
}
...
...
@@ -325,6 +325,9 @@ public class HGSC008 extends DaoEPBase {
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_quantity
);
eiColumn
.
setType
(
"N"
);
eiColumn
.
setScaleLength
(
1
);
eiColumn
.
setFieldLength
(
20
);
eiColumn
.
setDescName
(
"数量"
);
eiMetadata
.
addMeta
(
eiColumn
);
...
...
@@ -393,6 +396,9 @@ public class HGSC008 extends DaoEPBase {
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_task_quantity
);
eiColumn
.
setType
(
"N"
);
eiColumn
.
setScaleLength
(
1
);
eiColumn
.
setFieldLength
(
20
);
eiColumn
.
setDescName
(
"任务数量"
);
eiMetadata
.
addMeta
(
eiColumn
);
...
...
@@ -852,7 +858,7 @@ public class HGSC008 extends DaoEPBase {
* get the quantity - 数量.
* @return the quantity
*/
public
Integer
getQuantity
()
{
public
BigDecimal
getQuantity
()
{
return
this
.
quantity
;
}
...
...
@@ -861,7 +867,7 @@ public class HGSC008 extends DaoEPBase {
*
* @param quantity - 数量
*/
public
void
setQuantity
(
Integer
quantity
)
{
public
void
setQuantity
(
BigDecimal
quantity
)
{
this
.
quantity
=
quantity
;
}
/**
...
...
@@ -1067,7 +1073,7 @@ public class HGSC008 extends DaoEPBase {
setGroupCode
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_group_code
)),
groupCode
));
setGroupName
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_group_name
)),
groupName
));
setRegisterDate
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_register_date
)),
registerDate
));
setQuantity
(
NumberUtils
.
to
Integer
(
StringUtils
.
toString
(
map
.
get
(
FIELD_quantity
)),
quantity
));
setQuantity
(
NumberUtils
.
to
BigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_quantity
)),
quantity
));
setSingleWeight
(
NumberUtils
.
toBigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_single_weight
)),
singleWeight
));
setTotalWeight
(
NumberUtils
.
toBigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_total_weight
)),
totalWeight
));
setAccountCode
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_account_code
)),
accountCode
));
...
...
@@ -1078,11 +1084,11 @@ public class HGSC008 extends DaoEPBase {
setUpdatedName
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_updated_name
)),
updatedName
));
setUpdatedTime
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_updated_time
)),
updatedTime
));
setRegisteredQuantity
(
NumberUtils
.
to
Integer
(
StringUtils
.
toString
(
map
.
get
(
FIELD_registered_quantity
)),
registeredQuantity
));
setRegisteredQuantity
(
NumberUtils
.
to
BigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_registered_quantity
)),
registeredQuantity
));
setRegisteredWeight
(
NumberUtils
.
toBigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_registered_weight
)),
registeredWeight
));
setUnregisterQuantity
(
NumberUtils
.
to
Integer
(
StringUtils
.
toString
(
map
.
get
(
FIELD_unregister_quantity
)),
unregisterQuantity
));
setUnregisterQuantity
(
NumberUtils
.
to
BigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_unregister_quantity
)),
unregisterQuantity
));
setUnregisterWeight
(
NumberUtils
.
toBigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_unregister_weight
)),
unregisterWeight
));
setTaskQuantity
(
NumberUtils
.
to
Integer
(
StringUtils
.
toString
(
map
.
get
(
FIELD_task_quantity
)),
taskQuantity
));
setTaskQuantity
(
NumberUtils
.
to
BigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_task_quantity
)),
taskQuantity
));
setTaskWeight
(
NumberUtils
.
toBigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_task_weight
)),
taskWeight
));
setSpec
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_spec
)),
spec
));
setLength
(
NumberUtils
.
toBigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_length
)),
length
));
...
...
src/main/java/com/baosight/hggp/hg/sc/service/ServiceHGSC006A.java
View file @
fc8ae48e
...
...
@@ -81,7 +81,7 @@ public class ServiceHGSC006A extends ServiceBase {
// 校验主订单是否已分派
//HGSC006A hgsc006A = HGSCTools.THGSC006A.getById(Long.parseLong(orderDetailId));
AssignStatusEnum
assignStatusEnum
=
AssignStatusEnum
.
getEnumByCode
(
hgsc006A
.
getAssignStatus
());
Integer
assignQuantity
=
new
Integer
(
0
)
;
BigDecimal
assignQuantity
=
BigDecimal
.
ZERO
;
switch
(
assignStatusEnum
){
case
UNASSIGN:
assignQuantity
=
hgsc006A
.
getQuantity
();
...
...
@@ -112,7 +112,7 @@ public class ServiceHGSC006A extends ServiceBase {
hgsc007
.
setOrderDetailId
(
hgsc006A
.
getId
());
hgsc007
.
setQuantity
(
assignQuantity
);
hgsc007
.
setUnfinishQuantity
(
assignQuantity
);
hgsc007
.
setTotalWeight
(
hgsc006A
.
getSingleWeight
().
multiply
(
new
BigDecimal
(
assignQuantity
)
));
hgsc007
.
setTotalWeight
(
hgsc006A
.
getSingleWeight
().
multiply
(
assignQuantity
));
hgsc007
.
setUnfinishWeight
(
hgsc007
.
getTotalWeight
());
hgsc007
.
setGroupCode
(
groupCode
);
hgsc007
.
setGroupName
(
groupName
);
...
...
src/main/java/com/baosight/hggp/hg/sc/service/ServiceHGSC006B.java
View file @
fc8ae48e
...
...
@@ -165,8 +165,8 @@ public class ServiceHGSC006B extends ServiceBase {
List
<
HGSC007
>
hgsc007s
=
MapUtils
.
toDaoEPBases
(
resultRows
,
HGSC007
.
class
);
// 判断数量是否超过订单数量
Integer
totalNum
=
hgsc007s
.
stream
().
mapToInt
(
HGSC007:
:
getQuantity
).
sum
(
);
AssertUtils
.
isGt
(
new
BigDecimal
(
totalNum
),
new
BigDecimal
(
hgsc006A
.
getQuantity
()
),
"拆单的分派数量不能大于生产订单数量!"
);
BigDecimal
totalNum
=
hgsc007s
.
stream
().
map
(
HGSC007:
:
getQuantity
).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
AssertUtils
.
isGt
(
totalNum
,
hgsc006A
.
getQuantity
(
),
"拆单的分派数量不能大于生产订单数量!"
);
// 查询任务信息
List
<
HGSC007
>
hgsc007List
=
HGSCTools
.
THGSC007
.
list
(
taskIds
);
//查询生产报工
...
...
@@ -219,7 +219,7 @@ public class ServiceHGSC006B extends ServiceBase {
add007
.
setOrderDetailId
(
hgsc006A
.
getId
());
add007
.
setQuantity
(
hgsc007
.
getQuantity
());
add007
.
setUnfinishQuantity
(
hgsc007
.
getQuantity
());
add007
.
setTotalWeight
(
hgsc006A
.
getSingleWeight
().
multiply
(
new
BigDecimal
(
hgsc007
.
getQuantity
()
)));
add007
.
setTotalWeight
(
hgsc006A
.
getSingleWeight
().
multiply
(
hgsc007
.
getQuantity
(
)));
add007
.
setUnfinishWeight
(
add007
.
getTotalWeight
());
add007
.
setGroupCode
(
hgsc007
.
getGroupCode
());
add007
.
setGroupName
(
hgsc007
.
getGroupName
());
...
...
@@ -271,7 +271,7 @@ public class ServiceHGSC006B extends ServiceBase {
sc007
.
setFactoryName
(
hgsc007
.
getFactoryName
());
sc007
.
setQuantity
(
hgsc007
.
getQuantity
());
sc007
.
setUnfinishQuantity
(
hgsc007
.
getQuantity
());
sc007
.
setTotalWeight
(
sc007
.
getSingleWeight
().
multiply
(
new
BigDecimal
(
hgsc007
.
getQuantity
()
)));
sc007
.
setTotalWeight
(
sc007
.
getSingleWeight
().
multiply
(
hgsc007
.
getQuantity
(
)));
sc007
.
setUnfinishWeight
(
sc007
.
getTotalWeight
());
DaoUtils
.
update
(
HGSC007
.
UPDATE
,
sc007
);
...
...
@@ -296,10 +296,10 @@ public class ServiceHGSC006B extends ServiceBase {
HGSC007
hgsc007
=
new
HGSC007
();
hgsc007
.
fromMap
(
resultRow
);
HGSC007
dbsc007
=
HGSCTools
.
THGSC007
.
getById
(
hgsc007
.
getId
());
AssertUtils
.
isGt
(
new
BigDecimal
(
dbsc007
.
getFinishQuantity
()
),
BigDecimal
.
ZERO
,
AssertUtils
.
isGt
(
dbsc007
.
getFinishQuantity
(
),
BigDecimal
.
ZERO
,
String
.
format
(
"任务[%s]已存在完工数量不能删除"
,
dbsc007
.
getTaskCode
()));
// 更新订单主表数量
HGSCTools
.
checkAssignedNum
(
orderDetailId
,
-
hgsc007
.
getQuantity
());
HGSCTools
.
checkAssignedNum
(
orderDetailId
,
hgsc007
.
getQuantity
().
negate
());
// 删除子单
DaoUtils
.
update
(
HGSC007
.
DELETE
,
hgsc007
);
// 清除已经分配的人员信息
...
...
@@ -335,24 +335,24 @@ public class ServiceHGSC006B extends ServiceBase {
* @param hgsc006A 生产订单明细
* @param totalNum 任务数量
*/
public
void
checkAssignedNum
(
HGSC006A
hgsc006A
,
Integer
totalNum
)
{
public
void
checkAssignedNum
(
HGSC006A
hgsc006A
,
BigDecimal
totalNum
)
{
// 生产订单
//HGSC006A hgsc006A = HGSCTools.THGSC006A.getById(orderDetailId);
Integer
jhNum
=
hgsc006A
.
getQuantity
();
BigDecimal
jhNum
=
hgsc006A
.
getQuantity
();
Map
updateMap
=
new
HashMap
<>();
updateMap
.
put
(
HGSC006A
.
FIELD_id
,
hgsc006A
.
getId
());
updateMap
.
put
(
HGSC006A
.
FIELD_assign_quantity
,
totalNum
);
updateMap
.
put
(
HGSC006A
.
FIELD_unassign_quantity
,
jhNum
-
totalNum
);
updateMap
.
put
(
HGSC006A
.
FIELD_unassign_quantity
,
jhNum
.
subtract
(
totalNum
)
);
if
(
Objects
.
nonNull
(
hgsc006A
.
getSingleWeight
())&&
hgsc006A
.
getSingleWeight
().
compareTo
(
BigDecimal
.
ZERO
)>
0
)
{
BigDecimal
assignWeight
=
hgsc006A
.
getSingleWeight
().
multiply
(
new
BigDecimal
(
totalNum
)
);
BigDecimal
assignWeight
=
hgsc006A
.
getSingleWeight
().
multiply
(
totalNum
);
updateMap
.
put
(
HGSC006A
.
FIELD_assign_weight
,
assignWeight
);
updateMap
.
put
(
HGSC006A
.
FIELD_unassign_weight
,
hgsc006A
.
getTotalWeight
().
subtract
(
assignWeight
));
}
// 0.未派工,1.部分派工,2.全部派工
AssignStatusEnum
orderDetailAssignStatus
;
if
(
jhNum
-
totalNum
==
0
)
{
AssignStatusEnum
orderDetailAssignStatus
;
if
(
jhNum
.
subtract
(
totalNum
).
compareTo
(
BigDecimal
.
ZERO
)
==
0
)
{
orderDetailAssignStatus
=
AssignStatusEnum
.
ASSIGNED
;
}
else
if
(
totalNum
>
0
)
{
}
else
if
(
totalNum
.
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
orderDetailAssignStatus
=
AssignStatusEnum
.
PARTIAL_ASSIGN
;
}
else
{
orderDetailAssignStatus
=
AssignStatusEnum
.
UNASSIGN
;
...
...
@@ -364,13 +364,16 @@ public class ServiceHGSC006B extends ServiceBase {
private
void
handleOrderAssignStatus
(
HGSC006A
hgsc006A
,
AssignStatusEnum
orderDetailAssignStatus
){
List
<
HGSC006A
>
otherSc006AList
=
HGSCTools
.
THGSC006A
.
otherById
(
hgsc006A
.
getOrderCode
(),
hgsc006A
.
getId
());
int
assignQuantity
=
0
;
int
unassignQuantity
=
0
;
int
totalQuantity
=
0
;
BigDecimal
assignQuantity
=
BigDecimal
.
ZERO
;
BigDecimal
unassignQuantity
=
BigDecimal
.
ZERO
;
BigDecimal
totalQuantity
=
BigDecimal
.
ZERO
;
if
(
CollectionUtils
.
isNotEmpty
(
otherSc006AList
)){
assignQuantity
=
otherSc006AList
.
stream
().
mapToInt
(
HGSC006A:
:
getAssignQuantity
).
sum
();
unassignQuantity
=
otherSc006AList
.
stream
().
mapToInt
(
HGSC006A:
:
getUnassignQuantity
).
sum
();
totalQuantity
=
otherSc006AList
.
stream
().
mapToInt
(
HGSC006A:
:
getQuantity
).
sum
();
assignQuantity
=
otherSc006AList
.
stream
().
map
(
HGSC006A:
:
getAssignQuantity
)
.
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
unassignQuantity
=
otherSc006AList
.
stream
().
map
(
HGSC006A:
:
getUnassignQuantity
)
.
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
totalQuantity
=
otherSc006AList
.
stream
().
map
(
HGSC006A:
:
getQuantity
)
.
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
}
AssignStatusEnum
orderAssignStatus
;
switch
(
orderDetailAssignStatus
){
...
...
src/main/java/com/baosight/hggp/hg/sc/service/ServiceHGSC007A.java
View file @
fc8ae48e
...
...
@@ -48,9 +48,11 @@ public class ServiceHGSC007A extends ServiceEPBase {
hgsc008
.
setTaskId
(
hgsc007
.
getId
());
hgsc008
.
setTaskQuantity
(
hgsc007
.
getQuantity
());
hgsc008
.
setTaskWeight
(
hgsc007
.
getTotalWeight
());
hgsc008
.
setRegisteredQuantity
(
Optional
.
ofNullable
(
old008List
).
orElse
(
new
ArrayList
<>()).
stream
().
mapToInt
(
HGSC008:
:
getQuantity
).
sum
());
hgsc008
.
setRegisteredWeight
(
Optional
.
ofNullable
(
old008List
).
orElse
(
new
ArrayList
<>()).
stream
().
map
(
HGSC008:
:
getTotalWeight
).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
));
hgsc008
.
setUnregisterQuantity
(
hgsc007
.
getQuantity
()
-
hgsc008
.
getRegisteredQuantity
());
hgsc008
.
setRegisteredQuantity
(
Optional
.
ofNullable
(
old008List
).
orElse
(
new
ArrayList
<>()).
stream
()
.
map
(
HGSC008:
:
getQuantity
).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
));
hgsc008
.
setRegisteredWeight
(
Optional
.
ofNullable
(
old008List
).
orElse
(
new
ArrayList
<>()).
stream
()
.
map
(
HGSC008:
:
getTotalWeight
).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
));
hgsc008
.
setUnregisterQuantity
(
hgsc007
.
getQuantity
().
subtract
(
hgsc008
.
getRegisteredQuantity
()));
hgsc008
.
setUnregisterWeight
(
hgsc007
.
getTotalWeight
().
subtract
(
hgsc008
.
getRegisteredWeight
()));
hgsc008
.
setRegisterDate
(
DateUtil
.
toDateStr
(
new
Date
(),
DateUtil
.
DATE10_PATTERN
));
hgsc008
.
setQuantity
(
null
);
...
...
@@ -67,8 +69,8 @@ public class ServiceHGSC007A extends ServiceEPBase {
public
EiInfo
save
(
EiInfo
inInfo
)
{
try
{
Map
resultMap
=
EiInfoUtils
.
getFirstRow
(
inInfo
,
EiConstant
.
resultBlock
);
HGSC008
hgsc008
=
HGSCTools
.
THGSC008
.
add
(
inInfo
);
String
docId
=
org
.
apache
.
commons
.
collections
.
MapUtils
.
getString
(
resultMap
,
HGSB004A
.
FIELD_DOC_ID
);
HGSC008
hgsc008
=
HGSCTools
.
THGSC008
.
add
(
inInfo
);
String
docId
=
MapUtils
.
getString
(
resultMap
,
HGSB004A
.
FIELD_DOC_ID
);
if
(
StringUtils
.
isNotEmpty
(
docId
))
{
String
[]
docIds
=
docId
.
split
(
","
);
for
(
String
docIdStr
:
docIds
){
...
...
src/main/java/com/baosight/hggp/hg/sc/tools/HGSCTools.java
View file @
fc8ae48e
...
...
@@ -44,6 +44,7 @@ import com.baosight.hggp.util.DateUtil;
import
com.baosight.hggp.util.DateUtils
;
import
com.baosight.hggp.util.EiInfoUtils
;
import
com.baosight.hggp.util.FileUtils
;
import
com.baosight.hggp.util.MapUtils
;
import
com.baosight.hggp.util.ObjectUtils
;
import
com.baosight.iplat4j.core.ProjectInfo
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
...
...
@@ -52,7 +53,6 @@ import com.baosight.iplat4j.core.exception.PlatException;
import
com.baosight.iplat4j.core.util.NumberUtils
;
import
com.baosight.iplat4j.ed.util.SequenceGenerator
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.MapUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
java.math.BigDecimal
;
...
...
@@ -90,36 +90,36 @@ public class HGSCTools {
* @param orderDetailId 生产订单编码
* @param assignNum 分派数量
*/
public
static
void
checkAssignedNum
(
Long
orderDetailId
,
Integer
assignNum
)
{
public
static
void
checkAssignedNum
(
Long
orderDetailId
,
BigDecimal
assignNum
)
{
// 生产订单
HGSC006A
hgsc006A
=
HGSCTools
.
THGSC006A
.
getById
(
orderDetailId
);
Integer
jhNum
=
hgsc006A
.
getQuantity
();
BigDecimal
jhNum
=
hgsc006A
.
getQuantity
();
// 子单
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
HGSC007
.
FIELD_order_detail_id
,
orderDetailId
);
List
<
HGSC007
>
hgsc007List
=
DaoBase
.
getInstance
().
query
(
HGSC007
.
QUERY
,
queryMap
,
0
,
-
999999
);
Integer
totalNum
=
assignNum
;
BigDecimal
totalNum
=
assignNum
;
if
(
CollectionUtils
.
isNotEmpty
(
hgsc007List
)){
for
(
HGSC007
dbsc007
:
hgsc007List
){
totalNum
=
totalNum
+
dbsc007
.
getQuantity
(
);
totalNum
=
totalNum
.
add
(
dbsc007
.
getQuantity
()
);
}
}
// 判断数量是否超过订单数量
AssertUtils
.
isGt
(
new
BigDecimal
(
totalNum
),
new
BigDecimal
(
jhNum
)
,
"拆单的分派数量不能大于生产订单数量!"
);
AssertUtils
.
isGt
(
totalNum
,
jhNum
,
"拆单的分派数量不能大于生产订单数量!"
);
Map
updateMap
=
new
HashMap
();
updateMap
.
put
(
HGSC006A
.
FIELD_id
,
hgsc006A
.
getId
());
updateMap
.
put
(
HGSC006A
.
FIELD_assign_quantity
,
totalNum
);
updateMap
.
put
(
HGSC006A
.
FIELD_unassign_quantity
,
jhNum
-
totalNum
);
updateMap
.
put
(
HGSC006A
.
FIELD_unassign_quantity
,
jhNum
.
subtract
(
totalNum
)
);
if
(
Objects
.
nonNull
(
hgsc006A
.
getSingleWeight
())&&
hgsc006A
.
getSingleWeight
().
compareTo
(
BigDecimal
.
ZERO
)>
0
)
{
BigDecimal
assignWeight
=
hgsc006A
.
getSingleWeight
().
multiply
(
new
BigDecimal
(
totalNum
)
);
BigDecimal
assignWeight
=
hgsc006A
.
getSingleWeight
().
multiply
(
totalNum
);
updateMap
.
put
(
HGSC006A
.
FIELD_assign_weight
,
assignWeight
);
updateMap
.
put
(
HGSC006A
.
FIELD_unassign_weight
,
hgsc006A
.
getTotalWeight
().
subtract
(
assignWeight
));
}
// 0.未派工,1.部分派工,2.全部派工
AssignStatusEnum
orderDetailAssignStatus
;
if
(
jhNum
-
totalNum
==
0
)
{
AssignStatusEnum
orderDetailAssignStatus
;
if
(
jhNum
.
subtract
(
totalNum
).
compareTo
(
BigDecimal
.
ZERO
)
==
0
)
{
orderDetailAssignStatus
=
ASSIGNED
;
}
else
if
(
totalNum
>
0
)
{
}
else
if
(
totalNum
.
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
orderDetailAssignStatus
=
PARTIAL_ASSIGN
;
}
else
{
orderDetailAssignStatus
=
UNASSIGN
;
...
...
@@ -131,13 +131,16 @@ public class HGSCTools {
private
static
void
handleOrderAssignStatus
(
HGSC006A
hgsc006A
,
AssignStatusEnum
orderDetailAssignStatus
){
List
<
HGSC006A
>
otherSc006AList
=
HGSCTools
.
THGSC006A
.
otherById
(
hgsc006A
.
getOrderCode
(),
hgsc006A
.
getId
());
int
assignQuantity
=
0
;
int
unassignQuantity
=
0
;
int
totalQuantity
=
0
;
BigDecimal
assignQuantity
=
BigDecimal
.
ZERO
;
BigDecimal
unassignQuantity
=
BigDecimal
.
ZERO
;
BigDecimal
totalQuantity
=
BigDecimal
.
ZERO
;
if
(
CollectionUtils
.
isNotEmpty
(
otherSc006AList
)){
assignQuantity
=
otherSc006AList
.
stream
().
mapToInt
(
HGSC006A:
:
getAssignQuantity
).
sum
();
unassignQuantity
=
otherSc006AList
.
stream
().
mapToInt
(
HGSC006A:
:
getUnassignQuantity
).
sum
();
totalQuantity
=
otherSc006AList
.
stream
().
mapToInt
(
HGSC006A:
:
getQuantity
).
sum
();
assignQuantity
=
otherSc006AList
.
stream
().
map
(
HGSC006A:
:
getAssignQuantity
)
.
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
unassignQuantity
=
otherSc006AList
.
stream
().
map
(
HGSC006A:
:
getUnassignQuantity
)
.
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
totalQuantity
=
otherSc006AList
.
stream
().
map
(
HGSC006A:
:
getQuantity
)
.
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
}
AssignStatusEnum
orderAssignStatus
;
switch
(
orderDetailAssignStatus
){
...
...
@@ -168,7 +171,7 @@ public class HGSCTools {
}
public
static
void
complete
(
Long
checkId
,
Integer
completeNum
,
Long
rectificationId
,
Integer
storageType
){
public
static
void
complete
(
Long
checkId
,
BigDecimal
completeNum
,
Long
rectificationId
,
Integer
storageType
){
HGZL002
hgzl002
=
HGZLTools
.
THGZL002
.
get
(
checkId
);
//如果是退回,需要修改整改通知单状态,工序质检单状态
if
(
storageType
.
intValue
()
==
HGConstant
.
StorageType
.
TH
){
...
...
@@ -187,26 +190,25 @@ public class HGSCTools {
HGSC008
hgsc008
=
THGSC008
.
getById
(
hgzl002
.
getWorkId
());
HGSC007
hgsc007
=
THGSC007
.
getById
(
hgsc008
.
getTaskId
());
//更新生产任务完工数量
Integer
finishQuatity
=
hgsc007
.
getFinishQuantity
()+
completeNum
;
// AssertUtils.isTrue(hgsc007.getQuantity().compareTo(finishQuatity)<0,"完工数量加已完工数量不能大于任务数量!");
AssertUtils
.
isTrue
(
finishQuatity
<
0
,
"扣除完工数量不能大于已完工数量!"
);
BigDecimal
finishQuatity
=
hgsc007
.
getFinishQuantity
().
add
(
completeNum
);
AssertUtils
.
isTrue
(
finishQuatity
.
compareTo
(
BigDecimal
.
ZERO
)
<
0
,
"扣除完工数量不能大于已完工数量!"
);
hgsc007
.
setFinishQuantity
(
finishQuatity
);
hgsc007
.
setUnfinishQuantity
(
hgsc007
.
getQuantity
()
-
finishQuatity
);
hgsc007
.
setFinishWeight
(
hgsc007
.
getSingleWeight
().
multiply
(
new
BigDecimal
(
finishQuatity
)
));
hgsc007
.
setUnfinishWeight
(
hgsc007
.
getSingleWeight
().
multiply
(
new
BigDecimal
(
hgsc007
.
getUnfinishQuantity
()
)));
if
(
hgsc007
.
getUnfinishQuantity
()==
0
)
{
hgsc007
.
setCompleteDate
(
DateUtil
.
toDateStr
(
new
Date
(),
DateUtil
.
DATE10_PATTERN
));
hgsc007
.
setUnfinishQuantity
(
hgsc007
.
getQuantity
()
.
subtract
(
finishQuatity
)
);
hgsc007
.
setFinishWeight
(
hgsc007
.
getSingleWeight
().
multiply
(
finishQuatity
));
hgsc007
.
setUnfinishWeight
(
hgsc007
.
getSingleWeight
().
multiply
(
hgsc007
.
getUnfinishQuantity
(
)));
if
(
hgsc007
.
getUnfinishQuantity
().
compareTo
(
BigDecimal
.
ZERO
)
==
0
)
{
hgsc007
.
setCompleteDate
(
DateUtil
.
toDateStr
(
new
Date
(),
DateUtil
.
DATE10_PATTERN
));
}
DaoUtils
.
update
(
HGSC007
.
UPDATE
,
hgsc007
);
HGSC006A
hgsc006A
=
THGSC006A
.
getById
(
hgsc007
.
getOrderDetailId
());
HGSC005A
hgsc005A
=
THGSC005A
.
getById
(
hgsc006A
.
getPlanDetailId
());
finishQuatity
=
hgsc005A
.
getFinishQuantity
()+
completeNum
;
finishQuatity
=
hgsc005A
.
getFinishQuantity
().
add
(
completeNum
)
;
// AssertUtils.isTrue(hgsc005A.getQuantity().compareTo(finishQuatity)<0,"完工数量加已完工数量不能大于任务数量!");
AssertUtils
.
isTrue
(
finishQuatity
<
0
,
"扣除完工数量不能大于已完工数量!"
);
AssertUtils
.
isTrue
(
finishQuatity
.
compareTo
(
BigDecimal
.
ZERO
)
<
0
,
"扣除完工数量不能大于已完工数量!"
);
hgsc005A
.
setFinishQuantity
(
finishQuatity
);
hgsc005A
.
setUnfinishQuantity
(
hgsc005A
.
getQuantity
()
-
finishQuatity
);
hgsc005A
.
setFinishWeight
(
hgsc005A
.
getSingleWeight
().
multiply
(
new
BigDecimal
(
finishQuatity
)
));
hgsc005A
.
setUnfinishWeight
(
hgsc005A
.
getSingleWeight
().
multiply
(
new
BigDecimal
(
hgsc007
.
getUnfinishQuantity
()
)));
hgsc005A
.
setUnfinishQuantity
(
hgsc005A
.
getQuantity
()
.
subtract
(
finishQuatity
)
);
hgsc005A
.
setFinishWeight
(
hgsc005A
.
getSingleWeight
().
multiply
(
finishQuatity
));
hgsc005A
.
setUnfinishWeight
(
hgsc005A
.
getSingleWeight
().
multiply
(
hgsc007
.
getUnfinishQuantity
(
)));
DaoUtils
.
update
(
HGSC005A
.
UPDATE
,
hgsc005A
);
}
...
...
@@ -577,15 +579,22 @@ public class HGSCTools {
public
static
class
THGSC005
{
public
static
List
<
HGSC005
>
buildFinishRate
(
List
<
HGSC005
>
hgsc005List
){
if
(
CollectionUtils
.
isNotEmpty
(
hgsc005List
)){
List
<
HGSC005A
>
hgsc005AList
=
THGSC005A
.
queryByPlanCodes
(
hgsc005List
.
stream
().
map
(
HGSC005:
:
getPlanCode
).
collect
(
Collectors
.
toList
()));
Map
<
String
,
Double
>
finishRateMap
=
hgsc005AList
.
stream
().
collect
(
Collectors
.
groupingBy
(
HGSC005A:
:
getPlanCode
,
Collectors
.
collectingAndThen
(
Collectors
.
toList
(),
list
->{
return
list
.
stream
().
mapToDouble
(
HGSC005A:
:
getFinishQuantity
).
sum
()/
list
.
stream
().
mapToDouble
(
HGSC005A:
:
getQuantity
).
sum
();
List
<
HGSC005A
>
hgsc005AList
=
THGSC005A
.
queryByPlanCodes
(
hgsc005List
.
stream
().
map
(
HGSC005:
:
getPlanCode
).
collect
(
Collectors
.
toList
()));
Map
<
String
,
BigDecimal
>
finishRateMap
=
hgsc005AList
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
HGSC005A:
:
getPlanCode
,
Collectors
.
collectingAndThen
(
Collectors
.
toList
(),
list
->
{
BigDecimal
finishQuantitySum
=
list
.
stream
().
map
(
HGSC005A:
:
getFinishQuantity
)
.
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
BigDecimal
quantitySum
=
list
.
stream
().
map
(
HGSC005A:
:
getQuantity
)
.
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
return
finishQuantitySum
.
divide
(
quantitySum
,
3
,
RoundingMode
.
HALF_UP
);
})));
hgsc005List
.
forEach
(
hgsc005
->
{
hgsc005
.
setFinishRate
(
MapUtils
.
isNotEmpty
(
finishRateMap
)&&
Objects
.
nonNull
(
finishRateMap
.
get
(
hgsc005
.
getPlanCode
()))?
new
BigDecimal
(
finishRateMap
.
get
(
hgsc005
.
getPlanCode
()))
.
setScale
(
0
,
ROUND_DOWN
).
doubleValue
():
0
);
hgsc005
.
setFinishRate
(
MapUtils
.
isNotEmpty
(
finishRateMap
)
&&
Objects
.
nonNull
(
finishRateMap
.
get
(
hgsc005
.
getPlanCode
()))
?
finishRateMap
.
get
(
hgsc005
.
getPlanCode
()).
setScale
(
0
,
ROUND_DOWN
).
doubleValue
()
:
0
);
});
}
return
hgsc005List
;
...
...
@@ -772,7 +781,7 @@ public class HGSCTools {
Map
<
Long
,
Optional
<
HGSC005A
>>
oldObjMap
=
Optional
.
ofNullable
(
oldObjFilterList
)
.
orElse
(
new
ArrayList
<>()).
stream
()
.
collect
(
Collectors
.
groupingBy
(
HGSC005A:
:
getInventProcessId
,
Collectors
.
maxBy
(
Comparator
.
comparing
Int
(
HGSC005A:
:
getQuantity
))));
Comparator
.
comparing
(
HGSC005A:
:
getQuantity
))));
returnOldObjMap
.
putAll
(
oldObjMap
);
}
else
{
List
<
HGSC005A
>
oldObjFilterList
=
oldObjList
.
stream
()
...
...
@@ -781,7 +790,7 @@ public class HGSCTools {
Map
<
Long
,
Optional
<
HGSC005A
>>
oldObjMap
=
Optional
.
ofNullable
(
oldObjFilterList
)
.
orElse
(
new
ArrayList
<>()).
stream
()
.
collect
(
Collectors
.
groupingBy
(
HGSC005A:
:
getInventProcessId
,
Collectors
.
maxBy
(
Comparator
.
comparing
Int
(
HGSC005A:
:
getQuantity
))));
Comparator
.
comparing
(
HGSC005A:
:
getQuantity
))));
returnOldObjMap
.
putAll
(
oldObjMap
);
}
});
...
...
@@ -804,7 +813,7 @@ public class HGSCTools {
return
o
.
getProductCode
()
+
"#"
+
o
.
getInventProcessId
();
},
Collectors
.
collectingAndThen
(
Collectors
.
maxBy
(
Comparator
.
comparing
Int
(
HGSC005A:
:
getQuantity
)),
Optional:
:
get
)));
Comparator
.
comparing
(
HGSC005A:
:
getQuantity
)),
Optional:
:
get
)));
}
return
null
;
}
...
...
@@ -820,7 +829,7 @@ public class HGSCTools {
List
<
HGSC005A
>
oldObjList
=
DaoBase
.
getInstance
().
query
(
HGSC005A
.
QUERY
,
paramMap
);
Map
<
Long
,
Optional
<
HGSC005A
>>
oldObjMap
=
Optional
.
ofNullable
(
oldObjList
).
orElse
(
new
ArrayList
<>()).
stream
()
.
collect
(
Collectors
.
groupingBy
(
HGSC005A:
:
getInventProcessId
,
Collectors
.
maxBy
(
Comparator
.
comparing
Int
(
HGSC005A:
:
getQuantity
))));
Comparator
.
comparing
(
HGSC005A:
:
getQuantity
))));
return
oldObjMap
;
}
...
...
@@ -864,8 +873,8 @@ public class HGSCTools {
Optional
<
HGSC005A
>
op
=
oldObjMap
.
get
(
o
.
getInventProcessId
());
if
(
Objects
.
nonNull
(
op
))
{
HGSC005A
uo
=
op
.
get
();
uo
.
setQuantity
(
uo
.
getQuantity
()
+
o
.
getQuantity
(
));
uo
.
setUnfinishQuantity
(
uo
.
getUnfinishQuantity
()
+
o
.
getQuantity
(
));
uo
.
setQuantity
(
uo
.
getQuantity
()
.
add
(
o
.
getQuantity
()
));
uo
.
setUnfinishQuantity
(
uo
.
getUnfinishQuantity
()
.
add
(
o
.
getQuantity
()
));
handleWeight
(
hgsc005a
,
uo
);
updateList
.
add
(
uo
);
}
else
{
...
...
@@ -898,7 +907,7 @@ public class HGSCTools {
if
(
Objects
.
nonNull
(
op
))
{
HGSC005A
uo
=
op
.
get
();
uo
.
setQuantity
(
o
.
getQuantity
());
uo
.
setUnfinishQuantity
(
o
.
getQuantity
()
-
uo
.
getFinishQuantity
(
));
uo
.
setUnfinishQuantity
(
o
.
getQuantity
()
.
subtract
(
uo
.
getFinishQuantity
()
));
handleWeight
(
hgsc005a
,
uo
);
updateList
.
add
(
uo
);
}
else
{
...
...
@@ -926,12 +935,12 @@ public class HGSCTools {
List
<
HGSC005A
>
updateList
=
new
ArrayList
<>();
oldObjMap
.
forEach
((
k
,
v
)
->
{
HGSC005A
oldObj
=
v
.
get
();
if
(
oldObj
.
getQuantity
()
-
hgsc005a
.
getQuantity
(
)
<=
0
)
{
if
(
oldObj
.
getQuantity
()
.
subtract
(
hgsc005a
.
getQuantity
()).
compareTo
(
BigDecimal
.
ZERO
)
<=
0
)
{
handleWeight
(
hgsc005a
,
oldObj
);
deleteIds
.
add
(
oldObj
.
getId
());
}
else
{
oldObj
.
setQuantity
(
oldObj
.
getQuantity
()
-
hgsc005a
.
getQuantity
(
));
oldObj
.
setUnfinishQuantity
(
oldObj
.
getQuantity
()
-
oldObj
.
getFinishQuantity
(
));
oldObj
.
setQuantity
(
oldObj
.
getQuantity
()
.
subtract
(
hgsc005a
.
getQuantity
()
));
oldObj
.
setUnfinishQuantity
(
oldObj
.
getQuantity
()
.
subtract
(
oldObj
.
getFinishQuantity
()
));
handleWeight
(
hgsc005a
,
oldObj
);
updateList
.
add
(
oldObj
);
}
...
...
@@ -963,8 +972,8 @@ public class HGSCTools {
if
(
CollectionUtils
.
isNotEmpty
(
hgsc005aList
))
{
Map
<
String
,
HGSC005A
>
hgsc005aMap
=
hgsc005aList
.
stream
()
.
collect
(
Collectors
.
toMap
(
HGSC005A:
:
getProductCode
,
o
->
o
,
(
o1
,
o2
)
->
{
o1
.
setQuantity
(
o1
.
getQuantity
()
+
o2
.
getQuantity
(
));
o1
.
setTotalWeight
(
o1
.
getSingleWeight
().
multiply
(
new
BigDecimal
(
o1
.
getQuantity
()
)));
o1
.
setQuantity
(
o1
.
getQuantity
()
.
add
(
o2
.
getQuantity
()
));
o1
.
setTotalWeight
(
o1
.
getSingleWeight
().
multiply
(
o1
.
getQuantity
(
)));
return
o1
;
}));
checkUpdateData
(
hgsc005aList
);
...
...
@@ -973,12 +982,12 @@ public class HGSCTools {
oldObjMap
.
forEach
((
k
,
oldObj
)
->
{
if
(
Objects
.
nonNull
(
oldObj
))
{
HGSC005A
hgsc005a
=
hgsc005aMap
.
get
(
k
.
split
(
"#"
)[
0
]);
if
(
oldObj
.
getQuantity
()
-
hgsc005a
.
getQuantity
(
)
<=
0
)
{
if
(
oldObj
.
getQuantity
()
.
subtract
(
hgsc005a
.
getQuantity
()).
compareTo
(
BigDecimal
.
ZERO
)
<=
0
)
{
handleWeight
(
hgsc005a
,
oldObj
);
deleteIds
.
add
(
oldObj
.
getId
());
}
else
{
oldObj
.
setQuantity
(
oldObj
.
getQuantity
()
-
hgsc005a
.
getQuantity
(
));
oldObj
.
setUnfinishQuantity
(
oldObj
.
getQuantity
()
-
oldObj
.
getFinishQuantity
(
));
oldObj
.
setQuantity
(
oldObj
.
getQuantity
()
.
subtract
(
hgsc005a
.
getQuantity
()
));
oldObj
.
setUnfinishQuantity
(
oldObj
.
getQuantity
()
.
subtract
(
oldObj
.
getFinishQuantity
()
));
handleWeight
(
hgsc005a
,
oldObj
);
updateList
.
add
(
oldObj
);
}
...
...
@@ -1007,10 +1016,9 @@ public class HGSCTools {
private
static
void
handleWeight
(
HGSC005A
hgsc005a
,
HGSC005A
target
)
{
if
(
Objects
.
nonNull
(
hgsc005a
.
getSingleWeight
()))
{
target
.
setSingleWeight
(
hgsc005a
.
getSingleWeight
());
target
.
setTotalWeight
(
hgsc005a
.
getSingleWeight
().
multiply
(
new
BigDecimal
(
target
.
getQuantity
())));
target
.
setFinishWeight
(
hgsc005a
.
getSingleWeight
().
multiply
(
new
BigDecimal
(
target
.
getFinishQuantity
())));
target
.
setUnfinishWeight
(
hgsc005a
.
getSingleWeight
().
multiply
(
new
BigDecimal
(
target
.
getUnfinishQuantity
())));
target
.
setTotalWeight
(
hgsc005a
.
getSingleWeight
().
multiply
(
target
.
getQuantity
()));
target
.
setFinishWeight
(
hgsc005a
.
getSingleWeight
().
multiply
(
target
.
getFinishQuantity
()));
target
.
setUnfinishWeight
(
hgsc005a
.
getSingleWeight
().
multiply
(
target
.
getUnfinishQuantity
()));
}
}
...
...
@@ -1039,13 +1047,13 @@ public class HGSCTools {
hgsc005a
.
setProjName
(
hgsc005
.
getProjName
());
hgsc005a
.
setFinishDate
(
hgsc005
.
getFinishDate
());
hgsc005a
.
setUnfinishQuantity
(
hgsc005a
.
getQuantity
());
hgsc005a
.
setFinishQuantity
(
0
);
hgsc005a
.
setFinishQuantity
(
BigDecimal
.
ZERO
);
hgsc005a
.
setUnfinishWeight
(
hgsc005a
.
getTotalWeight
());
//零件
if
(
hgsc005a
.
getProductType
().
compareTo
(
ProductTypeEnum
.
PART
.
getCode
())
==
0
)
{
HGSC005A
hisObj
=
hgsc005AMap
.
get
(
hgsc005a
.
getProductCode
());
if
(
Objects
.
nonNull
(
hisObj
))
{
hgsc005a
.
setQuantity
(
hgsc005a
.
getQuantity
()
+
hisObj
.
getQuantity
(
));
hgsc005a
.
setQuantity
(
hgsc005a
.
getQuantity
()
.
add
(
hisObj
.
getQuantity
()
));
hgsc005a
.
setUnfinishQuantity
(
hgsc005a
.
getQuantity
());
hgsc005a
.
setTotalWeight
(
hgsc005a
.
getTotalWeight
().
add
(
hisObj
.
getTotalWeight
()));
hgsc005a
.
setUnfinishWeight
(
hgsc005a
.
getTotalWeight
());
...
...
@@ -1074,7 +1082,8 @@ public class HGSCTools {
AssertUtils
.
isEmpty
(
hgsc005a
.
getProductName
(),
"产品名称不能为空!"
);
AssertUtils
.
isTrue
(
Objects
.
isNull
(
hgsc005a
.
getTechFlowId
())
||
hgsc005a
.
getTechFlowId
()
<=
0
,
"工艺流程ID不能为空!"
);
AssertUtils
.
isTrue
(
Objects
.
isNull
(
hgsc005a
.
getQuantity
())
||
hgsc005a
.
getQuantity
()
<=
0
,
"数量不能为空!"
);
AssertUtils
.
isTrue
(
Objects
.
isNull
(
hgsc005a
.
getQuantity
())
||
hgsc005a
.
getQuantity
().
compareTo
(
BigDecimal
.
ZERO
)
<=
0
,
"数量不能为空!"
);
}
public
static
List
<
HGSC005A
>
constructObj
(
List
<
HGSC005A
>
hgsc005aList
,
HGSC005
hgsc005
)
{
...
...
@@ -1088,7 +1097,7 @@ public class HGSCTools {
hgsc005a
.
setProjName
(
hgsc005
.
getProjName
());
hgsc005a
.
setFinishDate
(
hgsc005
.
getFinishDate
());
hgsc005a
.
setUnfinishQuantity
(
hgsc005a
.
getQuantity
());
hgsc005a
.
setFinishQuantity
(
0
);
hgsc005a
.
setFinishQuantity
(
BigDecimal
.
ZERO
);
hgsc005a
.
setUnfinishWeight
(
hgsc005a
.
getTotalWeight
());
});
return
hgsc005aList
;
...
...
@@ -1105,7 +1114,7 @@ public class HGSCTools {
hgsc005a
.
setProjName
(
hgsc005
.
getProjName
());
hgsc005a
.
setFinishDate
(
hgsc005
.
getFinishDate
());
hgsc005a
.
setUnfinishQuantity
(
hgsc005a
.
getQuantity
());
hgsc005a
.
setFinishQuantity
(
0
);
hgsc005a
.
setFinishQuantity
(
BigDecimal
.
ZERO
);
hgsc005a
.
setUnfinishWeight
(
hgsc005a
.
getTotalWeight
());
return
hgsc005a
;
}
...
...
@@ -1310,13 +1319,13 @@ public class HGSCTools {
ComputeTypeEnum
computeType
=
ComputeTypeEnum
.
getEnumByCode
(
dbSj001
.
getComputeType
());
switch
(
computeType
)
{
case
CD:
workHour
.
set
(
dbPz005
.
getLength
().
multiply
(
new
BigDecimal
(
dbSc005A
.
getQuantity
()
))
workHour
.
set
(
dbPz005
.
getLength
().
multiply
(
dbSc005A
.
getQuantity
(
))
.
divide
(
unitConver
,
2
,
ROUND_DOWN
).
multiply
(
composingCoeff
)
.
divide
(
timing
,
2
,
ROUND_DOWN
)
.
multiply
(
baseWorkHour
).
add
(
remainder
));
break
;
case
SL:
workHour
.
set
(
new
BigDecimal
(
dbSc005A
.
getQuantity
()
).
multiply
(
composingCoeff
)
workHour
.
set
(
dbSc005A
.
getQuantity
(
).
multiply
(
composingCoeff
)
.
divide
(
timing
,
2
,
ROUND_DOWN
)
.
multiply
(
baseWorkHour
).
add
(
remainder
));
break
;
...
...
@@ -1488,7 +1497,7 @@ public class HGSCTools {
hgsc006a
.
setPlanEndDate
(
o
.
getPlanEndDate
());
hgsc006a
.
setQuantity
(
o
.
getQuantity
());
hgsc006a
.
setUnassignQuantity
(
o
.
getQuantity
());
hgsc006a
.
setAssignQuantity
(
0
);
hgsc006a
.
setAssignQuantity
(
BigDecimal
.
ZERO
);
hgsc006a
.
setSingleWeight
(
o
.
getSingleWeight
());
hgsc006a
.
setTotalWeight
(
o
.
getTotalWeight
());
hgsc006a
.
setUnassignWeight
(
hgsc006a
.
getTotalWeight
());
...
...
@@ -1642,10 +1651,10 @@ public class HGSCTools {
BeanUtils
.
copyProperties
(
hgsc007
,
hgsc008
);
cleanBaseInfo
(
hgsc008
);
hgsc008
.
setTaskId
(
hgsc007
.
getId
());
hgsc008
.
setQuantity
(
NumberUtils
.
toInteger
(
resultMap
.
get
(
HGSC008
.
FIELD_quantity
)
));
hgsc008
.
setQuantity
(
MapUtils
.
getBigDecimal
(
resultMap
,
HGSC008
.
FIELD_quantity
));
hgsc008
.
setRegisterDate
(
String
.
valueOf
(
resultMap
.
get
(
HGSC008
.
FIELD_register_date
)));
hgsc008
.
setExceedReason
(
resultMap
.
get
(
HGSC008
.
FIELD_exceed_reason
).
toString
());
hgsc008
.
setTotalWeight
(
hgsc007
.
getSingleWeight
().
multiply
(
new
BigDecimal
(
hgsc008
.
getQuantity
()
)));
hgsc008
.
setTotalWeight
(
hgsc007
.
getSingleWeight
().
multiply
(
hgsc008
.
getQuantity
(
)));
checkAddDate
(
hgsc008
);
hgsc008
.
setWorkCode
(
SequenceGenerator
.
getNextSequence
(
HGConstant
.
SequenceId
.
HGSC008_WORK_CODE
));
DaoUtils
.
insert
(
HGSC008
.
INSERT
,
hgsc008
);
...
...
src/main/java/com/baosight/hggp/hg/zl/domain/HGZL002.java
View file @
fc8ae48e
...
...
@@ -149,9 +149,9 @@ public class HGZL002 extends DaoEPBase {
private
String
groupName
=
" "
;
/* 工作组名称*/
private
String
workBy
=
" "
;
/* 生产人*/
private
String
workName
=
" "
;
/* 生产人名称*/
private
Integer
quantity
=
new
Integer
(
0
);
/* 数量*/
private
Integer
passQuantity
=
new
Integer
(
0
);
/* 合格数量*/
private
Integer
unpassQuantity
=
new
Integer
(
0
);
/* 不合格数量*/
private
BigDecimal
quantity
=
new
BigDecimal
(
0
);
/* 数量*/
private
BigDecimal
passQuantity
=
new
BigDecimal
(
0
);
/* 合格数量*/
private
BigDecimal
unpassQuantity
=
new
BigDecimal
(
0
);
/* 不合格数量*/
private
BigDecimal
singleWeight
=
new
BigDecimal
(
"0"
);
/* 单重*/
private
BigDecimal
totalWeight
=
new
BigDecimal
(
"0"
);
/* 总重*/
private
String
checkBy
=
" "
;
/* 质检人*/
...
...
@@ -286,14 +286,23 @@ public class HGZL002 extends DaoEPBase {
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_quantity
);
eiColumn
.
setType
(
"N"
);
eiColumn
.
setScaleLength
(
1
);
eiColumn
.
setFieldLength
(
20
);
eiColumn
.
setDescName
(
"数量"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_pass_quantity
);
eiColumn
.
setType
(
"N"
);
eiColumn
.
setScaleLength
(
1
);
eiColumn
.
setFieldLength
(
20
);
eiColumn
.
setDescName
(
"合格数量"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_unpass_quantity
);
eiColumn
.
setType
(
"N"
);
eiColumn
.
setScaleLength
(
1
);
eiColumn
.
setFieldLength
(
20
);
eiColumn
.
setDescName
(
"不合格数量"
);
eiMetadata
.
addMeta
(
eiColumn
);
...
...
@@ -817,7 +826,7 @@ public class HGZL002 extends DaoEPBase {
* get the quantity - 数量.
* @return the quantity
*/
public
Integer
getQuantity
()
{
public
BigDecimal
getQuantity
()
{
return
this
.
quantity
;
}
...
...
@@ -826,14 +835,14 @@ public class HGZL002 extends DaoEPBase {
*
* @param quantity - 数量
*/
public
void
setQuantity
(
Integer
quantity
)
{
public
void
setQuantity
(
BigDecimal
quantity
)
{
this
.
quantity
=
quantity
;
}
/**
* get the passQuantity - 合格数量.
* @return the passQuantity
*/
public
Integer
getPassQuantity
()
{
public
BigDecimal
getPassQuantity
()
{
return
this
.
passQuantity
;
}
...
...
@@ -842,14 +851,14 @@ public class HGZL002 extends DaoEPBase {
*
* @param passQuantity - 合格数量
*/
public
void
setPassQuantity
(
Integer
passQuantity
)
{
public
void
setPassQuantity
(
BigDecimal
passQuantity
)
{
this
.
passQuantity
=
passQuantity
;
}
/**
* get the unpassQuantity - 不合格数量.
* @return the unpassQuantity
*/
public
Integer
getUnpassQuantity
()
{
public
BigDecimal
getUnpassQuantity
()
{
return
this
.
unpassQuantity
;
}
...
...
@@ -858,7 +867,7 @@ public class HGZL002 extends DaoEPBase {
*
* @param unpassQuantity - 不合格数量
*/
public
void
setUnpassQuantity
(
Integer
unpassQuantity
)
{
public
void
setUnpassQuantity
(
BigDecimal
unpassQuantity
)
{
this
.
unpassQuantity
=
unpassQuantity
;
}
/**
...
...
@@ -1105,9 +1114,9 @@ public class HGZL002 extends DaoEPBase {
setGroupName
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_group_name
)),
groupName
));
setWorkBy
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_work_by
)),
workBy
));
setWorkName
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_work_name
)),
workName
));
setQuantity
(
NumberUtils
.
to
Integer
(
StringUtils
.
toString
(
map
.
get
(
FIELD_quantity
)),
quantity
));
setPassQuantity
(
NumberUtils
.
to
Integer
(
StringUtils
.
toString
(
map
.
get
(
FIELD_pass_quantity
)),
passQuantity
));
setUnpassQuantity
(
NumberUtils
.
to
Integer
(
StringUtils
.
toString
(
map
.
get
(
FIELD_unpass_quantity
)),
unpassQuantity
));
setQuantity
(
NumberUtils
.
to
BigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_quantity
)),
quantity
));
setPassQuantity
(
NumberUtils
.
to
BigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_pass_quantity
)),
passQuantity
));
setUnpassQuantity
(
NumberUtils
.
to
BigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_unpass_quantity
)),
unpassQuantity
));
setSingleWeight
(
NumberUtils
.
toBigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_single_weight
)),
singleWeight
));
setTotalWeight
(
NumberUtils
.
toBigDecimal
(
StringUtils
.
toString
(
map
.
get
(
FIELD_total_weight
)),
totalWeight
));
setCheckBy
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_check_by
)),
checkBy
));
...
...
src/main/java/com/baosight/hggp/hg/zl/service/ServiceHGZL002.java
View file @
fc8ae48e
...
...
@@ -16,6 +16,7 @@ import com.baosight.iplat4j.core.ei.EiInfo;
import
com.baosight.iplat4j.core.service.impl.ServiceBase
;
import
org.apache.commons.collections.CollectionUtils
;
import
java.math.BigDecimal
;
import
java.util.*
;
import
java.util.stream.Collectors
;
...
...
@@ -112,13 +113,16 @@ public class ServiceHGZL002 extends ServiceBase {
resultMap
.
put
(
"unpassQuantity"
,
0
);
try
{
inInfo
=
super
.
query
(
inInfo
,
HGZL002
.
QUERY
,
new
HGZL002
());
List
<
HGZL002
>
hgzl002s
=
MapUtils
.
toDaoEPBases
(
inInfo
,
HGZL002
.
class
);
int
quantity
=
Optional
.
ofNullable
(
hgzl002s
).
orElse
(
new
ArrayList
<>()).
stream
().
mapToInt
(
HGZL002:
:
getQuantity
).
sum
();
int
passQuantity
=
Optional
.
ofNullable
(
hgzl002s
).
orElse
(
new
ArrayList
<>()).
stream
().
mapToInt
(
HGZL002:
:
getPassQuantity
).
sum
();
int
unpassQuantity
=
Optional
.
ofNullable
(
hgzl002s
).
orElse
(
new
ArrayList
<>()).
stream
().
mapToInt
(
HGZL002:
:
getUnpassQuantity
).
sum
();
resultMap
.
put
(
"quantity"
,
quantity
);
resultMap
.
put
(
"passQuantity"
,
passQuantity
);
resultMap
.
put
(
"unpassQuantity"
,
unpassQuantity
);
List
<
HGZL002
>
hgzl002s
=
MapUtils
.
toDaoEPBases
(
inInfo
,
HGZL002
.
class
);
BigDecimal
quantity
=
Optional
.
ofNullable
(
hgzl002s
).
orElse
(
new
ArrayList
<>()).
stream
()
.
map
(
HGZL002:
:
getQuantity
).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
BigDecimal
passQuantity
=
Optional
.
ofNullable
(
hgzl002s
).
orElse
(
new
ArrayList
<>()).
stream
()
.
map
(
HGZL002:
:
getPassQuantity
).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
BigDecimal
unpassQuantity
=
Optional
.
ofNullable
(
hgzl002s
).
orElse
(
new
ArrayList
<>()).
stream
()
.
map
(
HGZL002:
:
getUnpassQuantity
).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
resultMap
.
put
(
"quantity"
,
quantity
);
resultMap
.
put
(
"passQuantity"
,
passQuantity
);
resultMap
.
put
(
"unpassQuantity"
,
unpassQuantity
);
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"查询失败"
);
}
...
...
src/main/java/com/baosight/hggp/hg/zl/tools/HGZLTools.java
View file @
fc8ae48e
...
...
@@ -16,6 +16,7 @@ import com.baosight.iplat4j.ed.util.SequenceGenerator;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.BeanUtils
;
import
java.math.BigDecimal
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -211,8 +212,8 @@ public class HGZLTools {
}
public
static
void
addByHGZL002
(
HGZL002
hgzl002
)
{
List
<
HGZL004
>
hgzl004DbList
=
listByCheckId
(
hgzl002
.
getId
(),
CheckTypeEnum
.
PROCESS_CHECK
.
getCode
());
if
(
hgzl002
.
getUnpassQuantity
()>
0
&&
CollectionUtils
.
isEmpty
(
hgzl004DbList
))
{
List
<
HGZL004
>
hgzl004DbList
=
listByCheckId
(
hgzl002
.
getId
(),
CheckTypeEnum
.
PROCESS_CHECK
.
getCode
());
if
(
hgzl002
.
getUnpassQuantity
().
compareTo
(
BigDecimal
.
ZERO
)
==
1
&&
CollectionUtils
.
isEmpty
(
hgzl004DbList
))
{
HGZL004
hgzl004
=
new
HGZL004
();
BeanUtils
.
copyProperties
(
hgzl002
,
hgzl004
);
cleanBaseInfo
(
hgzl004
);
...
...
src/main/webapp/HG/SC/HGSC007.jsp
View file @
fc8ae48e
...
...
@@ -29,7 +29,7 @@
</div>
</EF:EFRegion>
<EF:EFRegion
id=
"result"
title=
"明细信息"
>
<EF:EFRegion
id=
"result"
title=
"明细信息"
fitHeight=
"true"
>
<EF:EFGrid
blockId=
"result"
autoDraw=
"override"
isFloat=
"true"
>
<EF:EFColumn
ename=
"id"
primaryKey=
"true"
cname=
"内码"
hidden=
"true"
/>
<EF:EFColumn
ename=
"accountCode"
cname=
"账套"
hidden=
"true"
/>
...
...
src/main/webapp/HG/SC/HGSC007A.js
View file @
fc8ae48e
$
(
function
()
{
$
(
"#result-0-quantity_textField"
).
on
(
'change'
,
function
()
{
var
quantity
=
$
(
"#result-0-quantity_textField
"
).
val
();
if
(
!
isPositiveInteger
(
quantity
))
{
message
(
"报工数量必须是大于0的正整数
"
)
$
(
"#result-0-quantity"
).
on
(
'change'
,
function
()
{
var
quantity
=
$
(
"#result-0-quantity
"
).
val
();
if
(
!
isPositiveNumber
(
quantity
))
{
message
(
"报工数量必须是大于0的数字
"
)
}
var
singleWeight
=
$
(
"#result-0-singleWeight_textField"
).
val
();
if
(
isPositiveNumber
(
singleWeight
))
{
$
(
"#result-0-totalWeight_textField"
).
val
((
parseInt
(
singleWeight
*
quantity
*
100
)
/
100
).
toFixed
(
2
));
if
(
isPositiveNumber
(
singleWeight
))
{
$
(
"#result-0-totalWeight_textField"
).
val
(
(
parseInt
(
singleWeight
*
quantity
*
100
)
/
100
).
toFixed
(
2
));
}
})
...
...
@@ -25,9 +26,9 @@ $(function () {
* 保存*
*/
$
(
"#btn_save"
).
on
(
"click"
,
function
(){
var
quantity
=
$
(
"#result-0-quantity
_textField
"
).
val
();
if
(
!
isPositive
Integ
er
(
quantity
)){
message
(
"报工数量必须是大于0的
正整数
"
);
var
quantity
=
$
(
"#result-0-quantity"
).
val
();
if
(
!
isPositive
Numb
er
(
quantity
)){
message
(
"报工数量必须是大于0的
数字
"
);
return
;
}
var
registerDate
=
$
(
"#result-0-registerDate"
).
val
();
...
...
src/main/webapp/HG/SC/HGSC007A.jsp
View file @
fc8ae48e
...
...
@@ -32,7 +32,7 @@
<EF:EFInput
ename=
"result-0-groupName"
cname=
"班组"
colWidth=
"4"
required=
"true"
readonly=
"true"
/>
<EF:EFDatePicker
cname=
"报工日期"
ename=
"result-0-registerDate"
colWidth=
"4"
format=
"yyyy-MM-dd"
required=
"true"
readonly=
"false"
/>
<EF:EFInput
ename=
"result-0-quantity"
cname=
"报工数量"
format=
"{0:0
}"
editType=
"text"
colWidth=
"4"
required=
"true"
/>
<EF:EFInput
ename=
"result-0-quantity"
cname=
"报工数量"
format=
"{0:0
.0}"
colWidth=
"4"
required=
"true"
/>
<EF:EFInput
ename=
"result-0-totalWeight"
cname=
"报工重量"
format=
"{0:0.00}"
editType=
"text"
colWidth=
"4"
readonly=
"true"
/>
<EF:EFInput
ename=
"result-0-exceedReason"
cname=
"超报原因"
type=
"textarea"
editType=
"text"
colWidth=
"8"
ratio=
"2:10"
/>
</div>
...
...
src/main/webapp/HG/SC/HGSC008.jsp
View file @
fc8ae48e
...
...
@@ -18,7 +18,7 @@
</div>
</EF:EFRegion>
<EF:EFRegion
id=
"result"
title=
"明细信息
"
>
<EF:EFRegion
id=
"result"
title=
"明细信息"
fitHeight=
"true
"
>
<EF:EFGrid
blockId=
"result"
autoDraw=
"override"
isFloat=
"true"
>
<EF:EFColumn
ename=
"id"
primaryKey=
"true"
cname=
"内码"
hidden=
"true"
/>
<EF:EFColumn
ename=
"accountCode"
cname=
"账套"
hidden=
"true"
/>
...
...
src/main/webapp/HG/ZL/HGZL002.js
View file @
fc8ae48e
...
...
@@ -39,15 +39,16 @@ $(function () {
// 判断父级节点是否发生变化
if
(
e
.
field
==
"unpassQuantity"
)
{
// loadChange(grid,e,"passQuantity");
var
passQuantity
=
e
.
items
[
0
][
'quantity'
]
-
e
.
items
[
0
][
'unpassQuantity'
];
resultGrid
.
setCellValue
(
e
.
items
[
0
],
"passQuantity"
,
passQuantity
.
toFixed
(
3
)
);
var
passQuantity
=
parseFloat
(
e
.
items
[
0
][
'quantity'
])
-
parseFloat
(
e
.
items
[
0
][
'unpassQuantity'
]
);
resultGrid
.
setCellValue
(
e
.
items
[
0
],
"passQuantity"
,
passQuantity
);
}
// 判断父级节点是否发生变化
if
(
e
.
field
==
"passQuantity"
)
{
// loadChange(grid,e,"unpassQuantity");
var
unpassQuantity
=
e
.
items
[
0
][
'quantity'
]
-
e
.
items
[
0
][
'passQuantity'
];
resultGrid
.
setCellValue
(
e
.
items
[
0
],
"unpassQuantity"
,
unpassQuantity
);
var
unpassQuantity
=
parseFloat
(
e
.
items
[
0
][
'quantity'
])
-
parseFloat
(
e
.
items
[
0
][
'passQuantity'
]);
resultGrid
.
setCellValue
(
e
.
items
[
0
],
"unpassQuantity"
,
unpassQuantity
);
}
});
},
...
...
src/main/webapp/HG/ZL/HGZL002.jsp
View file @
fc8ae48e
...
...
@@ -25,7 +25,7 @@
</EF:EFRegion>
<EF:EFRegion
id=
"result"
title=
"明细信息"
>
<EF:EFGrid
blockId=
"result"
autoDraw=
"override"
isFloat=
"true"
>
<EF:EFGrid
blockId=
"result"
autoDraw=
"override"
isFloat=
"true"
checkMode=
"row"
>
<EF:EFColumn
ename=
"id"
cname=
"内码"
hidden=
"true"
/>
<EF:EFColumn
ename=
"checkBy"
cname=
"质检员"
hidden=
"true"
/>
<EF:EFColumn
ename=
"companyName"
cname=
"公司名称"
width=
"130"
enable=
"false"
readonly=
"true"
align=
"center"
/>
...
...
@@ -37,8 +37,9 @@
<EF:EFColumn
ename=
"productCode"
cname=
"存货编码"
width=
"90"
enable=
"false"
readonly=
"true"
align=
"center"
/>
<EF:EFColumn
ename=
"productName"
cname=
"存货名称"
width=
"90"
enable=
"false"
readonly=
"true"
align=
"center"
/>
<EF:EFColumn
ename=
"quantity"
cname=
"报工数量"
width=
"90"
enable=
"false"
readonly=
"true"
align=
"center"
/>
<EF:EFColumn
ename=
"passQuantity"
cname=
"合格数量"
width=
"90"
align=
"center"
required=
"true"
/>
<EF:EFColumn
ename=
"unpassQuantity"
cname=
"不合格数量"
width=
"100"
align=
"center"
required=
"true"
/>
<EF:EFColumn
ename=
"passQuantity"
cname=
"合格数量"
format=
"{0:0.0}"
width=
"90"
align=
"center"
required=
"true"
/>
<EF:EFColumn
ename=
"unpassQuantity"
cname=
"不合格数量"
format=
"{0:0.0}"
width=
"100"
align=
"center"
required=
"true"
/>
<EF:EFColumn
ename=
"checkDate"
cname=
"质检日期"
width=
"120"
enable=
"true"
align=
"center"
editType=
"date"
dateFormat=
"yyyy-MM-dd"
parseFormats=
"['yyyy-MM-dd']"
required=
"true"
/>
<EF:EFColumn
ename=
"checkName"
cname=
"质检员"
width=
"100"
enable=
"false"
readonly=
"true"
align=
"center"
/>
...
...
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