采购订单-开票文件下载bug修复

product
chuang 2 years ago
parent 81bf47c3b6
commit 60a4d88f5e

@ -3,8 +3,8 @@ spring: #环境 dev|test|pro|preview
active: dev active: dev
servlet: servlet:
multipart: #文件传输配置 multipart: #文件传输配置
max-file-size: 100MB #单个数据大小限制 max-file-size: 1000MB #单个数据大小限制
max-request-size: 100MB #请求总数据大小限制 max-request-size: 1000MB #请求总数据大小限制
enabled: true #是否启用分段上传支持 enabled: true #是否启用分段上传支持
mvc: mvc:
hiddenmethod: #隐式方法过滤器 hiddenmethod: #隐式方法过滤器

@ -79,6 +79,7 @@ public class FileCopy {
MultipartFile multipartFile = new MultipartFileDto(file.getName(), file.getName(), ContentType.JSON.toString(), FileCopyUtils.copyToByteArray(input)); MultipartFile multipartFile = new MultipartFileDto(file.getName(), file.getName(), ContentType.JSON.toString(), FileCopyUtils.copyToByteArray(input));
UtilsController utilsController = SpringContext.getBean(UtilsController.class); UtilsController utilsController = SpringContext.getBean(UtilsController.class);
System.out.println(multipartFile.getName()); System.out.println(multipartFile.getName());
Thread.sleep(1000);
ActionResult annex = utilsController.uploader(multipartFile, "annex"); ActionResult annex = utilsController.uploader(multipartFile, "annex");
if (annex.getCode() == 200) { if (annex.getCode() == 200) {
list.add(annex.getData()); list.add(annex.getData());
@ -261,7 +262,7 @@ public class FileCopy {
String type = url.substring(16, i); String type = url.substring(16, i);
// System.out.println("type"+type); // System.out.println("type"+type);
// System.out.println("type.toLowerCase()"+type.toLowerCase()); // System.out.println("type.toLowerCase()"+type.toLowerCase());
String fileId = map.get("name"); // String fileId = map.get("name");
// 本地文件路径 // 本地文件路径
String filePath = FilePathUtil.getFilePath(type.toLowerCase()) + fileName; String filePath = FilePathUtil.getFilePath(type.toLowerCase()) + fileName;
// 获得图片的base64码 // 获得图片的base64码
@ -269,7 +270,7 @@ public class FileCopy {
int[] imgWidthHeight = FileCopy.getImgWidthHeight(filePath); int[] imgWidthHeight = FileCopy.getImgWidthHeight(filePath);
HashMap<String, Object> map1 = new HashMap<>(); HashMap<String, Object> map1 = new HashMap<>();
map1.put("imgBase", imageBase); map1.put("imgBase", imageBase);
map1.put("name", fileId); map1.put("name", fileName);
map1.put("filePath", filePath); map1.put("filePath", filePath);
if (imgWidthHeight != null) { if (imgWidthHeight != null) {
map1.put("width", String.valueOf(imgWidthHeight[0])); map1.put("width", String.valueOf(imgWidthHeight[0]));

@ -502,26 +502,33 @@ public class PurchaseorderitemServiceImpl extends ServiceImpl<PurchaseorderitemM
paragraph1.appendText(String.valueOf(map.get("supplierNm"))); paragraph1.appendText(String.valueOf(map.get("supplierNm")));
paragraph1.applyStyle("paraStyle"); paragraph1.applyStyle("paraStyle");
Paragraph paragraph = section.addParagraph(); Paragraph paragraph = section.addParagraph();
DocPicture pic = paragraph.appendPicture((String) map1.get("filePath")); File filePath = new File((String) map1.get("filePath"));
int picHeight = 300; DocPicture pic =null;
int picWidth = 250; if (filePath.exists()){
Integer width = null; pic = paragraph.appendPicture((String) map1.get("filePath"));
int picHeight = 300;
int picWidth = 250;
Integer width = null;
Integer height = null; Integer height = null;
if (map1.get("width") != null) { if (map1.get("width") != null) {
width = Integer.valueOf(String.valueOf(map1.get("width"))); width = Integer.valueOf(String.valueOf(map1.get("width")));
} }
if (map1.get("height") != null) { if (map1.get("height") != null) {
height = Integer.valueOf(String.valueOf(map1.get("height"))); height = Integer.valueOf(String.valueOf(map1.get("height")));
} }
if (width != null && height != null) { if (width != null && height != null) {
picWidth = picHeight * width / height; picWidth = picHeight * width / height;
// if (picWidth == null)
}
pic.setWidth(picWidth==0?250:picWidth);
pic.setHeight(picHeight==0?300:picHeight);
} }
pic.setWidth(picWidth);
pic.setHeight(picHeight);
} }
} }
} }
@ -1479,7 +1486,6 @@ public class PurchaseorderitemServiceImpl extends ServiceImpl<PurchaseorderitemM
} else { } else {
model.setCauseError("销售合同不存在!请添加销售合同后尝试添加!"); model.setCauseError("销售合同不存在!请添加销售合同后尝试添加!");
errList.add(model); errList.add(model);
ints.add(i); ints.add(i);
continue; continue;
} }

@ -69,73 +69,6 @@
</resultMap> </resultMap>
<!-- <select id="getPurchorderItemMap" resultMap="purchorderItemMap">-->
<!-- SELECT-->
<!-- *-->
<!-- FROM-->
<!-- (-->
<!-- SELECT-->
<!-- a.DOCUMENT_NO,-->
<!-- a.creator_user_name AS `creatorUserName`,-->
<!-- a.creator_time AS `creatorTime`,-->
<!-- a.contract_no AS `contractNo`,-->
<!-- a.contract_code AS `contractCode`,-->
<!-- a.supplier_name AS `supplierName`,-->
<!-- a.document_no AS `documentNo`,-->
<!-- b.material_name AS `materialName`,-->
<!-- (-->
<!-- CASE-->
<!-- b.rate-->
<!-- WHEN '0' THEN-->
<!-- 13-->
<!-- WHEN '1' THEN-->
<!-- 9-->
<!-- WHEN '2' THEN-->
<!-- 6-->
<!-- WHEN '3' THEN-->
<!-- 5-->
<!-- WHEN '4' THEN-->
<!-- 3 ELSE b.unit-->
<!-- END-->
<!-- ) AS `rate1`,-->
<!-- AVG( b.price ) AS `price1`,-->
<!-- SUM( b.settlement ) AS `settlement1`,-->
<!-- ( CASE b.unit WHEN 0 THEN '吨' ELSE '千克' END ) AS `unit1`,-->
<!-- SUM( b.amount ) `amount1`,-->
<!-- b.pound_pictures poundPictures,-->
<!-- c.vehicle_pictures vehiclePictures,-->
<!-- d.supplier_nm,-->
<!-- c.pound_date 收货日期,-->
<!-- e.ticketno 送货车号,-->
<!-- c.gross_weight 毛重,-->
<!-- c.tare_weight 皮重,-->
<!-- c.buckle_weight 扣重,-->
<!-- c.settlement 结算重量-->
<!-- FROM-->
<!-- jg_purchaseorder AS a-->
<!-- LEFT JOIN jg_purchaseorder_item0 AS b ON a.id = b.purchaseorder_id-->
<!-- AND (-->
<!-- b.delete_mark != '1'-->
<!-- OR ISNULL( b.delete_mark ))-->
<!-- LEFT JOIN jg_poundlist AS c ON b.poundlist_id = c.id-->
<!-- AND (-->
<!-- c.delete_mark != '1'-->
<!-- OR ISNULL( c.delete_mark ))-->
<!-- AND (-->
<!-- ( c.pound_status != '1' AND c.pound_status != '2' )-->
<!-- OR ISNULL( c.pound_status ))-->
<!-- LEFT JOIN jg_customer AS d ON c.customer_id = d.id-->
<!-- AND (-->
<!-- d.delete_mark != '1'-->
<!-- OR ISNULL( d.delete_mark ))-->
<!-- LEFT JOIN jg_vehicle e ON c.vehicle_id = e.id-->
<!-- GROUP BY-->
<!-- b.material_name,-->
<!-- b.rate,-->
<!-- b.unit,-->
<!-- a.id-->
<!-- ) aaa ${ew.customSqlSegment}-->
<!-- </select>-->
<select id="getPdfInfo" resultMap="resultPdfInfoMap"> <select id="getPdfInfo" resultMap="resultPdfInfoMap">
SELECT SELECT
@ -223,7 +156,8 @@
( (
SELECT SELECT
a.document_no, a.document_no,
a.supplier_name AS `supplierName`, IFNULL(g.supplier_name,'供应商信息查不到') AS `supplierName`,
c.supplier_id,
f.item_name AS `materialName`, f.item_name AS `materialName`,
c.vehicle_pictures vehiclePictures, c.vehicle_pictures vehiclePictures,
c.pound_pictures poundPictures, c.pound_pictures poundPictures,
@ -238,7 +172,9 @@
( CASE c.unit WHEN 0 THEN '吨' ELSE '千克' END ) AS `unit` ( CASE c.unit WHEN 0 THEN '吨' ELSE '千克' END ) AS `unit`
FROM FROM
jg_purchaseorder AS a jg_purchaseorder AS a
LEFT JOIN jg_poundlist AS c ON c.purchase_id = a.contract_code LEFT JOIN jg_purchaseorder_item0 b ON a.id = b.purchaseorder_id
AND b.delete_mark = '0'
LEFT JOIN jg_poundlist AS c ON c.id = b.poundlist_id
AND c.delete_mark = '0' AND c.delete_mark = '0'
LEFT JOIN jg_material f ON c.material_id = f.id LEFT JOIN jg_material f ON c.material_id = f.id
AND f.delete_mark = '0' AND f.delete_mark = '0'
@ -246,9 +182,10 @@
AND d.delete_mark = '0' AND d.delete_mark = '0'
LEFT JOIN jg_vehicle e ON c.vehicle_id = e.id LEFT JOIN jg_vehicle e ON c.vehicle_id = e.id
AND e.delete_mark = '0' AND e.delete_mark = '0'
LEFT JOIN jg_supplier g on c.supplier_id=g.id
WHERE WHERE
a.delete_mark = '0' a.delete_mark = '0'
) aaa ${ew.customSqlSegment} ) aaa ${ew.customSqlSegment}
</select> </select>
<select id="getVehicleInfo" resultType="hashMap"> <select id="getVehicleInfo" resultType="hashMap">
@ -265,13 +202,14 @@
e.drivername e.drivername
FROM FROM
jg_purchaseorder AS a jg_purchaseorder AS a
LEFT JOIN jg_poundlist AS c ON c.purchase_id = a.contract_code LEFT JOIN jg_purchaseorder_item0 b ON a.id = b.purchaseorder_id
AND c.delete_mark = '0' AND b.delete_mark = '0'
LEFT JOIN jg_poundlist AS c ON c.id = b.poundlist_id
LEFT JOIN jg_vehicle e ON c.vehicle_id = e.id LEFT JOIN jg_vehicle e ON c.vehicle_id = e.id
AND e.delete_mark = '0' AND e.delete_mark = '0'
WHERE WHERE
a.delete_mark = '0' a.delete_mark = '0'
) aaa ${ew.customSqlSegment} ) aaa ${ew.customSqlSegment}
</select> </select>
<select id="queryByKeyword" resultType="jnpf.purchaseorder.entity.PurchaseorderitemEntity"> <select id="queryByKeyword" resultType="jnpf.purchaseorder.entity.PurchaseorderitemEntity">

Loading…
Cancel
Save