Преглед изворни кода

5/17 修改支付回调路径

lwhhszx пре 1 година
родитељ
комит
5a751ad048

+ 1 - 1
src/main/java/com/example/xiaoshiweixinback/business/config/ElasticSearchClientConfig.java

@@ -48,7 +48,7 @@ private String config;
         public ElasticsearchClient elasticsearchClient() throws Exception {
             RestClientBuilder builder = RestClient.builder(new HttpHost(config, 9200, "http"));
             CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
-            credentialsProvider.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials("elastic", "xiaoshi221101"));
+            credentialsProvider.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials("elastic", "Xiaoshi221101"));
             SSLContext sslContext = SSLContextBuilder.create()
                     .loadTrustMaterial(new TrustSelfSignedStrategy())
                     .build();

+ 9 - 2
src/main/java/com/example/xiaoshiweixinback/service/importPatent/GetPatentFromExcelService.java

@@ -42,14 +42,20 @@ private GetPatentPictureFromExcelService getPatentPictureFromExcelService;
 
     public void run(String path) {
         try {
-            File tempFile = new File("C:\\Users\\admin\\Desktop\\exce\\"+path);
+            File file = CommonService.getFile("importFile");
+            if (file == null || file.listFiles().length == 0) {
+                return;
+            }
+            File[] files = file.listFiles();
+            for (int t = 0; t < files.length; t++) {
+                File tempFile = files[t];
             //创建临时文件tempFile,并将文件读取到tempFile
             Integer lastIndex = 0;
 
             Integer sourceId = 1;
             Integer total = ReadExcelUtils.textExcel(tempFile, sourceId.toString());
             //解析数据源类,通过数据来源id(如1:智慧芽)解析数据源配置文件,获得数据源配置文件对象jsonData
-            List<UploadSettingVO.Column> jsonData = excuteUploadSettingService.ExcuteUploadSetting(sourceId.toString(),null);
+            List<UploadSettingVO.Column> jsonData = excuteUploadSettingService.ExcuteUploadSetting(sourceId.toString(), null);
             //解析Excel文件获得工作簿
             Sheet sheet = ReadExcelUtils.readExcel(tempFile);
             Integer x = 0;
@@ -67,6 +73,7 @@ private GetPatentPictureFromExcelService getPatentPictureFromExcelService;
                 getPatentPictureFromExcelService.run(uploadPatentWebDTO);
                 x++;
             }
+        }
             //删除临时文件tempFile
         } catch (Exception e) {
             e.printStackTrace();

+ 2 - 3
src/main/java/com/example/xiaoshiweixinback/service/importPatent/GetPatentPictureFromExcelService.java

@@ -54,9 +54,8 @@ public class GetPatentPictureFromExcelService {
     }
 
     public void tem(File file, Patent patent, Integer i) throws Exception {
-        String guid = FormatUtil.getPictureFormat(patent.getAppNo()) + i;
-        System.out.println(guid);
-            fileManagerService.uploadFileWithGuid(file, guid);
+        String guid = FormatUtil.getPictureFormat(patent.getAppNo()) + i;         
+        fileManagerService.uploadFileWithGuid(file, guid);
         PatentVector patentVectorOrg = esService.getVectorByIndex(patent.getAppNo(), i);
         if (patentVectorOrg != null) {
             return;

+ 17 - 1
src/main/java/com/example/xiaoshiweixinback/service/importPatent/excel/GetPatentFromSzService.java

@@ -64,7 +64,23 @@ public class GetPatentFromSzService {
                 getPatentFromExcelService.loadPatent(uploadParamsVO);
                 UploadPatentWebDTO uploadPatentWebDTO = new UploadPatentWebDTO();
                 uploadPatentWebDTO.setPatent(uploadParamsVO.getPatent());
-                getPatentPictureFromWebService.getWdPatentPicture(uploadPatentWebDTO);
+                //getPatentPictureFromWebService.getWdPatentPicture(uploadPatentWebDTO);
+                List<PictureData> pictureDatas = ReadExcelUtils.getPictures((XSSFSheet) sheet, r + 1);
+
+                for (int i = 0; i < pictureDatas.size(); i++) {
+                    PictureData pictureData = pictureDatas.get(i);
+                    try {
+                        if (pictureData != null) {
+                            String ext = pictureData.suggestFileExtension();
+                            byte[] data = pictureData.getData();
+                            String picName = IdUtil.simpleUUID();
+                            File file2 = FileUtils.getFileByBytes(data, picName, "." + ext);
+                            getPatentPictureFromExcelService.tem(file2, uploadPatentWebDTO.getPatent(), i);
+                        }
+                    } catch (Exception e) {
+
+                    }
+                }
                 savePatentToEsService.saveOrUpdate(uploadPatentWebDTO);
                 System.out.println(r);
             }

+ 87 - 0
src/main/resources/application-prodNetInAll.yml

@@ -0,0 +1,87 @@
+spring:
+  rabbitmq:
+    host: 172.27.247.174
+    port: 5672
+    username: admin
+    password: 123456
+  data:
+   redis:
+     host: 172.27.247.174
+     port: 6379
+     database: 3
+     password: Xx0GWxdWQJxx6Swe
+     lettuce:
+       pool:
+         max-active: 20
+         max-idle: 20
+         min-idle: 0
+         max-wait: -1ms
+     timeout: 2000ms
+  datasource:
+    url: jdbc:mysql://172.27.247.174:3306/ecs?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=GMT%2B8
+    username: root
+    password: TU5x6IeBi7rl
+    driver-class-name: com.mysql.cj.jdbc.Driver
+    type: com.alibaba.druid.pool.DruidDataSource
+    druid:
+      stat-view-servlet:
+        login-username: admin
+        login-password: Cslg2022+
+      web-stat-filter:
+        exclusions: "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*"
+  quartz:
+    #相关属性配置
+    properties:
+      org:
+        quartz:
+          scheduler:
+            instanceName: DefaultQuartzScheduler
+            instanceId: AUTO
+          jobStore:
+            class: org.springframework.scheduling.quartz.LocalDataSourceJobStore
+            driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate
+            tablePrefix: QRTZ_
+            isClustered: false
+            clusterCheckinInterval: 10000
+            useProperties: false
+          threadPool:
+            class: org.quartz.simpl.SimpleThreadPool
+            threadCount: 10
+            threadPriority: 5
+            threadsInheritContextClassLoaderOfInitializingThread: true
+          dataSource:
+            default:
+              URL: jdbc:mysql://172.27.247.174:3306:3306/pas-prod2?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=GMT%2B8
+              user: root
+              password: TU5x6IeBi7rl
+              driver: com.mysql.jdbc.Driver
+
+    #数据库方式
+    job-store-type: jdbc
+    #初始化表结构
+    jdbc:
+      initialize-schema: always
+authorUrl: http://localhost:8871
+PCSUrl: http://localhost:8871
+#OPSUrl: http://192.168.1.24:5001
+OPSUrl: http://139.224.24.90:5001
+PASUrl: http://localhost:8877
+FMSUrl: http://localhost:8802
+VectorUrl: http://127.0.0.1:8000
+FileSource: 5
+
+##################  短信 ####################
+SMS:
+  regionId: cn-shanghai
+  accessKeyId: LTAI5tGyG1Q7fKprgg1nWhXj
+  secret: Y6Erboh5lEFiRPR4XK8oCPMvUzYGLN
+
+##################  微信小程序  ####################
+WeChat:
+  appId: wxaefb842bd0b93ff0
+  appSecret: 89fe0fb96472548d48f63b2f5c956537
+Keypath: apiclient_key.pem
+ES:
+  patentVector: patent_vector
+  patent: wxpatent
+  config: es-cn-em93o8856000ho9e7.elasticsearch.aliyuncs.com

+ 1 - 1
src/main/resources/application.yml

@@ -20,7 +20,7 @@ spring:
       max-file-size: 1000MB
       max-request-size: 1000MB
   profiles:
-    active: prodNetIn2
+    active: prodNetInAll
   jackson:
     default-property-inclusion: non_null
     serialization: