Sfoglia il codice sorgente

万盛中期计量

chenr 21 ore fa
parent
commit
3d4c2de6ec

+ 3 - 0
blade-service-api/blade-meter-api/src/main/java/org/springblade/meter/vo/MeterInventoryVO1.java

@@ -64,6 +64,9 @@ public class MeterInventoryVO1 {
     @ApiModelProperty(value = "到本期末完成金额")
     private BigDecimal nowEndMoney;
 
+    @ApiModelProperty(value = "排序")
+    private Integer sort;
+
 
    public static int getFirstThreeCharsAsInt(MeterInventoryVO1 vo1) {
         String name = vo1.getFormNumber();

+ 14 - 6
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/FormulaServiceImpl.java

@@ -2202,12 +2202,13 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
         ReportResult subsidyApplicationPaymentReviewPDF = getSubsidyApplicationPaymentReviewPDF(url2,contractId,periodId,list);
         //获取中间计量支付证书pdfUrl
         ReportResult intermediateMeasurementPaymentCertificatePDF = getIntermediateMeasurementPaymentCertificatePDF(url3,contractId,periodId,list);
-        //获取中间支付申请表pdfUrl
-        ReportResult intermediateApplyPDF=getIntermediateApplyPDF(url4,redisId);
+
         //获取清单支付报表PDF
         ReportResult inventoryPayReportPDF=getInventoryPayReportPDF(url6,contractId,periodId,projectId,list,redisId);
         //获取工程支付月报pdfUrl
         ReportResult monthlyReportPDF=getMonthlyReportPDF(url5,reportId,contractId,periodId,projectId,list,redisId);
+        //获取中间支付申请表pdfUrl
+        ReportResult intermediateApplyPDF=getIntermediateApplyPDF(url4,periodId);
         reportResults.add(CoverOfMidtermPaymentReportPDF);
         reportResults.add(intermediatePaymentPDF);
         reportResults.add(subsidyApplicationPaymentReviewPDF);
@@ -2927,7 +2928,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
      * @param url
      * @return
      */
-    public ReportResult getIntermediateApplyPDF(String url,Long redisId){
+    public ReportResult getIntermediateApplyPDF(String url,Long periodId){
     InputStream modInput = null;
         FileInputStream excelFileInput = null;
         FileOutputStream outputStream = null;
@@ -2940,8 +2941,12 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
             //根据坐标获取单元格
             Cell c = getCellByAddress(sheet, "E6");
             //本期计量
-            String s = redisTemplate.opsForValue().get(MeasurementStorage.CUR_MEASUREMENT + redisId);
-            c.setCellValue(s);
+            Object o = bladeRedis.get("periodId" + periodId + "nowMoney");
+            BigDecimal value=new BigDecimal(0);
+            if(ObjectUtil.isNotEmpty(o)&& o instanceof BigDecimal){
+                value=(BigDecimal) o;
+            }
+            c.setCellValue(value.toString());
             String file_path = FileUtils.getSysLocalFileUrl();
             //String file_path = "C://upload1//";
             String locationFile = file_path + SnowFlakeUtil.getId() + ".xlsx";
@@ -3203,6 +3208,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
         BigDecimal percentage6 = m19.getNowEndMoney().divide(m11.getAfterCurrentMeterMoney(), 10, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"));
         percentage6 = percentage6.setScale(2, BigDecimal.ROUND_HALF_UP);
         m19.setNowEndC(percentage6);
+        bladeRedis.set("periodId"+periodId+"nowMoney",m19.getNowMoney());
         values.add(m19);
         setZeroBigDecimalFieldsToNullInList(values);
         InputStream modInput = null;
@@ -3322,6 +3328,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
                     vo.setCurrentMeterPrice(form.getBidPrice());
                     //原合同金额
                     vo.setCurrentMeterMoney(form.getContractMoney().setScale(0, RoundingMode.HALF_UP));
+                    vo.setSort(query.indexOf(form));
                     break;
                 }
             }
@@ -3353,7 +3360,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
             //本期完成工程量
             vo.setNowTotal(detailVO.getAllMeterTotal());
             //本期完成金额
-            vo.setNowMoney(detailVO.getAllMeterMoney().setScale(0, RoundingMode.HALF_UP));
+            vo.setNowMoney(detailVO.getAllMeterTotal().multiply(detailVO.getCurrentPrice()).setScale(0, RoundingMode.HALF_UP));
             //大于0表示有上期的 需要添加上期末数据
             if(changeFormDetailMap.size()>0){
                     BigDecimal b1=BigDecimal.ZERO;
@@ -3395,6 +3402,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
 
             list1.add(vo);
         }
+        list1=list1.stream().sorted(Comparator.comparing(MeterInventoryVO1::getSort)).collect(Collectors.toList());
         setZeroBigDecimalFieldsToNullInList(list1);
         ReportResult reportResult = new ReportResult();
           String suffix=SnowFlakeUtil.getId()+".pdf";

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

@@ -3671,7 +3671,7 @@ public class TaskController extends BladeController {
         /*如果数据没有变化,则各表的PDF可以不用更新*/
         ExecutionTime executionTime = new ExecutionTime();
         List<ReportResult> reportResults;
-        if(ObjectUtil.isNotEmpty(report.getProjectId())&&report.getProjectId().equals(1847548977467035649L)){
+        if(ObjectUtil.isNotEmpty(report.getProjectId())&&report.getProjectId().equals(1764484458576179201L)){
              reportResults=formulaClient.formulaExecute4(report.getId(),report.getContractId(),report.getPeriodId(),report.getType(),report.getProjectId());
             /*合并所有表*/
             String file_path = CollectionUtils.getSysLocalFileUrl();