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

修改查看送货照片

上级 c0ee413c
...@@ -15,6 +15,8 @@ import java.util.stream.Collectors; ...@@ -15,6 +15,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.service.*;
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;
...@@ -26,17 +28,8 @@ import org.apache.shiro.authz.annotation.RequiresPermissions; ...@@ -26,17 +28,8 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
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.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.IostDeliveryNotePage;
import org.jeecg.modules.iost.basedata.vo.IostDeliveryRecordPage; 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.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ResourceUtils; import org.springframework.util.ResourceUtils;
...@@ -83,6 +76,10 @@ public class IostDeliveryNoteController { ...@@ -83,6 +76,10 @@ public class IostDeliveryNoteController {
private IIostDeliveryNoteListService iostDeliveryNoteListService; private IIostDeliveryNoteListService iostDeliveryNoteListService;
@Autowired @Autowired
private IIostDeliveryRecordPicService iostDeliveryRecordPicService; private IIostDeliveryRecordPicService iostDeliveryRecordPicService;
@Autowired
private IIostSummarySheetListService iostSummarySheetListService;
@Autowired
private IIostSummarySheetService iostSummarySheetService;
/** /**
* 分页列表查询 * 分页列表查询
...@@ -145,7 +142,7 @@ public class IostDeliveryNoteController { ...@@ -145,7 +142,7 @@ public class IostDeliveryNoteController {
/** /**
* 编辑 * 编辑
* *
* @param iostDeliveryNotePage * @param iostDeliveryRecordPage
* @return * @return
*/ */
@AutoLog(value = "delivery note-编辑") @AutoLog(value = "delivery note-编辑")
...@@ -184,18 +181,20 @@ public class IostDeliveryNoteController { ...@@ -184,18 +181,20 @@ public class IostDeliveryNoteController {
@GetMapping("/exportDeliveryNotePicPdf") @GetMapping("/exportDeliveryNotePicPdf")
@ApiOperation(value = "下载送货单报表(pdf)") @ApiOperation(value = "下载送货单报表(pdf)")
public void exportDeliveryNotePicPdf(HttpServletResponse response, @RequestParam(name="deliveryRecordId",required=true) String deliveryRecordId) throws IOException, DocumentException { public void exportDeliveryNotePicPdf(HttpServletResponse response, @RequestParam(name="deliveryRecordId",required=true) String deliveryRecordId) throws IOException, DocumentException {
QueryWrapper<IostSummarySheet> iostSummarySheetQueryWrapper = new QueryWrapper<>();
QueryWrapper<IostDeliveryRecordPic> iostDeliveryRecordPicWrapper = new QueryWrapper<>(); iostSummarySheetQueryWrapper.eq("delivery_record_id", deliveryRecordId);
iostDeliveryRecordPicWrapper.eq("id", deliveryRecordId); IostSummarySheet iostSummarySheets = iostSummarySheetService.getBaseMapper().selectOne(iostSummarySheetQueryWrapper);
List<IostDeliveryRecordPic> recordPics = iostDeliveryRecordPicService.list(iostDeliveryRecordPicWrapper); 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"; String fileName = "Delivery Note";
response.setContentType("application/x-download"); response.setContentType("application/x-download");
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);
//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);
...@@ -214,8 +213,10 @@ public class IostDeliveryNoteController { ...@@ -214,8 +213,10 @@ public class IostDeliveryNoteController {
document.newPage(); document.newPage();
addTitle(document, textFont); addTitle(document, textFont);
PdfPTable detailTable = new PdfPTable(1); PdfPTable detailTable = new PdfPTable(1);
Image img = getImg(iostDeliveryRecordPic) ; List<Image> img = getImg(iostDeliveryRecordPic) ;
PdfPCell cell = new PdfPCell(img); cell.setBorder(PdfPCell.NO_BORDER); detailTable.addCell(cell); 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); //cell.setFixedHeight(img.getHeight() * (60 / img.getWidth()));cell.setFixedHeight(200);
document.add(detailTable); document.add(detailTable);
} }
...@@ -238,9 +239,18 @@ public class IostDeliveryNoteController { ...@@ -238,9 +239,18 @@ public class IostDeliveryNoteController {
* @param flag 1 url形式 2本地存储形式 * @param flag 1 url形式 2本地存储形式
* @return * @return
*/ */
public Image getImg(IostDeliveryRecordPic iostDeliveryRecordPic) throws IOException, BadElementException { public List<Image> getImg(IostDeliveryRecordPic iostDeliveryRecordPic) throws IOException, BadElementException {
Image img = Image.getInstance("/wmssystem/storage/opt/upFiles/" + iostDeliveryRecordPic.getPic()); List<Image> imageList = new ArrayList<>();
return img; //获取字符串
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 { ...@@ -278,7 +288,6 @@ public class IostDeliveryNoteController {
//加载字体 //加载字体
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);
//字体 //字体
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);
......
...@@ -551,18 +551,26 @@ public class IostSummarySheetController { ...@@ -551,18 +551,26 @@ public class IostSummarySheetController {
double totleMoney = 0;//金额总 double totleMoney = 0;//金额总
for(IostSummarySheetList iostSummarySheetList: iostSummarySheetLists) for(IostSummarySheetList iostSummarySheetList: iostSummarySheetLists)
{ {
BigDecimal A1 = new BigDecimal(Double.toString(totlevolume)); BigDecimal A1;
BigDecimal A2 = new BigDecimal(Double.toString(iostSummarySheetList.getVolume())); BigDecimal A2;
totlevolume = A1.add(A2).doubleValue(); if(iostSummarySheetList.getVolume()!=null){
A1 = new BigDecimal(Double.toString(totleWeightTotal)); A1 = new BigDecimal(Double.toString(totlevolume));
A2 = new BigDecimal(Double.toString(iostSummarySheetList.getWeight())); A2 = new BigDecimal(Double.toString(iostSummarySheetList.getVolume()));
totleWeightTotal = A1.add(A2).doubleValue(); 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){ if(iostSummarySheetList.getPackages()!=null){
totlePackagesTotal = totlePackagesTotal + iostSummarySheetList.getPackages(); totlePackagesTotal = totlePackagesTotal + iostSummarySheetList.getPackages();
} }
A1 = new BigDecimal(Double.toString(totleMoney)); if(iostSummarySheetList.getMoney()!=null){
A2 = new BigDecimal(Double.toString(iostSummarySheetList.getMoney())); A1 = new BigDecimal(Double.toString(totleMoney));
totleMoney = A1.add(A2).doubleValue(); A2 = new BigDecimal(Double.toString(iostSummarySheetList.getMoney()));
totleMoney = A1.add(A2).doubleValue();
}
} }
IostSummarySheetList iostSummarySheetList = new IostSummarySheetList(); IostSummarySheetList iostSummarySheetList = new IostSummarySheetList();
......
7server: server:
port: 8080 port: 8080
tomcat: tomcat:
max-swallow-size: -1 max-swallow-size: -1
...@@ -127,7 +127,7 @@ spring: ...@@ -127,7 +127,7 @@ spring:
connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000 connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
datasource: datasource:
master: 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 username: root
password: gf^*i6%&9J83&(*kJ653F&L password: gf^*i6%&9J83&(*kJ653F&L
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
...@@ -140,7 +140,7 @@ spring: ...@@ -140,7 +140,7 @@ spring:
#redis 配置 #redis 配置
redis: redis:
database: 0 database: 0
host: wmssystem-redis host: 127.0.0.1
lettuce: lettuce:
pool: pool:
max-active: 8 #最大连接数据库连接数,设 0 为没有限制 max-active: 8 #最大连接数据库连接数,设 0 为没有限制
......
spring: spring:
profiles: profiles:
active: test active: docker
swagger: swagger:
production: false production: false
basic: basic:
......
package org.jeecg; package org.jeecg;
import cn.hutool.json.JSONObject; 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.SecurityTools;
import org.jeecg.common.util.security.entity.*; 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.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 { public class SecurityToolsTest {
@Test @Test
......
7server: server:
port: 8080 port: 8080
tomcat: tomcat:
max-swallow-size: -1 max-swallow-size: -1
...@@ -127,7 +127,7 @@ spring: ...@@ -127,7 +127,7 @@ spring:
connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000 connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
datasource: datasource:
master: 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 username: root
password: gf^*i6%&9J83&(*kJ653F&L password: gf^*i6%&9J83&(*kJ653F&L
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
...@@ -140,7 +140,7 @@ spring: ...@@ -140,7 +140,7 @@ spring:
#redis 配置 #redis 配置
redis: redis:
database: 0 database: 0
host: wmssystem-redis host: 127.0.0.1
lettuce: lettuce:
pool: pool:
max-active: 8 #最大连接数据库连接数,设 0 为没有限制 max-active: 8 #最大连接数据库连接数,设 0 为没有限制
......
spring: spring:
profiles: profiles:
active: test active: docker
swagger: swagger:
production: false production: false
basic: basic:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论