Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hp-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
hp-smart
Commits
9710629d
Commit
9710629d
authored
Apr 29, 2024
by
liuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2024-04-26 采购申请对输入校验和计划数量计算优化
parent
79327b79
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
9 deletions
+29
-9
ServiceHPCG001.java
.../java/com/baosight/hpjx/hp/cg/service/ServiceHPCG001.java
+13
-3
HPCG001.xml
src/main/java/com/baosight/hpjx/hp/cg/sql/HPCG001.xml
+1
-1
HPCG001.jsp
src/main/webapp/HP/CG/HPCG001.jsp
+15
-5
No files found.
src/main/java/com/baosight/hpjx/hp/cg/service/ServiceHPCG001.java
View file @
9710629d
...
...
@@ -30,6 +30,7 @@ import org.apache.commons.collections.CollectionUtils;
import
org.apache.commons.collections.MapUtils
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.List
;
...
...
@@ -264,15 +265,24 @@ public class ServiceHPCG001 extends ServiceEPBase {
}
}
}
hpcg002a
.
setPlanAmount
(
hpcg002a
.
getApplyAmount
().
subtract
(
applyAmount
));
BigDecimal
planWeight
=
hpcg002a
.
getApplyAmount
().
subtract
(
applyAmount
).
multiply
(
hpcg002a
.
getApplyUnitWeight
()).
divide
(
new
BigDecimal
(
"1000"
),
3
,
BigDecimal
.
ROUND_UP
);
hpcg002a
.
setPlanWeight
(
planWeight
);
//判断库存数和申请数
int
result
=
applyAmount
.
compareTo
(
hpcg002a
.
getApplyAmount
());
BigDecimal
planAmount
=
BigDecimal
.
ZERO
;
BigDecimal
planWeight
=
BigDecimal
.
ZERO
;
BigDecimal
value
=
BigDecimal
.
ZERO
;
if
(
result
>
0
)
{
//库存数大于申请数
value
=
applyAmount
.
subtract
(
hpcg002a
.
getApplyAmount
());
planAmount
=
applyAmount
.
subtract
(
hpcg002a
.
getApplyAmount
());
planWeight
=
applyAmount
.
subtract
(
hpcg002a
.
getApplyAmount
()).
multiply
(
hpcg002a
.
getApplyUnitWeight
()).
divide
(
new
BigDecimal
(
"1000"
),
3
,
RoundingMode
.
UP
);
}
else
if
(
result
<
0
){
//申请数大于库存数
planAmount
=
hpcg002a
.
getApplyAmount
().
subtract
(
applyAmount
);
planWeight
=
hpcg002a
.
getApplyAmount
().
subtract
(
applyAmount
).
multiply
(
hpcg002a
.
getApplyUnitWeight
()).
divide
(
new
BigDecimal
(
"1000"
),
3
,
RoundingMode
.
UP
);
}
hpcg002a
.
setPlanAmount
(
planAmount
);
hpcg002a
.
setPlanWeight
(
planWeight
);
for
(
HPKC010
hpkc010
:
hpkc010List
)
{
if
(
hpkc010
.
getFactoryCode
().
equals
(
hpcg002a
.
getFactoryCode
())
&&
hpkc010
.
getInventRecordId
().
equals
(
hpcg002a
.
getInventRecordId
())
...
...
src/main/java/com/baosight/hpjx/hp/cg/sql/HPCG001.xml
View file @
9710629d
...
...
@@ -156,7 +156,7 @@
$orderBy$
</isNotEmpty>
<isEmpty
property=
"orderBy"
>
PRO_APPLY_DATE desc,PRO_APPLY_STATUS asc,FACTORY_CODE asc
PRO_APPLY_DATE desc,
CREATED_TIME desc,
PRO_APPLY_STATUS asc,FACTORY_CODE asc
</isEmpty>
</dynamic>
...
...
src/main/webapp/HP/CG/HPCG001.jsp
View file @
9710629d
...
...
@@ -74,13 +74,23 @@
<EF:EFColumn ename="inventName" cname="存货名称" width="150" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="inventRecordId" cname="规格ID" width="120" align="center" readonly="true" hidden="true"/>
<EF:EFColumn ename="spec" cname="规格" width="120" align="center" readonly="true"/>
<EF:EFColumn ename="applyAmount" cname="申请数量" format="{0:N0}" maxLength="20" width="100" align="right" required="true"/>
<EF:EFColumn ename="applyAmount" cname="申请数量" format="{0:N0}" width="100" align="right"
data-regex="/^-?[0-9]{1,15}?$/" maxLength="15" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数!"/>
<EF:EFColumn ename="unitWeight" cname="单重(KG)" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFColumn ename="weight" cname="总重(T)" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFColumn ename="length" cname="长(MM)" width="80" align="right" format="{0:N3}" readonly="true"/>
<EF:EFColumn ename="width" cname="宽(MM)" width="80" align="right" format="{0:N3}" readonly="true"/>
<EF:EFColumn ename="thick" cname="厚(MM)" width="80" align="right" format="{0:N3}" readonly="true"/>
<EF:EFColumn ename="coefficient" cname="系数" width="80" align="right" format="{0:N3}" readonly="true"/>
<EF:EFColumn ename="length" cname="长(MM)" width="80" align="right" format="{0:N3}" readonly="true"
data-regex="/^-?[0-9]{1,12}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置12位整数和3位小数!"/>
<EF:EFColumn ename="width" cname="宽(MM)" width="80" align="right" format="{0:N3}" readonly="true"
data-regex="/^-?[0-9]{1,12}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置12位整数和3位小数!"/>
<EF:EFColumn ename="thick" cname="厚(MM)" width="80" align="right" format="{0:N3}" readonly="true"
data-regex="/^-?[0-9]{1,12}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置12位整数和3位小数!"/>
<EF:EFColumn ename="coefficient" cname="系数" width="80" align="right" format="{0:N3}" readonly="true"
data-regex="/^-?[0-9]{1,12}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置12位整数和3位小数!"/>
<EF:EFColumn ename="material" cname="材质" width="80" align="center" readonly="true"/>
<EF:EFColumn ename="unit" cname="单位" width="80" align="center" readonly="true"/>
<EF:EFColumn ename="remark" cname="备注" width="150"/>
...
...
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