浏览代码

万盛中期计量

chenr 2 天之前
父节点
当前提交
e87aacced4

+ 24 - 0
blade-service-api/blade-meter-api/src/main/java/org/springblade/meter/feign/CollectionUtilsClient.java

@@ -0,0 +1,24 @@
+package org.springblade.meter.feign;
+
+import org.springblade.common.constant.LauncherConstant;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import java.util.List;
+
+@FeignClient(value = LauncherConstant.APPLICATION_METER_NAME)
+public interface CollectionUtilsClient {
+     /**
+     * 接口前缀
+     */
+    String API_PREFIX = "/CertificateItem";
+
+    /**
+     * 保存中期证书项目详情
+     */
+    @PostMapping(API_PREFIX + "/mergePdfPublicMethods")
+    public void mergePdfPublicMethods(@RequestBody List<String> urlList, @RequestParam String localImgUrl);
+
+}

+ 8 - 4
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/FormulaServiceImpl.java

@@ -50,6 +50,7 @@ import org.springblade.manager.utils.FileUtils;
 import org.springblade.manager.vo.*;
 import org.springblade.meter.entity.*;
 import org.springblade.meter.feign.CertificateItemClient;
+import org.springblade.meter.feign.CollectionUtilsClient;
 import org.springblade.meter.feign.IContractInventoryFormClient;
 import org.springblade.meter.feign.MiddleMeterApplyClient;
 import org.springblade.meter.utils.CollectionUtils;
@@ -144,6 +145,8 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
         private BladeRedis bladeRedis;
         @Autowired
         private IContractInventoryFormClient iContractInventoryFormClient;
+        @Autowired
+        private CollectionUtilsClient collectionUtilsClient;
 
     @Override
     public void execute(TableElementConverter tec) {
@@ -3110,7 +3113,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
         m11.setNowMoney(m3.getNowMoney());
         if(ObjectUtil.isNotEmpty(m3.getNowEndMoney())){
             m11.setNowEndMoney(m3.getNowEndMoney());
-            m11.setNowEndC(m3.getNowC());
+            m11.setNowEndC(m3.getNowEndC());
         }
         values.add(m11);
 
@@ -3126,7 +3129,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
             m13.setBeforeEndMoney(new BigDecimal(s));
         }
         m13.setNowMoney(new BigDecimal(redisTemplate.opsForValue().get(MeasurementStorage.CUR_END_RESERVE_MONEY + redisId)));
-        m13.setNowEndMoney(new BigDecimal(redisTemplate.opsForValue().get(MeasurementStorage.CUR_END_RESERVE_MONEY_SUM +redisId)));
+       m13.setNowEndMoney(new BigDecimal(redisTemplate.opsForValue().get(MeasurementStorage.CUR_END_RESERVE_MONEY_SUM +redisId)));
         values.add(m13);
 
         MonthlyReportVo m14 = new MonthlyReportVo();
@@ -3354,7 +3357,8 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
         }
         ReportResult reportResult = new ReportResult();
           String suffix=SnowFlakeUtil.getId()+".pdf";
-          String localImgUrl="D://web//pdf//"+suffix;
+          String fileUrl= FileUtils.getSysLocalFileUrl();
+          String localImgUrl=fileUrl+suffix;
         if(list1.size()>0){
             //先根据根据前三个字符排序
              list1.sort(Comparator.comparingInt(MeterInventoryVO1::getFirstThreeCharsAsInt));
@@ -3487,7 +3491,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
                 }
                 bladeRedis.set("redisId"+redisId+"periodId:"+periodId+"formNum:"+listEntry.getKey()+"nowMoney",totalNowMoney);
             }
-            CollectionUtils.mergePdfPublicMethods(listUrl, localImgUrl);
+            collectionUtilsClient.mergePdfPublicMethods(listUrl, localImgUrl);
             //上传oss
             BladeFile bladeFile = newIOSSClient.uploadFile(suffix,localImgUrl);
             reportResult.setOssPdfUrl(bladeFile.getLink());

+ 16 - 0
blade-service/blade-meter/src/main/java/org/springblade/meter/feign/CollectionUtilsClientImpl.java

@@ -0,0 +1,16 @@
+package org.springblade.meter.feign;
+
+import lombok.AllArgsConstructor;
+import org.springblade.meter.utils.CollectionUtils;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@RestController
+@AllArgsConstructor
+public class CollectionUtilsClientImpl implements CollectionUtilsClient{
+    @Override
+    public void mergePdfPublicMethods(List<String> urlList, String localImgUrl) {
+        CollectionUtils.mergePdfPublicMethods(urlList,localImgUrl);
+    }
+}