Forráskód Böngészése

1.个贷生成文档方法终止日期改为获取国土证的终止日期

GouGengquan 6 hónapja
szülő
commit
65952ea80d

+ 2 - 1
service/src/main/java/com/dayou/service/IPersonalProductionService.java

@@ -6,6 +6,7 @@ import com.dayou.entity.PersonalProduction;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.fasterxml.jackson.core.JsonProcessingException;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.web.multipart.MultipartFile;
 
@@ -31,7 +32,7 @@ public interface IPersonalProductionService extends IService<PersonalProduction>
 
         Boolean delete(Long id);
 
-    Boolean genFile(Long personalId, Integer tag);
+    Boolean genFile(Long personalId, Integer tag) throws JsonProcessingException;
 
     Boolean upload(String filePath, MultipartFile file,Long targetId, Integer tag);
 

+ 19 - 0
service/src/main/java/com/dayou/service/impl/PersonalProductionServiceImpl.java

@@ -22,6 +22,10 @@ import com.dayou.service.*;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.dayou.utils.*;
 import com.dayou.vo.*;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.JsonMappingException;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.poi.xwpf.usermodel.XWPFDocument;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -129,6 +133,14 @@ public class PersonalProductionServiceImpl extends ServiceImpl<PersonalProductio
         Map<String,Object> textMap = new HashMap();
 
         PersonalSellingAbilityVO sell = JSON.parseObject(target.getSellingAbility(), PersonalSellingAbilityVO.class);
+        ObjectMapper mapper = new ObjectMapper();
+        JsonNode rootNode = null;
+        try {
+            rootNode = mapper.readTree(target.getLandCertificate());
+        } catch (JsonProcessingException e) {
+            throw new RuntimeException(e);
+        }
+        sell.setLimitDate(rootNode.path("limitDateD").asText());
         PersonalBackgroundInfo bg = JSON.parseObject(target.getBackgroundInfo(), PersonalBackgroundInfo.class);
         PersonalEntityInfoVO en = JSON.parseObject(target.getEntityInfo(), PersonalEntityInfoVO.class);
         Field[] sellFields = sell.getClass().getDeclaredFields();
@@ -183,6 +195,9 @@ public class PersonalProductionServiceImpl extends ServiceImpl<PersonalProductio
             Map<String,Object> textMap = new HashMap();
 
             PersonalSellingAbilityVO sell = JSON.parseObject(target.getSellingAbility(), PersonalSellingAbilityVO.class);
+            ObjectMapper mapper = new ObjectMapper();
+            JsonNode rootNode = mapper.readTree(target.getLandCertificate());
+            sell.setLimitDate(rootNode.path("limitDateD").asText());
             PersonalBackgroundInfo bg = JSON.parseObject(target.getBackgroundInfo(), PersonalBackgroundInfo.class);
             PersonalEntityInfoVO en = JSON.parseObject(target.getEntityInfo(), PersonalEntityInfoVO.class);
             Field[] sellFields = sell.getClass().getDeclaredFields();
@@ -217,6 +232,10 @@ public class PersonalProductionServiceImpl extends ServiceImpl<PersonalProductio
             return Boolean.TRUE;
         } catch (SecurityException e) {
             throw new RuntimeException(e);
+        } catch (JsonMappingException e) {
+            throw new RuntimeException(e);
+        } catch (JsonProcessingException e) {
+            throw new RuntimeException(e);
         }
     }