瀏覽代碼

打包配置修改

wucl 8 月之前
父節點
當前提交
41b512bf67

+ 1 - 1
biz-base/pom.xml

@@ -77,13 +77,13 @@
                 <version>${spring-boot.version}</version>
                 <executions>
                     <execution>
-                        <id>repackage</id>
                         <goals>
                             <goal>repackage</goal>
                         </goals>
                     </execution>
                 </executions>
             </plugin>
+
         </plugins>
     </build>
 

+ 3 - 4
biz-base/src/main/resources/application-local.yaml

@@ -1,7 +1,7 @@
 server:
   port: 9080
   servlet:
-    context-path: /api
+    context-path: /pp
   error:
     include-exception: true
 spring:
@@ -66,7 +66,7 @@ oa-api-url: localhost:8088/api/
 
 file-net:
   # 基础配置
-  base-dir: E:\productivity-platform-files\
+  base-dir: /Users/wuwei/opt/temp/
   max-file-size: 102400
   # 资产业务配置
   asset-template-report-path: assets\templates\report\
@@ -76,5 +76,4 @@ file-net:
   house-guaranty-path: house/guaranty
   house-guaranty-template-path: house/guaranty/temp/
 
-posyspath:  E:\pageoffice
-
+posyspath:  /Users/wuwei/pageoffice

+ 79 - 0
biz-base/src/main/resources/application-prod.yaml

@@ -0,0 +1,79 @@
+server:
+  port: 9080
+  servlet:
+    context-path: /pp
+  error:
+    include-exception: true
+spring:
+  servlet:
+    #文件上传配置
+    multipart:
+      enabled: true
+      max-file-size: 50MB
+      max-request-size: 100MB
+  datasource:
+    username: root
+    password: Dypg@1996
+    url: jdbc:mysql://localhost:1230/productivity-platform?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
+    type: com.alibaba.druid.pool.DruidDataSource
+  jackson:
+    date-format: yyyy-MM-dd HH:mm:ss
+  mvc:
+    static-path-pattern: /**
+mybatis-plus:
+  mapper-locations: classpath*:mapper/**/*Mapper.xml
+  type-aliases-package: com.dayou.entity
+  #debug
+  configuration:
+    #关闭日志:org.apache.ibatis.logging.nologging.NoLoggingImpl 开启日志:org.apache.ibatis.logging.stdout.StdOutImpl
+    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+    # mybatis映射到实体的驼峰命名
+    mapUnderscoreToCamelCase: true
+  global-config:
+    db-config:
+      id-type: auto
+      logic-delete-field: deleteStatus
+      logic-delete-value: 1
+      logic-not-delete-value: 0
+#分页插件
+pagehelper:
+  helperDialect: mysql
+  reasonable: true
+  supportMethodsArguments: true
+  pageSizeZero: false
+  params: count=countSql
+
+############## Sa-Token 配置 (文档: https://sa-token.cc) ##############
+sa-token:
+  # token 名称(同时也是 cookie 名称)
+  token-name: token
+  # token 有效期(单位:秒) 默认30天,-1 代表永久有效
+  timeout: 86400
+  # token 最低活跃频率(单位:秒),如果 token 超过此时间没有访问系统就会被冻结,默认-1 代表不限制,永不冻结
+  active-timeout: -1
+  # 是否允许同一账号多地同时登录 (为 true 时允许一起登录, 为 false 时新登录挤掉旧登录)
+  is-concurrent: true
+  # 在多人登录同一账号时,是否共用一个 token (为 true 时所有登录共用一个 token, 为 false 时每次登录新建一个 token)
+  is-share: true
+  # token 风格(默认可取值:uuid、simple-uuid、random-32、random-64、random-128、tik)
+  token-style: random-64
+  # 是否输出操作日志
+  is-log: true
+
+# oa系统的api url
+oa-api-url: localhost:8088/api/
+
+file-net:
+  # 基础配置
+  base-dir: /opt/dfs/productivity-platform/
+  max-file-size: 102400
+  # 资产业务配置
+  asset-template-report-path: assets\templates\report\
+  asset-template-calculate-path: assets\templates\calculate\
+  asset-output-report-path: assets\output\report\
+  asset-output-calculate-path: assets\output\calculate\
+  house-guaranty-path: house/guaranty
+  house-guaranty-template-path: house/guaranty/temp/
+
+posyspath:  /root/pageoffice

biz-base/src/main/resources/ftl/wordTableTemplate.ftl → biz-base/src/main/resources/wordTableTemplate.ftl


+ 76 - 76
biz-base/src/test/java/com/dayou/AddressParser.java

@@ -18,81 +18,81 @@ import static com.dayou.utils.HouseDocumentUtil.mergeAddress;
 
 public class AddressParser {
 
-    public static void main(String[] args) {
-        String[] addresses = {
-//                "成都市武侯区双凤五路412号1栋2单元3层",
-//                "西安市未央区史蒂五路22号12栋33单元13层",
-//                "成都市青羊区双凤三路412号1栋2单元4层",
-//                "成都市武侯区双凤三路42号1栋2单元4层",
-//                "武侯区双凤五路412号1层",
-//                "武侯区双凤五路450号1层",
-//                "武侯区双凤五路470号1层",
-//                "武侯区金江路216号1层",
-//                "武侯区武兴路989号2层",
-//                "都江堰市玉堂镇青城水街北段255号1栋1单元1层1号",
-//                "都江堰市玉堂镇青城水街北段255号1栋1单元1层2号",
-//                "都江堰市玉堂镇青城水街北段255号1栋1单元1层3号",
-//                "高新区高棚东路18号1幢",
-//                "高新区新乐中街280号1栋-1层局部(共计142套)",
-//                "青羊区草堂路3号6栋1-3楼B1号",
-//                "武侯区晋阳街道晋阳村领秀别墅1栋1-3楼1号",
-                "武侯区人民南路四段21号3栋3单元5层03号",
-                "武侯区人民南路四段21号3栋3单元7层03号",
-                "青羊区人民南路四段21号3栋3单元7层03号",
-//                "武侯区双凤五路412号1层",
-//                "武侯区双凤五路450号1层",
-//                "武侯区双凤五路470号1层",
-//                "武侯区金江路216号1层",
-//                "青羊区武兴路989号2层",
-//                "都江堰市玉堂镇青城水街北段255号",
-//                "都江堰市玉堂镇青城水街北段257号",
-//                "都江堰市玉堂镇青城水街北段259号",
-////                "南充市阆中市缓缓路23号"
-//                "武侯区双凤五路412号1层",
-//                "武侯区双凤五路450号1层",
-//                "武侯区双凤五路470号1层",
-//                "武侯区金江路216号1层",
-//                "武侯区武兴路989号2层"
-//                "武侯区人民南路四段",
-//                "武侯区晋阳街道晋阳村",
-//                "高新区新乐中街",
-//                "高新区高棚东路",
-//                "青羊区草堂路"
-//                "成都市武侯区",
-//                "成都市青羊区",
-//                "成都市成华区",
-//                "成都市双流区",
-//                "成都市新都区",
-//                "成都市都江堰市"
-        };
-        List<String> list = Arrays.asList(addresses);
-        try {
-            List<Address> lists = new ArrayList<>();
-            for (String address : list) {
-                lists.add(AddressUtil.parseAddress(address));
-            }
-            Map<List<Object>, List<Address>> collect = lists.stream().collect(Collectors.groupingBy(compositeKey, Collectors.toList()));
-
-            if (collect.size()>5){
-                AddressUtil.ignoreToRoad(lists);
-            }
-            String s ;
-            if (lists.size()>8){
-                lists = lists.subList(0, 8);
-                s = CollectionUtil.formatSplitAndRemoveMiddle(mergeAddress(lists)) + "等" + lists.size() + "处";
-            }else {
-                s = CollectionUtil.formatSplitAndRemoveMiddle(mergeAddress(lists)) + ",共计"+ lists.size() + "处";
-            }
-            System.out.println(s);
-
-        }catch (Exception e){
-            e.printStackTrace();
-        }
-
-    }
-
-    static Function<Address, List<Object>> compositeKey = address ->
-            Arrays.asList(address.getProvince(), address.getCity(), address.getDistrict(), address.getTown(),
-                    address.getCommunity(), address.getRoad());
+//    public static void main(String[] args) {
+//        String[] addresses = {
+////                "成都市武侯区双凤五路412号1栋2单元3层",
+////                "西安市未央区史蒂五路22号12栋33单元13层",
+////                "成都市青羊区双凤三路412号1栋2单元4层",
+////                "成都市武侯区双凤三路42号1栋2单元4层",
+////                "武侯区双凤五路412号1层",
+////                "武侯区双凤五路450号1层",
+////                "武侯区双凤五路470号1层",
+////                "武侯区金江路216号1层",
+////                "武侯区武兴路989号2层",
+////                "都江堰市玉堂镇青城水街北段255号1栋1单元1层1号",
+////                "都江堰市玉堂镇青城水街北段255号1栋1单元1层2号",
+////                "都江堰市玉堂镇青城水街北段255号1栋1单元1层3号",
+////                "高新区高棚东路18号1幢",
+////                "高新区新乐中街280号1栋-1层局部(共计142套)",
+////                "青羊区草堂路3号6栋1-3楼B1号",
+////                "武侯区晋阳街道晋阳村领秀别墅1栋1-3楼1号",
+//                "武侯区人民南路四段21号3栋3单元5层03号",
+//                "武侯区人民南路四段21号3栋3单元7层03号",
+//                "青羊区人民南路四段21号3栋3单元7层03号",
+////                "武侯区双凤五路412号1层",
+////                "武侯区双凤五路450号1层",
+////                "武侯区双凤五路470号1层",
+////                "武侯区金江路216号1层",
+////                "青羊区武兴路989号2层",
+////                "都江堰市玉堂镇青城水街北段255号",
+////                "都江堰市玉堂镇青城水街北段257号",
+////                "都江堰市玉堂镇青城水街北段259号",
+//////                "南充市阆中市缓缓路23号"
+////                "武侯区双凤五路412号1层",
+////                "武侯区双凤五路450号1层",
+////                "武侯区双凤五路470号1层",
+////                "武侯区金江路216号1层",
+////                "武侯区武兴路989号2层"
+////                "武侯区人民南路四段",
+////                "武侯区晋阳街道晋阳村",
+////                "高新区新乐中街",
+////                "高新区高棚东路",
+////                "青羊区草堂路"
+////                "成都市武侯区",
+////                "成都市青羊区",
+////                "成都市成华区",
+////                "成都市双流区",
+////                "成都市新都区",
+////                "成都市都江堰市"
+//        };
+//        List<String> list = Arrays.asList(addresses);
+//        try {
+//            List<Address> lists = new ArrayList<>();
+//            for (String address : list) {
+//                lists.add(AddressUtil.parseAddress(address));
+//            }
+//            Map<List<Object>, List<Address>> collect = lists.stream().collect(Collectors.groupingBy(compositeKey, Collectors.toList()));
+//
+//            if (collect.size()>5){
+//                AddressUtil.ignoreToRoad(lists);
+//            }
+//            String s ;
+//            if (lists.size()>8){
+//                lists = lists.subList(0, 8);
+//                s = CollectionUtil.formatSplitAndRemoveMiddle(mergeAddress(lists)) + "等" + lists.size() + "处";
+//            }else {
+//                s = CollectionUtil.formatSplitAndRemoveMiddle(mergeAddress(lists)) + ",共计"+ lists.size() + "处";
+//            }
+//            System.out.println(s);
+//
+//        }catch (Exception e){
+//            e.printStackTrace();
+//        }
+//
+//    }
+//
+//    static Function<Address, List<Object>> compositeKey = address ->
+//            Arrays.asList(address.getProvince(), address.getCity(), address.getDistrict(), address.getTown(),
+//                    address.getCommunity(), address.getRoad());
 
 }

+ 55 - 0
biz-base/src/test/java/com/dayou/ConditionDocumentTest.java

@@ -0,0 +1,55 @@
+package com.dayou;
+
+import com.alibaba.fastjson2.JSON;
+import com.dayou.constants.HouseGuarantyParagraphTemp;
+import com.dayou.doc.house.ConditionDO;
+import com.dayou.doc.house.ConsignorLetterDO;
+import com.dayou.dto.HouseGuarantyTableDTO;
+import com.dayou.utils.AsposeWordUtil;
+import com.dayou.utils.EasyExcelUtil;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.test.context.SpringBootTest;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.Map;
+
+import static com.dayou.constants.HouseGuarantyParagraphTemp.*;
+
+@SpringBootTest
+public class ConditionDocumentTest {
+
+    @Test
+    public void genConditionDocument() throws IOException {
+
+        XSSFWorkbook workbook = new XSSFWorkbook("/Users/wuwei/opt/temp/collect1.xlsx");
+        Map<String, String> valueMap = EasyExcelUtil.getExcelCellValue(workbook, "基本信息");
+        ConditionDO conditionDO = JSON.parseObject(JSON.toJSONString(valueMap), ConditionDO.class);
+        StringBuffer sb = new StringBuffer();
+        sb.append("1.").append(YBJS_P1_2)
+                .append("2.").append(YBJS_P2)
+                .append("3.").append(YBJS_P3)
+                .append("4.").append(YBJS_P4)
+                .append("5.").append(YBJS_P5)
+                .append("6.") .append(YBJS_P6)
+                .append("7.") .append(YBJS_P7)
+                .append("8.") .append(YBJS_P8)
+                .append("9.") .append(YBJS_P9)
+                .append("10.") .append(YBJS_P10_1);
+        conditionDO.setYBJS(sb.toString());
+        byte[] tmplWordByte = Files.readAllBytes(Paths.get("/Users/wuwei/opt/temp/house/guaranty/temp/condition_letter.docx"));
+
+
+        byte[] resultWordByte = AsposeWordUtil.fillWordDataByDomain(tmplWordByte, conditionDO);
+
+
+        File resultFile = new File("/Users/wuwei/opt/temp/ct.docx");
+        FileOutputStream fos = new FileOutputStream(resultFile);
+        fos.write(resultWordByte);
+        fos.close();
+    }
+}

+ 16 - 1
common/pom.xml

@@ -108,7 +108,22 @@
     </dependencyManagement>
 
     <build>
-
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>3.1</version>
+                <configuration>
+                    <source>${java.version}</source>
+                    <target>${java.version}</target>
+                    <encoding>UTF-8</encoding>
+                    <compilerArguments>
+                        <verbose/>
+                        <bootclasspath>${java.home}/lib/rt.jar${path.separator}${java.home}/lib/jce.jar</bootclasspath>
+                    </compilerArguments>
+                </configuration>
+            </plugin>
+        </plugins>
     </build>
 
 </project>

+ 34 - 0
common/src/main/java/com/dayou/constants/HouseGuarantyParagraphTemp.java

@@ -0,0 +1,34 @@
+package com.dayou.constants;
+
+public class HouseGuarantyParagraphTemp {
+
+    public static  String YBJS_P1_1 = "委托人未提供估价对象房地产权属证书,根据委托人提供的《房地产评估委托书、确认书》等相关资料,经委托人确认:在价值时点,估价对象系合法建设、合法使用,估价对象房地产具备合法城市不动产权属证书,不受任何可能影响其价值的权利限制,能够合法、完整、独立的进入房地产市场转让,本次评估以此为假设前提进行估价。\n";
+
+    public static String YBJS_P1_2 = "在价值时点,估价委托人提供的估价对象房地产权属、估价所必需的反映估价对象状况的资料真实、合法、有效,估价对象符合国家相关法律法规设立抵押的有关规定。\n";
+
+    public static  String YBJS_P2 = "估价对象在价值时点的房地产市场为公开、平等、自愿的交易市场,即能满足以下条件:\n" +
+            "(1)交易双方自愿地进行交易;\n" +
+            "(2)交易双方处于利己动机进行交易;\n" +
+            "(3)交易双方精明、谨慎行事,并了解交易对象、知晓市场行情;\n" +
+            "(4)交易双方有较充裕的时间进行交易;\n" +
+            "(5)不存在买者因特殊兴趣而给予附加出价。\n";
+
+    public static  String YBJS_P3 = "房屋所有权人对估价对象合法拥有占有、使用、收益和处分的权利,至价值时点,本次评估以估价对象未发生任何形式的产权转移行为为估价假设前提。\n";
+
+    public static  String YBJS_P4 = "本次估价以估价对象无行政机关和司法机关限制其权利状况的情形,估价对象产权清晰、完整,权属无纠纷,可以在公开市场上合法转让、销售等处分为假设前提。\n";
+
+    public static String YBJS_P5 = "房屋所有权人因估价对象应缴纳的各项税费已按国家、省、市法律、法规及规章缴纳完毕,无欠缴税费情况。\n";
+
+    public static String YBJS_P6 = "我们已对委托人提供的估价对象《房屋所有权证》和《国有土地使用证》(《不动产权证书》)原件进行了审慎核对,在无理由怀疑其原件合法性、真实性、准确性和完整性的情况下,假设委托人提供的上述原件合法、真实、准确、完整。\n";
+
+    public static String YBJS_P7 = "我们已对房屋安全、环境污染等影响估价对象价值的重大因素给予了关注,在无理由怀疑估价对象存在安全隐患且无相应的专业机构进行鉴定、检测的情况下,假设估价对象能正常安全使用。\n";
+
+    public static String YBJS_P8 = "由于受专业限制,我们未对估价对象房屋建筑面积及其占用(分摊)的土地使用权面积进行专业测量,本次估价假设估价对象房屋建筑面积及其占用(分摊)的土地使用权面积与《房屋所有权证》和《国有土地使用证》《不动产权证书》记载面积一致。\n";
+
+    public static String YBJS_P9 = "由于我们无法通过第三方进一步查证估价对象是否存在法定优先受偿权,或者查证委托人提供的情况是否与实际相符,本次估价假设委托人提供的“估价对象权利状况说明及承诺书”所述内容真实、完整、有效。\n";
+
+    public static String YBJS_P10_1 = "估价对象为所在建筑物的部分,本次估价以估价对象建筑物区分所有权的共有部分的通行权及水、公共照明、消防等附属设施设备的使用权,能被房屋所有权人、实际占有人合法享有为前提进行估价。\n";
+
+    public static String YBJS_P10_2 = "估价对象为所在酒店的一部分,本次估价以估价对象所在酒店各功能区、共用及配套设施的使用权和公共部位的通行权,能被估价对象房屋所有权人、实际占有人享有,估价对象能持续正常经营为前提进行估价。\n";
+
+}

+ 3 - 3
common/src/main/java/com/dayou/utils/table/FreemarkerUtil.java

@@ -27,10 +27,10 @@ public class FreemarkerUtil {
     private Configuration getInstance(String templatePath) throws IOException {
         if (configuration == null) {
             configuration = new Configuration(Configuration.getVersion());
-//            //server
-//            configuration.setClassForTemplateLoading(this.getClass(),templatePath);
+            //server
+            configuration.setClassForTemplateLoading(this.getClass(),templatePath);
             //location
-            configuration.setDirectoryForTemplateLoading(new File(templatePath));
+           //configuration.setDirectoryForTemplateLoading(new File(templatePath));
             configuration.setDefaultEncoding("utf-8");
         }
         return configuration;

+ 9 - 5
common/src/main/java/com/dayou/utils/table/WordTableHelper.java

@@ -9,6 +9,7 @@ import org.jsoup.select.Elements;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
 
+import java.net.URL;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -30,7 +31,6 @@ public class WordTableHelper {
      * @return 生成的word表格的存储路径
      */
     public String createTableWord(String html,String path){
-
         try {
             if (StrUtil.isNotBlank(html)){
                 RichObject richObject = new RichObject();
@@ -39,14 +39,18 @@ public class WordTableHelper {
                 Map<String,String> data = new HashMap<>();
                 data.put("table", richHtmlHandler.getHandledDocBodyBlock());
                 String tablePath = path + TARGETS_DOCX;
-                String templatePath = Class.class.getResource(FTL_TEMPLATE_DIR).getPath();
-                templatePath = java.net.URLDecoder.decode(templatePath,"utf-8");
-                WordGeneratorWithFreemarker.createDoc(templatePath,FTL_TEMPLATE,data,tablePath);
+//                URL resource = getClass().getClassLoader().getResource(FTL_TEMPLATE_DIR);
+//                System.out.println("resource====================>"+resource);
+//                String templatePath = resource.getPath();
+//                System.out.println("templatePaht====>"+templatePath);
+                //templatePath = java.net.URLDecoder.decode(templatePath,"utf-8");
+                WordGeneratorWithFreemarker.createDoc("/",FTL_TEMPLATE,data,tablePath);
                 return tablePath;
             }
         } catch (Exception e) {
-            ErrorCode.throwBusinessException(ErrorCode.CUSTOM_ERROR,"生成表格WORD失败");
+            throw new RuntimeException(e);
         }
+
         return null;
     }
 

+ 24 - 0
domain/src/main/java/com/dayou/doc/house/ConditionDO.java

@@ -0,0 +1,24 @@
+package com.dayou.doc.house;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class ConditionDO {
+
+    private String appraiser1;
+
+    private String appraiser2;
+
+    private String appraNo1;
+
+    private String appraNo2;
+
+    private String docDate;
+
+    /**
+     * 一般假设
+     */
+    private String YBJS;
+ }

+ 21 - 16
pom.xml

@@ -211,23 +211,28 @@
                     <encoding>UTF-8</encoding>
                 </configuration>
             </plugin>
-            <plugin>
-                <groupId>org.springframework.boot</groupId>
-                <artifactId>spring-boot-maven-plugin</artifactId>
-                <version>${spring-boot.version}</version>
-                <configuration>
-                    <mainClass>com.dayou.BaseApplication</mainClass>
-                </configuration>
-                <executions>
-                    <execution>
-                        <id>repackage</id>
-                        <goals>
-                            <goal>repackage</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
         </plugins>
+
+        <resources>
+            <resource>
+                <directory>src/main/resources</directory>
+                <!--开启过滤,用指定的参数替换directory下的文件中的参数-->
+                <filtering>true</filtering>
+                <excludes>
+                    <exclude>**/*.xlsx</exclude>
+                    <exclude>**/*.docx</exclude>
+                </excludes>
+            </resource>
+            <resource>
+                <directory>src/main/resources</directory>
+                <!--开启过滤,用指定的参数替换directory下的文件中的参数-->
+                <filtering>false</filtering>
+                <includes>
+                    <include>**/*.xlsx</include>
+                    <include>**/*.docx</include>
+                </includes>
+            </resource>
+        </resources>
     </build>
 
 </project>

+ 1 - 1
service/src/main/java/com/dayou/service/impl/HouseGuarantyServiceImpl.java

@@ -102,7 +102,7 @@ public class HouseGuarantyServiceImpl implements HouseGuarantyService {
     @Override
     public String genConsignorLetter(Long id) {
         try {
-            sleep(2000);
+            sleep(1000);
         } catch (InterruptedException e) {
             throw new RuntimeException(e);
         }