Bläddra i källkod

修改重点工程

bihuisong 1 år sedan
förälder
incheckning
f26a62af78

+ 17 - 11
src/main/java/com/sooka/sponest/dataexchange/exchange/controller/ExchangeController.java

@@ -2,6 +2,7 @@ package com.sooka.sponest.dataexchange.exchange.controller;
 
 
 import com.alibaba.fastjson.JSONObject;
+import com.ruoyi.common.core.exception.file.FileException;
 import com.ruoyi.common.core.utils.file.FilePrefixUtils;
 import com.ruoyi.system.api.RemoteConfigService;
 import com.ruoyi.system.api.RemoteFileService;
@@ -38,7 +39,7 @@ public class ExchangeController {
     @Resource
     private RemoteConfigService remoteConfigService;
 
-//    @Value("${}")
+    //    @Value("${}")
     private String url;
 
     /**
@@ -73,27 +74,32 @@ public class ExchangeController {
     @PostMapping("/straightPushData")
     @ResponseBody
     public R<?> straightPushData(@RequestBody DataExchangeEntity dataExchangeEntity) {
-        log.info("dataExchangeEntity:{}",dataExchangeEntity);
+        log.info("dataExchangeEntity:{}", dataExchangeEntity);
         List<String> pictureList = new ArrayList<>();
         if (StringUtils.isNotEmpty(SecurityUtils.getToken()) && !CollectionUtils.isEmpty(dataExchangeEntity.getEventPicture())) {
-            log.info("token:{}",StringUtils.isNotEmpty(SecurityUtils.getToken()));
+            log.info("token:{}", StringUtils.isNotEmpty(SecurityUtils.getToken()));
             for (String picture : dataExchangeEntity.getEventPicture()) {
                 if (!"image".equals(FilePrefixUtils.getUrlSuffix(picture))) {
                     log.error("事件图片必须为图片格式---{}", dataExchangeEntity);
                     return R.fail("事件图片必须为图片格式");
                 } else {
                     MultipartFile multipartFile = FilePrefixUtils.urlToMultipartFile(picture, System.currentTimeMillis() + ".jpg");
-                    log.info("multipartFile:{}",multipartFile);
-                    SysFile sysFile = SpringUtils.getBean(RemoteFileService.class).upload(multipartFile).getData();
-                    log.info("sysFile:{}",sysFile);
-                    pictureList.add(sysFile.getUrl());
+                    log.info("multipartFile:{}", multipartFile);
+                    try {
+                        SysFile sysFile = SpringUtils.getBean(RemoteFileService.class).upload(multipartFile).getData();
+                        log.info("sysFile:{}", sysFile);
+                        pictureList.add(sysFile.getUrl());
+                    } catch (FileException e) {
+                        log.info("上传附件失败");
+                    }
+
                 }
             }
             dataExchangeEntity.setPictureUrlList(pictureList);
             R<?> result = remoteEventBaseService.insert3rdSystemEvent(dataExchangeEntity);
-            log.info("insert3rdSystemEvent:{}",result);
+            log.info("insert3rdSystemEvent:{}", result);
             if (result.getCode() == 200) {
-                return R.ok(null,"推送成功");
+                return R.ok(null, "推送成功");
             } else {
                 return R.fail(result.getMsg());
             }
@@ -118,11 +124,11 @@ public class ExchangeController {
         jsonObject.put("", dataExchangeEntity);
         try {
             JSONObject result = RestUtil.post(url, jsonObject);
-            log.info("远程调用119:{}",result);
+            log.info("远程调用119:{}", result);
         } catch (Exception e) {
             log.info("远程调用119报错");
         }
-        return R.ok(null,"接收成功");
+        return R.ok(null, "接收成功");
     }
 
 }

+ 5 - 1
src/main/java/com/sooka/sponest/dataexchange/sendChange/controller/EngineeringController.java

@@ -72,9 +72,13 @@ public class EngineeringController {
         R<String> appUrl = remoteConfigService.remotegetConfigKey("appUrl");
         List<CenterdataTKeyProjectsPictures> requestList = new ArrayList<>();
         for (CenterdataTKeyProjectsPictures var : list) {
+            List<String> pictureList = new ArrayList<>();
             CenterdataTKeyProjectsPictures centerdataTKeyProjectsPictures = new CenterdataTKeyProjectsPictures();
             centerdataTKeyProjectsPictures.setProjectId(var.getProjectId());
-            centerdataTKeyProjectsPictures.setSchedulePictures(appUrl.getData().toString() + var.getSchedulePictures());
+            for (String str : var.getSchedulePictures()) {
+                pictureList.add(appUrl.getData().toString() + str);
+            }
+            centerdataTKeyProjectsPictures.setSchedulePictures(pictureList);
             requestList.add(var);
         }
         // TODO: 2024/1/16 0016 待修改

+ 1 - 1
src/main/java/com/sooka/sponest/dataexchange/sendChange/domian/CenterdataTKeyProjects.java

@@ -40,6 +40,6 @@ public class CenterdataTKeyProjects {
     private String thisYearCumulativeInvestment;
     private String realityCompletedTime;
     private String springStartProject;
-    private String id;
+    private String projectId;
 
 }

+ 1 - 1
src/main/java/com/sooka/sponest/dataexchange/sendChange/domian/CenterdataTKeyProjectsPictures.java

@@ -13,6 +13,6 @@ public class CenterdataTKeyProjectsPictures {
 
     private String projectId;
 
-    private String schedulePictures;
+    private List<String> schedulePictures;
 
 }