Pārlūkot izejas kodu

个贷批量口估跑单修改

wucl 1 nedēļu atpakaļ
vecāks
revīzija
8ef4e27d6d

+ 2 - 2
biz-base/src/main/java/com/dayou/controller/PersonalFacePriceController.java

@@ -122,8 +122,8 @@ public class PersonalFacePriceController extends BaseController {
      */
     @IgnoreAuth
     @PostMapping("/upload/temp")
-    public RestResponse<String> uploadPersonalFacePriceTemp(@RequestPart("file") MultipartFile file,HttpServletResponse response) throws IOException {
-        String url = personalFacePriceService.uploadPersonalFacePriceTemp(file);
+    public RestResponse<String> uploadPersonalFacePriceTemp(@RequestPart("file") MultipartFile file,@RequestParam("limit") String limit,HttpServletResponse response) throws IOException {
+        String url = personalFacePriceService.uploadPersonalFacePriceTemp(file,limit);
         return RestResponse.data(url);
     }
 

+ 27 - 9
biz-base/src/main/resources/application-local.yml

@@ -7,7 +7,7 @@ spring:
       primary: mbs
       datasource:
         mbs:
-          url: jdbc:mysql://localhost:3306/item-management?autoReconnect=true&useUnicode=true&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true&characterEncoding=UTF-8&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true
+          url: jdbc:mysql://localhost:3306/item-management-prod?autoReconnect=true&useUnicode=true&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true&characterEncoding=UTF-8&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true
           driver-class-name: com.mysql.cj.jdbc.Driver
           username: root
           password: 914851221
@@ -22,10 +22,25 @@ spring:
             idle-timeout: 600000
             max-lifetime: 1800000
         dyoa:
-          url: jdbc:mysql://localhost:3306/dyoa?autoReconnect=true&useUnicode=true&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true&characterEncoding=UTF-8&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true
+          url: jdbc:mysql://192.168.0.7:3306/p_dyoa?autoReconnect=true&useUnicode=true&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true&characterEncoding=UTF-8&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true
           driver-class-name: com.mysql.cj.jdbc.Driver
-          username: root
-          password: 914851221
+          username: mbs
+          password: Dypg@1996
+          initialSize: 10 #初始化连接数D
+          minIdle: 10 #最小空闲连接数
+          max-active: 100 #最大连接数
+          maxWait: 60000 #最大等待时间ms(获取不到连接后多久超时)
+          hikari:
+            minimum-idle: 5
+            maximum-pool-size: 200
+            connection-timeout: 30000
+            idle-timeout: 600000
+            max-lifetime: 1800000
+        dydb:
+          url: jdbc:mysql://192.168.0.8:3306/p_dydb?autoReconnect=true&useUnicode=true&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true&characterEncoding=UTF-8&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true
+          driver-class-name: com.mysql.cj.jdbc.Driver
+          username: test
+          password: test
           initialSize: 10 #初始化连接数D
           minIdle: 10 #最小空闲连接数
           max-active: 100 #最大连接数
@@ -39,12 +54,13 @@ spring:
 
 
 dfs:
-  path: E:\upload
-  domain: E:\upload
+  path: /Users/wuwei/opt/dfs
+  domain: /dfs
   domainName: https://kps.scdayou.com/dfs
-  code: \code
-  domainRoot: localhost
-  luceneDir: E:\luceneIndex
+  code: /code
+  domainRoot: https://kps.scdayou.com/admin
+  luceneDir: /Users/wuwei/luceneDir
+  genFile: /Users/wuwei/opt/dfs/genFile
 
 advice:
   file:
@@ -63,4 +79,6 @@ ueditor:
   uploadPath: ${dfs.path}
   urlPrefix: replaceurl  #动态替换url
 
+posyspath:  /Users/wuwei/pageoffice
+
 

+ 1 - 0
biz-base/src/main/resources/application-prod.yml

@@ -60,6 +60,7 @@ dfs:
   code: /code
   domainRoot: http://mbs.scdayou.com/admin
   luceneDir: /luceneDir
+  genFile: /opt/dfs/genFile
 
 
 #系统配置

+ 1 - 0
biz-base/src/main/resources/application-test.yml

@@ -44,6 +44,7 @@ dfs:
   code: /code
   domainRoot: http://kps.scdayou.com/admin
   luceneDir: /luceneDir
+  genFile: /opt/dfs/genFile
 
 #系统配置
 system:

+ 10 - 0
common/src/main/java/com/dayou/configuration/DfsConfig.java

@@ -32,6 +32,8 @@ public class DfsConfig
 
     private String luceneDir;
 
+    private String genFile;
+
     public String getLuceneDir() {
         return luceneDir;
     }
@@ -80,4 +82,12 @@ public class DfsConfig
     public void setDomainRoot(String domainRoot) {
         this.domainRoot = domainRoot;
     }
+
+    public String getGenFile() {
+        return genFile;
+    }
+
+    public void setGenFile(String genFile) {
+        this.genFile = genFile;
+    }
 }

+ 1 - 1
common/src/main/java/com/dayou/utils/ExcelPlusUtil.java

@@ -865,7 +865,7 @@ public class ExcelPlusUtil<T> {
      * @param filename 文件名称
      */
     public String getAbsoluteFile(String filename) {
-        String downloadPath = SpringContextHolder.getBean(DfsConfig.class).getPath() + "/" + filename;
+        String downloadPath = SpringContextHolder.getBean(DfsConfig.class).getGenFile() + "/" + filename;
         //String downloadPath = "D:\\" + filename;
         File desc = new File(downloadPath);
         if (!desc.getParentFile().exists()) {

+ 1 - 1
service/src/main/java/com/dayou/service/IPersonalFacePriceService.java

@@ -59,5 +59,5 @@ public interface IPersonalFacePriceService extends IService<PersonalFacePrice> {
      */
     BigDecimal querySysFacePrice(PersonalFacePriceQueryDTO facePriceQuery);
 
-    String  uploadPersonalFacePriceTemp(MultipartFile file);
+    String  uploadPersonalFacePriceTemp(MultipartFile file,String limit);
 }

+ 23 - 4
service/src/main/java/com/dayou/service/impl/PersonalFacePriceServiceImpl.java

@@ -192,38 +192,57 @@ public class PersonalFacePriceServiceImpl extends ServiceImpl<PersonalFacePriceM
             facePriceQuery.setAcreageMin(acreage.subtract(diff));
         }
 
-        facePriceQuery.setLimit("一年内");
 
         //获取数据源集合
         List<DayouPersonalPriceVO> dyPrices = this.personalPriceByLocation(facePriceQuery);
         ExternalFacePriceVO externalFacePriceVO = this.externalPriceByLocation(facePriceQuery);
+
+        //提升查询结果率
+        if (CollectionUtil.isEmpty(dyPrices)){
+            facePriceQuery.setAcreageMin(null);
+            facePriceQuery.setAcreageMax(null);
+            dyPrices = this.personalPriceByLocation(facePriceQuery);
+        }
+
+        if (externalFacePriceVO==null){
+            facePriceQuery.setAcreageMin(null);
+            facePriceQuery.setAcreageMax(null);
+            externalFacePriceVO = this.externalPriceByLocation(facePriceQuery);
+        }
+
         BigDecimal dealAvgPrice = BigDecimal.ZERO;
         BigDecimal dyAvgPrice = BigDecimal.ZERO;
         int i = 0;
         if (externalFacePriceVO != null){
             //链家成交均价
             dealAvgPrice = externalFacePriceVO.getDealPrice();
-            i += 1;
+            if (dealAvgPrice.compareTo(BigDecimal.ZERO) > 0){
+                i+=1;
+            }
         }
 
         if (CollectionUtil.isNotEmpty(dyPrices)){
             //大友评估均价
             double reduce = dyPrices.stream().filter(x->x.getPrice()!=null).map(DayouPersonalPriceVO::getPrice).mapToDouble(BigDecimal::doubleValue).reduce(0, Double::sum);
             dyAvgPrice = BigDecimal.valueOf(reduce).divide(BigDecimal.valueOf(dyPrices.size()==0?1:dyPrices.size()), 0, RoundingMode.HALF_UP);
-            i += 1;
+            if (dyAvgPrice.compareTo(BigDecimal.ZERO) > 0){
+                i+=1;
+            }
         }
 
+
         //综合均价
         return i==0?BigDecimal.ZERO:dealAvgPrice.add(dyAvgPrice).divide(new BigDecimal(i), RoundingMode.HALF_UP);
     }
 
     @Override
-    public String uploadPersonalFacePriceTemp(MultipartFile file) {
+    public String uploadPersonalFacePriceTemp(MultipartFile file,String limit) {
         try {
             List<PersonalFacePriceBatchDTO> batchQuery = ExcelUtil.importExcel(PersonalFacePriceBatchDTO.class,file.getInputStream(),1);
             for (PersonalFacePriceBatchDTO batch : batchQuery) {
                 PersonalFacePriceQueryDTO target = new PersonalFacePriceQueryDTO();
                 BeanUtil.copyProperties(batch, target);
+                target.setLimit(limit);
                 batch.setPrice(this.querySysFacePrice(target));
                 batch.setAmount(batch.getPrice().multiply(batch.getAcreage()==null?BigDecimal.ZERO:batch.getAcreage()).setScale(2, RoundingMode.HALF_UP));
                 batch.setValueTiming(LocalDate.now());