提交 cfa0ca4a authored 作者: Wangjiajie's avatar Wangjiajie

增加送货管理总行,修改送货管理的查看图片功能(未完成)

上级 73593866
...@@ -194,7 +194,8 @@ public class IostDeliveryNoteController { ...@@ -194,7 +194,8 @@ public class IostDeliveryNoteController {
response.addHeader("Content-Disposition", "attachment;filename="+new String(fileName.getBytes("utf-8"), "ISO8859-1" )+".pdf"); response.addHeader("Content-Disposition", "attachment;filename="+new String(fileName.getBytes("utf-8"), "ISO8859-1" )+".pdf");
//加载字体 //加载字体
BaseFont bfChinese = BaseFont.createFont("/wmssystem/config/res/stsong.ttf", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED); //BaseFont bfChinese = BaseFont.createFont("/wmssystem/config/res/stsong.ttf", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
BaseFont bfChinese = BaseFont.createFont("/res/stsong.ttf", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
//Create Document Instance //Create Document Instance
Document document = new Document(PageSize.A4); Document document = new Document(PageSize.A4);
Font textFont = new Font(bfChinese, 6, Font.NORMAL); Font textFont = new Font(bfChinese, 6, Font.NORMAL);
...@@ -213,9 +214,11 @@ public class IostDeliveryNoteController { ...@@ -213,9 +214,11 @@ public class IostDeliveryNoteController {
document.newPage(); document.newPage();
addTitle(document, textFont); addTitle(document, textFont);
PdfPTable detailTable = new PdfPTable(1); PdfPTable detailTable = new PdfPTable(1);
detailTable.setWidthPercentage(100f);
List<Image> img = getImg(iostDeliveryRecordPic) ; List<Image> img = getImg(iostDeliveryRecordPic) ;
for (Image imagelist: img) { for (Image imagelist: img) {
PdfPCell cell = new PdfPCell(imagelist); cell.setBorder(PdfPCell.NO_BORDER); detailTable.addCell(cell);
PdfPCell cell = new PdfPCell(imagelist);cell.setBorder(PdfPCell.NO_BORDER);cell.setHorizontalAlignment(Element.ALIGN_LEFT);detailTable.addCell(cell);
} }
//cell.setFixedHeight(img.getHeight() * (60 / img.getWidth()));cell.setFixedHeight(200); //cell.setFixedHeight(img.getHeight() * (60 / img.getWidth()));cell.setFixedHeight(200);
document.add(detailTable); document.add(detailTable);
...@@ -247,7 +250,8 @@ public class IostDeliveryNoteController { ...@@ -247,7 +250,8 @@ public class IostDeliveryNoteController {
String substring = string.substring(0, string.length()); String substring = string.substring(0, string.length());
String[] result = substring.split(","); String[] result = substring.split(",");
for (int i = 0; i<result.length;i++){ for (int i = 0; i<result.length;i++){
imageList .add(Image.getInstance("/wmssystem/storage/opt/upFiles/" + result[i])); Image img = Image.getInstance("/公司专用文件/wmssystem/storage/opt/upFiles/" + result[i]);
imageList.add(img);
} }
return imageList; return imageList;
...@@ -287,7 +291,8 @@ public class IostDeliveryNoteController { ...@@ -287,7 +291,8 @@ public class IostDeliveryNoteController {
Document document = new Document(PageSize.A4); Document document = new Document(PageSize.A4);
//加载字体 //加载字体
BaseFont bfChinese = BaseFont.createFont("/wmssystem/config/res/stsong.ttf", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED); //BaseFont bfChinese = BaseFont.createFont("/wmssystem/config/res/stsong.ttf", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
BaseFont bfChinese = BaseFont.createFont("/res/stsong.ttf", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
//字体 //字体
Font titleFont = new Font(bfChinese, 20, Font.BOLD); Font titleFont = new Font(bfChinese, 20, Font.BOLD);
Font keyFont = new Font(bfChinese, 8, Font.NORMAL); Font keyFont = new Font(bfChinese, 8, Font.NORMAL);
......
...@@ -2,6 +2,7 @@ package org.jeecg.modules.iost.basedata.controller; ...@@ -2,6 +2,7 @@ package org.jeecg.modules.iost.basedata.controller;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.io.IOException; import java.io.IOException;
import java.math.BigDecimal;
import java.net.URLDecoder; import java.net.URLDecoder;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
...@@ -13,6 +14,8 @@ import java.util.stream.Collectors; ...@@ -13,6 +14,8 @@ import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.jeecg.modules.iost.basedata.entity.*;
import org.jeecg.modules.iost.basedata.vo.IostSummarySheetPage;
import org.jeecgframework.poi.excel.ExcelImportUtil; import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants; import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams; import org.jeecgframework.poi.excel.entity.ExportParams;
...@@ -23,10 +26,6 @@ import org.apache.shiro.SecurityUtils; ...@@ -23,10 +26,6 @@ import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils; import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.iost.basedata.entity.IostDeliveryRecordList;
import org.jeecg.modules.iost.basedata.entity.IostReceivinglist;
import org.jeecg.modules.iost.basedata.entity.DeliverySumSourceField;
import org.jeecg.modules.iost.basedata.entity.IostDeliveryRecord;
import org.jeecg.modules.iost.basedata.vo.IostDeliveryRecordPage; import org.jeecg.modules.iost.basedata.vo.IostDeliveryRecordPage;
import org.jeecg.modules.iost.basedata.vo.IostReceivingPage; import org.jeecg.modules.iost.basedata.vo.IostReceivingPage;
import org.jeecg.modules.iost.basedata.service.IIostDeliveryRecordService; import org.jeecg.modules.iost.basedata.service.IIostDeliveryRecordService;
...@@ -408,7 +407,7 @@ public class IostDeliveryRecordController { ...@@ -408,7 +407,7 @@ public class IostDeliveryRecordController {
/** /**
* 通过id删除 * 通过id删除
* *
* @param i * @param
* @return * @return
*/ */
@AutoLog(value = "出库记录-通过id删除") @AutoLog(value = "出库记录-通过id删除")
...@@ -480,6 +479,83 @@ public class IostDeliveryRecordController { ...@@ -480,6 +479,83 @@ public class IostDeliveryRecordController {
return Result.OK(iostDeliveryRecordListList); return Result.OK(iostDeliveryRecordListList);
} }
/***
* 增加统计行
* @param pageList
*/
private IostDeliveryRecordPage addSumRow(List<IostDeliveryRecordPage> pageList)
{
IostDeliveryRecordPage iostDeliveryRecord = new IostDeliveryRecordPage();
List<IostDeliveryRecordList> iostDeliveryRecordLists = new ArrayList<>();
double totlevolume = 0;//体积总
int totlepackagesTotals = 0;//件数总
double totleweightTotals = 0;//重量总
double totleMoney = 0;//金额总
double totlevolumeList = 0;//体积总
int totlepackagesTotalsList = 0;//件数总
double totleweightTotalsList = 0;//重量总
double totleMoneyList = 0;//金额总
for (IostDeliveryRecordPage iostDeliveryRecordPage:pageList){
for(IostDeliveryRecordList iostDeliveryRecordList :iostDeliveryRecordPage.getIostDeliveryRecordListList()){
BigDecimal A1;
BigDecimal A2;
if(iostDeliveryRecordList.getVolumeTotal()!=null){
A1 = new BigDecimal(Double.toString(totlevolumeList));
A2 = new BigDecimal(Double.toString(iostDeliveryRecordList.getVolumeTotal()));
totlevolumeList = A1.add(A2).doubleValue();
}
if(iostDeliveryRecordList.getWeightTotal()!=null){
A1 = new BigDecimal(Double.toString(totleweightTotalsList));
A2 = new BigDecimal(Double.toString(iostDeliveryRecordList.getWeightTotal()));
totleweightTotalsList = A1.add(A2).doubleValue();
}
if(iostDeliveryRecordList.getWeightTotal()!=null){
totlepackagesTotalsList = totlepackagesTotalsList + iostDeliveryRecordList.getPackagesTotal();
}
if(iostDeliveryRecordList.getMoney()!=null){
A1 = new BigDecimal(Double.toString(totleMoneyList));
A2 = new BigDecimal(Double.toString(iostDeliveryRecordList.getMoney()));
totleMoneyList = A1.add(A2).doubleValue();
}
}
BigDecimal A1;
BigDecimal A2;
if(iostDeliveryRecordPage.getVolumeTotals()!=null){
A1 = new BigDecimal(Double.toString(totlevolumeList));
A2 = new BigDecimal(Double.toString(iostDeliveryRecordPage.getVolumeTotals()));
totlevolume = A1.add(A2).doubleValue();
}
if(iostDeliveryRecordPage.getWeightTotals()!=null){
A1 = new BigDecimal(Double.toString(totleweightTotalsList));
A2 = new BigDecimal(Double.toString(iostDeliveryRecordPage.getWeightTotals()));
totleweightTotals= A1.add(A2).doubleValue();
}
if(iostDeliveryRecordPage.getWeightTotals()!=null){
totlepackagesTotals = totlepackagesTotalsList + iostDeliveryRecordPage.getPackagesTotals();
}
if(iostDeliveryRecordPage.getMoneyTotal()!=null){
A1 = new BigDecimal(Double.toString(totleMoneyList));
A2 = new BigDecimal(Double.toString(iostDeliveryRecordPage.getMoneyTotal()));
totleMoney = A1.add(A2).doubleValue();
}
}
//List<IostDeliveryRecordList>
IostDeliveryRecordList iostDeliveryRecord1 = new IostDeliveryRecordList();
iostDeliveryRecord1.setVolumeTotal(totlevolumeList);
iostDeliveryRecord1.setWeightTotal(totleweightTotalsList);
iostDeliveryRecord1.setPackagesTotal(totlepackagesTotalsList);
iostDeliveryRecord1.setMoney(totleMoneyList);
iostDeliveryRecordLists.add(iostDeliveryRecord1);
//IostDeliveryRecordPage
iostDeliveryRecord.setBulkNo("总行");
iostDeliveryRecord.setVolumeTotals(totlevolume);
iostDeliveryRecord.setWeightTotals(totleweightTotals);
iostDeliveryRecord.setPackagesTotals(totlepackagesTotals);
iostDeliveryRecord.setMoneyTotal(totleMoney);
iostDeliveryRecord.setIostDeliveryRecordListList(iostDeliveryRecordLists);
return iostDeliveryRecord;
}
/** /**
* 导出excel * 导出excel
* *
...@@ -513,7 +589,8 @@ public class IostDeliveryRecordController { ...@@ -513,7 +589,8 @@ public class IostDeliveryRecordController {
vo.setIostDeliveryRecordListList(iostDeliveryRecordListList); vo.setIostDeliveryRecordListList(iostDeliveryRecordListList);
pageList.add(vo); pageList.add(vo);
} }
//添加总数行
pageList.add(addSumRow(pageList));
// Step.4 AutoPoi 导出Excel // Step.4 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
mv.addObject(NormalExcelConstants.FILE_NAME, "出库记录列表"); mv.addObject(NormalExcelConstants.FILE_NAME, "出库记录列表");
......
...@@ -140,7 +140,7 @@ spring: ...@@ -140,7 +140,7 @@ spring:
#redis 配置 #redis 配置
redis: redis:
database: 0 database: 0
host: 127.0.0.1 host: wmssystem-redis
lettuce: lettuce:
pool: pool:
max-active: 8 #最大连接数据库连接数,设 0 为没有限制 max-active: 8 #最大连接数据库连接数,设 0 为没有限制
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论