Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
E
EIP-API
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
李炎
EIP-API
Commits
02a80fcd
提交
02a80fcd
authored
6月 30, 2021
作者:
Wangjiajie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6.30 添加总行和更改小数显示问题
上级
5dedd539
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
57 行增加
和
30 行删除
+57
-30
IostReceivingNoteController.java
...iost/basedata/controller/IostReceivingNoteController.java
+25
-14
IostSummarySheetController.java
.../iost/basedata/controller/IostSummarySheetController.java
+32
-16
IostReceivingNoteController.class
...ost/basedata/controller/IostReceivingNoteController.class
+0
-0
IostSummarySheetController.class
...iost/basedata/controller/IostSummarySheetController.class
+0
-0
没有找到文件。
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/basedata/controller/IostReceivingNoteController.java
浏览文件 @
02a80fcd
...
...
@@ -4,6 +4,7 @@ import java.io.UnsupportedEncodingException;
import
java.io.File
;
import
java.io.FileNotFoundException
;
import
java.io.IOException
;
import
java.math.BigDecimal
;
import
java.net.URLDecoder
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
...
...
@@ -16,6 +17,7 @@ import javax.servlet.http.HttpServletRequest;
import
javax.servlet.http.HttpServletResponse
;
import
org.jeecg.modules.iost.basedata.entity.IostReceivinglist
;
import
org.jeecg.modules.iost.basedata.entity.IostSummarySheetList
;
import
org.jeecgframework.poi.excel.ExcelImportUtil
;
import
org.jeecgframework.poi.excel.def.NormalExcelConstants
;
import
org.jeecgframework.poi.excel.entity.ExportParams
;
...
...
@@ -171,7 +173,7 @@ public class IostReceivingNoteController {
//加载标题、日期
addTitleAndDateInfo
(
document
,
titleFont
,
keyFont
,
smtextFont
);
List
<
IostReceivingNoteList
>
iostReceivingNoteListList
=
new
ArrayList
<
IostReceivingNoteList
>();
List
<
IostReceivingNoteList
>
iostReceivingNoteListList
=
new
ArrayList
<
IostReceivingNoteList
>();
for
(
IostReceivingNoteList
iostReceivingNoteList:
iostReceivingNoteLists
)
{
...
...
@@ -542,23 +544,32 @@ public class IostReceivingNoteController {
double
totleWeightTotal
=
0
;
//重量总
int
totlePackagesTotal
=
0
;
//箱数总
double
totlePrice
=
0
;
//价格总
double
totleMoney
=
0
;
//
double
totleMoney
=
0
;
//
金额总
for
(
IostReceivingNoteList
iostReceivingNoteList:
iostIostReceivingNoteList
)
{
totlevolume
=
totlevolume
+
iostReceivingNoteList
.
getVolume
();
BigDecimal
A1
=
new
BigDecimal
(
Double
.
toString
(
totlevolume
));
BigDecimal
A2
=
new
BigDecimal
(
Double
.
toString
(
iostReceivingNoteList
.
getVolume
()));
totlevolume
=
A1
.
add
(
A2
).
doubleValue
();
A1
=
new
BigDecimal
(
Double
.
toString
(
totleWeightTotal
));
A2
=
new
BigDecimal
(
Double
.
toString
(
iostReceivingNoteList
.
getWeight
()));
totleWeightTotal
=
A1
.
add
(
A2
).
doubleValue
();
totlePackagesTotal
=
totlePackagesTotal
+
iostReceivingNoteList
.
getPackages
();
totleWeightTotal
=
totleWeightTotal
+
iostReceivingNoteList
.
getWeight
();
totlePrice
=
totlePrice
+
iostReceivingNoteList
.
getPrice
();
totleMoney
=
totleMoney
+
iostReceivingNoteList
.
getMoney
();
A1
=
new
BigDecimal
(
Double
.
toString
(
totlePrice
));
A2
=
new
BigDecimal
(
Double
.
toString
(
iostReceivingNoteList
.
getPrice
()));
totlePrice
=
A1
.
add
(
A2
).
doubleValue
();
A1
=
new
BigDecimal
(
Double
.
toString
(
totleMoney
));
A2
=
new
BigDecimal
(
Double
.
toString
(
iostReceivingNoteList
.
getMoney
()));
totleMoney
=
A1
.
add
(
A2
).
doubleValue
();
}
IostReceivingNoteList
curIostReceivingNotlist
=
new
IostReceivingNoteList
();
curIostReceivingNotlist
.
setNameChs
(
"总和"
);
curIostReceivingNotlist
.
setVolume
(
totlevolume
);
curIostReceivingNotlist
.
setWeight
(
totleWeightTotal
);
curIostReceivingNotlist
.
setPackages
(
totlePackagesTotal
);
curIostReceivingNotlist
.
setPrice
(
totlePrice
);
curIostReceivingNotlist
.
setMoney
(
totleMoney
);
iostIostReceivingNoteList
.
add
(
curIostReceivingNotlist
);
IostReceivingNoteList
iostReceivingNoteList
=
new
IostReceivingNoteList
();
iostReceivingNoteList
.
setNameChs
(
"总和"
);
iostReceivingNoteList
.
setVolume
(
totlevolume
);
iostReceivingNoteList
.
setWeight
(
totleWeightTotal
);
iostReceivingNoteList
.
setPackages
(
totlePackagesTotal
);
iostReceivingNoteList
.
setPrice
(
totlePrice
);
iostReceivingNoteList
.
setMoney
(
totleMoney
);
iostIostReceivingNoteList
.
add
(
iostReceivingNoteList
);
}
/**
...
...
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/basedata/controller/IostSummarySheetController.java
浏览文件 @
02a80fcd
...
...
@@ -2,6 +2,7 @@ package org.jeecg.modules.iost.basedata.controller;
import
java.io.UnsupportedEncodingException
;
import
java.io.IOException
;
import
java.math.BigDecimal
;
import
java.net.URLDecoder
;
import
java.text.DecimalFormat
;
import
java.util.ArrayList
;
...
...
@@ -536,15 +537,14 @@ public class IostSummarySheetController {
@GetMapping
(
value
=
"/queryIostSummarySheetListByMainIdiostListByMainId"
)
public
Result
<?>
queryIostReceivingNoteListListMainId
(
@RequestParam
(
name
=
"id"
,
required
=
true
)
String
id
)
{
List
<
IostSummarySheetList
>
iostReceivingNoteListList
=
iostSummarySheetListService
.
selectByMainId
(
id
);
addSumRow
(
iostReceivingNoteListList
);
iostReceivingNoteListList
.
add
(
addSumRow
(
iostReceivingNoteListList
)
);
return
Result
.
OK
(
iostReceivingNoteListList
);
}
/***
* 增加统计行
* @param iostSummarySheetLists
*/
private
void
addSumRow
(
List
<
IostSummarySheetList
>
iostSummarySheetLists
)
private
IostSummarySheetList
addSumRow
(
List
<
IostSummarySheetList
>
iostSummarySheetLists
)
{
double
totlevolume
=
0
;
//体积总
double
totleWeightTotal
=
0
;
//重量总
...
...
@@ -552,19 +552,28 @@ public class IostSummarySheetController {
double
totleMoney
=
0
;
//金额总
for
(
IostSummarySheetList
iostSummarySheetList:
iostSummarySheetLists
)
{
totlevolume
=
totlevolume
+
iostSummarySheetList
.
getVolume
();
totlePackagesTotal
=
totlePackagesTotal
+
iostSummarySheetList
.
getPackages
();
totleWeightTotal
=
totleWeightTotal
+
iostSummarySheetList
.
getWeight
();
totleMoney
=
totleMoney
+
iostSummarySheetList
.
getMoney
();
BigDecimal
A1
=
new
BigDecimal
(
Double
.
toString
(
totlevolume
));
BigDecimal
A2
=
new
BigDecimal
(
Double
.
toString
(
iostSummarySheetList
.
getVolume
()));
totlevolume
=
A1
.
add
(
A2
).
doubleValue
();
A1
=
new
BigDecimal
(
Double
.
toString
(
totleWeightTotal
));
A2
=
new
BigDecimal
(
Double
.
toString
(
iostSummarySheetList
.
getWeight
()));
totleWeightTotal
=
A1
.
add
(
A2
).
doubleValue
();
if
(
iostSummarySheetList
.
getPackages
()!=
null
){
totlePackagesTotal
=
totlePackagesTotal
+
iostSummarySheetList
.
getPackages
();
}
A1
=
new
BigDecimal
(
Double
.
toString
(
totleMoney
));
A2
=
new
BigDecimal
(
Double
.
toString
(
iostSummarySheetList
.
getMoney
()));
totleMoney
=
A1
.
add
(
A2
).
doubleValue
();
}
IostSummarySheetList
iostSummarySheetList
=
new
IostSummarySheetList
();
iostSummarySheetList
.
setCustomerName
(
"总和"
);
iostSummarySheetList
.
setVolume
((
double
)
Math
.
round
(
totlevolume
*
100
)/
100
);
//iostSummarySheetList.setVolume((Double.valueOf(String.format("%.2f", totlevolume))));
iostSummarySheetList
.
setVolume
(
totlevolume
);
iostSummarySheetList
.
setWeight
(
totleWeightTotal
);
iostSummarySheetList
.
setPackages
(
totlePackagesTotal
);
iostSummarySheetList
.
setMoney
(
totleMoney
);
iostSummarySheetLists
.
add
(
iostSummarySheetList
)
;
return
iostSummarySheetList
;
}
/**
...
...
@@ -592,15 +601,22 @@ public class IostSummarySheetController {
}
// Step.3 组装pageList
List
<
IostSummarySheetList
>
iostSummarySheetPagesList
=
new
ArrayList
<
IostSummarySheetList
>();
//记录需要总数的数据
List
<
IostSummarySheetPage
>
pageList
=
new
ArrayList
<
IostSummarySheetPage
>();
for
(
IostSummarySheet
main
:
iostSummarySheetList
)
{
IostSummarySheetPage
vo
=
new
IostSummarySheetPage
();
BeanUtils
.
copyProperties
(
main
,
vo
);
List
<
IostSummarySheetList
>
iostSummarySheetListList
=
iostSummarySheetListService
.
selectByMainId
(
main
.
getId
());
vo
.
setIostSummarySheetListList
(
iostSummarySheetListList
);
pageList
.
add
(
vo
);
}
IostSummarySheetPage
vo
=
new
IostSummarySheetPage
();
BeanUtils
.
copyProperties
(
main
,
vo
);
List
<
IostSummarySheetList
>
iostSummarySheetListList
=
iostSummarySheetListService
.
selectByMainId
(
main
.
getId
());
vo
.
setIostSummarySheetListList
(
iostSummarySheetListList
);
pageList
.
add
(
vo
);
iostSummarySheetPagesList
.
add
(
addSumRow
(
iostSummarySheetListList
));
}
//把总数放入pageList
IostSummarySheetPage
list
=
new
IostSummarySheetPage
();
List
<
IostSummarySheetList
>
listzongshu
=
new
ArrayList
<>();
listzongshu
.
add
(
addSumRow
(
iostSummarySheetPagesList
));
list
.
setIostSummarySheetListList
(
listzongshu
);
pageList
.
add
(
list
);
// Step.4 AutoPoi 导出Excel
ModelAndView
mv
=
new
ModelAndView
(
new
JeecgEntityExcelView
());
mv
.
addObject
(
NormalExcelConstants
.
FILE_NAME
,
"汇总单列表"
);
...
...
jeecg-boot-module-system/target/classes/org/jeecg/modules/iost/basedata/controller/IostReceivingNoteController.class
浏览文件 @
02a80fcd
No preview for this file type
jeecg-boot-module-system/target/classes/org/jeecg/modules/iost/basedata/controller/IostSummarySheetController.class
浏览文件 @
02a80fcd
No preview for this file type
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论