diff --git a/SC-boot/linkage-scm/src/main/java/jnpf/purchaseorder/service/impl/PurchaseorderitemServiceImpl.java b/SC-boot/linkage-scm/src/main/java/jnpf/purchaseorder/service/impl/PurchaseorderitemServiceImpl.java index bd39c5d7..41d13025 100644 --- a/SC-boot/linkage-scm/src/main/java/jnpf/purchaseorder/service/impl/PurchaseorderitemServiceImpl.java +++ b/SC-boot/linkage-scm/src/main/java/jnpf/purchaseorder/service/impl/PurchaseorderitemServiceImpl.java @@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.spire.doc.Document; import com.spire.doc.FileFormat; +import com.spire.doc.PageSetup; import com.spire.doc.Section; import com.spire.doc.documents.HorizontalAlignment; import com.spire.doc.documents.Paragraph; @@ -552,34 +553,61 @@ public class PurchaseorderitemServiceImpl extends ServiceImplpicHeight){ +// picHeight = picWidth * (height/width) ; +// }else { +// picHeight=height; +// } +// if (width>picWidth){ +// picHeight = picWidth * (height/width) ; +// }else { +// picWidth=width; +// } +// } + + + + Section sectionn = document.getLastSection(); + PageSetup pageSetup = sectionn.getPageSetup(); +//获取页面宽度 + float pageWidth = (float)pageSetup.getPageSize().getWidth(); +//获取左右页边距宽度 + float left = pageSetup.getMargins().getLeft(); + float right = pageSetup.getMargins().getRight(); +//可编辑区域的宽度,此宽度既可以作为插入图片的宽度,刚好铺满 + float width = pageWidth - left - right; + +//设置图片大小代码 + + picture.setWidth(width ); + Integer height = 0; + Integer widthh = 0; if (map1.get("width") != null) { - width = Integer.valueOf(String.valueOf(map1.get("width"))); + widthh = Integer.valueOf(String.valueOf(map1.get("width"))); } if (map1.get("height") != null) { - height = Integer.valueOf(String.valueOf(map1.get("height"))); - } - if (width != null && height != null) { - if (height>picHeight){ - picHeight = picWidth * (height/width) ; - }else { - picHeight=height; - } - if (width>picWidth){ - picHeight = picWidth * (height/width) ; - }else { - picWidth=width; - } + height = Integer.valueOf(String.valueOf(map1.get("height"))); } - pic.setWidth(picWidth==0?500:picWidth); - pic.setHeight(picHeight==0?600:picHeight); + picture.setHeight(widthh!=0?width*(height/widthh):0); + + +// picture.setWidth(picWidth==0?500:picWidth); +// picture.setHeight(picHeight==0?600:picHeight); } diff --git a/SC-boot/linkage-scm/src/main/resources/mapper/purchaseorder/PurchaseorderMapper.xml b/SC-boot/linkage-scm/src/main/resources/mapper/purchaseorder/PurchaseorderMapper.xml index f2fa1a1a..e25a52d7 100644 --- a/SC-boot/linkage-scm/src/main/resources/mapper/purchaseorder/PurchaseorderMapper.xml +++ b/SC-boot/linkage-scm/src/main/resources/mapper/purchaseorder/PurchaseorderMapper.xml @@ -83,7 +83,6 @@ e.contract_code AS `contractCode`, a.supplier_name AS `supplierName`, a.document_no AS `documentNo`, - a.amount AS `amount`, c.item_name AS `itemName`, ( CASE