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
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
185 additions
and
127 deletions
+185
-127
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
+0
-0
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
This diff is collapsed.
Click to expand it.
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