Forráskód Böngészése

计量公式相关

yangyj 1 éve
szülő
commit
a535997b50

+ 2 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/FormulaController.java

@@ -144,7 +144,8 @@ public class FormulaController {
                 old.setMap(fa.getMap());
                 old.setDev(fa.getDev());
                 old.setScale(fa.getScale());
-                this.service.update(Wrappers.<Formula>lambdaUpdate().set(Formula::getFormula,fa.getFormula()).set(Formula::getMap,fa.getMap()).set(Formula::getDev,fa.getDev()).set(Formula::getScale,fa.getScale()).eq(Formula::getId,fa.getId()));
+                this.service.updateById(old);
+                this.service.update(Wrappers.<Formula>lambdaUpdate().set(Formula::getFormula,fa.getFormula()).set(Formula::getMap,fa.getMap()).set(Formula::getRely,fa.getRely()).set(Formula::getDev,fa.getDev()).set(Formula::getScale,fa.getScale()).eq(Formula::getId,fa.getId()));
                 return R.data(fa.getId());
             }
         }

+ 4 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/formula/impl/ExecutorMeter.java

@@ -139,6 +139,9 @@ public class ExecutorMeter extends FormulaExecutor {
                         candidate.add(t);
                     }
                 }
+                if(candidate.size()<14){
+                    candidate.addAll(list);
+                }
            }else{
                /*假如不存在配置,则尝试自动识别*/
                 candidate.addAll(list);
@@ -187,7 +190,7 @@ public class ExecutorMeter extends FormulaExecutor {
                 /*合计*/
                 Material summary= new Material();
                 summary.setMaterialName("合计");
-                summary.setIndex(materials.size());
+                summary.setIndex(materials.size()+1);
                 summary.setSum(this.total);
                 summary.setAdvancePayment(this.totalAdvance);
                 materials.add(summary);

+ 11 - 13
blade-service/blade-meter/src/main/java/org/springblade/meter/controller/TaskController.java

@@ -2648,7 +2648,7 @@ public class TaskController extends BladeController {
                             pdfCopy = new PdfCopy(doc, new FileOutputStream(rs.getPdfPath()));
                             int pageCount;
                             doc.open();
-                            String tile=projectName+StringPool.DASH+rs.getName();
+                            String tile=rs.getName().contains("封面")?projectName:projectName+StringPool.DASH+rs.getName();
                             for(Map<String,Object> dataMap:rs.getData()){
                                 if (Func.isNotEmpty(dataMap)) {
                                     try {
@@ -2680,7 +2680,7 @@ public class TaskController extends BladeController {
                                         sheet.getPrintSetup().setPaperSize(PrintSetup.A4_PAPERSIZE);
                                         ByteArrayOutputStream out = new ByteArrayOutputStream();
                                         workbook.write(out);
-                                        //workbook.write(new FileOutputStream(rs.getExcelPath()));
+                                        workbook.write(new FileOutputStream(rs.getExcelPath()));
                                         com.aspose.cells.Workbook wb = new com.aspose.cells.Workbook( new ByteArrayInputStream(out.toByteArray()));
                                         out.reset();
                                         wb.save(out, SaveFormat.PDF);
@@ -2723,22 +2723,20 @@ public class TaskController extends BladeController {
 
 
     public void setTitle(Sheet sheet,String name){
-        if(name.contains("封面")){
-            return;
-        }
         Row row = sheet.getRow(0);
         Cell cell = row.getCell(0);
-        if(cell!=null){
-            Workbook workbook=sheet.getWorkbook();
-            Font font = workbook.createFont();
-            font.setFontName("黑体"); // 设置字体名称
-            font.setFontHeightInPoints((short) 20); // 设置字号为20
-            CellStyle style = workbook.createCellStyle();
-            style.setFont(font); // 将字体应用到样式中
+        if (cell != null) {
+           /* Workbook workbook = sheet.getWorkbook();*/
+           /* Font font = workbook.createFont();*/
+            CellStyle style=cell.getCellStyle();
+/*            font.setFontName("黑体"); // 设置字体名称
+            font.setFontHeightInPoints((short) 20); // 设置字号为20*/
+            /*CellStyle style = workbook.createCellStyle();*/
+            /*style.setFont(font); // 将字体应用到样式中*/
             style.setAlignment(HorizontalAlignment.CENTER);
             style.setVerticalAlignment(VerticalAlignment.CENTER);
             cell.setCellValue(name);
-            cell.setCellStyle(style);
+            /*cell.setCellStyle(style);*/
         }
     }