钱惠东 il y a 1 semaine
Parent
commit
60616b4ba1

+ 4 - 0
RuoYi-Vue-fast-master/src/main/java/com/ruoyi/project/business/dto/ContractSigningStatistic.java

@@ -33,12 +33,16 @@ public class ContractSigningStatistic {
     private BigDecimal weekDeliveryCountTotalAll;
 
     // 4. 全年各区域签约金额统计
+    private String signingAreaColStatisticsTitle;
     private List<List<String>> signingAreaColStatistics;
     // 5. 全年各区域排产金额统计
+    private String productionAreaColStatisticsTitle;
     private List<List<String>> productionAreaColStatistics;
     // 6. 全年各区域发货金额统计
+    private String deliveryMonthColStatisticsTitle;
     private List<List<String>> deliveryMonthColStatistics;
     // 7. 全年各区域排产金额统计
+    private String productionMonthColStatisticsTitle;
     private List<List<String>> productionMonthColStatistics;
 
 

+ 8 - 4
RuoYi-Vue-fast-master/src/main/java/com/ruoyi/project/business/service/impl/TqContractServiceImpl.java

@@ -526,14 +526,18 @@ public class TqContractServiceImpl implements ITqContractService
 
         // 4. 全年各区域签约金额
         List<LiftMonthCount> signingAmountAll = tqContractLiftMapper.countSigningStatisticAll(year);
+        result.setSigningAreaColStatisticsTitle(year + "国际各区域签单");
         result.setSigningAreaColStatistics(getAreaColList(signingAmountAll));
         // 5. 全年各区域排产金额
         List<LiftMonthCount> productionAmountAll = tqContractLiftMapper.countProductionStatisticAll(year);
+        result.setProductionAreaColStatisticsTitle(year + "国际各区域排产");
         result.setProductionAreaColStatistics(getAreaColList(productionAmountAll));
         // 6. 全年各区域发货金额
         List<LiftMonthCount> deliveryAmountAll = tqContractLiftMapper.countDeliveryStatisticAll(year);
+        result.setDeliveryMonthColStatisticsTitle(year + "发货金额");
         result.setDeliveryMonthColStatistics(getMonthColList(deliveryAmountAll));
         // 7. 全年各区域排产金额
+        result.setProductionAreaColStatisticsTitle(year + "排产金额");
         result.setProductionMonthColStatistics(getMonthColList(productionAmountAll));
 
         return result;
@@ -689,10 +693,10 @@ public class TqContractServiceImpl implements ITqContractService
         response.setCharacterEncoding("utf-8");
         try (ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream()).build()) {
 
-            excelWriter.write(contractSigningStatistic.getSigningAreaColStatistics(), EasyExcel.writerSheet(year + "国际各区域签单").build());
-            excelWriter.write(contractSigningStatistic.getProductionAreaColStatistics(), EasyExcel.writerSheet(year + "国际各区域排产").build());
-            excelWriter.write(contractSigningStatistic.getDeliveryMonthColStatistics(), EasyExcel.writerSheet(year + "发货金额").build());
-            excelWriter.write(contractSigningStatistic.getProductionMonthColStatistics(), EasyExcel.writerSheet(year + "排产金额").build());
+            excelWriter.write(contractSigningStatistic.getSigningAreaColStatistics(), EasyExcel.writerSheet(contractSigningStatistic.getSigningAreaColStatisticsTitle()).build());
+            excelWriter.write(contractSigningStatistic.getProductionAreaColStatistics(), EasyExcel.writerSheet(contractSigningStatistic.getProductionAreaColStatisticsTitle()).build());
+            excelWriter.write(contractSigningStatistic.getDeliveryMonthColStatistics(), EasyExcel.writerSheet(contractSigningStatistic.getDeliveryMonthColStatisticsTitle()).build());
+            excelWriter.write(contractSigningStatistic.getProductionMonthColStatistics(), EasyExcel.writerSheet(contractSigningStatistic.getProductionMonthColStatisticsTitle()).build());
         } catch (IOException e) {
             e.printStackTrace();
             throw new ServiceException("导出失败");

+ 15 - 6
RuoYi-Vue-fast-master/src/main/java/com/ruoyi/project/business/service/quotation/impl/TqQuotationServiceImpl.java

@@ -1250,14 +1250,17 @@ public class TqQuotationServiceImpl extends ServiceImpl<TqQuotationMapper, TqQuo
         List<MaterialImageVO> images = new ArrayList<>();
         imageKeys.stream().distinct().forEach(key -> {
             if (CollectionUtils.isNotEmpty(imageMap.get(key))) {
-//                MaterialImageVO exist = images.size() > 0 ? images.get(images.size() - 1) : null;
-                MaterialImageVO exist = null;
+                MaterialImageVO exist = images.size() > 0 ? images.get(images.size() - 1) : null;
                 String code = paraItemNameMap.get(key);
                 String path = RuoYiConfig.getProfile() + StringUtils.substringAfter(imageMap.get(key).get(0).getPrarSource(), Constants.RESOURCE_PREFIX);
                 FileImageProvider file = new FileImageProvider(new File(path), true);
                 try {
-                    if (file.getImageInfo().getWidth() > 600f){
-                        file.setWidth(600f);
+                    if (file.getImageInfo().getWidth() > 250f){
+                        file.setWidth(250f);
+                        file.setResize(true);
+                    }
+                    if (file.getImageInfo().getHeight() > 250f){
+                        file.setHeight(250f);
                         file.setResize(true);
                     }
                 } catch (IOException e) {
@@ -1318,8 +1321,14 @@ public class TqQuotationServiceImpl extends ServiceImpl<TqQuotationMapper, TqQuo
         String path = CollectionUtils.isNotEmpty(previewList) ? RuoYiConfig.getProfile() + StringUtils.substringAfter(previewList.get(0).getFilePath(), Constants.RESOURCE_PREFIX): "/null";
         FileImageProvider file = new FileImageProvider(new File(path), true);
         file.setBehaviour(NullImageBehaviour.RemoveImageTemplate);
-        file.setWidth(600f);
-        file.setResize(true);
+        try {
+            if (file.getImageInfo().getWidth() > 600f){
+                file.setWidth(600f);
+                file.setResize(true);
+            }
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
         map.put("preview", file);
         if (new File(path).exists()){
             map.put("showPreview", true);

BIN
RuoYi-Vue-fast-master/src/main/resources/wordTemplate/报价单.docx


+ 1 - 1
ruoyi-ui-vue2/src/views/board/contractSigningStatistic/index.vue

@@ -81,7 +81,7 @@
 
       <el-row :gutter="24">
         <el-col :span="12">
-          <h2>{{ data.year }}排产金额</h2>
+          <h2>{{ data.data.productionMonthColStatisticsTitle }}</h2>
           <el-table :data="getBody(data.productionMonthColStatistics)" :summary-method="() => getFooter(data.productionMonthColStatistics)" :show-summary="true" v-loading="loading"
           :height="300" class="page-table" element-loading-text="loading..." :header-cell-style="{'background-color':'#F4F6F8','border-right':'1px solid #dfdcdc','color':'#92A2B5'}" border>
             <Column v-for="(label, index) in getHeader(data.productionMonthColStatistics)" :label="label" :prop="index" :fixed="index === 0? 'left' : false"/>