yaozhixue 1 年之前
父节点
当前提交
c917de225e

二进制
1684169336970440705


二进制
1684169656849035265


二进制
1684170041009532929.jpeg


二进制
1684170044889264129.jpeg


二进制
1684170055219834882


二进制
bx.jpeg


+ 30 - 5
src/main/java/com/zfire/jiasm/syncdata/upload/worker/UploadWorkeCertificate.java

@@ -104,13 +104,15 @@ public class UploadWorkeCertificate {
 
             // 生成图片
             if (StringUtils.isNotEmpty(item.getFileUrl()) && (StringUtils.isEmpty(item.getOutFileUrl()))){
-                fid1 = IdWorker.getIdStr() + ".jpeg";
+                fid1 = IdWorker.getIdStr() + ".jpg";
+                // 下载文件生成新文件 fid1
                 baseService.saveToFile(ossUtil.getUrlWw(item.getFileUrl()),fid1);
                 // 获取文件
                 fileo = fid1;
             }
             if (StringUtils.isNotEmpty(item.getFileUrl2()) && (StringUtils.isEmpty(item.getOutFileUrl2()))){
-                fid2 = IdWorker.getIdStr() + ".jpeg";
+                fid2 = IdWorker.getIdStr() + ".jpg";
+                // 下载文件生成新文件 fid2
                 baseService.saveToFile(ossUtil.getUrlWw(item.getFileUrl()),fid2);
                 // 获取文件
                 filet = fid2;
@@ -119,23 +121,45 @@ public class UploadWorkeCertificate {
             // 上传图片 按网点上传
             for (WorkerBrandAccount wdno: workerWdnos){
                 uploadFileexc(fileo, filet, fid1, fid2,wdno.getBrandWebsitId(),item);
+                delfilet(fid3);
                 // 保险数据同步 保险证不在证件表中
                 fid3 = uploadInsureCert(wdno);
             }
             // 文件清除
-            delfile(fid1, fid2,fid3);
+            delfile(fileo, filet, fid1, fid2,fid3);
 
         }
         log.info("同步师傅证件信息结束: \uF0B7{}",sdf.format(new Date()));
     }
 
-    private void delfile(String fid1, String fid2, String file3) {
+    private void delfile(String fileo,String filet,String fid1, String fid2, String file3) {
+        if (StringUtils.isNotEmpty(fileo)){
+            new File(fileo).delete();
+        }
+        if (StringUtils.isNotEmpty(filet)){
+            new File(filet).delete();
+        }
         if (StringUtils.isNotEmpty(fid1)){
             new File(fid1).delete();
         }
         if (StringUtils.isNotEmpty(fid2)){
+            new File(fid2).delete();
+        }
+        if (StringUtils.isNotEmpty(file3)){
+            new File(file3).delete();
+        }
+    }
+
+    private void delfiletow(String fid1, String fid2) {
+        if (StringUtils.isNotEmpty(fid1)){
             new File(fid1).delete();
         }
+        if (StringUtils.isNotEmpty(fid2)){
+            new File(fid2).delete();
+        }
+    }
+
+    private void delfilet(String file3) {
         if (StringUtils.isNotEmpty(file3)){
             new File(file3).delete();
         }
@@ -158,7 +182,7 @@ public class UploadWorkeCertificate {
                 fid1 = "bx.jpeg";
                 baseService.initFile(fid1);
             } else {
-                fid1 = IdWorker.getIdStr() + ".jpeg";
+                fid1 = IdWorker.getIdStr() + ".jpeg12";
                 baseService.saveToFile(ossUtil.getUrlWw(wk.getInsureCert()),fid1);
             }
             fileo = fid1;
@@ -186,6 +210,7 @@ public class UploadWorkeCertificate {
                 // 2:文件上传
                 PostObjectSample ossPostObject = new PostObjectSample();
                 String result = ossPostObject.PostObject(fileo, resultData.getExtData());
+
                 // 3: 保存文件
                 if (StringUtils.isEmpty(result.trim())){
                     Map<String,String>req = new HashMap<>();

+ 1 - 1
src/main/resources/bootstrap-prd.properties

@@ -90,7 +90,7 @@ baseurl4pgid=https://api-sms.gree.com/api/sso/autoapp-default-server-greeshservi
 
 ######################## 上传格力总部文件 ##############################
 downfileurl=https://api-sms.gree.com/api/pub/nts-foundation-attachmentmanager/api/v2/attachment/download?id=%s&access_token=%sdownfileurl=https://api-sms.gree.com/api/pub/nts-foundation-attachmentmanager/api/v2/attachment/download?id=%s&access_token=%s
-sevefileurl=https://api-sms.gree.com/api/sso/nts-foundation-attachmentmanager
+sevefileurl=https://api-sms.gree.com/api/sso/nts-foundation-attachmentmanager/api/v2/attachment/saveFileInfo
 imageurl=https://api-sms.gree.com/api/sso/nts-foundation-attachmentmanager/api/v2/attachment/saveFileInfo
 imagesign=https://api-sms.gree.com/api/sso/nts-foundation-attachmentmanager/api/v2/attachment/getSignWithWdno?wdno=%s
 gree.gettoken=https://idmshyun.gree.com/auth/realms/fdp-shyun-test/protocol/openid-connect/token

+ 1 - 1
src/main/resources/bootstrap-test.properties

@@ -113,7 +113,7 @@ baseurl4pgid=https://gateway.yshcs.gree.com:9635/api/sso/autoapp-default-server-
 
 ######################## 上传格力总部文件 ##############################
 downfileurl=https://gateway.yshcs.gree.com:9635/api/pub/nts-foundation-attachmentmanager/api/v2/attachment/download?id=%s&access_token=%s
-sevefileurl=https://gateway.yshcs.gree.com:9635/api/sso/nts-foundation-attachmentmanager
+sevefileurl=https://gateway.yshcs.gree.com:9635/api/sso/nts-foundation-attachmentmanager/api/v2/attachment/saveFileInfo
 imageurl=https://gateway.yshcs.gree.com:9635/api/sso/nts-foundation-attachmentmanager/api/v2/attachment/saveFileInfo
 imagesign=https://gateway.yshcs.gree.com:9635/api/sso/nts-foundation-attachmentmanager/api/v2/attachment/getSignWithWdno?wdno=%s
 gree.gettoken=https://idm.yshcs.gree.com:9635/auth/realms/fdp-shyun-test/protocol/openid-connect/token