Bladeren bron

Pageoffice配置

wucl 10 maanden geleden
bovenliggende
commit
3e9bc49feb

+ 38 - 0
biz-base/src/main/java/com/dayou/controller/PageOfficeController.java

@@ -0,0 +1,38 @@
+package com.dayou.controller;
+
+
+import com.dayou.utils.PageOfficeUtils;
+import com.zhuozhengsoft.pageoffice.FileSaver;
+import com.zhuozhengsoft.pageoffice.OpenModeType;
+import com.zhuozhengsoft.pageoffice.PageOfficeCtrl;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@RestController
+@RequestMapping(value = "/doc")
+public class PageOfficeController {
+
+        //获取doc目录的磁盘路径
+    private String dir = PageOfficeUtils.getDirPath() + "static/";
+
+    @RequestMapping(value="/openFile")
+    public String openFile(HttpServletRequest request, int file_id, String file_name)  {
+        //file_id和file_name是为了展示如何使用参数,我们这里只用到了file_name
+        PageOfficeCtrl poCtrl = new PageOfficeCtrl(request);
+        //webOpen的第一个参数支持能够输出下载文件的Url相对地址或者文件在服务器上的磁盘路径两种方式
+        //查看详细,请在"https://www.pageoffice.cn/"搜索“PageOffice属性或方法中涉及到的URL路径或磁盘路径的说明”
+        poCtrl.webOpen("file://"+dir+file_name, OpenModeType.docNormalEdit, "张三");
+        return poCtrl.getHtmlCode();//必须
+    }
+
+    @RequestMapping("/saveFile")
+    public void saveFile(HttpServletRequest request, HttpServletResponse response, int file_id, String file_name)  {
+        //file_id和file_name是为了展示如何使用参数,我们这里只用到了file_name
+        FileSaver fs = new FileSaver(request, response);
+        fs.saveToFile(dir + file_name);
+        fs.close();
+    }
+}

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

@@ -57,3 +57,5 @@ system:
 ueditor:
   uploadPath: ${dfs.path}
   urlPrefix: replaceurl  #动态替换url
+
+posyspath:  /root/pageoffice

BIN
biz-base/src/main/resources/docs/personal/immovable_final_report.docx


+ 27 - 0
common/src/main/java/com/dayou/configuration/PageOfficeConfig.java

@@ -0,0 +1,27 @@
+package com.dayou.configuration;
+
+import org.springframework.beans.factory.annotation.Value;
+
+import org.springframework.boot.web.servlet.ServletRegistrationBean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Bean;
+
+@Configuration
+public class PageOfficeConfig {
+
+    @Value("${posyspath}")
+    private String poSysPath;
+
+    @Bean
+    public ServletRegistrationBean pageofficeRegistrationBean()  {
+        com.zhuozhengsoft.pageoffice.poserver.Server poserver
+                = new com.zhuozhengsoft.pageoffice.poserver.Server();
+        poserver.setSysPath(poSysPath);//设置PageOffice注册成功后,license.lic文件存放的目录
+
+        ServletRegistrationBean srb = new ServletRegistrationBean(poserver);
+        srb.addUrlMappings("/poserver.zz");
+        srb.addUrlMappings("/poclient");
+        srb.addUrlMappings("/sealsetup.exe");
+        return srb;
+    }
+}

+ 2 - 1
common/src/main/java/com/dayou/configuration/WebConfig.java

@@ -70,7 +70,8 @@ public class WebConfig implements WebMvcConfigurer {
                 .excludePathPatterns("/*/dfs/**")
                 .excludePathPatterns("/dfs/**")
                 .excludePathPatterns("/user/login", "/gisUser/login", "/gisUser/verification",
-                        "/gisVisited", "/globalConfig/getSysCfg", "/sdk/**", "/error","/onlyoffice/**");
+                        "/gisVisited", "/globalConfig/getSysCfg", "/sdk/**", "/error","/onlyoffice/**",
+                        "/poserver.zz","/poclient","/sealsetup.exe");
 
         registry.addInterceptor(permissionInterceptor)
                 .addPathPatterns("/**")

+ 26 - 0
common/src/main/java/com/dayou/utils/PageOfficeUtils.java

@@ -0,0 +1,26 @@
+package com.dayou.utils;
+
+import org.springframework.core.io.FileSystemResource;
+import org.springframework.core.io.Resource;
+
+import java.io.IOException;
+import java.net.URL;
+
+public class PageOfficeUtils {
+
+    /**
+     * @Author: dong
+     * @Date: 2020/11/2 10:39
+     * @Version 1.0
+     */
+    public static String getDirPath(){
+        try {
+            Resource resource = new FileSystemResource("target/classes");
+            URL resourceUrl = resource.getURL();
+            return resourceUrl.getPath();
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+}

+ 5 - 0
pom.xml

@@ -228,6 +228,11 @@
             <artifactId>spring-boot-devtools</artifactId>
             <optional>true</optional> <!-- 表示依赖不会传递 -->
         </dependency>
+        <dependency>
+            <groupId>com.zhuozhengsoft</groupId>
+            <artifactId>pageoffice</artifactId>
+            <version>6.3.2.1-javax</version>
+        </dependency>
     </dependencies>
 
     <build>

+ 13 - 11
service/src/main/java/com/dayou/service/impl/PersonalProductionServiceImpl.java

@@ -764,34 +764,36 @@ public class PersonalProductionServiceImpl extends ServiceImpl<PersonalProductio
         isShareDesc += (index == 2 ? "" : "\t") + (index++) + "、本报告估价结果包括房屋(含附属设备设施)所有权及其占用(分摊)范围内的土地使用权的价值。该土地使用权和附属的设施设备若与房屋所有权分割处置,本估价结果无效。";
         if (rightsType.equals("SELL")) {
             // 出让金
-            isShareDesc += "本报告估价结果含土地出让金。\r\n";
+            isShareDesc += "本报告估价结果含土地出让金。";
         } else {
             // 划拨
-            isShareDesc += "本报告估价结果已扣除估价对象划拨土地使用权应缴纳的土地出让金或者相当于土地出让金的价款。\r\n";
+            isShareDesc += "本报告估价结果已扣除估价对象划拨土地使用权应缴纳的土地出让金或者相当于土地出让金的价款。";
         }
 
         // 1未出租,未抵押
         if (!"出租".equals(usingInfo) && "否".equals(isPledge)) {
-            isShareDesc += "\n\t" + (index++) + "、根据委托人提供的“估价对象权利状况、法定优先受偿款调查说明及承诺书”、“房地产评估委托、确认书”书面承诺和确认,在价值时点,估价对象未设定抵押,无法定优先受偿权,本次评估以此为引用依据。\r\n\t";
+            isShareDesc += "\r\n\t" + (index++) + "、根据委托人提供的“估价对象权利状况、法定优先受偿款调查说明及承诺书”、“房地产评估委托、确认书”书面承诺和确认,在价值时点,估价对象未设定抵押,无法定优先受偿权,本次评估以此为引用依据。";
         }
         // 2已出租,未抵押
         if ("出租".equals(usingInfo) && "否".equals(isPledge)) {
-            isShareDesc += "\n\t" +  (index++) + "、根据委托人提供的“房地产评估委托、确认书”、“估价对象权利状况、法定优先受偿款调查说明及承诺书”,经注册房地产估价师实地查勘,至价值时点,估价对象已出租,未设定抵押等他项权利。\r\n\t";
+            isShareDesc += "\r\n\t" +  (index++) + "、根据委托人提供的“房地产评估委托、确认书”、“估价对象权利状况、法定优先受偿款调查说明及承诺书”,经注册房地产估价师实地查勘,至价值时点,估价对象已出租,未设定抵押等他项权利。";
         }
         // 3未出租,已抵押
         if (!"出租".equals(usingInfo) && !"否".equals(isPledge)) {
-            isShareDesc += String.format("%s、根据委托人介绍和提供的“房地产评估委托、确认书”、“估价对象权利状况、法定优先受偿款调查说明及承诺书”,经注册房地产估价师实地查勘,至价值时点,估价对象未出租,估价对象已设置了一般抵押权尚未注销,抵押权人为%s,抵押权利价值为%s万元。\r\n\t",
-                    ("\n\t" + index++),pledgePerson, textMap.get("totalDebiAmount"));
+            String totalDebiAmount = String.format("、根据委托人介绍和提供的“房地产评估委托、确认书”、“估价对象权利状况、法定优先受偿款调查说明及承诺书”,经注册房地产估价师实地查勘,至价值时点,估价对象未出租,估价对象已设置了一般抵押权尚未注销,抵押权人为%s,抵押权利价值为%s万元。"
+                    , pledgePerson, textMap.get("totalDebiAmount"));
+            isShareDesc += "\r\n\t" + (index++)+totalDebiAmount;
         }
         // 4已出租,已抵押
         if ("出租".equals(usingInfo) && !"否".equals(isPledge)) {
-            isShareDesc += String.format("%s、根据委托人介绍和提供的“房地产评估委托、确认书”、“估价对象权利状况、法定优先受偿款调查说明及承诺书”,经注册房地产估价师实地查勘,至价值时点,估价对象已出租,估价对象已设置了一般抵押权尚未注销,抵押权人为%s,抵押权利价值为%s万元。\r\n\t",
-                    ("\n\t" + index++),pledgePerson, textMap.get("totalDebiAmount"));
+            String totalDebiAmount = String.format("、根据委托人介绍和提供的“房地产评估委托、确认书”、“估价对象权利状况、法定优先受偿款调查说明及承诺书”,经注册房地产估价师实地查勘,至价值时点,估价对象已出租,估价对象已设置了一般抵押权尚未注销,抵押权人为%s,抵押权利价值为%s万元。"
+                    , pledgePerson, textMap.get("totalDebiAmount"));
+            isShareDesc +="\r\n\t" +(index++)+ totalDebiAmount;
         }
-        isShareDesc += "\r\n\t";
 
-        isShareDesc += String.format("%s、经注册房地产估价师现场查勘,估价对象系%s,无与相邻房屋合并连通使用情形。\r\n\t", index++, rightsToPurpose);
-        isShareDesc += (index++) + "、经注册房地产估价师现场查勘,估价对象内、外部设计未进行明显改造。";
+        String format = String.format("、经注册房地产估价师现场查勘,估价对象系%s,无与相邻房屋合并连通使用情形。", rightsToPurpose);
+        isShareDesc += "\r\n\t" +(index++)+format;
+        isShareDesc += "\r\n\t"+(index++)+"、经注册房地产估价师现场查勘,估价对象内、外部设计未进行明显改造。";
         textMap.put("isShareDesc", isShareDesc);
     }
 

+ 5 - 3
service/src/main/java/com/dayou/service/impl/PersonalTargetServiceImpl.java

@@ -80,9 +80,11 @@ public class PersonalTargetServiceImpl extends ServiceImpl<PersonalTargetMapper,
     public Boolean updateFeedback(PersonalTarget personalTarget){
         String feedback = personalTarget.getFeedback();
         if (StrUtil.isNotEmpty(feedback)){
-            PersonalTarget target = this.getById(personalTarget.getId());
-            List<String> feedbacks = JSON.parseArray(target.getFeedback(), String.class);
-            feedbacks = CollectionUtil.isEmpty(feedbacks)?new ArrayList<>():feedbacks;
+ //           PersonalTarget target = this.getById(personalTarget.getId());
+//            List<String> feedbacks = JSON.parseArray(target.getFeedback(), String.class);
+//            feedbacks = CollectionUtil.isEmpty(feedbacks)?new ArrayList<>():feedbacks;
+//            feedbacks.add(feedback);
+            List<String> feedbacks = new ArrayList<>();
             feedbacks.add(feedback);
             this.update(new LambdaUpdateWrapper<PersonalTarget>().set(PersonalTarget::getFeedback,JSON.toJSONString(feedbacks))
                     .eq(BaseEntity::getId,personalTarget.getId()));