提交 01a87ed7 authored 作者: Wangjiajie's avatar Wangjiajie

修改查看送货照片

上级 c0ee413c
......@@ -15,6 +15,8 @@ import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.modules.iost.basedata.entity.*;
import org.jeecg.modules.iost.basedata.service.*;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
......@@ -26,17 +28,8 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.iost.basedata.entity.IostDeliveryNoteList;
import org.jeecg.modules.iost.basedata.entity.IostReceivingNote;
import org.jeecg.modules.iost.basedata.entity.IostReceivingNoteList;
import org.jeecg.modules.iost.basedata.entity.IostDeliveryNote;
import org.jeecg.modules.iost.basedata.entity.IostDeliveryRecord4Pics;
import org.jeecg.modules.iost.basedata.entity.IostDeliveryRecordPic;
import org.jeecg.modules.iost.basedata.vo.IostDeliveryNotePage;
import org.jeecg.modules.iost.basedata.vo.IostDeliveryRecordPage;
import org.jeecg.modules.iost.basedata.service.IIostDeliveryNoteService;
import org.jeecg.modules.iost.basedata.service.IIostDeliveryRecordPicService;
import org.jeecg.modules.iost.basedata.service.IIostDeliveryNoteListService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ResourceUtils;
......@@ -83,6 +76,10 @@ public class IostDeliveryNoteController {
private IIostDeliveryNoteListService iostDeliveryNoteListService;
@Autowired
private IIostDeliveryRecordPicService iostDeliveryRecordPicService;
@Autowired
private IIostSummarySheetListService iostSummarySheetListService;
@Autowired
private IIostSummarySheetService iostSummarySheetService;
/**
* 分页列表查询
......@@ -145,7 +142,7 @@ public class IostDeliveryNoteController {
/**
* 编辑
*
* @param iostDeliveryNotePage
* @param iostDeliveryRecordPage
* @return
*/
@AutoLog(value = "delivery note-编辑")
......@@ -184,18 +181,20 @@ public class IostDeliveryNoteController {
@GetMapping("/exportDeliveryNotePicPdf")
@ApiOperation(value = "下载送货单报表(pdf)")
public void exportDeliveryNotePicPdf(HttpServletResponse response, @RequestParam(name="deliveryRecordId",required=true) String deliveryRecordId) throws IOException, DocumentException {
QueryWrapper<IostDeliveryRecordPic> iostDeliveryRecordPicWrapper = new QueryWrapper<>();
iostDeliveryRecordPicWrapper.eq("id", deliveryRecordId);
List<IostDeliveryRecordPic> recordPics = iostDeliveryRecordPicService.list(iostDeliveryRecordPicWrapper);
QueryWrapper<IostSummarySheet> iostSummarySheetQueryWrapper = new QueryWrapper<>();
iostSummarySheetQueryWrapper.eq("delivery_record_id", deliveryRecordId);
IostSummarySheet iostSummarySheets = iostSummarySheetService.getBaseMapper().selectOne(iostSummarySheetQueryWrapper);
List<IostSummarySheetList> iostSummarySheetLists = iostSummarySheetListService.selectByMainId(iostSummarySheets.getId());
List<IostDeliveryRecordPic> recordPics = new ArrayList<>();
for (IostSummarySheetList iostSummarySheetList:iostSummarySheetLists) {
recordPics.add(iostDeliveryRecordPicService.getBaseMapper().selectById(iostSummarySheetList.getId()));
}
String fileName = "Delivery Note";
response.setContentType("application/x-download");
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);
//Create Document Instance
Document document = new Document(PageSize.A4);
Font textFont = new Font(bfChinese, 6, Font.NORMAL);
......@@ -214,8 +213,10 @@ public class IostDeliveryNoteController {
document.newPage();
addTitle(document, textFont);
PdfPTable detailTable = new PdfPTable(1);
Image img = getImg(iostDeliveryRecordPic) ;
PdfPCell cell = new PdfPCell(img); cell.setBorder(PdfPCell.NO_BORDER); detailTable.addCell(cell);
List<Image> img = getImg(iostDeliveryRecordPic) ;
for (Image imagelist: img) {
PdfPCell cell = new PdfPCell(imagelist); cell.setBorder(PdfPCell.NO_BORDER); detailTable.addCell(cell);
}
//cell.setFixedHeight(img.getHeight() * (60 / img.getWidth()));cell.setFixedHeight(200);
document.add(detailTable);
}
......@@ -238,9 +239,18 @@ public class IostDeliveryNoteController {
* @param flag 1 url形式 2本地存储形式
* @return
*/
public Image getImg(IostDeliveryRecordPic iostDeliveryRecordPic) throws IOException, BadElementException {
Image img = Image.getInstance("/wmssystem/storage/opt/upFiles/" + iostDeliveryRecordPic.getPic());
return img;
public List<Image> getImg(IostDeliveryRecordPic iostDeliveryRecordPic) throws IOException, BadElementException {
List<Image> imageList = new ArrayList<>();
//获取字符串
String string = iostDeliveryRecordPic.getPic();
//分割字符串
String substring = string.substring(0, string.length());
String[] result = substring.split(",");
for (int i = 0; i<result.length;i++){
imageList .add(Image.getInstance("/wmssystem/storage/opt/upFiles/" + result[i]));
}
return imageList;
}
......@@ -278,7 +288,6 @@ public class IostDeliveryNoteController {
//加载字体
BaseFont bfChinese = BaseFont.createFont("/wmssystem/config/res/stsong.ttf", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
//字体
Font titleFont = new Font(bfChinese, 20, Font.BOLD);
Font keyFont = new Font(bfChinese, 8, Font.NORMAL);
......
......@@ -551,18 +551,26 @@ public class IostSummarySheetController {
double totleMoney = 0;//金额总
for(IostSummarySheetList iostSummarySheetList: iostSummarySheetLists)
{
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();
BigDecimal A1;
BigDecimal A2;
if(iostSummarySheetList.getVolume()!=null){
A1 = new BigDecimal(Double.toString(totlevolume));
A2 = new BigDecimal(Double.toString(iostSummarySheetList.getVolume()));
totlevolume = A1.add(A2).doubleValue();
}
if(iostSummarySheetList.getWeight()!=null){
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();
if(iostSummarySheetList.getMoney()!=null){
A1 = new BigDecimal(Double.toString(totleMoney));
A2 = new BigDecimal(Double.toString(iostSummarySheetList.getMoney()));
totleMoney = A1.add(A2).doubleValue();
}
}
IostSummarySheetList iostSummarySheetList = new IostSummarySheetList();
......
7server:
server:
port: 8080
tomcat:
max-swallow-size: -1
......@@ -127,7 +127,7 @@ spring:
connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
datasource:
master:
url: jdbc:mysql://wmssystem-mysql:3306/wmssystem?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
url: jdbc:mysql://nf.lingqingkeji.com:13579/wmssystem?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
username: root
password: gf^*i6%&9J83&(*kJ653F&L
driver-class-name: com.mysql.cj.jdbc.Driver
......@@ -140,7 +140,7 @@ spring:
#redis 配置
redis:
database: 0
host: wmssystem-redis
host: 127.0.0.1
lettuce:
pool:
max-active: 8 #最大连接数据库连接数,设 0 为没有限制
......
spring:
profiles:
active: test
active: docker
swagger:
production: false
basic:
......
package org.jeecg;
import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.util.security.SecurityTools;
import org.jeecg.common.util.security.entity.*;
import org.jeecg.modules.iost.basedata.entity.IostDeliveryRecordPic;
import org.jeecg.modules.iost.basedata.entity.IostReceivingNote;
import org.jeecg.modules.iost.basedata.mapper.IostDeliveryRecordPicMapper;
import org.jeecg.modules.iost.basedata.service.IIostDeliveryRecordPageService;
import org.jeecg.modules.iost.basedata.service.IIostDeliveryRecordPicService;
import org.jeecg.modules.iost.basedata.service.impl.IostDeliveryRecordPicServiceImpl;
import org.jeecg.modules.iost.basedata.vo.IostDeliveryRecordPage;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import java.io.Serializable;
import java.util.Collection;
import java.util.List;
import java.util.Map;
public class SecurityToolsTest {
@Test
......
7server:
server:
port: 8080
tomcat:
max-swallow-size: -1
......@@ -127,7 +127,7 @@ spring:
connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
datasource:
master:
url: jdbc:mysql://wmssystem-mysql:3306/wmssystem?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
url: jdbc:mysql://nf.lingqingkeji.com:13579/wmssystem?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
username: root
password: gf^*i6%&9J83&(*kJ653F&L
driver-class-name: com.mysql.cj.jdbc.Driver
......@@ -140,7 +140,7 @@ spring:
#redis 配置
redis:
database: 0
host: wmssystem-redis
host: 127.0.0.1
lettuce:
pool:
max-active: 8 #最大连接数据库连接数,设 0 为没有限制
......
spring:
profiles:
active: test
active: docker
swagger:
production: false
basic:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论